Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 1702
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-99b73860f7ba7042e0f573771578b6cc3b0fc5955d8ea414843124a80e1d956b.yml
openapi_spec_hash: 06f0b823f11181b6836e2691b4ac24c7
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-57c705c0689b845f0b2f4ffcde9ba87aae73be3ad3c4736ebfd2ded1098802f4.yml
openapi_spec_hash: 8f6843c5614cd65cf48df4cb4fd59d4a
config_hash: 02efc0b488a456e69c13dc4a934c658a
10 changes: 10 additions & 0 deletions src/resources/secrets-store/stores/secrets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,11 @@ export namespace SecretCreateParams {
*/
name: string;

/**
* The list of services that can use this secret.
*/
scopes: Array<string>;

/**
* The value of the secret. Note that this is 'write only' - no API reponse will
* provide this value, it is only used to create/modify secrets.
Expand Down Expand Up @@ -457,6 +462,11 @@ export interface SecretEditParams {
*/
name: string;

/**
* Body param: The list of services that can use this secret.
*/
scopes?: Array<string>;

/**
* Body param: The value of the secret. Note that this is 'write only' - no API
* reponse will provide this value, it is only used to create/modify secrets.
Expand Down
11 changes: 8 additions & 3 deletions tests/api-resources/secrets-store/stores/secrets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('resource secrets', () => {
test('create: only required params', async () => {
const responsePromise = client.secretsStore.stores.secrets.create('023e105f4ecef8ad9ca31a8372d0c353', {
account_id: '985e105f4ecef8ad9ca31a8372d0c353',
body: [{ name: 'MY_API_KEY', value: 'api-token-secret-123' }],
body: [{ name: 'MY_API_KEY', scopes: ['workers'], value: 'api-token-secret-123' }],
});
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
Expand All @@ -27,7 +27,7 @@ describe('resource secrets', () => {
test('create: required and optional params', async () => {
const response = await client.secretsStore.stores.secrets.create('023e105f4ecef8ad9ca31a8372d0c353', {
account_id: '985e105f4ecef8ad9ca31a8372d0c353',
body: [{ name: 'MY_API_KEY', value: 'api-token-secret-123' }],
body: [{ name: 'MY_API_KEY', scopes: ['workers'], value: 'api-token-secret-123' }],
});
});

Expand Down Expand Up @@ -140,7 +140,12 @@ describe('resource secrets', () => {
const response = await client.secretsStore.stores.secrets.edit(
'023e105f4ecef8ad9ca31a8372d0c353',
'3fd85f74b32742f1bff64a85009dda07',
{ account_id: '985e105f4ecef8ad9ca31a8372d0c353', name: 'MY_API_KEY', value: 'api-token-secret-123' },
{
account_id: '985e105f4ecef8ad9ca31a8372d0c353',
name: 'MY_API_KEY',
scopes: ['workers'],
value: 'api-token-secret-123',
},
);
});

Expand Down