From cdf70fe8bc602d0488601eee15cc65cbd509debc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 8 Apr 2025 17:04:06 +0000 Subject: [PATCH] feat(api): api update --- .stats.yml | 4 ++-- src/resources/secrets-store/stores/secrets.ts | 10 ++++++++++ .../secrets-store/stores/secrets.test.ts | 11 ++++++++--- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6d4d13d8c2..b66d4e7ab8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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 diff --git a/src/resources/secrets-store/stores/secrets.ts b/src/resources/secrets-store/stores/secrets.ts index 54e3bc6653..6c6ec3cfee 100644 --- a/src/resources/secrets-store/stores/secrets.ts +++ b/src/resources/secrets-store/stores/secrets.ts @@ -389,6 +389,11 @@ export namespace SecretCreateParams { */ name: string; + /** + * The list of services that can use this secret. + */ + scopes: Array; + /** * 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. @@ -457,6 +462,11 @@ export interface SecretEditParams { */ name: string; + /** + * Body param: The list of services that can use this secret. + */ + scopes?: Array; + /** * 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. diff --git a/tests/api-resources/secrets-store/stores/secrets.test.ts b/tests/api-resources/secrets-store/stores/secrets.test.ts index 3ab2e09347..7e6fd949eb 100644 --- a/tests/api-resources/secrets-store/stores/secrets.test.ts +++ b/tests/api-resources/secrets-store/stores/secrets.test.ts @@ -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); @@ -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' }], }); }); @@ -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', + }, ); });