Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

liblab SDK update v1.3.1 #21

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
13 changes: 8 additions & 5 deletions .manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"liblabVersion": "1.1.43",
"date": "2024-04-03T23:04:28.847Z",
"liblabVersion": "1.1.47",
"date": "2024-05-22T21:09:53.103Z",
"config": {
"authentication": {
"access": {
Expand All @@ -12,7 +12,7 @@
"inputFileName": "/tmp/resources/spec/open-api-spec.json",
"environmentVariables": [],
"fileOutput": "/tmp",
"tempDir": "/tmp/liblab-codegen-1.1.43-Our4mq",
"tempDir": "/tmp/liblab-codegen-1.1.47-IuzYlH",
"inferServiceNames": true,
"httpLibrary": {
"name": "https",
Expand All @@ -24,7 +24,7 @@
"privateRepo": false,
"githubRef": "",
"sdkName": "DopplerSDK",
"sdkVersion": "1.3.0",
"sdkVersion": "1.3.1",
"retry": {
"enabled": true,
"maxAttempts": 3,
Expand Down Expand Up @@ -63,6 +63,10 @@
"enforceRequestValidation": false,
"denoteCommon": false,
"includeOptionalSnippetParameters": true,
"githubRepoName": "node-sdk",
"publishing": {
"githubOrg": "DopplerHQ"
},
"hooks": {
"enabled": false,
"sourceDir": ""
Expand Down Expand Up @@ -164,7 +168,6 @@
"src/services/configs/models/CloneResponse.ts",
"src/services/configs/models/ConfigsCreateRequest.ts",
"src/services/configs/models/ConfigsCreateResponse.ts",
"src/services/configs/models/ConfigsDeleteRequest.ts",
"src/services/configs/models/ConfigsGetResponse.ts",
"src/services/configs/models/ConfigsListResponse.ts",
"src/services/configs/models/ConfigsUpdateRequest.ts",
Expand Down
316 changes: 150 additions & 166 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
},
"name": "@dopplerhq/node-sdk",
"description": "DopplerSDK",
"version": "1.3.0",
"version": "1.3.1",
"author": "DopplerSDK",
"dependencies": {},
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion src/http/HTTPLibrary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export default class HTTPLibrary implements HTTPClient {
...headers,
...this.getUserAgentHeader(),
'content-type': 'application/json',
'transfer-encoding': 'chunked',
},
JSON.stringify(HTTPLibrary.convertKeysWithMapper(input, this.requestMapper)),
);
Expand Down Expand Up @@ -208,7 +209,7 @@ export default class HTTPLibrary implements HTTPClient {
}

private getUserAgentHeader(): Headers {
const userAgentBase = 'DopplerSDK/1.3.0';
const userAgentBase = 'DopplerSDK/1.3.1';

let userAgent = '';
if (typeof window !== 'undefined') {
Expand Down
1 change: 0 additions & 1 deletion src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export type { ConfigLogsGetResponse } from './services/configLogs/models/ConfigL
export type { ConfigLogsListResponse } from './services/configLogs/models/ConfigLogsListResponse';
export type { ConfigsCreateRequest } from './services/configs/models/ConfigsCreateRequest';
export type { ConfigsCreateResponse } from './services/configs/models/ConfigsCreateResponse';
export type { ConfigsDeleteRequest } from './services/configs/models/ConfigsDeleteRequest';
export type { ConfigsGetResponse } from './services/configs/models/ConfigsGetResponse';
export type { ConfigsListResponse } from './services/configs/models/ConfigsListResponse';
export type { ConfigsUpdateRequest } from './services/configs/models/ConfigsUpdateRequest';
Expand Down
75 changes: 39 additions & 36 deletions src/services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,10 @@ Delete

**Required Parameters**

| input | object | Request body. |
| Name | Type | Description |
| :------ | :----- | :--------------------------------- |
| project | string | Unique identifier for the project. |
| config | string | Name of the config. |

**Return Type**

Expand All @@ -704,8 +707,7 @@ const DOPPLERSDK_ACCESS_TOKEN = '';
const sdk = new DopplerSDK({ accessToken: DOPPLERSDK_ACCESS_TOKEN });

(async () => {
const input = { config: 'CONFIG_NAME', project: 'PROJECT_NAME' };
const result = await sdk.configs.delete(input);
const result = await sdk.configs.delete('project', 'config');
console.log(result);
})();

Expand Down Expand Up @@ -1133,26 +1135,30 @@ const sdk = new DopplerSDK({ accessToken: DOPPLERSDK_ACCESS_TOKEN });
const input = {
change_requests: [
{
name: 'cupidatat consectetur ut non quis',
originalName: 'occaecat in in',
originalValue: 'cillum aute occaecat',
originalVisibility: 'sit minim ad',
shouldConverge: false,
name: 'sunt dolor ex eiusmod nisi',
originalName: 'ex exercitation ipsum anim velit',
originalValue: 'Duis veniam',
originalValueType: { type_: 'string' },
originalVisibility: 'incididunt et',
shouldConverge: true,
shouldDelete: false,
shouldPromote: false,
value: 'consectetur proident ea',
visibility: 'in labore exercitation',
shouldPromote: true,
value: 'nulla occaecat reprehenderit in anim',
valueType: { type_: 'cuid2' },
visibility: 'in quis nulla labore',
},
{
name: 'laborum anim sint',
originalName: 'laboris ut',
originalValue: 'in commodo in',
originalVisibility: 'tempor',
shouldConverge: false,
name: 'et magna Lorem',
originalName: 'magna sed consequat',
originalValue: 'esse ut id occaecat aute',
originalValueType: { type_: 'uuidv4' },
originalVisibility: 'laboris',
shouldConverge: true,
shouldDelete: true,
shouldPromote: true,
value: 'pariatur adipisicing nulla ea',
visibility: 'dolore in culpa officia',
shouldPromote: false,
value: 'amet sed dolore exercitation',
valueType: { type_: 'datetime8601' },
visibility: 'et ex nulla est laboris',
},
],
config: 'CONFIG_NAME',
Expand Down Expand Up @@ -1208,7 +1214,7 @@ const sdk = new DopplerSDK({ accessToken: DOPPLERSDK_ACCESS_TOKEN });
const result = await sdk.secrets.list('PROJECT_NAME', 'CONFIG_NAME', {
accepts: 'application/json',
includeDynamicSecrets: true,
dynamicSecretsTtlSec: -33704873,
dynamicSecretsTtlSec: -27865703,
secrets: 'secrets',
includeManagedSecrets: true,
});
Expand Down Expand Up @@ -1329,7 +1335,7 @@ const sdk = new DopplerSDK({ accessToken: DOPPLERSDK_ACCESS_TOKEN });
(async () => {
const result = await sdk.secrets.download('project', 'config', {
format: 'json',
nameTransformer: 'camel',
nameTransformer: 'lower-kebab',
includeDynamicSecrets: true,
dynamicSecretsTtlSec: 1800,
secrets: 'secrets',
Expand Down Expand Up @@ -1615,7 +1621,7 @@ const sdk = new DopplerSDK({ accessToken: DOPPLERSDK_ACCESS_TOKEN });
const input = {
access: 'read',
config: 'CONFIG_NAME',
expire_at: '1908-01-12T01:17:11.0Z',
expire_at: '1947-01-19T20:08:43.0Z',
name: 'TOKEN_NAME',
project: 'PROJECT_NAME',
};
Expand Down Expand Up @@ -1766,7 +1772,7 @@ const sdk = new DopplerSDK({ accessToken: DOPPLERSDK_ACCESS_TOKEN });
config: 'config',
dynamic_secret: 'dynamic_secret',
project: 'project',
ttl_sec: -46828653,
ttl_sec: 36997257,
};
const result = await sdk.dynamicSecrets.issueLease(input);
console.log(result);
Expand Down Expand Up @@ -2130,7 +2136,7 @@ const DOPPLERSDK_ACCESS_TOKEN = '';
const sdk = new DopplerSDK({ accessToken: DOPPLERSDK_ACCESS_TOKEN });

(async () => {
const input = { name: 'name', permissions: ['sunt', 'deserunt ad Lorem nisi'] };
const input = { name: 'name', permissions: ['nostrud aliqua et', 'magna adipisicing'] };
const result = await sdk.workplaceRoles.create(input);
console.log(result);
})();
Expand Down Expand Up @@ -2225,7 +2231,7 @@ const DOPPLERSDK_ACCESS_TOKEN = '';
const sdk = new DopplerSDK({ accessToken: DOPPLERSDK_ACCESS_TOKEN });

(async () => {
const input = { name: 'name', permissions: ['sint consequat', 'dolor aute esse adipisicing'] };
const input = { name: 'name', permissions: ['aute qui Ut amet voluptate', 'ea'] };
const result = await sdk.workplaceRoles.update(input, 'role');
console.log(result);
})();
Expand Down Expand Up @@ -2353,7 +2359,7 @@ const DOPPLERSDK_ACCESS_TOKEN = '';
const sdk = new DopplerSDK({ accessToken: DOPPLERSDK_ACCESS_TOKEN });

(async () => {
const input = { name: 'name', permissions: ['cupidatat laborum Ut proident amet', 'anim ut'] };
const input = { name: 'name', permissions: ['minim quis incididunt ullamco', 'reprehenderit'] };
const result = await sdk.projectRoles.update(input, 'role');
console.log(result);
})();
Expand Down Expand Up @@ -2420,7 +2426,7 @@ const sdk = new DopplerSDK({ accessToken: DOPPLERSDK_ACCESS_TOKEN });
(async () => {
const input = {
name: 'name',
permissions: ['Lorem ea quis commodo occaecat', 'qui voluptate et consectetur dolor'],
permissions: ['aute eiusmod est', 'adipisicing non magna eu cupidatat'],
};
const result = await sdk.projectRoles.create(input);
console.log(result);
Expand Down Expand Up @@ -2511,7 +2517,7 @@ const sdk = new DopplerSDK({ accessToken: DOPPLERSDK_ACCESS_TOKEN });

(async () => {
const input = {
environments: ['laborum elit enim cillum', 'consequat quis'],
environments: ['cupidatat', 'id laborum officia culpa adipisicing'],
role: 'role',
slug: 'slug',
type_: 'group',
Expand Down Expand Up @@ -2630,10 +2636,10 @@ const sdk = new DopplerSDK({ accessToken: DOPPLERSDK_ACCESS_TOKEN });

(async () => {
const input = {
environments: ['incididunt veniam in dolor', 'qui laborum sint exercitation ut'],
environments: ['laboris enim tempor consectetur', 'in voluptate non sed eu'],
role: 'role',
};
const result = await sdk.projectMembers.update(input, 'invite', 'slug', 'project');
const result = await sdk.projectMembers.update(input, 'workplace_user', 'slug', 'project');
console.log(result);
})();

Expand Down Expand Up @@ -2775,7 +2781,7 @@ const sdk = new DopplerSDK({ accessToken: DOPPLERSDK_ACCESS_TOKEN });
name: 'name',
workplace_role: {
identifier: 'identifier',
permissions: ['enim irure reprehenderit', 'eiusmod consequat proident veniam'],
permissions: ['quis est ut nulla veniam', 'culpa proident Ut quis veniam'],
},
};
const result = await sdk.serviceAccounts.update(input, 'slug');
Expand Down Expand Up @@ -2844,10 +2850,7 @@ const sdk = new DopplerSDK({ accessToken: DOPPLERSDK_ACCESS_TOKEN });
(async () => {
const input = {
name: 'name',
workplace_role: {
identifier: 'identifier',
permissions: ['do consequat', 'eiusmod quis nostrud nisi laborum'],
},
workplace_role: { identifier: 'identifier', permissions: ['deserunt', 'occaecat Duis dolore'] },
};
const result = await sdk.serviceAccounts.create(input);
console.log(result);
Expand Down Expand Up @@ -3575,7 +3578,7 @@ const DOPPLERSDK_ACCESS_TOKEN = '';
const sdk = new DopplerSDK({ accessToken: DOPPLERSDK_ACCESS_TOKEN });

(async () => {
const input = { expires_at: '1940-05-02T11:24:43.0Z', name: 'name' };
const input = { expires_at: '1898-08-31T02:04:41.0Z', name: 'name' };
const result = await sdk.serviceAccountTokens.create(input, 'service_account');
console.log(result);
})();
Expand Down
23 changes: 17 additions & 6 deletions src/services/configs/Configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { ConfigsGetResponse } from './models/ConfigsGetResponse';
import { ConfigsUpdateResponse } from './models/ConfigsUpdateResponse';
import { DeleteResponse } from '../common/DeleteResponse';
import { ConfigsUpdateRequest } from './models/ConfigsUpdateRequest';
import { ConfigsDeleteRequest } from './models/ConfigsDeleteRequest';
import { ConfigsListResponse } from './models/ConfigsListResponse';
import { ConfigsCreateResponse } from './models/ConfigsCreateResponse';
import { ConfigsCreateRequest } from './models/ConfigsCreateRequest';
Expand Down Expand Up @@ -84,17 +83,29 @@ export class ConfigsService extends BaseService {
* @summary Delete
* @description Permanently delete the config.

* @param project Unique identifier for the project.
* @param config Name of the config.
* @returns {Promise<DeleteResponse>} - The promise with the result
*/
async delete(input: ConfigsDeleteRequest): Promise<DeleteResponse> {
const headers: { [key: string]: string } = { 'Content-Type': 'application/json' };
async delete(project: string, config: string): Promise<DeleteResponse> {
if (project === undefined || config === undefined) {
throw new Error(
'The following are required parameters: project,config, cannot be empty or blank',
);
}
const queryParams: string[] = [];
if (project) {
queryParams.push(serializeQuery('form', true, 'project', project));
}
if (config) {
queryParams.push(serializeQuery('form', true, 'config', config));
}
const urlEndpoint = '/v3/configs/config';
const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}?${queryParams.join('&')}`);
const response: any = await this.httpClient.delete(
finalUrl,
input,
{ project, config },
{
...headers,
...this.getAuthorizationHeader(),
},
true,
Expand Down
1 change: 0 additions & 1 deletion src/services/configs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export type { CloneRequest } from './models/CloneRequest';
export type { CloneResponse } from './models/CloneResponse';
export type { ConfigsCreateRequest } from './models/ConfigsCreateRequest';
export type { ConfigsCreateResponse } from './models/ConfigsCreateResponse';
export type { ConfigsDeleteRequest } from './models/ConfigsDeleteRequest';
export type { ConfigsGetResponse } from './models/ConfigsGetResponse';
export type { ConfigsListResponse } from './models/ConfigsListResponse';
export type { ConfigsUpdateRequest } from './models/ConfigsUpdateRequest';
Expand Down
10 changes: 0 additions & 10 deletions src/services/configs/models/ConfigsDeleteRequest.ts

This file was deleted.

45 changes: 45 additions & 0 deletions src/services/secrets/models/SecretsUpdateRequest.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
type Type_ =
| 'string'
| 'json'
| 'json5'
| 'boolean'
| 'integer'
| 'decimal'
| 'email'
| 'url'
| 'uuidv4'
| 'cuid2'
| 'ulid'
| 'datetime8601'
| 'date8601'
| 'yaml';
type Type_1 =
| 'string'
| 'json'
| 'json5'
| 'boolean'
| 'integer'
| 'decimal'
| 'email'
| 'url'
| 'uuidv4'
| 'cuid2'
| 'ulid'
| 'datetime8601'
| 'date8601'
| 'yaml';

export interface SecretsUpdateRequest {
/**
* Unique identifier for the project object.
Expand Down Expand Up @@ -48,6 +79,8 @@ export interface SecretsUpdateRequest {
* Defaults to `false`. Can only be set to `true` if the config being updated is a branch config and there is a secret with the same name in the root config. In this case, the branch secret will inherit the value and visibility type from the root secret.
*/
shouldConverge?: boolean;
valueType?: ValueType;
originalValueType?: OriginalValueType;
}[];
}
/**
Expand All @@ -56,3 +89,15 @@ export interface SecretsUpdateRequest {
interface Secrets {
[k: string]: string;
}
/**
* The default valueType (string) will result in no validations being applied.
*/
interface ValueType {
type_?: Type_;
}
/**
* The valueType you expect the secret to have before `valueType` is applied. If specified, the request will only be processed if the provided valueType matches what's found in Doppler.
*/
interface OriginalValueType {
type_?: Type_1;
}
Loading
Loading