-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
192 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "@subsquid/cli", | ||
"description": "squid cli tool", | ||
"version": "2.3.1", | ||
"version": "2.4.0-beta.1", | ||
"license": "GPL-3.0-or-later", | ||
"repository": "[email protected]:subsquid/squid-cli.git", | ||
"publishConfig": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,53 @@ | ||
import { api } from './api'; | ||
import { HttpResponse, SecretsListResponse } from './types'; | ||
|
||
export async function listSecrets(): Promise<SecretsListResponse> { | ||
export async function listSecrets({ projectCode }: { projectCode?: string }): Promise<SecretsListResponse> { | ||
const { body } = await api<HttpResponse<SecretsListResponse>>({ | ||
method: 'get', | ||
path: '/secrets', | ||
query: { | ||
projectCode, | ||
}, | ||
path: `/secrets`, | ||
}); | ||
return body.payload; | ||
} | ||
|
||
export async function removeSecret(name: string): Promise<SecretsListResponse> { | ||
export async function removeSecret({ | ||
name, | ||
projectCode, | ||
}: { | ||
name: string; | ||
projectCode?: string; | ||
}): Promise<SecretsListResponse> { | ||
const { body } = await api<HttpResponse<SecretsListResponse>>({ | ||
method: 'delete', | ||
path: `/secrets/${name}`, | ||
method: 'put', | ||
path: `/secrets`, | ||
data: { | ||
projectCode, | ||
secrets: [{ action: 'DELETE', name }], | ||
}, | ||
}); | ||
|
||
return body.payload; | ||
} | ||
|
||
export async function setSecret(secrets: Record<string, string>): Promise<SecretsListResponse> { | ||
export async function setSecret({ | ||
name, | ||
value, | ||
projectCode, | ||
}: { | ||
name: string; | ||
value: string; | ||
projectCode?: string; | ||
}): Promise<SecretsListResponse> { | ||
const { body } = await api<HttpResponse<SecretsListResponse>>({ | ||
method: 'patch', | ||
method: 'put', | ||
path: `/secrets`, | ||
data: { secrets: secrets }, | ||
data: { | ||
projectCode, | ||
secrets: [{ action: 'UPDATE', name, value }], | ||
}, | ||
}); | ||
|
||
return body.payload; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.