diff --git a/.github/workflows/release-checks.yml b/.github/workflows/release-checks.yml index 34ae441..2467c28 100644 --- a/.github/workflows/release-checks.yml +++ b/.github/workflows/release-checks.yml @@ -26,7 +26,7 @@ jobs: node-version: '16' registry-url: https://registry.npmjs.org/ - run: npm ci - - run: npm run build - run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + diff --git a/package-lock.json b/package-lock.json index 276fb0e..5cfd609 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dopplerhq/node-sdk", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dopplerhq/node-sdk", - "version": "1.0.0", + "version": "1.0.1", "devDependencies": { "@types/jest": "^27.4.1", "@types/node": "^17.0.23", diff --git a/package.json b/package.json index 72a2f20..7068e94 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ }, "name": "@dopplerhq/node-sdk", "description": "DopplerSDK", - "version": "1.0.0", + "version": "1.0.1", "author": "DopplerSDK", "dependencies": {}, "type": "module" diff --git a/src/services/README.MD b/src/services/README.MD index c78fa5b..635ccfa 100644 --- a/src/services/README.MD +++ b/src/services/README.MD @@ -395,8 +395,8 @@ const sdk = new DopplerSDK(DOPPLERSDK_BEARER_TOKEN); const result = await sdk.secrets.list('PROJECT_NAME', 'CONFIG_NAME', { accepts: 'application/json', includeDynamicSecrets: true, - dynamicSecretsTtlSec: 58532169, - secrets: 'dolore exercitation nostrud', + dynamicSecretsTtlSec: -23862531, + secrets: 'quis consectetur sunt mollit ullamco', includeManagedSecrets: true, }); console.log(result); @@ -481,12 +481,16 @@ const DOPPLERSDK_BEARER_TOKEN = ''; const sdk = new DopplerSDK(DOPPLERSDK_BEARER_TOKEN); (async () => { - const result = await sdk.secrets.download('eiusmod', 'reprehenderit', { - format: 'json', - nameTransformer: 'dotnet-env', - includeDynamicSecrets: true, - dynamicSecretsTtlSec: 1800, - }); + const result = await sdk.secrets.download( + 'laboris minim sint fugiat pariatur', + 'irure veniam sunt', + { + format: 'json', + nameTransformer: 'camel', + includeDynamicSecrets: true, + dynamicSecretsTtlSec: 1800, + }, + ); console.log(result); })(); @@ -562,9 +566,9 @@ const sdk = new DopplerSDK(DOPPLERSDK_BEARER_TOKEN); (async () => { const input = { config: 'CONFIG_NAME', - note: 'amet enim', + note: 'ut occaecat sit proident', project: 'PROJECT_NAME', - secret: 'proident', + secret: 'sed dolore dolor officia', }; const result = await sdk.secrets.updateNote(input); console.log(result); @@ -728,7 +732,7 @@ const DOPPLERSDK_BEARER_TOKEN = ''; const sdk = new DopplerSDK(DOPPLERSDK_BEARER_TOKEN); (async () => { - const result = await sdk.environments.get('dolor', 'do deserunt quis Lorem'); + const result = await sdk.environments.get('proident eu laboris', 'irure'); console.log(result); })(); @@ -767,7 +771,7 @@ const DOPPLERSDK_BEARER_TOKEN = ''; const sdk = new DopplerSDK(DOPPLERSDK_BEARER_TOKEN); (async () => { - const result = await sdk.environments.delete('tempor dolor aliquip in', 'eiusmod ut'); + const result = await sdk.environments.delete('est', 'dolore laboris elit'); console.log(result); })(); @@ -807,8 +811,8 @@ const DOPPLERSDK_BEARER_TOKEN = ''; const sdk = new DopplerSDK(DOPPLERSDK_BEARER_TOKEN); (async () => { - const input = { name: 'nulla minim', slug: 'consectetur sed in' }; - const result = await sdk.environments.rename(input, 'occaecat', 'culpa fugiat nisi'); + const input = { name: 'dolore sit dolore nostrud ex', slug: 'deserunt non ipsum' }; + const result = await sdk.environments.rename(input, 'officia', 'enim consequat'); console.log(result); })(); @@ -847,8 +851,8 @@ const DOPPLERSDK_BEARER_TOKEN = ''; const sdk = new DopplerSDK(DOPPLERSDK_BEARER_TOKEN); (async () => { - const input = { name: 'in consequat in', slug: 'commodo est elit laboris aliqua' }; - const result = await sdk.environments.create(input, 'aute dolore eu'); + const input = { name: 'sint et consectetur', slug: 'fugiat pariatur ipsum incididunt in' }; + const result = await sdk.environments.create(input, 'culpa sint sit'); console.log(result); })(); @@ -886,7 +890,7 @@ const DOPPLERSDK_BEARER_TOKEN = ''; const sdk = new DopplerSDK(DOPPLERSDK_BEARER_TOKEN); (async () => { - const result = await sdk.environments.list('sint'); + const result = await sdk.environments.list('officia'); console.log(result); })(); @@ -959,7 +963,7 @@ const DOPPLERSDK_BEARER_TOKEN = ''; const sdk = new DopplerSDK(DOPPLERSDK_BEARER_TOKEN); (async () => { - const result = await sdk.configs.list('commodo sunt esse quis', { + const result = await sdk.configs.list('in incididunt', { environment: 'Environment slug', page: 1, perPage: 20, @@ -1295,7 +1299,7 @@ const sdk = new DopplerSDK(DOPPLERSDK_BEARER_TOKEN); const input = { access: 'read', config: 'CONFIG_NAME', - expire_at: '1919-10-16T02:51:47.0Z', + expire_at: '1969-09-18T10:53:17.0Z', name: 'TOKEN_NAME', project: 'PROJECT_NAME', }; @@ -1406,10 +1410,10 @@ const sdk = new DopplerSDK(DOPPLERSDK_BEARER_TOKEN); (async () => { const input = { - config: 'aliqua ut', - dynamic_secret: 'velit in', - project: 'amet enim sint sunt fugiat', - ttl_sec: 61886594, + config: 'laborum', + dynamic_secret: 'laboris proident magna velit cupidatat', + project: 'culpa', + ttl_sec: -23344411, }; const result = await sdk.dynamicSecrets.issueLease(input); console.log(result); @@ -1442,10 +1446,10 @@ const sdk = new DopplerSDK(DOPPLERSDK_BEARER_TOKEN); (async () => { const input = { - config: 'nostrud minim ad sint nulla', - dynamic_secret: 'aliquip', - project: 'sint veniam', - slug: 'Ut minim sit', + config: 'elit cupidatat velit reprehenderit', + dynamic_secret: 'proident', + project: 'adipisicing et incididunt sed', + slug: 'et', }; const result = await sdk.dynamicSecrets.revokeLease(input); console.log(result); @@ -1478,7 +1482,7 @@ const DOPPLERSDK_BEARER_TOKEN = ''; const sdk = new DopplerSDK(DOPPLERSDK_BEARER_TOKEN); (async () => { - const input = { data: {}, name: 'enim', type_: 'in in' }; + const input = { data: {}, name: 'amet anim ipsum', type_: 'laborum velit dolor' }; const result = await sdk.integrations.create(input); console.log(result); })(); @@ -1542,7 +1546,7 @@ const DOPPLERSDK_BEARER_TOKEN = ''; const sdk = new DopplerSDK(DOPPLERSDK_BEARER_TOKEN); (async () => { - const result = await sdk.integrations.get('eu commodo sint est consequat'); + const result = await sdk.integrations.get('sint adipisicing sunt Excepteur'); console.log(result); })(); @@ -1580,7 +1584,7 @@ const DOPPLERSDK_BEARER_TOKEN = ''; const sdk = new DopplerSDK(DOPPLERSDK_BEARER_TOKEN); (async () => { - const result = await sdk.integrations.delete('occaecat exercitation ad minim'); + const result = await sdk.integrations.delete('non commodo laboris pariatur'); console.log(result); })(); @@ -1619,8 +1623,8 @@ const DOPPLERSDK_BEARER_TOKEN = ''; const sdk = new DopplerSDK(DOPPLERSDK_BEARER_TOKEN); (async () => { - const input = { data: 'est Duis cupidatat occaecat labore', name: 'fugiat ex Ut' }; - const result = await sdk.integrations.update(input, 'consectetur culpa'); + const input = { data: 'laboris ullamco', name: 'enim proident ut' }; + const result = await sdk.integrations.update(input, 'non proident do'); console.log(result); })(); @@ -1661,12 +1665,8 @@ const DOPPLERSDK_BEARER_TOKEN = ''; const sdk = new DopplerSDK(DOPPLERSDK_BEARER_TOKEN); (async () => { - const input = { data: {}, import_option: 'none', integration: 'in dolore' }; - const result = await sdk.syncs.create( - input, - 'esse Ut Duis aliquip commodo', - 'ex Duis est reprehenderit dolore', - ); + const input = { data: {}, import_option: 'none', integration: 'in eiusmod ullamco dolor dolor' }; + const result = await sdk.syncs.create(input, 'dolor cupidatat dolor eiusmod enim', 'sint'); console.log(result); })(); @@ -1706,11 +1706,7 @@ const DOPPLERSDK_BEARER_TOKEN = ''; const sdk = new DopplerSDK(DOPPLERSDK_BEARER_TOKEN); (async () => { - const result = await sdk.syncs.get( - 'adipisicing laboris est exercitation', - 'pariatur cupidatat laboris', - 'cillum mollit veniam cupidatat aute', - ); + const result = await sdk.syncs.get('ad dolor', 'qui laboris sed velit', 'est sit id'); console.log(result); })(); @@ -1751,7 +1747,12 @@ const DOPPLERSDK_BEARER_TOKEN = ''; const sdk = new DopplerSDK(DOPPLERSDK_BEARER_TOKEN); (async () => { - const result = await sdk.syncs.delete('ad', 'ex ea', 'ea ut amet', true); + const result = await sdk.syncs.delete( + 'nisi dolor', + 'sunt quis in', + 'Duis dolor ipsum non nostrud', + true, + ); console.log(result); })(); diff --git a/src/services/base.ts b/src/services/base.ts index 9dcff76..955617c 100644 --- a/src/services/base.ts +++ b/src/services/base.ts @@ -3,7 +3,7 @@ import { Environment } from '../http/Environment'; import HTTPLibrary from '../http/HTTPLibrary'; export default class BaseService { - private userAgent: string = 'liblab/0.1.11 DopplerSDK/1.0.0 typescript/5.1.6'; + private userAgent: string = 'liblab/0.1.11 DopplerSDK/1.0.1 typescript/5.1.6'; public baseUrl: string = Environment.DEFAULT; diff --git a/test/services/ActivityLogs.test.ts b/test/services/ActivityLogs.test.ts index 006df90..61b89cf 100644 --- a/test/services/ActivityLogs.test.ts +++ b/test/services/ActivityLogs.test.ts @@ -22,33 +22,33 @@ describe('test ActivityLogsService', () => { describe('test retrieve', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') - .get('/v3/logs/log?log=ea') + .get('/v3/logs/log?log=saepe') .reply(200, { data: {} }); - return sdk.activityLogs.retrieve('ea').then((r: any) => expect(r.data).toEqual({})); + return sdk.activityLogs.retrieve('saepe').then((r: any) => expect(r.data).toEqual({})); }); test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') - .get('/v3/logs/log?log=minima') + .get('/v3/logs/log?log=quo') .reply(200, { data: {} }); return expect(async () => await sdk.activityLogs.retrieve()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') - .get('/v3/logs/log?log=quae') + .get('/v3/logs/log?log=ullam') .reply(404, { data: {} }); - return expect(async () => await sdk.activityLogs.retrieve('quae')).rejects.toThrow(); + return expect(async () => await sdk.activityLogs.retrieve('ullam')).rejects.toThrow(); }); }); describe('test list', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') - .get('/v3/logs?page=illum&per_page=5') + .get('/v3/logs?page=numquam&per_page=8') .reply(200, { data: {} }); return sdk.activityLogs - .list({ page: 'illum', perPage: 5 }) + .list({ page: 'numquam', perPage: 8 }) .then((r: any) => expect(r.data).toEqual({})); }); }); diff --git a/test/services/ConfigLogs.test.ts b/test/services/ConfigLogs.test.ts index f7aec70..89e0e8f 100644 --- a/test/services/ConfigLogs.test.ts +++ b/test/services/ConfigLogs.test.ts @@ -22,26 +22,26 @@ describe('test ConfigLogsService', () => { describe('test list', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') - .get('/v3/configs/config/logs?project=quasi&config=quia&page=3&per_page=1') + .get('/v3/configs/config/logs?project=incidunt&config=adipisci&page=8&per_page=3') .reply(200, { data: {} }); return sdk.configLogs - .list('quasi', 'quia', { page: 3, perPage: 1 }) + .list('incidunt', 'adipisci', { page: 8, perPage: 3 }) .then((r: any) => expect(r.data).toEqual({})); }); test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') - .get('/v3/configs/config/logs?project=adipisci&config=blanditiis&page=1&per_page=3') + .get('/v3/configs/config/logs?project=omnis&config=laborum&page=9&per_page=5') .reply(200, { data: {} }); return expect(async () => await sdk.configLogs.list()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') - .get('/v3/configs/config/logs?project=quae&config=vero&page=9&per_page=6') + .get('/v3/configs/config/logs?project=consequatur&config=eaque&page=3&per_page=1') .reply(404, { data: {} }); return expect( - async () => await sdk.configLogs.list('quae', 'vero', { page: 9, perPage: 6 }), + async () => await sdk.configLogs.list('consequatur', 'eaque', { page: 3, perPage: 1 }), ).rejects.toThrow(); }); }); @@ -49,26 +49,26 @@ describe('test ConfigLogsService', () => { describe('test get', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') - .get('/v3/configs/config/logs/log?project=repudiandae&config=nemo&log=quas') + .get('/v3/configs/config/logs/log?project=natus&config=libero&log=distinctio') .reply(200, { data: {} }); return sdk.configLogs - .get('repudiandae', 'nemo', 'quas') + .get('natus', 'libero', 'distinctio') .then((r: any) => expect(r.data).toEqual({})); }); test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') - .get('/v3/configs/config/logs/log?project=quae&config=ex&log=praesentium') + .get('/v3/configs/config/logs/log?project=amet&config=aliquam&log=animi') .reply(200, { data: {} }); return expect(async () => await sdk.configLogs.get()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') - .get('/v3/configs/config/logs/log?project=laboriosam&config=mollitia&log=quis') + .get('/v3/configs/config/logs/log?project=veritatis&config=mollitia&log=animi') .reply(404, { data: {} }); return expect( - async () => await sdk.configLogs.get('laboriosam', 'mollitia', 'quis'), + async () => await sdk.configLogs.get('veritatis', 'mollitia', 'animi'), ).rejects.toThrow(); }); }); @@ -76,26 +76,28 @@ describe('test ConfigLogsService', () => { describe('test rollback', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') - .post('/v3/configs/config/logs/log/rollback?project=ratione&config=corporis&log=minus') + .post('/v3/configs/config/logs/log/rollback?project=fugit&config=praesentium&log=fugiat') .reply(200, { data: {} }); return sdk.configLogs - .rollback('ratione', 'corporis', 'minus') + .rollback('fugit', 'praesentium', 'fugiat') .then((r: any) => expect(r.data).toEqual({})); }); test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') - .post('/v3/configs/config/logs/log/rollback?project=repellendus&config=adipisci&log=ex') + .post('/v3/configs/config/logs/log/rollback?project=molestias&config=tempore&log=aut') .reply(200, { data: {} }); return expect(async () => await sdk.configLogs.rollback()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') - .post('/v3/configs/config/logs/log/rollback?project=doloribus&config=occaecati&log=quod') + .post( + '/v3/configs/config/logs/log/rollback?project=laborum&config=possimus&log=perferendis', + ) .reply(404, { data: {} }); return expect( - async () => await sdk.configLogs.rollback('doloribus', 'occaecati', 'quod'), + async () => await sdk.configLogs.rollback('laborum', 'possimus', 'perferendis'), ).rejects.toThrow(); }); }); diff --git a/test/services/Configs.test.ts b/test/services/Configs.test.ts index 770b1d6..6c1f875 100644 --- a/test/services/Configs.test.ts +++ b/test/services/Configs.test.ts @@ -22,26 +22,26 @@ describe('test ConfigsService', () => { describe('test list', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') - .get('/v3/configs?project=quasi&environment=animi&page=5&per_page=1') + .get('/v3/configs?project=ad&environment=atque&page=7&per_page=9') .reply(200, { data: {} }); return sdk.configs - .list('quasi', { environment: 'animi', page: 5, perPage: 1 }) + .list('ad', { environment: 'atque', page: 7, perPage: 9 }) .then((r: any) => expect(r.data).toEqual({})); }); test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') - .get('/v3/configs?project=impedit&environment=quisquam&page=8&per_page=5') + .get('/v3/configs?project=dicta&environment=veniam&page=1&per_page=9') .reply(200, { data: {} }); return expect(async () => await sdk.configs.list()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') - .get('/v3/configs?project=facere&environment=velit&page=4&per_page=3') + .get('/v3/configs?project=non&environment=iusto&page=3&per_page=7') .reply(404, { data: {} }); return expect( - async () => await sdk.configs.list('facere', { environment: 'velit', page: 4, perPage: 3 }), + async () => await sdk.configs.list('non', { environment: 'iusto', page: 3, perPage: 7 }), ).rejects.toThrow(); }); }); @@ -56,23 +56,23 @@ describe('test ConfigsService', () => { describe('test get', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') - .get('/v3/configs/config?project=eligendi&config=omnis') + .get('/v3/configs/config?project=iure&config=alias') .reply(200, { data: {} }); - return sdk.configs.get('eligendi', 'omnis').then((r: any) => expect(r.data).toEqual({})); + return sdk.configs.get('iure', 'alias').then((r: any) => expect(r.data).toEqual({})); }); test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') - .get('/v3/configs/config?project=repudiandae&config=nostrum') + .get('/v3/configs/config?project=sit&config=nobis') .reply(200, { data: {} }); return expect(async () => await sdk.configs.get()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') - .get('/v3/configs/config?project=alias&config=veniam') + .get('/v3/configs/config?project=id&config=sed') .reply(404, { data: {} }); - return expect(async () => await sdk.configs.get('alias', 'veniam')).rejects.toThrow(); + return expect(async () => await sdk.configs.get('id', 'sed')).rejects.toThrow(); }); }); diff --git a/test/services/Environments.test.ts b/test/services/Environments.test.ts index 18e318c..8bedc93 100644 --- a/test/services/Environments.test.ts +++ b/test/services/Environments.test.ts @@ -22,51 +22,49 @@ describe('test EnvironmentsService', () => { describe('test get', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') - .get('/v3/environments/environment?project=consequuntur&environment=voluptate') + .get('/v3/environments/environment?project=enim&environment=quasi') .reply(200, { data: {} }); - return sdk.environments - .get('consequuntur', 'voluptate') - .then((r: any) => expect(r.data).toEqual({})); + return sdk.environments.get('enim', 'quasi').then((r: any) => expect(r.data).toEqual({})); }); test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') - .get('/v3/environments/environment?project=repellat&environment=totam') + .get('/v3/environments/environment?project=omnis&environment=ullam') .reply(200, { data: {} }); return expect(async () => await sdk.environments.get()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') - .get('/v3/environments/environment?project=maxime&environment=rem') + .get('/v3/environments/environment?project=ut&environment=aut') .reply(404, { data: {} }); - return expect(async () => await sdk.environments.get('maxime', 'rem')).rejects.toThrow(); + return expect(async () => await sdk.environments.get('ut', 'aut')).rejects.toThrow(); }); }); describe('test rename', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') - .put('/v3/environments/environment?project=veritatis&environment=aut') + .put('/v3/environments/environment?project=labore&environment=quod') .reply(200, { data: {} }); return sdk.environments - .rename({}, 'veritatis', 'aut') + .rename({}, 'labore', 'quod') .then((r: any) => expect(r.data).toEqual({})); }); test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') - .put('/v3/environments/environment?project=repudiandae&environment=debitis') + .put('/v3/environments/environment?project=temporibus&environment=suscipit') .reply(200, { data: {} }); return expect(async () => await sdk.environments.rename()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') - .put('/v3/environments/environment?project=ratione&environment=ducimus') + .put('/v3/environments/environment?project=sit&environment=facilis') .reply(404, { data: {} }); return expect( - async () => await sdk.environments.rename({}, 'ratione', 'ducimus'), + async () => await sdk.environments.rename({}, 'sit', 'facilis'), ).rejects.toThrow(); }); }); @@ -74,26 +72,26 @@ describe('test EnvironmentsService', () => { describe('test delete', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') - .delete('/v3/environments/environment?project=quas&environment=quibusdam') + .delete('/v3/environments/environment?project=voluptates&environment=tenetur') .reply(200, { data: {} }); return sdk.environments - .delete('quas', 'quibusdam') + .delete('voluptates', 'tenetur') .then((r: any) => expect(r.data).toEqual({})); }); test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') - .delete('/v3/environments/environment?project=ut&environment=magnam') + .delete('/v3/environments/environment?project=expedita&environment=optio') .reply(200, { data: {} }); return expect(async () => await sdk.environments.delete()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') - .delete('/v3/environments/environment?project=cupiditate&environment=sunt') + .delete('/v3/environments/environment?project=numquam&environment=excepturi') .reply(404, { data: {} }); return expect( - async () => await sdk.environments.delete('cupiditate', 'sunt'), + async () => await sdk.environments.delete('numquam', 'excepturi'), ).rejects.toThrow(); }); }); @@ -101,46 +99,46 @@ describe('test EnvironmentsService', () => { describe('test list', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') - .get('/v3/environments?project=minus') + .get('/v3/environments?project=aliquam') .reply(200, { data: {} }); - return sdk.environments.list('minus').then((r: any) => expect(r.data).toEqual({})); + return sdk.environments.list('aliquam').then((r: any) => expect(r.data).toEqual({})); }); test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') - .get('/v3/environments?project=et') + .get('/v3/environments?project=inventore') .reply(200, { data: {} }); return expect(async () => await sdk.environments.list()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') - .get('/v3/environments?project=voluptatibus') + .get('/v3/environments?project=voluptatum') .reply(404, { data: {} }); - return expect(async () => await sdk.environments.list('voluptatibus')).rejects.toThrow(); + return expect(async () => await sdk.environments.list('voluptatum')).rejects.toThrow(); }); }); describe('test create', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') - .post('/v3/environments?project=occaecati') + .post('/v3/environments?project=a') .reply(200, { data: {} }); - return sdk.environments.create({}, 'occaecati').then((r: any) => expect(r.data).toEqual({})); + return sdk.environments.create({}, 'a').then((r: any) => expect(r.data).toEqual({})); }); test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') - .post('/v3/environments?project=nobis') + .post('/v3/environments?project=voluptatem') .reply(200, { data: {} }); return expect(async () => await sdk.environments.create()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') - .post('/v3/environments?project=pariatur') + .post('/v3/environments?project=dolorum') .reply(404, { data: {} }); - return expect(async () => await sdk.environments.create({}, 'pariatur')).rejects.toThrow(); + return expect(async () => await sdk.environments.create({}, 'dolorum')).rejects.toThrow(); }); }); }); diff --git a/test/services/Integrations.test.ts b/test/services/Integrations.test.ts index cf46a9d..e0d5978 100644 --- a/test/services/Integrations.test.ts +++ b/test/services/Integrations.test.ts @@ -40,69 +40,69 @@ describe('test IntegrationsService', () => { describe('test get', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') - .get('/v3/integrations/integration?integration=necessitatibus') + .get('/v3/integrations/integration?integration=corporis') .reply(200, { data: {} }); - return sdk.integrations.get('necessitatibus').then((r: any) => expect(r.data).toEqual({})); + return sdk.integrations.get('corporis').then((r: any) => expect(r.data).toEqual({})); }); test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') - .get('/v3/integrations/integration?integration=ab') + .get('/v3/integrations/integration?integration=perspiciatis') .reply(200, { data: {} }); return expect(async () => await sdk.integrations.get()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') - .get('/v3/integrations/integration?integration=suscipit') + .get('/v3/integrations/integration?integration=distinctio') .reply(404, { data: {} }); - return expect(async () => await sdk.integrations.get('suscipit')).rejects.toThrow(); + return expect(async () => await sdk.integrations.get('distinctio')).rejects.toThrow(); }); }); describe('test update', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') - .put('/v3/integrations/integration?integration=dolor') + .put('/v3/integrations/integration?integration=deserunt') .reply(200, { data: {} }); - return sdk.integrations.update({}, 'dolor').then((r: any) => expect(r.data).toEqual({})); + return sdk.integrations.update({}, 'deserunt').then((r: any) => expect(r.data).toEqual({})); }); test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') - .put('/v3/integrations/integration?integration=voluptate') + .put('/v3/integrations/integration?integration=amet') .reply(200, { data: {} }); return expect(async () => await sdk.integrations.update()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') - .put('/v3/integrations/integration?integration=cumque') + .put('/v3/integrations/integration?integration=qui') .reply(404, { data: {} }); - return expect(async () => await sdk.integrations.update({}, 'cumque')).rejects.toThrow(); + return expect(async () => await sdk.integrations.update({}, 'qui')).rejects.toThrow(); }); }); describe('test delete', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') - .delete('/v3/integrations/integration?integration=dolor') + .delete('/v3/integrations/integration?integration=perferendis') .reply(200, { data: {} }); - return sdk.integrations.delete('dolor').then((r: any) => expect(r.data).toEqual({})); + return sdk.integrations.delete('perferendis').then((r: any) => expect(r.data).toEqual({})); }); test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') - .delete('/v3/integrations/integration?integration=amet') + .delete('/v3/integrations/integration?integration=esse') .reply(200, { data: {} }); return expect(async () => await sdk.integrations.delete()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') - .delete('/v3/integrations/integration?integration=ducimus') + .delete('/v3/integrations/integration?integration=amet') .reply(404, { data: {} }); - return expect(async () => await sdk.integrations.delete('ducimus')).rejects.toThrow(); + return expect(async () => await sdk.integrations.delete('amet')).rejects.toThrow(); }); }); }); diff --git a/test/services/Projects.test.ts b/test/services/Projects.test.ts index b9af316..41001e5 100644 --- a/test/services/Projects.test.ts +++ b/test/services/Projects.test.ts @@ -22,10 +22,10 @@ describe('test ProjectsService', () => { describe('test list', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') - .get('/v3/projects?page=7&per_page=7') + .get('/v3/projects?page=7&per_page=4') .reply(200, { data: {} }); return sdk.projects - .list({ page: 7, perPage: 7 }) + .list({ page: 7, perPage: 4 }) .then((r: any) => expect(r.data).toEqual({})); }); }); @@ -40,23 +40,23 @@ describe('test ProjectsService', () => { describe('test get', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') - .get('/v3/projects/project?project=perspiciatis') + .get('/v3/projects/project?project=eum') .reply(200, { data: {} }); - return sdk.projects.get('perspiciatis').then((r: any) => expect(r.data).toEqual({})); + return sdk.projects.get('eum').then((r: any) => expect(r.data).toEqual({})); }); test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') - .get('/v3/projects/project?project=eos') + .get('/v3/projects/project?project=nobis') .reply(200, { data: {} }); return expect(async () => await sdk.projects.get()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') - .get('/v3/projects/project?project=similique') + .get('/v3/projects/project?project=eaque') .reply(404, { data: {} }); - return expect(async () => await sdk.projects.get('similique')).rejects.toThrow(); + return expect(async () => await sdk.projects.get('eaque')).rejects.toThrow(); }); }); diff --git a/test/services/Secrets.test.ts b/test/services/Secrets.test.ts index a1e51b2..501ea88 100644 --- a/test/services/Secrets.test.ts +++ b/test/services/Secrets.test.ts @@ -23,15 +23,15 @@ describe('test SecretsService', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') .get( - '/v3/configs/config/secrets?project=placeat&config=at&include_dynamic_secrets=true&dynamic_secrets_ttl_sec=9&secrets=in&include_managed_secrets=true', + '/v3/configs/config/secrets?project=deserunt&config=tempora&include_dynamic_secrets=true&dynamic_secrets_ttl_sec=2&secrets=illum&include_managed_secrets=true', ) .reply(200, { data: {} }); return sdk.secrets - .list('placeat', 'at', { - accepts: 'ut', + .list('deserunt', 'tempora', { + accepts: 'quia', includeDynamicSecrets: true, - dynamicSecretsTtlSec: 9, - secrets: 'in', + dynamicSecretsTtlSec: 2, + secrets: 'illum', includeManagedSecrets: true, }) .then((r: any) => expect(r.data).toEqual({})); @@ -40,7 +40,7 @@ describe('test SecretsService', () => { test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') .get( - '/v3/configs/config/secrets?project=officiis&config=repudiandae&include_dynamic_secrets=true&dynamic_secrets_ttl_sec=2&secrets=exercitationem&include_managed_secrets=true', + '/v3/configs/config/secrets?project=adipisci&config=illum&include_dynamic_secrets=true&dynamic_secrets_ttl_sec=1&secrets=totam&include_managed_secrets=true', ) .reply(200, { data: {} }); return expect(async () => await sdk.secrets.list()).rejects.toThrow(); @@ -49,16 +49,16 @@ describe('test SecretsService', () => { test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') .get( - '/v3/configs/config/secrets?project=est&config=voluptatem&include_dynamic_secrets=true&dynamic_secrets_ttl_sec=4&secrets=sint&include_managed_secrets=true', + '/v3/configs/config/secrets?project=nemo&config=recusandae&include_dynamic_secrets=true&dynamic_secrets_ttl_sec=1&secrets=error&include_managed_secrets=true', ) .reply(404, { data: {} }); return expect( async () => - await sdk.secrets.list('est', 'voluptatem', { - accepts: 'illum', + await sdk.secrets.list('nemo', 'recusandae', { + accepts: 'cumque', includeDynamicSecrets: true, - dynamicSecretsTtlSec: 4, - secrets: 'sint', + dynamicSecretsTtlSec: 1, + secrets: 'error', includeManagedSecrets: true, }), ).rejects.toThrow(); @@ -77,25 +77,27 @@ describe('test SecretsService', () => { describe('test get', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') - .get('/v3/configs/config/secret?project=temporibus&config=necessitatibus&name=Annabell') + .get('/v3/configs/config/secret?project=temporibus&config=eaque&name=Jimmie') .reply(200, { data: {} }); return sdk.secrets - .get('temporibus', 'necessitatibus', 'Annabell') + .get('temporibus', 'eaque', 'Jimmie') .then((r: any) => expect(r.data).toEqual({})); }); test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') - .get('/v3/configs/config/secret?project=suscipit&config=saepe&name=Misael') + .get('/v3/configs/config/secret?project=amet&config=expedita&name=Cristopher') .reply(200, { data: {} }); return expect(async () => await sdk.secrets.get()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') - .get('/v3/configs/config/secret?project=iste&config=optio&name=Naomi') + .get('/v3/configs/config/secret?project=quibusdam&config=labore&name=Newell') .reply(404, { data: {} }); - return expect(async () => await sdk.secrets.get('iste', 'optio', 'Naomi')).rejects.toThrow(); + return expect( + async () => await sdk.secrets.get('quibusdam', 'labore', 'Newell'), + ).rejects.toThrow(); }); }); @@ -103,15 +105,15 @@ describe('test SecretsService', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') .get( - '/v3/configs/config/secrets/download?project=blanditiis&config=magni&format=json&name_transformer=camel&include_dynamic_secrets=true&dynamic_secrets_ttl_sec=4', + '/v3/configs/config/secrets/download?project=occaecati&config=enim&format=json&name_transformer=camel&include_dynamic_secrets=true&dynamic_secrets_ttl_sec=7', ) .reply(200, { data: {} }); return sdk.secrets - .download('blanditiis', 'magni', { + .download('occaecati', 'enim', { format: 'json', nameTransformer: 'camel', includeDynamicSecrets: true, - dynamicSecretsTtlSec: 4, + dynamicSecretsTtlSec: 7, }) .then((r: any) => expect(r.data).toEqual({})); }); @@ -119,7 +121,7 @@ describe('test SecretsService', () => { test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') .get( - '/v3/configs/config/secrets/download?project=non&config=repellendus&format=json&name_transformer=camel&include_dynamic_secrets=true&dynamic_secrets_ttl_sec=1', + '/v3/configs/config/secrets/download?project=explicabo&config=nam&format=json&name_transformer=camel&include_dynamic_secrets=true&dynamic_secrets_ttl_sec=6', ) .reply(200, { data: {} }); return expect(async () => await sdk.secrets.download()).rejects.toThrow(); @@ -128,16 +130,16 @@ describe('test SecretsService', () => { test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') .get( - '/v3/configs/config/secrets/download?project=officiis&config=dolore&format=json&name_transformer=camel&include_dynamic_secrets=true&dynamic_secrets_ttl_sec=5', + '/v3/configs/config/secrets/download?project=assumenda&config=quidem&format=json&name_transformer=camel&include_dynamic_secrets=true&dynamic_secrets_ttl_sec=3', ) .reply(404, { data: {} }); return expect( async () => - await sdk.secrets.download('officiis', 'dolore', { + await sdk.secrets.download('assumenda', 'quidem', { format: 'json', nameTransformer: 'camel', includeDynamicSecrets: true, - dynamicSecretsTtlSec: 5, + dynamicSecretsTtlSec: 3, }), ).rejects.toThrow(); }); @@ -147,18 +149,21 @@ describe('test SecretsService', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') .get( - '/v3/configs/config/secrets/names?project=quam&config=ipsum&include_dynamic_secrets=true&include_managed_secrets=true', + '/v3/configs/config/secrets/names?project=exercitationem&config=corporis&include_dynamic_secrets=true&include_managed_secrets=true', ) .reply(200, { data: {} }); return sdk.secrets - .listNames('quam', 'ipsum', { includeDynamicSecrets: true, includeManagedSecrets: true }) + .listNames('exercitationem', 'corporis', { + includeDynamicSecrets: true, + includeManagedSecrets: true, + }) .then((r: any) => expect(r.data).toEqual({})); }); test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') .get( - '/v3/configs/config/secrets/names?project=ipsum&config=sit&include_dynamic_secrets=true&include_managed_secrets=true', + '/v3/configs/config/secrets/names?project=porro&config=dicta&include_dynamic_secrets=true&include_managed_secrets=true', ) .reply(200, { data: {} }); return expect(async () => await sdk.secrets.listNames()).rejects.toThrow(); @@ -167,12 +172,12 @@ describe('test SecretsService', () => { test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') .get( - '/v3/configs/config/secrets/names?project=molestias&config=aut&include_dynamic_secrets=true&include_managed_secrets=true', + '/v3/configs/config/secrets/names?project=suscipit&config=quas&include_dynamic_secrets=true&include_managed_secrets=true', ) .reply(404, { data: {} }); return expect( async () => - await sdk.secrets.listNames('molestias', 'aut', { + await sdk.secrets.listNames('suscipit', 'quas', { includeDynamicSecrets: true, includeManagedSecrets: true, }), diff --git a/test/services/ServiceTokens.test.ts b/test/services/ServiceTokens.test.ts index 5e27831..dfbecea 100644 --- a/test/services/ServiceTokens.test.ts +++ b/test/services/ServiceTokens.test.ts @@ -22,24 +22,26 @@ describe('test ServiceTokensService', () => { describe('test list', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') - .get('/v3/configs/config/tokens?project=quas&config=quas') + .get('/v3/configs/config/tokens?project=tenetur&config=consequatur') .reply(200, { data: {} }); - return sdk.serviceTokens.list('quas', 'quas').then((r: any) => expect(r.data).toEqual({})); + return sdk.serviceTokens + .list('tenetur', 'consequatur') + .then((r: any) => expect(r.data).toEqual({})); }); test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') - .get('/v3/configs/config/tokens?project=temporibus&config=itaque') + .get('/v3/configs/config/tokens?project=delectus&config=nesciunt') .reply(200, { data: {} }); return expect(async () => await sdk.serviceTokens.list()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') - .get('/v3/configs/config/tokens?project=quos&config=aspernatur') + .get('/v3/configs/config/tokens?project=temporibus&config=eum') .reply(404, { data: {} }); return expect( - async () => await sdk.serviceTokens.list('quos', 'aspernatur'), + async () => await sdk.serviceTokens.list('temporibus', 'eum'), ).rejects.toThrow(); }); }); diff --git a/test/services/Syncs.test.ts b/test/services/Syncs.test.ts index 2b483ec..d67fee4 100644 --- a/test/services/Syncs.test.ts +++ b/test/services/Syncs.test.ts @@ -22,49 +22,51 @@ describe('test SyncsService', () => { describe('test create', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') - .post('/v3/configs/config/syncs?project=veniam&config=excepturi') + .post('/v3/configs/config/syncs?project=vel&config=non') .reply(200, { data: {} }); - return sdk.syncs - .create({}, 'veniam', 'excepturi') - .then((r: any) => expect(r.data).toEqual({})); + return sdk.syncs.create({}, 'vel', 'non').then((r: any) => expect(r.data).toEqual({})); }); test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') - .post('/v3/configs/config/syncs?project=assumenda&config=reprehenderit') + .post('/v3/configs/config/syncs?project=distinctio&config=reiciendis') .reply(200, { data: {} }); return expect(async () => await sdk.syncs.create()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') - .post('/v3/configs/config/syncs?project=mollitia&config=quam') + .post('/v3/configs/config/syncs?project=delectus&config=consequatur') .reply(404, { data: {} }); - return expect(async () => await sdk.syncs.create({}, 'mollitia', 'quam')).rejects.toThrow(); + return expect( + async () => await sdk.syncs.create({}, 'delectus', 'consequatur'), + ).rejects.toThrow(); }); }); describe('test get', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') - .get('/v3/configs/config/syncs/sync?project=libero&config=omnis&sync=esse') + .get('/v3/configs/config/syncs/sync?project=harum&config=iusto&sync=ducimus') .reply(200, { data: {} }); - return sdk.syncs.get('libero', 'omnis', 'esse').then((r: any) => expect(r.data).toEqual({})); + return sdk.syncs + .get('harum', 'iusto', 'ducimus') + .then((r: any) => expect(r.data).toEqual({})); }); test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') - .get('/v3/configs/config/syncs/sync?project=quod&config=ullam&sync=ipsa') + .get('/v3/configs/config/syncs/sync?project=accusantium&config=impedit&sync=saepe') .reply(200, { data: {} }); return expect(async () => await sdk.syncs.get()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') - .get('/v3/configs/config/syncs/sync?project=veritatis&config=consequatur&sync=iure') + .get('/v3/configs/config/syncs/sync?project=commodi&config=ullam&sync=consequuntur') .reply(404, { data: {} }); return expect( - async () => await sdk.syncs.get('veritatis', 'consequatur', 'iure'), + async () => await sdk.syncs.get('commodi', 'ullam', 'consequuntur'), ).rejects.toThrow(); }); }); @@ -73,18 +75,18 @@ describe('test SyncsService', () => { test('test api call', () => { const scope = nock('https://api.doppler.com') .delete( - '/v3/configs/config/syncs/sync?project=eius&config=voluptate&sync=ipsum&delete_from_target=true', + '/v3/configs/config/syncs/sync?project=beatae&config=quis&sync=nihil&delete_from_target=true', ) .reply(200, { data: {} }); return sdk.syncs - .delete('eius', 'voluptate', 'ipsum', true) + .delete('beatae', 'quis', 'nihil', true) .then((r: any) => expect(r.data).toEqual({})); }); test('test will throw error if required fields missing', () => { const scope = nock('https://api.doppler.com') .delete( - '/v3/configs/config/syncs/sync?project=id&config=doloremque&sync=sunt&delete_from_target=true', + '/v3/configs/config/syncs/sync?project=quae&config=accusamus&sync=aut&delete_from_target=true', ) .reply(200, { data: {} }); return expect(async () => await sdk.syncs.delete()).rejects.toThrow(); @@ -93,11 +95,11 @@ describe('test SyncsService', () => { test('test will throw error on a non-200 response', () => { const scope = nock('https://api.doppler.com') .delete( - '/v3/configs/config/syncs/sync?project=enim&config=earum&sync=laudantium&delete_from_target=true', + '/v3/configs/config/syncs/sync?project=alias&config=iste&sync=dolore&delete_from_target=true', ) .reply(404, { data: {} }); return expect( - async () => await sdk.syncs.delete('enim', 'earum', 'laudantium', true), + async () => await sdk.syncs.delete('alias', 'iste', 'dolore', true), ).rejects.toThrow(); }); });