@scaleway/sdk 2.34.0 → 2.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/baremetal/v1/api.gen.d.ts +1 -1
- package/dist/api/block/v1alpha1/api.gen.d.ts +1 -1
- package/dist/api/cockpit/v1/api.gen.cjs +26 -0
- package/dist/api/cockpit/v1/api.gen.d.ts +12 -1
- package/dist/api/cockpit/v1/api.gen.js +27 -1
- package/dist/api/cockpit/v1/index.gen.d.ts +1 -1
- package/dist/api/cockpit/v1/marshalling.gen.cjs +26 -0
- package/dist/api/cockpit/v1/marshalling.gen.d.ts +2 -1
- package/dist/api/cockpit/v1/marshalling.gen.js +26 -0
- package/dist/api/cockpit/v1/types.gen.d.ts +34 -0
- package/dist/api/cockpit/v1/validation-rules.gen.cjs +10 -0
- package/dist/api/cockpit/v1/validation-rules.gen.d.ts +9 -0
- package/dist/api/cockpit/v1/validation-rules.gen.js +10 -0
- package/dist/api/container/v1beta1/index.gen.d.ts +1 -1
- package/dist/api/container/v1beta1/marshalling.gen.cjs +3 -0
- package/dist/api/container/v1beta1/marshalling.gen.js +3 -0
- package/dist/api/container/v1beta1/types.gen.d.ts +7 -0
- package/dist/api/function/v1beta1/index.gen.d.ts +1 -1
- package/dist/api/function/v1beta1/marshalling.gen.cjs +3 -0
- package/dist/api/function/v1beta1/marshalling.gen.js +3 -0
- package/dist/api/function/v1beta1/types.gen.d.ts +8 -1
- package/dist/api/inference/v1beta1/api.gen.d.ts +151 -0
- package/dist/api/inference/v1beta1/content.gen.d.ts +3 -0
- package/dist/api/inference/v1beta1/index.gen.d.ts +4 -0
- package/dist/api/inference/v1beta1/marshalling.gen.d.ts +18 -0
- package/dist/api/inference/v1beta1/types.gen.d.ts +435 -0
- package/dist/api/inference/v1beta1/validation-rules.gen.d.ts +50 -0
- package/dist/api/instance/v1/api.utils.cjs +1 -2
- package/dist/api/instance/v1/api.utils.js +1 -2
- package/dist/api/secret/v1beta1/api.gen.cjs +25 -0
- package/dist/api/secret/v1beta1/api.gen.d.ts +12 -1
- package/dist/api/secret/v1beta1/api.gen.js +26 -1
- package/dist/api/secret/v1beta1/index.gen.d.ts +1 -1
- package/dist/api/secret/v1beta1/marshalling.gen.cjs +12 -0
- package/dist/api/secret/v1beta1/marshalling.gen.d.ts +2 -1
- package/dist/api/secret/v1beta1/marshalling.gen.js +12 -0
- package/dist/api/secret/v1beta1/types.gen.d.ts +17 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.cjs +1 -1
- package/dist/api/tem/v1alpha1/marshalling.gen.js +1 -1
- package/dist/api/tem/v1alpha1/types.gen.d.ts +1 -1
- package/dist/api/tem/v1alpha1/validation-rules.gen.cjs +64 -0
- package/dist/api/tem/v1alpha1/validation-rules.gen.d.ts +57 -0
- package/dist/api/tem/v1alpha1/validation-rules.gen.js +64 -0
- package/dist/helpers/marshalling.cjs +2 -4
- package/dist/helpers/marshalling.js +2 -4
- package/dist/internal/async/interval-retrier.cjs +2 -4
- package/dist/internal/async/interval-retrier.js +2 -4
- package/dist/scw/auth.cjs +2 -4
- package/dist/scw/auth.js +2 -4
- package/dist/scw/constants.cjs +1 -1
- package/dist/scw/constants.d.ts +2 -2
- package/dist/scw/constants.js +1 -1
- package/dist/scw/errors/standard/invalid-arguments-error.cjs +1 -2
- package/dist/scw/errors/standard/invalid-arguments-error.js +1 -2
- package/dist/scw/errors/standard/out-of-stock-error.cjs +1 -2
- package/dist/scw/errors/standard/out-of-stock-error.js +1 -2
- package/dist/scw/errors/standard/permissions-denied-error.cjs +1 -2
- package/dist/scw/errors/standard/permissions-denied-error.js +1 -2
- package/dist/scw/errors/standard/quotas-exceeded-error.cjs +1 -2
- package/dist/scw/errors/standard/quotas-exceeded-error.js +1 -2
- package/dist/scw/errors/standard/too-many-requests-error.cjs +1 -2
- package/dist/scw/errors/standard/too-many-requests-error.js +1 -2
- package/dist/scw/fetch/resource-paginator.cjs +1 -2
- package/dist/scw/fetch/resource-paginator.js +1 -2
- package/dist/scw/fetch/response-parser.cjs +2 -4
- package/dist/scw/fetch/response-parser.js +2 -4
- package/package.json +2 -2
|
@@ -355,5 +355,30 @@ class API extends api.API {
|
|
|
355
355
|
* @returns A Promise of ListTagsResponse
|
|
356
356
|
*/
|
|
357
357
|
listTags = (request = {}) => resourcePaginator.enrichForPagination("tags", this.pageOfListTags, request);
|
|
358
|
+
pageOfListSecretTypes = (request = {}) => this.client.fetch(
|
|
359
|
+
{
|
|
360
|
+
method: "GET",
|
|
361
|
+
path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secret-types`,
|
|
362
|
+
urlParams: marshalling.urlParams(
|
|
363
|
+
["page", request.page],
|
|
364
|
+
[
|
|
365
|
+
"page_size",
|
|
366
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
367
|
+
],
|
|
368
|
+
[
|
|
369
|
+
"project_id",
|
|
370
|
+
request.projectId ?? this.client.settings.defaultProjectId
|
|
371
|
+
]
|
|
372
|
+
)
|
|
373
|
+
},
|
|
374
|
+
marshalling_gen.unmarshalListSecretTypesResponse
|
|
375
|
+
);
|
|
376
|
+
/**
|
|
377
|
+
* List secret types. List all secret types created within a given Project.
|
|
378
|
+
*
|
|
379
|
+
* @param request - The request {@link ListSecretTypesRequest}
|
|
380
|
+
* @returns A Promise of ListSecretTypesResponse
|
|
381
|
+
*/
|
|
382
|
+
listSecretTypes = (request = {}) => resourcePaginator.enrichForPagination("types", this.pageOfListSecretTypes, request);
|
|
358
383
|
}
|
|
359
384
|
exports.API = API;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { API as ParentAPI } from '../../../bridge';
|
|
2
2
|
import type { Region } from '../../../bridge';
|
|
3
|
-
import type { AccessSecretVersionByPathRequest, AccessSecretVersionRequest, AccessSecretVersionResponse, AddSecretOwnerRequest, BrowseSecretsRequest, BrowseSecretsResponse, CreateSecretRequest, CreateSecretVersionRequest, DeleteSecretRequest, DeleteSecretVersionRequest, DisableSecretVersionRequest, EnableSecretVersionRequest, GetSecretRequest, GetSecretVersionRequest, ListSecretVersionsRequest, ListSecretVersionsResponse, ListSecretsRequest, ListSecretsResponse, ListTagsRequest, ListTagsResponse, ProtectSecretRequest, Secret, SecretVersion, UnprotectSecretRequest, UpdateSecretRequest, UpdateSecretVersionRequest } from './types.gen';
|
|
3
|
+
import type { AccessSecretVersionByPathRequest, AccessSecretVersionRequest, AccessSecretVersionResponse, AddSecretOwnerRequest, BrowseSecretsRequest, BrowseSecretsResponse, CreateSecretRequest, CreateSecretVersionRequest, DeleteSecretRequest, DeleteSecretVersionRequest, DisableSecretVersionRequest, EnableSecretVersionRequest, GetSecretRequest, GetSecretVersionRequest, ListSecretTypesRequest, ListSecretTypesResponse, ListSecretVersionsRequest, ListSecretVersionsResponse, ListSecretsRequest, ListSecretsResponse, ListTagsRequest, ListTagsResponse, ProtectSecretRequest, Secret, SecretVersion, UnprotectSecretRequest, UpdateSecretRequest, UpdateSecretVersionRequest } from './types.gen';
|
|
4
4
|
/**
|
|
5
5
|
* Secret Manager API.
|
|
6
6
|
*
|
|
@@ -179,4 +179,15 @@ export declare class API extends ParentAPI {
|
|
|
179
179
|
all: () => Promise<string[]>;
|
|
180
180
|
[Symbol.asyncIterator]: () => AsyncGenerator<string[], void, void>;
|
|
181
181
|
};
|
|
182
|
+
protected pageOfListSecretTypes: (request?: Readonly<ListSecretTypesRequest>) => Promise<ListSecretTypesResponse>;
|
|
183
|
+
/**
|
|
184
|
+
* List secret types. List all secret types created within a given Project.
|
|
185
|
+
*
|
|
186
|
+
* @param request - The request {@link ListSecretTypesRequest}
|
|
187
|
+
* @returns A Promise of ListSecretTypesResponse
|
|
188
|
+
*/
|
|
189
|
+
listSecretTypes: (request?: Readonly<ListSecretTypesRequest>) => Promise<ListSecretTypesResponse> & {
|
|
190
|
+
all: () => Promise<import("./types.gen").SecretType[]>;
|
|
191
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen").SecretType[], void, void>;
|
|
192
|
+
};
|
|
182
193
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { API as API$1 } from "../../../scw/api.js";
|
|
2
2
|
import { validatePathParam, urlParams } from "../../../helpers/marshalling.js";
|
|
3
3
|
import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
|
|
4
|
-
import { marshalCreateSecretRequest, unmarshalSecret, marshalUpdateSecretRequest, unmarshalListSecretsResponse, unmarshalBrowseSecretsResponse, marshalAddSecretOwnerRequest, marshalCreateSecretVersionRequest, unmarshalSecretVersion, marshalUpdateSecretVersionRequest, unmarshalListSecretVersionsResponse, unmarshalAccessSecretVersionResponse, unmarshalListTagsResponse } from "./marshalling.gen.js";
|
|
4
|
+
import { marshalCreateSecretRequest, unmarshalSecret, marshalUpdateSecretRequest, unmarshalListSecretsResponse, unmarshalBrowseSecretsResponse, marshalAddSecretOwnerRequest, marshalCreateSecretVersionRequest, unmarshalSecretVersion, marshalUpdateSecretVersionRequest, unmarshalListSecretVersionsResponse, unmarshalAccessSecretVersionResponse, unmarshalListTagsResponse, unmarshalListSecretTypesResponse } from "./marshalling.gen.js";
|
|
5
5
|
const jsonContentHeaders = {
|
|
6
6
|
"Content-Type": "application/json; charset=utf-8"
|
|
7
7
|
};
|
|
@@ -353,6 +353,31 @@ class API extends API$1 {
|
|
|
353
353
|
* @returns A Promise of ListTagsResponse
|
|
354
354
|
*/
|
|
355
355
|
listTags = (request = {}) => enrichForPagination("tags", this.pageOfListTags, request);
|
|
356
|
+
pageOfListSecretTypes = (request = {}) => this.client.fetch(
|
|
357
|
+
{
|
|
358
|
+
method: "GET",
|
|
359
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secret-types`,
|
|
360
|
+
urlParams: urlParams(
|
|
361
|
+
["page", request.page],
|
|
362
|
+
[
|
|
363
|
+
"page_size",
|
|
364
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
365
|
+
],
|
|
366
|
+
[
|
|
367
|
+
"project_id",
|
|
368
|
+
request.projectId ?? this.client.settings.defaultProjectId
|
|
369
|
+
]
|
|
370
|
+
)
|
|
371
|
+
},
|
|
372
|
+
unmarshalListSecretTypesResponse
|
|
373
|
+
);
|
|
374
|
+
/**
|
|
375
|
+
* List secret types. List all secret types created within a given Project.
|
|
376
|
+
*
|
|
377
|
+
* @param request - The request {@link ListSecretTypesRequest}
|
|
378
|
+
* @returns A Promise of ListSecretTypesResponse
|
|
379
|
+
*/
|
|
380
|
+
listSecretTypes = (request = {}) => enrichForPagination("types", this.pageOfListSecretTypes, request);
|
|
356
381
|
}
|
|
357
382
|
export {
|
|
358
383
|
API
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { API } from './api.gen';
|
|
2
|
-
export type { AccessSecretVersionByPathRequest, AccessSecretVersionRequest, AccessSecretVersionResponse, AddSecretOwnerRequest, BasicCredentials, BrowseSecretsRequest, BrowseSecretsRequestOrderBy, BrowseSecretsResponse, BrowseSecretsResponseItem, BrowseSecretsResponseItemFolderDetails, BrowseSecretsResponseItemSecretDetails, CreateSecretRequest, CreateSecretVersionRequest, DatabaseCredentials, DeleteSecretRequest, DeleteSecretVersionRequest, DisableSecretVersionRequest, EnableSecretVersionRequest, EphemeralPolicy, EphemeralPolicyAction, EphemeralProperties, GetSecretRequest, GetSecretVersionRequest, ListSecretVersionsRequest, ListSecretVersionsResponse, ListSecretsRequest, ListSecretsRequestOrderBy, ListSecretsResponse, ListTagsRequest, ListTagsResponse, Product, ProtectSecretRequest, SSHKey, Secret, SecretStatus, SecretType, SecretVersion, SecretVersionStatus, UnprotectSecretRequest, UpdateSecretRequest, UpdateSecretVersionRequest, } from './types.gen';
|
|
2
|
+
export type { AccessSecretVersionByPathRequest, AccessSecretVersionRequest, AccessSecretVersionResponse, AddSecretOwnerRequest, BasicCredentials, BrowseSecretsRequest, BrowseSecretsRequestOrderBy, BrowseSecretsResponse, BrowseSecretsResponseItem, BrowseSecretsResponseItemFolderDetails, BrowseSecretsResponseItemSecretDetails, CreateSecretRequest, CreateSecretVersionRequest, DatabaseCredentials, DeleteSecretRequest, DeleteSecretVersionRequest, DisableSecretVersionRequest, EnableSecretVersionRequest, EphemeralPolicy, EphemeralPolicyAction, EphemeralProperties, GetSecretRequest, GetSecretVersionRequest, ListSecretTypesRequest, ListSecretTypesResponse, ListSecretVersionsRequest, ListSecretVersionsResponse, ListSecretsRequest, ListSecretsRequestOrderBy, ListSecretsResponse, ListTagsRequest, ListTagsResponse, Product, ProtectSecretRequest, SSHKey, Secret, SecretStatus, SecretType, SecretVersion, SecretVersionStatus, UnprotectSecretRequest, UpdateSecretRequest, UpdateSecretVersionRequest, } from './types.gen';
|
|
3
3
|
export * as ValidationRules from './validation-rules.gen';
|
|
@@ -132,6 +132,17 @@ const unmarshalBrowseSecretsResponse = (data) => {
|
|
|
132
132
|
totalCount: data.total_count
|
|
133
133
|
};
|
|
134
134
|
};
|
|
135
|
+
const unmarshalListSecretTypesResponse = (data) => {
|
|
136
|
+
if (!json.isJSONObject(data)) {
|
|
137
|
+
throw new TypeError(
|
|
138
|
+
`Unmarshalling the type 'ListSecretTypesResponse' failed as data isn't a dictionary.`
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
totalCount: data.total_count,
|
|
143
|
+
types: data.types
|
|
144
|
+
};
|
|
145
|
+
};
|
|
135
146
|
const unmarshalListSecretVersionsResponse = (data) => {
|
|
136
147
|
if (!json.isJSONObject(data)) {
|
|
137
148
|
throw new TypeError(
|
|
@@ -212,6 +223,7 @@ exports.marshalUpdateSecretRequest = marshalUpdateSecretRequest;
|
|
|
212
223
|
exports.marshalUpdateSecretVersionRequest = marshalUpdateSecretVersionRequest;
|
|
213
224
|
exports.unmarshalAccessSecretVersionResponse = unmarshalAccessSecretVersionResponse;
|
|
214
225
|
exports.unmarshalBrowseSecretsResponse = unmarshalBrowseSecretsResponse;
|
|
226
|
+
exports.unmarshalListSecretTypesResponse = unmarshalListSecretTypesResponse;
|
|
215
227
|
exports.unmarshalListSecretVersionsResponse = unmarshalListSecretVersionsResponse;
|
|
216
228
|
exports.unmarshalListSecretsResponse = unmarshalListSecretsResponse;
|
|
217
229
|
exports.unmarshalListTagsResponse = unmarshalListTagsResponse;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { DefaultValues } from '../../../bridge';
|
|
2
|
-
import type { AccessSecretVersionResponse, AddSecretOwnerRequest, BrowseSecretsResponse, CreateSecretRequest, CreateSecretVersionRequest, ListSecretVersionsResponse, ListSecretsResponse, ListTagsResponse, Secret, SecretVersion, UpdateSecretRequest, UpdateSecretVersionRequest } from './types.gen';
|
|
2
|
+
import type { AccessSecretVersionResponse, AddSecretOwnerRequest, BrowseSecretsResponse, CreateSecretRequest, CreateSecretVersionRequest, ListSecretTypesResponse, ListSecretVersionsResponse, ListSecretsResponse, ListTagsResponse, Secret, SecretVersion, UpdateSecretRequest, UpdateSecretVersionRequest } from './types.gen';
|
|
3
3
|
export declare const unmarshalSecretVersion: (data: unknown) => SecretVersion;
|
|
4
4
|
export declare const unmarshalSecret: (data: unknown) => Secret;
|
|
5
5
|
export declare const unmarshalAccessSecretVersionResponse: (data: unknown) => AccessSecretVersionResponse;
|
|
6
6
|
export declare const unmarshalBrowseSecretsResponse: (data: unknown) => BrowseSecretsResponse;
|
|
7
|
+
export declare const unmarshalListSecretTypesResponse: (data: unknown) => ListSecretTypesResponse;
|
|
7
8
|
export declare const unmarshalListSecretVersionsResponse: (data: unknown) => ListSecretVersionsResponse;
|
|
8
9
|
export declare const unmarshalListSecretsResponse: (data: unknown) => ListSecretsResponse;
|
|
9
10
|
export declare const unmarshalListTagsResponse: (data: unknown) => ListTagsResponse;
|
|
@@ -130,6 +130,17 @@ const unmarshalBrowseSecretsResponse = (data) => {
|
|
|
130
130
|
totalCount: data.total_count
|
|
131
131
|
};
|
|
132
132
|
};
|
|
133
|
+
const unmarshalListSecretTypesResponse = (data) => {
|
|
134
|
+
if (!isJSONObject(data)) {
|
|
135
|
+
throw new TypeError(
|
|
136
|
+
`Unmarshalling the type 'ListSecretTypesResponse' failed as data isn't a dictionary.`
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
return {
|
|
140
|
+
totalCount: data.total_count,
|
|
141
|
+
types: data.types
|
|
142
|
+
};
|
|
143
|
+
};
|
|
133
144
|
const unmarshalListSecretVersionsResponse = (data) => {
|
|
134
145
|
if (!isJSONObject(data)) {
|
|
135
146
|
throw new TypeError(
|
|
@@ -211,6 +222,7 @@ export {
|
|
|
211
222
|
marshalUpdateSecretVersionRequest,
|
|
212
223
|
unmarshalAccessSecretVersionResponse,
|
|
213
224
|
unmarshalBrowseSecretsResponse,
|
|
225
|
+
unmarshalListSecretTypesResponse,
|
|
214
226
|
unmarshalListSecretVersionsResponse,
|
|
215
227
|
unmarshalListSecretsResponse,
|
|
216
228
|
unmarshalListTagsResponse,
|
|
@@ -375,6 +375,23 @@ export type GetSecretVersionRequest = {
|
|
|
375
375
|
*/
|
|
376
376
|
revision: string;
|
|
377
377
|
};
|
|
378
|
+
export type ListSecretTypesRequest = {
|
|
379
|
+
/**
|
|
380
|
+
* Region to target. If none is passed will use default region from the
|
|
381
|
+
* config.
|
|
382
|
+
*/
|
|
383
|
+
region?: Region;
|
|
384
|
+
/** ID of the Project to target. */
|
|
385
|
+
projectId?: string;
|
|
386
|
+
page?: number;
|
|
387
|
+
pageSize?: number;
|
|
388
|
+
};
|
|
389
|
+
export interface ListSecretTypesResponse {
|
|
390
|
+
/** List of secret types. */
|
|
391
|
+
types: SecretType[];
|
|
392
|
+
/** Count of all secret types matching the requested criteria. */
|
|
393
|
+
totalCount: number;
|
|
394
|
+
}
|
|
378
395
|
export type ListSecretVersionsRequest = {
|
|
379
396
|
/**
|
|
380
397
|
* Region to target. If none is passed will use default region from the
|
|
@@ -299,7 +299,7 @@ const marshalCreateEmailRequest = (request, defaults) => ({
|
|
|
299
299
|
) : void 0,
|
|
300
300
|
bcc: request.bcc !== void 0 ? request.bcc.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0,
|
|
301
301
|
cc: request.cc !== void 0 ? request.cc.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0,
|
|
302
|
-
from:
|
|
302
|
+
from: marshalCreateEmailRequestAddress(request.from),
|
|
303
303
|
html: request.html,
|
|
304
304
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
305
305
|
send_before: request.sendBefore,
|
|
@@ -297,7 +297,7 @@ const marshalCreateEmailRequest = (request, defaults) => ({
|
|
|
297
297
|
) : void 0,
|
|
298
298
|
bcc: request.bcc !== void 0 ? request.bcc.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0,
|
|
299
299
|
cc: request.cc !== void 0 ? request.cc.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0,
|
|
300
|
-
from:
|
|
300
|
+
from: marshalCreateEmailRequestAddress(request.from),
|
|
301
301
|
html: request.html,
|
|
302
302
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
303
303
|
send_before: request.sendBefore,
|
|
@@ -259,7 +259,7 @@ export type CreateEmailRequest = {
|
|
|
259
259
|
*/
|
|
260
260
|
region?: Region;
|
|
261
261
|
/** Sender information. Must be from a checked domain declared in the Project. */
|
|
262
|
-
from
|
|
262
|
+
from: CreateEmailRequestAddress;
|
|
263
263
|
/** An array of the primary recipient's information. */
|
|
264
264
|
to?: CreateEmailRequestAddress[];
|
|
265
265
|
/** An array of the carbon copy recipient's information. */
|
|
@@ -1,5 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const CreateDomainRequest = {
|
|
4
|
+
domainName: {
|
|
5
|
+
maxLength: 255,
|
|
6
|
+
minLength: 1
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
const CreateEmailRequest = {
|
|
10
|
+
subject: {
|
|
11
|
+
minLength: 6
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const CreateEmailRequestAddress = {
|
|
15
|
+
email: {
|
|
16
|
+
minLength: 1
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const CreateEmailRequestAttachment = {
|
|
20
|
+
name: {
|
|
21
|
+
minLength: 1
|
|
22
|
+
},
|
|
23
|
+
type: {
|
|
24
|
+
minLength: 1
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const CreateEmailRequestHeader = {
|
|
28
|
+
key: {
|
|
29
|
+
minLength: 1
|
|
30
|
+
},
|
|
31
|
+
value: {
|
|
32
|
+
minLength: 1
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const ListDomainsRequest = {
|
|
36
|
+
page: {
|
|
37
|
+
greaterThan: 0
|
|
38
|
+
},
|
|
39
|
+
pageSize: {
|
|
40
|
+
greaterThanOrEqual: 1,
|
|
41
|
+
lessThanOrEqual: 1e3
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const ListEmailsRequest = {
|
|
45
|
+
page: {
|
|
46
|
+
greaterThan: 0
|
|
47
|
+
},
|
|
48
|
+
pageSize: {
|
|
49
|
+
greaterThanOrEqual: 1,
|
|
50
|
+
lessThanOrEqual: 1e3
|
|
51
|
+
},
|
|
52
|
+
search: {
|
|
53
|
+
maxLength: 100,
|
|
54
|
+
minLength: 3
|
|
55
|
+
},
|
|
56
|
+
subject: {
|
|
57
|
+
minLength: 6
|
|
58
|
+
}
|
|
59
|
+
};
|
|
3
60
|
const ListWebhookEventsRequest = {
|
|
4
61
|
page: {
|
|
5
62
|
greaterThan: 0
|
|
@@ -28,6 +85,13 @@ const UpdateWebhookRequest = {
|
|
|
28
85
|
minLength: 3
|
|
29
86
|
}
|
|
30
87
|
};
|
|
88
|
+
exports.CreateDomainRequest = CreateDomainRequest;
|
|
89
|
+
exports.CreateEmailRequest = CreateEmailRequest;
|
|
90
|
+
exports.CreateEmailRequestAddress = CreateEmailRequestAddress;
|
|
91
|
+
exports.CreateEmailRequestAttachment = CreateEmailRequestAttachment;
|
|
92
|
+
exports.CreateEmailRequestHeader = CreateEmailRequestHeader;
|
|
93
|
+
exports.ListDomainsRequest = ListDomainsRequest;
|
|
94
|
+
exports.ListEmailsRequest = ListEmailsRequest;
|
|
31
95
|
exports.ListWebhookEventsRequest = ListWebhookEventsRequest;
|
|
32
96
|
exports.ListWebhooksRequest = ListWebhooksRequest;
|
|
33
97
|
exports.UpdateWebhookRequest = UpdateWebhookRequest;
|
|
@@ -1,3 +1,60 @@
|
|
|
1
|
+
export declare const CreateDomainRequest: {
|
|
2
|
+
domainName: {
|
|
3
|
+
maxLength: number;
|
|
4
|
+
minLength: number;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export declare const CreateEmailRequest: {
|
|
8
|
+
subject: {
|
|
9
|
+
minLength: number;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare const CreateEmailRequestAddress: {
|
|
13
|
+
email: {
|
|
14
|
+
minLength: number;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare const CreateEmailRequestAttachment: {
|
|
18
|
+
name: {
|
|
19
|
+
minLength: number;
|
|
20
|
+
};
|
|
21
|
+
type: {
|
|
22
|
+
minLength: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare const CreateEmailRequestHeader: {
|
|
26
|
+
key: {
|
|
27
|
+
minLength: number;
|
|
28
|
+
};
|
|
29
|
+
value: {
|
|
30
|
+
minLength: number;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export declare const ListDomainsRequest: {
|
|
34
|
+
page: {
|
|
35
|
+
greaterThan: number;
|
|
36
|
+
};
|
|
37
|
+
pageSize: {
|
|
38
|
+
greaterThanOrEqual: number;
|
|
39
|
+
lessThanOrEqual: number;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export declare const ListEmailsRequest: {
|
|
43
|
+
page: {
|
|
44
|
+
greaterThan: number;
|
|
45
|
+
};
|
|
46
|
+
pageSize: {
|
|
47
|
+
greaterThanOrEqual: number;
|
|
48
|
+
lessThanOrEqual: number;
|
|
49
|
+
};
|
|
50
|
+
search: {
|
|
51
|
+
maxLength: number;
|
|
52
|
+
minLength: number;
|
|
53
|
+
};
|
|
54
|
+
subject: {
|
|
55
|
+
minLength: number;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
1
58
|
export declare const ListWebhookEventsRequest: {
|
|
2
59
|
page: {
|
|
3
60
|
greaterThan: number;
|
|
@@ -1,3 +1,60 @@
|
|
|
1
|
+
const CreateDomainRequest = {
|
|
2
|
+
domainName: {
|
|
3
|
+
maxLength: 255,
|
|
4
|
+
minLength: 1
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
const CreateEmailRequest = {
|
|
8
|
+
subject: {
|
|
9
|
+
minLength: 6
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const CreateEmailRequestAddress = {
|
|
13
|
+
email: {
|
|
14
|
+
minLength: 1
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const CreateEmailRequestAttachment = {
|
|
18
|
+
name: {
|
|
19
|
+
minLength: 1
|
|
20
|
+
},
|
|
21
|
+
type: {
|
|
22
|
+
minLength: 1
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const CreateEmailRequestHeader = {
|
|
26
|
+
key: {
|
|
27
|
+
minLength: 1
|
|
28
|
+
},
|
|
29
|
+
value: {
|
|
30
|
+
minLength: 1
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const ListDomainsRequest = {
|
|
34
|
+
page: {
|
|
35
|
+
greaterThan: 0
|
|
36
|
+
},
|
|
37
|
+
pageSize: {
|
|
38
|
+
greaterThanOrEqual: 1,
|
|
39
|
+
lessThanOrEqual: 1e3
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const ListEmailsRequest = {
|
|
43
|
+
page: {
|
|
44
|
+
greaterThan: 0
|
|
45
|
+
},
|
|
46
|
+
pageSize: {
|
|
47
|
+
greaterThanOrEqual: 1,
|
|
48
|
+
lessThanOrEqual: 1e3
|
|
49
|
+
},
|
|
50
|
+
search: {
|
|
51
|
+
maxLength: 100,
|
|
52
|
+
minLength: 3
|
|
53
|
+
},
|
|
54
|
+
subject: {
|
|
55
|
+
minLength: 6
|
|
56
|
+
}
|
|
57
|
+
};
|
|
1
58
|
const ListWebhookEventsRequest = {
|
|
2
59
|
page: {
|
|
3
60
|
greaterThan: 0
|
|
@@ -27,6 +84,13 @@ const UpdateWebhookRequest = {
|
|
|
27
84
|
}
|
|
28
85
|
};
|
|
29
86
|
export {
|
|
87
|
+
CreateDomainRequest,
|
|
88
|
+
CreateEmailRequest,
|
|
89
|
+
CreateEmailRequestAddress,
|
|
90
|
+
CreateEmailRequestAttachment,
|
|
91
|
+
CreateEmailRequestHeader,
|
|
92
|
+
ListDomainsRequest,
|
|
93
|
+
ListEmailsRequest,
|
|
30
94
|
ListWebhookEventsRequest,
|
|
31
95
|
ListWebhooksRequest,
|
|
32
96
|
UpdateWebhookRequest
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
function validatePathParam(name, param) {
|
|
4
|
-
if (typeof param === "string" && param.length > 0)
|
|
5
|
-
|
|
6
|
-
if (typeof param === "number")
|
|
7
|
-
return param.toString();
|
|
4
|
+
if (typeof param === "string" && param.length > 0) return param;
|
|
5
|
+
if (typeof param === "number") return param.toString();
|
|
8
6
|
throw new TypeError(`param ${name} cannot be empty in request`);
|
|
9
7
|
}
|
|
10
8
|
const resolveOneOf = (list, isRequired = false) => {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
function validatePathParam(name, param) {
|
|
2
|
-
if (typeof param === "string" && param.length > 0)
|
|
3
|
-
|
|
4
|
-
if (typeof param === "number")
|
|
5
|
-
return param.toString();
|
|
2
|
+
if (typeof param === "string" && param.length > 0) return param;
|
|
3
|
+
if (typeof param === "number") return param.toString();
|
|
6
4
|
throw new TypeError(`param ${name} cannot be empty in request`);
|
|
7
5
|
}
|
|
8
6
|
const resolveOneOf = (list, isRequired = false) => {
|
|
@@ -27,12 +27,10 @@ const tryAtIntervals = async (retry, strategy, timeout = DEFAULT_TIMEOUT_SECONDS
|
|
|
27
27
|
let retryCount = 0;
|
|
28
28
|
while (Date.now() <= timeoutTimestamp) {
|
|
29
29
|
const delay = strategy.next(retryCount += 1).value * 1e3;
|
|
30
|
-
if (timeoutTimestamp <= Date.now() + delay)
|
|
31
|
-
break;
|
|
30
|
+
if (timeoutTimestamp <= Date.now() + delay) break;
|
|
32
31
|
await sleep.sleep(delay);
|
|
33
32
|
const { value, done } = await retry();
|
|
34
|
-
if (done)
|
|
35
|
-
return value;
|
|
33
|
+
if (done) return value;
|
|
36
34
|
}
|
|
37
35
|
throw new Error(`Timeout after ${timeout}s`);
|
|
38
36
|
};
|
|
@@ -25,12 +25,10 @@ const tryAtIntervals = async (retry, strategy, timeout = DEFAULT_TIMEOUT_SECONDS
|
|
|
25
25
|
let retryCount = 0;
|
|
26
26
|
while (Date.now() <= timeoutTimestamp) {
|
|
27
27
|
const delay = strategy.next(retryCount += 1).value * 1e3;
|
|
28
|
-
if (timeoutTimestamp <= Date.now() + delay)
|
|
29
|
-
break;
|
|
28
|
+
if (timeoutTimestamp <= Date.now() + delay) break;
|
|
30
29
|
await sleep(delay);
|
|
31
30
|
const { value, done } = await retry();
|
|
32
|
-
if (done)
|
|
33
|
-
return value;
|
|
31
|
+
if (done) return value;
|
|
34
32
|
}
|
|
35
33
|
throw new Error(`Timeout after ${timeout}s`);
|
|
36
34
|
};
|
package/dist/scw/auth.cjs
CHANGED
|
@@ -15,10 +15,8 @@ const obfuscateAuthHeadersEntry = ([
|
|
|
15
15
|
name,
|
|
16
16
|
value
|
|
17
17
|
]) => {
|
|
18
|
-
if (name === SESSION_HEADER_KEY)
|
|
19
|
-
|
|
20
|
-
if (name === AUTH_HEADER_KEY)
|
|
21
|
-
return [name, obfuscateUUID(value)];
|
|
18
|
+
if (name === SESSION_HEADER_KEY) return [name, obfuscateToken(value)];
|
|
19
|
+
if (name === AUTH_HEADER_KEY) return [name, obfuscateUUID(value)];
|
|
22
20
|
return [name, value];
|
|
23
21
|
};
|
|
24
22
|
exports.authenticateWithSecrets = authenticateWithSecrets;
|
package/dist/scw/auth.js
CHANGED
|
@@ -13,10 +13,8 @@ const obfuscateAuthHeadersEntry = ([
|
|
|
13
13
|
name,
|
|
14
14
|
value
|
|
15
15
|
]) => {
|
|
16
|
-
if (name === SESSION_HEADER_KEY)
|
|
17
|
-
|
|
18
|
-
if (name === AUTH_HEADER_KEY)
|
|
19
|
-
return [name, obfuscateUUID(value)];
|
|
16
|
+
if (name === SESSION_HEADER_KEY) return [name, obfuscateToken(value)];
|
|
17
|
+
if (name === AUTH_HEADER_KEY) return [name, obfuscateUUID(value)];
|
|
20
18
|
return [name, value];
|
|
21
19
|
};
|
|
22
20
|
export {
|
package/dist/scw/constants.cjs
CHANGED
package/dist/scw/constants.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "v2.
|
|
2
|
-
export declare const userAgent = "scaleway-sdk-js/v2.
|
|
1
|
+
export declare const version = "v2.35.0";
|
|
2
|
+
export declare const userAgent = "scaleway-sdk-js/v2.35.0";
|
package/dist/scw/constants.js
CHANGED
|
@@ -36,8 +36,7 @@ class InvalidArgumentsError extends scwError.ScalewayError {
|
|
|
36
36
|
this.name = "InvalidArgumentsError";
|
|
37
37
|
}
|
|
38
38
|
static fromJSON(status, obj) {
|
|
39
|
-
if (!Array.isArray(obj.details))
|
|
40
|
-
return null;
|
|
39
|
+
if (!Array.isArray(obj.details)) return null;
|
|
41
40
|
return new InvalidArgumentsError(
|
|
42
41
|
status,
|
|
43
42
|
obj,
|
|
@@ -34,8 +34,7 @@ class InvalidArgumentsError extends ScalewayError {
|
|
|
34
34
|
this.name = "InvalidArgumentsError";
|
|
35
35
|
}
|
|
36
36
|
static fromJSON(status, obj) {
|
|
37
|
-
if (!Array.isArray(obj.details))
|
|
38
|
-
return null;
|
|
37
|
+
if (!Array.isArray(obj.details)) return null;
|
|
39
38
|
return new InvalidArgumentsError(
|
|
40
39
|
status,
|
|
41
40
|
obj,
|
|
@@ -10,8 +10,7 @@ class OutOfStockError extends scwError.ScalewayError {
|
|
|
10
10
|
this.name = "OutOfStockError";
|
|
11
11
|
}
|
|
12
12
|
static fromJSON(status, obj) {
|
|
13
|
-
if (typeof obj.resource !== "string")
|
|
14
|
-
return null;
|
|
13
|
+
if (typeof obj.resource !== "string") return null;
|
|
15
14
|
return new OutOfStockError(status, obj, obj.resource);
|
|
16
15
|
}
|
|
17
16
|
}
|
|
@@ -8,8 +8,7 @@ class OutOfStockError extends ScalewayError {
|
|
|
8
8
|
this.name = "OutOfStockError";
|
|
9
9
|
}
|
|
10
10
|
static fromJSON(status, obj) {
|
|
11
|
-
if (typeof obj.resource !== "string")
|
|
12
|
-
return null;
|
|
11
|
+
if (typeof obj.resource !== "string") return null;
|
|
13
12
|
return new OutOfStockError(status, obj, obj.resource);
|
|
14
13
|
}
|
|
15
14
|
}
|
|
@@ -12,8 +12,7 @@ class PermissionsDeniedError extends scwError.ScalewayError {
|
|
|
12
12
|
this.name = "PermissionsDeniedError";
|
|
13
13
|
}
|
|
14
14
|
static fromJSON(status, obj) {
|
|
15
|
-
if (!Array.isArray(obj.details))
|
|
16
|
-
return null;
|
|
15
|
+
if (!Array.isArray(obj.details)) return null;
|
|
17
16
|
return new PermissionsDeniedError(
|
|
18
17
|
status,
|
|
19
18
|
obj,
|
|
@@ -10,8 +10,7 @@ class PermissionsDeniedError extends ScalewayError {
|
|
|
10
10
|
this.name = "PermissionsDeniedError";
|
|
11
11
|
}
|
|
12
12
|
static fromJSON(status, obj) {
|
|
13
|
-
if (!Array.isArray(obj.details))
|
|
14
|
-
return null;
|
|
13
|
+
if (!Array.isArray(obj.details)) return null;
|
|
15
14
|
return new PermissionsDeniedError(
|
|
16
15
|
status,
|
|
17
16
|
obj,
|
|
@@ -24,8 +24,7 @@ class QuotasExceededError extends scwError.ScalewayError {
|
|
|
24
24
|
this.name = "QuotasExceededError";
|
|
25
25
|
}
|
|
26
26
|
static fromJSON(status, obj) {
|
|
27
|
-
if (!Array.isArray(obj.details))
|
|
28
|
-
return null;
|
|
27
|
+
if (!Array.isArray(obj.details)) return null;
|
|
29
28
|
return new QuotasExceededError(
|
|
30
29
|
status,
|
|
31
30
|
obj,
|
|
@@ -22,8 +22,7 @@ class QuotasExceededError extends ScalewayError {
|
|
|
22
22
|
this.name = "QuotasExceededError";
|
|
23
23
|
}
|
|
24
24
|
static fromJSON(status, obj) {
|
|
25
|
-
if (!Array.isArray(obj.details))
|
|
26
|
-
return null;
|
|
25
|
+
if (!Array.isArray(obj.details)) return null;
|
|
27
26
|
return new QuotasExceededError(
|
|
28
27
|
status,
|
|
29
28
|
obj,
|
|
@@ -37,8 +37,7 @@ class TooManyRequestsError extends scwError.ScalewayError {
|
|
|
37
37
|
this.name = "TooManyRequestsError";
|
|
38
38
|
}
|
|
39
39
|
static fromJSON(status, obj) {
|
|
40
|
-
if (typeof obj.help_message !== "string")
|
|
41
|
-
return null;
|
|
40
|
+
if (typeof obj.help_message !== "string") return null;
|
|
42
41
|
let limit;
|
|
43
42
|
if (json.isJSONObject(obj.limit) && typeof obj.limit.quota === "number") {
|
|
44
43
|
limit = {
|
|
@@ -35,8 +35,7 @@ class TooManyRequestsError extends ScalewayError {
|
|
|
35
35
|
this.name = "TooManyRequestsError";
|
|
36
36
|
}
|
|
37
37
|
static fromJSON(status, obj) {
|
|
38
|
-
if (typeof obj.help_message !== "string")
|
|
39
|
-
return null;
|
|
38
|
+
if (typeof obj.help_message !== "string") return null;
|
|
40
39
|
let limit;
|
|
41
40
|
if (isJSONObject(obj.limit) && typeof obj.limit.quota === "number") {
|
|
42
41
|
limit = {
|