@scaleway/sdk 3.0.0-alpha.0 → 3.1.1
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/index.gen.d.ts +362 -0
- package/dist/index.gen.js +323 -0
- package/package.json +71 -25
- package/README.md +0 -46
- package/dist/api/account/index.js +0 -4
- package/dist/api/account/v2/api.gen.js +0 -147
- package/dist/api/account/v2/index.gen.js +0 -4
- package/dist/api/account/v2/marshalling.gen.js +0 -39
- package/dist/api/account/v3/api.gen.js +0 -129
- package/dist/api/account/v3/index.gen.js +0 -6
- package/dist/api/account/v3/marshalling.gen.js +0 -39
- package/dist/api/account/v3/validation-rules.gen.js +0 -39
- package/dist/api/applesilicon/index.js +0 -2
- package/dist/api/applesilicon/v1alpha1/api.gen.js +0 -220
- package/dist/api/applesilicon/v1alpha1/content.gen.js +0 -7
- package/dist/api/applesilicon/v1alpha1/index.gen.js +0 -5
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +0 -113
- package/dist/api/baremetal/index.js +0 -2
- package/dist/api/baremetal/v1/api.gen.js +0 -523
- package/dist/api/baremetal/v1/api.utils.js +0 -27
- package/dist/api/baremetal/v1/content.gen.js +0 -13
- package/dist/api/baremetal/v1/index.js +0 -5
- package/dist/api/baremetal/v1/marshalling.gen.js +0 -395
- package/dist/api/baremetal/v1/validation-rules.gen.js +0 -109
- package/dist/api/billing/index.js +0 -2
- package/dist/api/billing/v2alpha1/api.gen.js +0 -80
- package/dist/api/billing/v2alpha1/index.gen.js +0 -4
- package/dist/api/billing/v2alpha1/marshalling.gen.js +0 -53
- package/dist/api/block/index.js +0 -2
- package/dist/api/block/v1alpha1/api.gen.js +0 -245
- package/dist/api/block/v1alpha1/content.gen.js +0 -13
- package/dist/api/block/v1alpha1/index.gen.js +0 -7
- package/dist/api/block/v1alpha1/marshalling.gen.js +0 -175
- package/dist/api/block/v1alpha1/validation-rules.gen.js +0 -42
- package/dist/api/cockpit/index.js +0 -2
- package/dist/api/cockpit/v1beta1/api.gen.js +0 -448
- package/dist/api/cockpit/v1beta1/content.gen.js +0 -7
- package/dist/api/cockpit/v1beta1/index.gen.js +0 -5
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +0 -220
- package/dist/api/container/index.js +0 -2
- package/dist/api/container/v1beta1/api.gen.js +0 -549
- package/dist/api/container/v1beta1/content.gen.js +0 -22
- package/dist/api/container/v1beta1/index.gen.js +0 -5
- package/dist/api/container/v1beta1/marshalling.gen.js +0 -330
- package/dist/api/document_db/index.js +0 -2
- package/dist/api/document_db/v1beta1/api.gen.js +0 -830
- package/dist/api/document_db/v1beta1/content.gen.js +0 -19
- package/dist/api/document_db/v1beta1/index.gen.js +0 -7
- package/dist/api/document_db/v1beta1/marshalling.gen.js +0 -580
- package/dist/api/document_db/v1beta1/validation-rules.gen.js +0 -10
- package/dist/api/domain/index.js +0 -2
- package/dist/api/domain/v2beta1/api.gen.js +0 -875
- package/dist/api/domain/v2beta1/content.gen.js +0 -28
- package/dist/api/domain/v2beta1/index.gen.js +0 -7
- package/dist/api/domain/v2beta1/marshalling.gen.js +0 -958
- package/dist/api/flexibleip/index.js +0 -2
- package/dist/api/flexibleip/v1alpha1/api.gen.js +0 -203
- package/dist/api/flexibleip/v1alpha1/content.gen.js +0 -10
- package/dist/api/flexibleip/v1alpha1/index.gen.js +0 -7
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -97
- package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +0 -14
- package/dist/api/function/index.js +0 -2
- package/dist/api/function/v1beta1/api.gen.js +0 -560
- package/dist/api/function/v1beta1/content.gen.js +0 -22
- package/dist/api/function/v1beta1/index.gen.js +0 -5
- package/dist/api/function/v1beta1/marshalling.gen.js +0 -368
- package/dist/api/iam/index.js +0 -2
- package/dist/api/iam/v1alpha1/api.gen.js +0 -799
- package/dist/api/iam/v1alpha1/index.gen.js +0 -6
- package/dist/api/iam/v1alpha1/marshalling.gen.js +0 -373
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +0 -207
- package/dist/api/instance/index.js +0 -2
- package/dist/api/instance/v1/api.gen.js +0 -1003
- package/dist/api/instance/v1/api.utils.js +0 -369
- package/dist/api/instance/v1/content.gen.js +0 -31
- package/dist/api/instance/v1/index.js +0 -2
- package/dist/api/instance/v1/marshalling.gen.js +0 -1206
- package/dist/api/instance/v1/marshalling.utils.js +0 -63
- package/dist/api/iot/index.js +0 -2
- package/dist/api/iot/v1/api.gen.js +0 -581
- package/dist/api/iot/v1/content.gen.js +0 -7
- package/dist/api/iot/v1/index.gen.js +0 -5
- package/dist/api/iot/v1/marshalling.gen.js +0 -388
- package/dist/api/ipfs/index.js +0 -2
- package/dist/api/ipfs/v1alpha1/api.gen.js +0 -197
- package/dist/api/ipfs/v1alpha1/content.gen.js +0 -7
- package/dist/api/ipfs/v1alpha1/index.gen.js +0 -5
- package/dist/api/ipfs/v1alpha1/marshalling.gen.js +0 -121
- package/dist/api/k8s/index.js +0 -2
- package/dist/api/k8s/v1/api.gen.js +0 -454
- package/dist/api/k8s/v1/api.utils.js +0 -13
- package/dist/api/k8s/v1/content.gen.js +0 -13
- package/dist/api/k8s/v1/index.js +0 -4
- package/dist/api/k8s/v1/marshalling.gen.js +0 -333
- package/dist/api/k8s/v1/validation-rules.gen.js +0 -101
- package/dist/api/lb/index.js +0 -2
- package/dist/api/lb/v1/api.gen.js +0 -1669
- package/dist/api/lb/v1/api.utils.js +0 -81
- package/dist/api/lb/v1/content.gen.js +0 -16
- package/dist/api/lb/v1/index.js +0 -2
- package/dist/api/lb/v1/marshalling.gen.js +0 -923
- package/dist/api/marketplace/index.js +0 -4
- package/dist/api/marketplace/v1/api.gen.js +0 -60
- package/dist/api/marketplace/v1/index.gen.js +0 -4
- package/dist/api/marketplace/v1/marshalling.gen.js +0 -92
- package/dist/api/marketplace/v2/api.gen.js +0 -162
- package/dist/api/marketplace/v2/index.gen.js +0 -4
- package/dist/api/marketplace/v2/marshalling.gen.js +0 -94
- package/dist/api/mnq/index.js +0 -2
- package/dist/api/mnq/v1alpha1/api.gen.js +0 -205
- package/dist/api/mnq/v1alpha1/index.gen.js +0 -4
- package/dist/api/mnq/v1alpha1/marshalling.gen.js +0 -121
- package/dist/api/rdb/index.js +0 -2
- package/dist/api/rdb/v1/api.gen.js +0 -972
- package/dist/api/rdb/v1/content.gen.js +0 -22
- package/dist/api/rdb/v1/index.gen.js +0 -7
- package/dist/api/rdb/v1/marshalling.gen.js +0 -636
- package/dist/api/rdb/v1/validation-rules.gen.js +0 -10
- package/dist/api/redis/index.js +0 -2
- package/dist/api/redis/v1/api.gen.js +0 -389
- package/dist/api/redis/v1/content.gen.js +0 -7
- package/dist/api/redis/v1/index.gen.js +0 -5
- package/dist/api/redis/v1/marshalling.gen.js +0 -259
- package/dist/api/registry/index.js +0 -2
- package/dist/api/registry/v1/api.gen.js +0 -252
- package/dist/api/registry/v1/content.gen.js +0 -13
- package/dist/api/registry/v1/index.gen.js +0 -5
- package/dist/api/registry/v1/marshalling.gen.js +0 -106
- package/dist/api/secret/index.js +0 -2
- package/dist/api/secret/v1alpha1/api.gen.js +0 -415
- package/dist/api/secret/v1alpha1/index.gen.js +0 -4
- package/dist/api/secret/v1alpha1/marshalling.gen.js +0 -143
- package/dist/api/tem/index.js +0 -2
- package/dist/api/tem/v1alpha1/api.gen.js +0 -229
- package/dist/api/tem/v1alpha1/content.gen.js +0 -10
- package/dist/api/tem/v1alpha1/index.gen.js +0 -5
- package/dist/api/tem/v1alpha1/marshalling.gen.js +0 -159
- package/dist/api/test/index.js +0 -2
- package/dist/api/test/v1/api.gen.js +0 -152
- package/dist/api/test/v1/content.gen.js +0 -7
- package/dist/api/test/v1/index.gen.js +0 -5
- package/dist/api/test/v1/marshalling.gen.js +0 -79
- package/dist/api/vpc/index.js +0 -4
- package/dist/api/vpc/v1/api.gen.js +0 -110
- package/dist/api/vpc/v1/index.gen.js +0 -4
- package/dist/api/vpc/v1/marshalling.gen.js +0 -44
- package/dist/api/vpc/v2/api.gen.js +0 -276
- package/dist/api/vpc/v2/index.gen.js +0 -4
- package/dist/api/vpc/v2/marshalling.gen.js +0 -135
- package/dist/api/vpcgw/index.js +0 -2
- package/dist/api/vpcgw/v1/api.gen.js +0 -669
- package/dist/api/vpcgw/v1/content.gen.js +0 -10
- package/dist/api/vpcgw/v1/index.gen.js +0 -5
- package/dist/api/vpcgw/v1/marshalling.gen.js +0 -336
- package/dist/api/webhosting/index.js +0 -2
- package/dist/api/webhosting/v1alpha1/api.gen.js +0 -210
- package/dist/api/webhosting/v1alpha1/content.gen.js +0 -7
- package/dist/api/webhosting/v1alpha1/index.gen.js +0 -7
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +0 -173
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +0 -23
- package/dist/helpers/is-browser.js +0 -5
- package/dist/helpers/is-response.js +0 -10
- package/dist/helpers/json.js +0 -11
- package/dist/helpers/marshalling.js +0 -130
- package/dist/index.cjs +0 -24364
- package/dist/index.d.ts +0 -27584
- package/dist/index.js +0 -69
- package/dist/internal/async/interval-retrier.js +0 -105
- package/dist/internal/async/sleep.js +0 -13
- package/dist/internal/interceptors/composer.js +0 -46
- package/dist/internal/interceptors/helpers.js +0 -32
- package/dist/internal/logger/console-logger.js +0 -38
- package/dist/internal/logger/index.js +0 -41
- package/dist/internal/logger/level-resolver.js +0 -13
- package/dist/internal/validations/string-validation.js +0 -38
- package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -13
- package/dist/scw/api.js +0 -12
- package/dist/scw/auth.js +0 -68
- package/dist/scw/client-ini-factory.js +0 -174
- package/dist/scw/client-ini-profile.js +0 -54
- package/dist/scw/client-settings.js +0 -78
- package/dist/scw/client.js +0 -98
- package/dist/scw/constants.js +0 -4
- package/dist/scw/custom-marshalling.js +0 -131
- package/dist/scw/errors/error-parser.js +0 -107
- package/dist/scw/errors/non-standard/invalid-request-mapper.js +0 -36
- package/dist/scw/errors/non-standard/unknown-resource-mapper.js +0 -27
- package/dist/scw/errors/scw-error.js +0 -66
- package/dist/scw/errors/standard/already-exists-error.js +0 -26
- package/dist/scw/errors/standard/denied-authentication-error.js +0 -52
- package/dist/scw/errors/standard/index.js +0 -13
- package/dist/scw/errors/standard/invalid-arguments-error.js +0 -67
- package/dist/scw/errors/standard/out-of-stock-error.js +0 -22
- package/dist/scw/errors/standard/permissions-denied-error.js +0 -48
- package/dist/scw/errors/standard/precondition-failed-error.js +0 -42
- package/dist/scw/errors/standard/quotas-exceeded-error.js +0 -68
- package/dist/scw/errors/standard/resource-expired-error.js +0 -26
- package/dist/scw/errors/standard/resource-locked-error.js +0 -25
- package/dist/scw/errors/standard/resource-not-found-error.js +0 -25
- package/dist/scw/errors/standard/too-many-requests-error.js +0 -70
- package/dist/scw/errors/standard/transient-state-error.js +0 -26
- package/dist/scw/errors/types.js +0 -23
- package/dist/scw/fetch/build-fetcher.js +0 -72
- package/dist/scw/fetch/http-dumper.js +0 -54
- package/dist/scw/fetch/http-interceptors.js +0 -99
- package/dist/scw/fetch/resource-paginator.js +0 -84
- package/dist/scw/fetch/response-parser.js +0 -72
- package/node_modules/@scaleway/random-name/.npmignore +0 -4
- package/node_modules/@scaleway/random-name/CHANGELOG.md +0 -129
- package/node_modules/@scaleway/random-name/LICENSE.md +0 -21
- package/node_modules/@scaleway/random-name/README.md +0 -26
- package/node_modules/@scaleway/random-name/dist/index.d.ts +0 -3
- package/node_modules/@scaleway/random-name/dist/index.js +0 -13
- package/node_modules/@scaleway/random-name/package.json +0 -23
|
@@ -1,368 +0,0 @@
|
|
|
1
|
-
import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js';
|
|
2
|
-
import { isJSONObject } from '../../../helpers/json.js';
|
|
3
|
-
import { unmarshalArrayOfObject, unmarshalDate, resolveOneOf } from '../../../helpers/marshalling.js';
|
|
4
|
-
|
|
5
|
-
// This file was automatically generated. DO NOT EDIT.
|
|
6
|
-
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
7
|
-
const unmarshalCron = data => {
|
|
8
|
-
if (!isJSONObject(data)) {
|
|
9
|
-
throw new TypeError(`Unmarshalling the type 'Cron' failed as data isn't a dictionary.`);
|
|
10
|
-
}
|
|
11
|
-
return {
|
|
12
|
-
args: data.args ? data.args : undefined,
|
|
13
|
-
functionId: data.function_id,
|
|
14
|
-
id: data.id,
|
|
15
|
-
name: data.name,
|
|
16
|
-
schedule: data.schedule,
|
|
17
|
-
status: data.status
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
const unmarshalDomain = data => {
|
|
21
|
-
if (!isJSONObject(data)) {
|
|
22
|
-
throw new TypeError(`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`);
|
|
23
|
-
}
|
|
24
|
-
return {
|
|
25
|
-
errorMessage: data.error_message ? data.error_message : undefined,
|
|
26
|
-
functionId: data.function_id,
|
|
27
|
-
hostname: data.hostname,
|
|
28
|
-
id: data.id,
|
|
29
|
-
status: data.status,
|
|
30
|
-
url: data.url
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
const unmarshalSecretHashedValue = data => {
|
|
34
|
-
if (!isJSONObject(data)) {
|
|
35
|
-
throw new TypeError(`Unmarshalling the type 'SecretHashedValue' failed as data isn't a dictionary.`);
|
|
36
|
-
}
|
|
37
|
-
return {
|
|
38
|
-
hashedValue: data.hashed_value,
|
|
39
|
-
key: data.key
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
const unmarshalFunction = data => {
|
|
43
|
-
if (!isJSONObject(data)) {
|
|
44
|
-
throw new TypeError(`Unmarshalling the type 'Function' failed as data isn't a dictionary.`);
|
|
45
|
-
}
|
|
46
|
-
return {
|
|
47
|
-
buildMessage: data.build_message ? data.build_message : undefined,
|
|
48
|
-
cpuLimit: data.cpu_limit,
|
|
49
|
-
description: data.description ? data.description : undefined,
|
|
50
|
-
domainName: data.domain_name,
|
|
51
|
-
environmentVariables: data.environment_variables,
|
|
52
|
-
errorMessage: data.error_message ? data.error_message : undefined,
|
|
53
|
-
handler: data.handler,
|
|
54
|
-
httpOption: data.http_option,
|
|
55
|
-
id: data.id,
|
|
56
|
-
maxScale: data.max_scale,
|
|
57
|
-
memoryLimit: data.memory_limit,
|
|
58
|
-
minScale: data.min_scale,
|
|
59
|
-
name: data.name,
|
|
60
|
-
namespaceId: data.namespace_id,
|
|
61
|
-
privacy: data.privacy,
|
|
62
|
-
region: data.region,
|
|
63
|
-
runtime: data.runtime,
|
|
64
|
-
runtimeMessage: data.runtime_message,
|
|
65
|
-
secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue),
|
|
66
|
-
status: data.status,
|
|
67
|
-
timeout: data.timeout ? data.timeout : undefined
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
const unmarshalNamespace = data => {
|
|
71
|
-
if (!isJSONObject(data)) {
|
|
72
|
-
throw new TypeError(`Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`);
|
|
73
|
-
}
|
|
74
|
-
return {
|
|
75
|
-
description: data.description ? data.description : undefined,
|
|
76
|
-
environmentVariables: data.environment_variables,
|
|
77
|
-
errorMessage: data.error_message ? data.error_message : undefined,
|
|
78
|
-
id: data.id,
|
|
79
|
-
name: data.name,
|
|
80
|
-
organizationId: data.organization_id,
|
|
81
|
-
projectId: data.project_id,
|
|
82
|
-
region: data.region,
|
|
83
|
-
registryEndpoint: data.registry_endpoint,
|
|
84
|
-
registryNamespaceId: data.registry_namespace_id,
|
|
85
|
-
secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue),
|
|
86
|
-
status: data.status
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
const unmarshalToken = data => {
|
|
90
|
-
if (!isJSONObject(data)) {
|
|
91
|
-
throw new TypeError(`Unmarshalling the type 'Token' failed as data isn't a dictionary.`);
|
|
92
|
-
}
|
|
93
|
-
return {
|
|
94
|
-
description: data.description ? data.description : undefined,
|
|
95
|
-
expiresAt: unmarshalDate(data.expires_at),
|
|
96
|
-
functionId: data.function_id ? data.function_id : undefined,
|
|
97
|
-
id: data.id,
|
|
98
|
-
namespaceId: data.namespace_id ? data.namespace_id : undefined,
|
|
99
|
-
publicKey: data.public_key ? data.public_key : undefined,
|
|
100
|
-
status: data.status,
|
|
101
|
-
token: data.token
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
const unmarshalTriggerMnqNatsClientConfig = data => {
|
|
105
|
-
if (!isJSONObject(data)) {
|
|
106
|
-
throw new TypeError(`Unmarshalling the type 'TriggerMnqNatsClientConfig' failed as data isn't a dictionary.`);
|
|
107
|
-
}
|
|
108
|
-
return {
|
|
109
|
-
mnqCredentialId: data.mnq_credential_id ? data.mnq_credential_id : undefined,
|
|
110
|
-
mnqNamespaceId: data.mnq_namespace_id,
|
|
111
|
-
mnqProjectId: data.mnq_project_id,
|
|
112
|
-
mnqRegion: data.mnq_region,
|
|
113
|
-
subject: data.subject
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
const unmarshalTriggerSqsClientConfig = data => {
|
|
117
|
-
if (!isJSONObject(data)) {
|
|
118
|
-
throw new TypeError(`Unmarshalling the type 'TriggerSqsClientConfig' failed as data isn't a dictionary.`);
|
|
119
|
-
}
|
|
120
|
-
return {
|
|
121
|
-
accessKey: data.access_key,
|
|
122
|
-
endpoint: data.endpoint,
|
|
123
|
-
queueUrl: data.queue_url,
|
|
124
|
-
secretKey: data.secret_key
|
|
125
|
-
};
|
|
126
|
-
};
|
|
127
|
-
const unmarshalTriggerMnqSqsClientConfig = data => {
|
|
128
|
-
if (!isJSONObject(data)) {
|
|
129
|
-
throw new TypeError(`Unmarshalling the type 'TriggerMnqSqsClientConfig' failed as data isn't a dictionary.`);
|
|
130
|
-
}
|
|
131
|
-
return {
|
|
132
|
-
mnqCredentialId: data.mnq_credential_id ? data.mnq_credential_id : undefined,
|
|
133
|
-
mnqNamespaceId: data.mnq_namespace_id,
|
|
134
|
-
mnqProjectId: data.mnq_project_id,
|
|
135
|
-
mnqRegion: data.mnq_region,
|
|
136
|
-
queue: data.queue
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
const unmarshalTrigger = data => {
|
|
140
|
-
if (!isJSONObject(data)) {
|
|
141
|
-
throw new TypeError(`Unmarshalling the type 'Trigger' failed as data isn't a dictionary.`);
|
|
142
|
-
}
|
|
143
|
-
return {
|
|
144
|
-
description: data.description,
|
|
145
|
-
errorMessage: data.error_message ? data.error_message : undefined,
|
|
146
|
-
functionId: data.function_id,
|
|
147
|
-
id: data.id,
|
|
148
|
-
inputType: data.input_type,
|
|
149
|
-
name: data.name,
|
|
150
|
-
scwNatsConfig: data.scw_nats_config ? unmarshalTriggerMnqNatsClientConfig(data.scw_nats_config) : undefined,
|
|
151
|
-
scwSqsConfig: data.scw_sqs_config ? unmarshalTriggerMnqSqsClientConfig(data.scw_sqs_config) : undefined,
|
|
152
|
-
sqsConfig: data.sqs_config ? unmarshalTriggerSqsClientConfig(data.sqs_config) : undefined,
|
|
153
|
-
status: data.status
|
|
154
|
-
};
|
|
155
|
-
};
|
|
156
|
-
const unmarshalDownloadURL = data => {
|
|
157
|
-
if (!isJSONObject(data)) {
|
|
158
|
-
throw new TypeError(`Unmarshalling the type 'DownloadURL' failed as data isn't a dictionary.`);
|
|
159
|
-
}
|
|
160
|
-
return {
|
|
161
|
-
headers: data.headers,
|
|
162
|
-
url: data.url
|
|
163
|
-
};
|
|
164
|
-
};
|
|
165
|
-
const unmarshalListCronsResponse = data => {
|
|
166
|
-
if (!isJSONObject(data)) {
|
|
167
|
-
throw new TypeError(`Unmarshalling the type 'ListCronsResponse' failed as data isn't a dictionary.`);
|
|
168
|
-
}
|
|
169
|
-
return {
|
|
170
|
-
crons: unmarshalArrayOfObject(data.crons, unmarshalCron),
|
|
171
|
-
totalCount: data.total_count
|
|
172
|
-
};
|
|
173
|
-
};
|
|
174
|
-
const unmarshalListDomainsResponse = data => {
|
|
175
|
-
if (!isJSONObject(data)) {
|
|
176
|
-
throw new TypeError(`Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`);
|
|
177
|
-
}
|
|
178
|
-
return {
|
|
179
|
-
domains: unmarshalArrayOfObject(data.domains, unmarshalDomain),
|
|
180
|
-
totalCount: data.total_count
|
|
181
|
-
};
|
|
182
|
-
};
|
|
183
|
-
const unmarshalRuntime = data => {
|
|
184
|
-
if (!isJSONObject(data)) {
|
|
185
|
-
throw new TypeError(`Unmarshalling the type 'Runtime' failed as data isn't a dictionary.`);
|
|
186
|
-
}
|
|
187
|
-
return {
|
|
188
|
-
codeSample: data.code_sample,
|
|
189
|
-
defaultHandler: data.default_handler,
|
|
190
|
-
extension: data.extension,
|
|
191
|
-
implementation: data.implementation,
|
|
192
|
-
language: data.language,
|
|
193
|
-
logoUrl: data.logo_url,
|
|
194
|
-
name: data.name,
|
|
195
|
-
status: data.status,
|
|
196
|
-
statusMessage: data.status_message,
|
|
197
|
-
version: data.version
|
|
198
|
-
};
|
|
199
|
-
};
|
|
200
|
-
const unmarshalListFunctionRuntimesResponse = data => {
|
|
201
|
-
if (!isJSONObject(data)) {
|
|
202
|
-
throw new TypeError(`Unmarshalling the type 'ListFunctionRuntimesResponse' failed as data isn't a dictionary.`);
|
|
203
|
-
}
|
|
204
|
-
return {
|
|
205
|
-
runtimes: unmarshalArrayOfObject(data.runtimes, unmarshalRuntime),
|
|
206
|
-
totalCount: data.total_count
|
|
207
|
-
};
|
|
208
|
-
};
|
|
209
|
-
const unmarshalListFunctionsResponse = data => {
|
|
210
|
-
if (!isJSONObject(data)) {
|
|
211
|
-
throw new TypeError(`Unmarshalling the type 'ListFunctionsResponse' failed as data isn't a dictionary.`);
|
|
212
|
-
}
|
|
213
|
-
return {
|
|
214
|
-
functions: unmarshalArrayOfObject(data.functions, unmarshalFunction),
|
|
215
|
-
totalCount: data.total_count
|
|
216
|
-
};
|
|
217
|
-
};
|
|
218
|
-
const unmarshalLog = data => {
|
|
219
|
-
if (!isJSONObject(data)) {
|
|
220
|
-
throw new TypeError(`Unmarshalling the type 'Log' failed as data isn't a dictionary.`);
|
|
221
|
-
}
|
|
222
|
-
return {
|
|
223
|
-
id: data.id,
|
|
224
|
-
level: data.level,
|
|
225
|
-
message: data.message,
|
|
226
|
-
source: data.source,
|
|
227
|
-
stream: data.stream,
|
|
228
|
-
timestamp: unmarshalDate(data.timestamp)
|
|
229
|
-
};
|
|
230
|
-
};
|
|
231
|
-
const unmarshalListLogsResponse = data => {
|
|
232
|
-
if (!isJSONObject(data)) {
|
|
233
|
-
throw new TypeError(`Unmarshalling the type 'ListLogsResponse' failed as data isn't a dictionary.`);
|
|
234
|
-
}
|
|
235
|
-
return {
|
|
236
|
-
logs: unmarshalArrayOfObject(data.logs, unmarshalLog),
|
|
237
|
-
totalCount: data.total_count
|
|
238
|
-
};
|
|
239
|
-
};
|
|
240
|
-
const unmarshalListNamespacesResponse = data => {
|
|
241
|
-
if (!isJSONObject(data)) {
|
|
242
|
-
throw new TypeError(`Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`);
|
|
243
|
-
}
|
|
244
|
-
return {
|
|
245
|
-
namespaces: unmarshalArrayOfObject(data.namespaces, unmarshalNamespace),
|
|
246
|
-
totalCount: data.total_count
|
|
247
|
-
};
|
|
248
|
-
};
|
|
249
|
-
const unmarshalListTokensResponse = data => {
|
|
250
|
-
if (!isJSONObject(data)) {
|
|
251
|
-
throw new TypeError(`Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`);
|
|
252
|
-
}
|
|
253
|
-
return {
|
|
254
|
-
tokens: unmarshalArrayOfObject(data.tokens, unmarshalToken),
|
|
255
|
-
totalCount: data.total_count
|
|
256
|
-
};
|
|
257
|
-
};
|
|
258
|
-
const unmarshalListTriggersResponse = data => {
|
|
259
|
-
if (!isJSONObject(data)) {
|
|
260
|
-
throw new TypeError(`Unmarshalling the type 'ListTriggersResponse' failed as data isn't a dictionary.`);
|
|
261
|
-
}
|
|
262
|
-
return {
|
|
263
|
-
totalCount: data.total_count,
|
|
264
|
-
triggers: unmarshalArrayOfObject(data.triggers, unmarshalTrigger)
|
|
265
|
-
};
|
|
266
|
-
};
|
|
267
|
-
const unmarshalUploadURL = data => {
|
|
268
|
-
if (!isJSONObject(data)) {
|
|
269
|
-
throw new TypeError(`Unmarshalling the type 'UploadURL' failed as data isn't a dictionary.`);
|
|
270
|
-
}
|
|
271
|
-
return {
|
|
272
|
-
headers: data.headers,
|
|
273
|
-
url: data.url
|
|
274
|
-
};
|
|
275
|
-
};
|
|
276
|
-
const marshalCreateCronRequest = (request, defaults) => ({
|
|
277
|
-
args: request.args,
|
|
278
|
-
function_id: request.functionId,
|
|
279
|
-
name: request.name,
|
|
280
|
-
schedule: request.schedule
|
|
281
|
-
});
|
|
282
|
-
const marshalCreateDomainRequest = (request, defaults) => ({
|
|
283
|
-
function_id: request.functionId,
|
|
284
|
-
hostname: request.hostname
|
|
285
|
-
});
|
|
286
|
-
const marshalCreateFunctionRequest = (request, defaults) => ({
|
|
287
|
-
description: request.description,
|
|
288
|
-
environment_variables: request.environmentVariables,
|
|
289
|
-
handler: request.handler,
|
|
290
|
-
http_option: request.httpOption,
|
|
291
|
-
max_scale: request.maxScale,
|
|
292
|
-
memory_limit: request.memoryLimit,
|
|
293
|
-
min_scale: request.minScale,
|
|
294
|
-
name: request.name || randomName('fn'),
|
|
295
|
-
namespace_id: request.namespaceId,
|
|
296
|
-
privacy: request.privacy,
|
|
297
|
-
runtime: request.runtime,
|
|
298
|
-
secret_environment_variables: request.secretEnvironmentVariables,
|
|
299
|
-
timeout: request.timeout
|
|
300
|
-
});
|
|
301
|
-
const marshalCreateNamespaceRequest = (request, defaults) => ({
|
|
302
|
-
description: request.description,
|
|
303
|
-
environment_variables: request.environmentVariables,
|
|
304
|
-
name: request.name || randomName('ns'),
|
|
305
|
-
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
306
|
-
secret_environment_variables: request.secretEnvironmentVariables
|
|
307
|
-
});
|
|
308
|
-
const marshalCreateTokenRequest = (request, defaults) => ({
|
|
309
|
-
description: request.description,
|
|
310
|
-
expires_at: request.expiresAt,
|
|
311
|
-
...resolveOneOf([{
|
|
312
|
-
param: 'function_id',
|
|
313
|
-
value: request.functionId
|
|
314
|
-
}, {
|
|
315
|
-
param: 'namespace_id',
|
|
316
|
-
value: request.namespaceId
|
|
317
|
-
}])
|
|
318
|
-
});
|
|
319
|
-
const marshalCreateTriggerRequest = (request, defaults) => ({
|
|
320
|
-
description: request.description,
|
|
321
|
-
function_id: request.functionId,
|
|
322
|
-
name: request.name,
|
|
323
|
-
...resolveOneOf([{
|
|
324
|
-
param: 'scw_nats_config',
|
|
325
|
-
value: request.scwNatsConfig
|
|
326
|
-
}, {
|
|
327
|
-
param: 'scw_sqs_config',
|
|
328
|
-
value: request.scwSqsConfig
|
|
329
|
-
}, {
|
|
330
|
-
param: 'sqs_config',
|
|
331
|
-
value: request.sqsConfig
|
|
332
|
-
}])
|
|
333
|
-
});
|
|
334
|
-
const marshalUpdateCronRequest = (request, defaults) => ({
|
|
335
|
-
args: request.args,
|
|
336
|
-
function_id: request.functionId,
|
|
337
|
-
name: request.name,
|
|
338
|
-
schedule: request.schedule
|
|
339
|
-
});
|
|
340
|
-
const marshalUpdateFunctionRequest = (request, defaults) => ({
|
|
341
|
-
description: request.description,
|
|
342
|
-
environment_variables: request.environmentVariables,
|
|
343
|
-
handler: request.handler,
|
|
344
|
-
http_option: request.httpOption,
|
|
345
|
-
max_scale: request.maxScale,
|
|
346
|
-
memory_limit: request.memoryLimit,
|
|
347
|
-
min_scale: request.minScale,
|
|
348
|
-
privacy: request.privacy,
|
|
349
|
-
redeploy: request.redeploy,
|
|
350
|
-
runtime: request.runtime,
|
|
351
|
-
secret_environment_variables: request.secretEnvironmentVariables,
|
|
352
|
-
timeout: request.timeout
|
|
353
|
-
});
|
|
354
|
-
const marshalUpdateNamespaceRequest = (request, defaults) => ({
|
|
355
|
-
description: request.description,
|
|
356
|
-
environment_variables: request.environmentVariables,
|
|
357
|
-
secret_environment_variables: request.secretEnvironmentVariables
|
|
358
|
-
});
|
|
359
|
-
const marshalUpdateTriggerRequest = (request, defaults) => ({
|
|
360
|
-
description: request.description,
|
|
361
|
-
name: request.name,
|
|
362
|
-
...resolveOneOf([{
|
|
363
|
-
param: 'sqs_config',
|
|
364
|
-
value: request.sqsConfig
|
|
365
|
-
}])
|
|
366
|
-
});
|
|
367
|
-
|
|
368
|
-
export { marshalCreateCronRequest, marshalCreateDomainRequest, marshalCreateFunctionRequest, marshalCreateNamespaceRequest, marshalCreateTokenRequest, marshalCreateTriggerRequest, marshalUpdateCronRequest, marshalUpdateFunctionRequest, marshalUpdateNamespaceRequest, marshalUpdateTriggerRequest, unmarshalCron, unmarshalDomain, unmarshalDownloadURL, unmarshalFunction, unmarshalListCronsResponse, unmarshalListDomainsResponse, unmarshalListFunctionRuntimesResponse, unmarshalListFunctionsResponse, unmarshalListLogsResponse, unmarshalListNamespacesResponse, unmarshalListTokensResponse, unmarshalListTriggersResponse, unmarshalNamespace, unmarshalToken, unmarshalTrigger, unmarshalUploadURL };
|
package/dist/api/iam/index.js
DELETED