@scaleway/sdk 0.1.0-beta.8 → 1.0.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/README.md +1 -1
- package/dist/api/account/index.js +2 -2
- package/dist/api/account/v2/api.gen.js +5 -18
- package/dist/api/account/v2/index.gen.js +3 -0
- package/dist/api/account/v2/marshalling.gen.js +0 -2
- package/dist/api/account/v2alpha1/api.gen.js +3 -13
- package/dist/api/account/v2alpha1/marshalling.gen.js +0 -5
- package/dist/api/applesilicon/index.js +2 -2
- package/dist/api/applesilicon/v1alpha1/api.gen.js +7 -27
- package/dist/api/applesilicon/v1alpha1/index.gen.js +4 -0
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +1 -14
- package/dist/api/baremetal/v1/api.gen.js +47 -49
- package/dist/api/baremetal/v1/api.utils.js +2 -10
- package/dist/api/baremetal/v1/content.gen.js +6 -3
- package/dist/api/baremetal/v1/index.js +4 -1
- package/dist/api/baremetal/v1/marshalling.gen.js +44 -45
- package/dist/api/baremetal/v1/validation-rules.gen.js +109 -0
- package/dist/api/container/index.js +2 -2
- package/dist/api/container/v1beta1/api.gen.js +5 -51
- package/dist/api/container/v1beta1/content.gen.js +4 -4
- package/dist/api/container/v1beta1/{index.js → index.gen.js} +3 -1
- package/dist/api/container/v1beta1/marshalling.gen.js +12 -26
- package/dist/api/domain/index.js +2 -2
- package/dist/api/domain/v2beta1/api.gen.js +55 -85
- package/dist/api/domain/v2beta1/content.gen.js +22 -1
- package/dist/api/domain/v2beta1/index.gen.js +4 -0
- package/dist/api/domain/v2beta1/marshalling.gen.js +47 -165
- package/dist/api/flexibleip/index.js +2 -2
- package/dist/api/flexibleip/v1alpha1/api.gen.js +5 -22
- package/dist/api/flexibleip/v1alpha1/content.gen.js +1 -1
- package/dist/api/flexibleip/v1alpha1/index.gen.js +6 -0
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -7
- package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +14 -0
- package/dist/api/function/index.js +2 -2
- package/dist/api/function/v1beta1/api.gen.js +54 -57
- package/dist/api/function/v1beta1/content.gen.js +8 -5
- package/dist/api/function/v1beta1/index.gen.js +4 -0
- package/dist/api/function/v1beta1/marshalling.gen.js +125 -33
- package/dist/api/iam/index.js +2 -2
- package/dist/api/iam/v1alpha1/api.gen.js +15 -62
- package/dist/api/iam/v1alpha1/index.gen.js +5 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.js +7 -29
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +184 -0
- package/dist/api/instance/v1/api.gen.js +38 -118
- package/dist/api/instance/v1/api.utils.js +59 -51
- package/dist/api/instance/v1/content.gen.js +7 -7
- package/dist/api/instance/v1/marshalling.gen.js +46 -168
- package/dist/api/instance/v1/marshalling.utils.js +63 -0
- package/dist/api/iot/index.js +2 -2
- package/dist/api/iot/v1/api.gen.js +5 -56
- package/dist/api/iot/v1/index.gen.js +4 -0
- package/dist/api/iot/v1/marshalling.gen.js +2 -51
- package/dist/api/k8s/index.js +2 -2
- package/dist/api/k8s/v1/api.gen.js +17 -43
- package/dist/api/k8s/v1/content.gen.js +2 -2
- package/dist/api/k8s/v1/index.gen.js +6 -0
- package/dist/api/k8s/v1/marshalling.gen.js +18 -36
- package/dist/api/k8s/v1/validation-rules.gen.js +92 -0
- package/dist/api/lb/v1/api.gen.js +8 -163
- package/dist/api/lb/v1/api.utils.js +3 -9
- package/dist/api/lb/v1/content.gen.js +3 -3
- package/dist/api/lb/v1/marshalling.gen.js +74 -101
- package/dist/api/marketplace/index.js +4 -2
- package/dist/api/marketplace/v1/api.gen.js +3 -13
- package/dist/api/marketplace/v1/index.gen.js +3 -0
- package/dist/api/marketplace/v1/marshalling.gen.js +0 -13
- package/dist/api/marketplace/v2/api.gen.js +85 -0
- package/dist/api/marketplace/v2/index.gen.js +3 -0
- package/dist/api/marketplace/v2/marshalling.gen.js +92 -0
- package/dist/api/mnq/index.js +2 -2
- package/dist/api/mnq/v1alpha1/api.gen.js +7 -25
- package/dist/api/mnq/v1alpha1/index.gen.js +3 -0
- package/dist/api/mnq/v1alpha1/marshalling.gen.js +7 -46
- package/dist/api/rdb/index.js +2 -2
- package/dist/api/rdb/v1/api.gen.js +15 -89
- package/dist/api/rdb/v1/content.gen.js +10 -4
- package/dist/api/rdb/v1/index.gen.js +4 -0
- package/dist/api/rdb/v1/marshalling.gen.js +25 -81
- package/dist/api/redis/index.js +2 -2
- package/dist/api/redis/{v1alpha1 → v1}/api.gen.js +45 -77
- package/dist/api/redis/{v1alpha1 → v1}/content.gen.js +1 -1
- package/dist/api/redis/v1/index.gen.js +4 -0
- package/dist/api/redis/{v1alpha1 → v1}/marshalling.gen.js +42 -59
- package/dist/api/registry/index.js +2 -2
- package/dist/api/registry/v1/api.gen.js +5 -29
- package/dist/api/registry/v1/content.gen.js +2 -2
- package/dist/api/registry/v1/{index.js → index.gen.js} +3 -1
- package/dist/api/registry/v1/marshalling.gen.js +2 -8
- package/dist/api/secret/index.js +2 -0
- package/dist/api/secret/v1alpha1/api.gen.js +135 -0
- package/dist/api/secret/v1alpha1/index.gen.js +3 -0
- package/dist/api/secret/v1alpha1/marshalling.gen.js +82 -0
- package/dist/api/tem/index.js +2 -0
- package/dist/api/tem/v1alpha1/api.gen.js +109 -0
- package/dist/api/tem/v1alpha1/content.gen.js +10 -0
- package/dist/api/tem/v1alpha1/index.gen.js +4 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.js +132 -0
- package/dist/api/test/index.js +2 -2
- package/dist/api/test/v1/api.gen.js +6 -20
- package/dist/api/test/v1/index.gen.js +4 -0
- package/dist/api/test/v1/marshalling.gen.js +2 -5
- package/dist/api/vpc/index.js +2 -2
- package/dist/api/vpc/v1/api.gen.js +6 -17
- package/dist/api/vpc/v1/index.gen.js +3 -0
- package/dist/api/vpc/v1/marshalling.gen.js +1 -3
- package/dist/api/vpcgw/index.js +2 -2
- package/dist/api/vpcgw/v1/api.gen.js +5 -64
- package/dist/api/vpcgw/v1/content.gen.js +2 -2
- package/dist/api/vpcgw/v1/{index.js → index.gen.js} +3 -1
- package/dist/api/vpcgw/v1/marshalling.gen.js +3 -24
- package/dist/helpers/json.js +1 -2
- package/dist/helpers/marshalling.js +7 -20
- package/dist/index.cjs +3870 -2948
- package/dist/index.d.ts +7218 -4335
- package/dist/index.js +10 -6
- package/dist/internal/async/interval-retrier.js +10 -16
- package/dist/internal/interceptors/interceptor.js +3 -1
- package/dist/internal/interceptors/request.js +1 -3
- package/dist/internal/logger/console-logger.js +3 -5
- package/dist/internal/logger/index.js +3 -5
- package/dist/internal/logger/level-resolver.js +0 -3
- package/dist/internal/validations/string-validation.js +8 -10
- package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js +13 -0
- package/dist/scw/api.js +3 -4
- package/dist/scw/auth.js +3 -5
- package/dist/scw/client-ini-factory.js +32 -15
- package/dist/scw/client-ini-profile.js +10 -4
- package/dist/scw/client-settings.js +32 -15
- package/dist/scw/client.js +5 -6
- package/dist/scw/constants.js +1 -1
- package/dist/scw/custom-marshalling.js +8 -14
- package/dist/scw/errors/error-parser.js +2 -21
- package/dist/scw/errors/non-standard/invalid-request-mapper.js +17 -15
- package/dist/scw/errors/non-standard/unknown-resource-mapper.js +7 -6
- package/dist/scw/errors/scw-error.js +20 -20
- package/dist/scw/errors/standard/already-exists-error.js +3 -4
- package/dist/scw/errors/standard/denied-authentication-error.js +4 -11
- package/dist/scw/errors/standard/invalid-arguments-error.js +1 -10
- package/dist/scw/errors/standard/out-of-stock-error.js +0 -3
- package/dist/scw/errors/standard/permissions-denied-error.js +1 -4
- package/dist/scw/errors/standard/precondition-failed-error.js +4 -8
- package/dist/scw/errors/standard/quotas-exceeded-error.js +14 -14
- package/dist/scw/errors/standard/resource-expired-error.js +3 -4
- package/dist/scw/errors/standard/resource-locked-error.js +3 -4
- package/dist/scw/errors/standard/resource-not-found-error.js +3 -4
- package/dist/scw/errors/standard/too-many-requests-error.js +3 -16
- package/dist/scw/errors/standard/transient-state-error.js +3 -4
- package/dist/scw/errors/types.js +0 -3
- package/dist/scw/fetch/build-fetcher.js +1 -9
- package/dist/scw/fetch/http-dumper.js +4 -7
- package/dist/scw/fetch/http-interceptors.js +9 -12
- package/dist/scw/fetch/resource-paginator.js +18 -16
- package/dist/scw/fetch/response-parser.js +17 -23
- package/node_modules/@scaleway/random-name/CHANGELOG.md +42 -63
- package/node_modules/@scaleway/random-name/dist/index.js +5 -246
- package/node_modules/@scaleway/random-name/package.json +6 -5
- package/package.json +4 -5
- package/dist/api/account/v2/index.js +0 -1
- package/dist/api/applesilicon/v1alpha1/index.js +0 -2
- package/dist/api/domain/v2beta1/index.js +0 -2
- package/dist/api/flexibleip/v1alpha1/index.js +0 -2
- package/dist/api/function/v1beta1/index.js +0 -2
- package/dist/api/iam/v1alpha1/index.js +0 -1
- package/dist/api/iot/v1/index.js +0 -2
- package/dist/api/k8s/v1/index.js +0 -2
- package/dist/api/marketplace/v1/index.js +0 -1
- package/dist/api/mnq/v1alpha1/index.js +0 -1
- package/dist/api/rdb/v1/index.js +0 -2
- package/dist/api/redis/v1alpha1/index.js +0 -2
- package/dist/api/test/v1/index.js +0 -1
- package/dist/api/vpc/v1/index.js +0 -1
- package/dist/node_modules/.pnpm/@scaleway_random-name@3.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -254
- package/node_modules/@scaleway/random-name/dist/index.browser.js +0 -256
|
@@ -1,29 +1,55 @@
|
|
|
1
|
-
import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@
|
|
1
|
+
import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
|
|
2
2
|
import { isJSONObject } from '../../../helpers/json.js';
|
|
3
3
|
import { unmarshalArrayOfObject, unmarshalDate, resolveOneOf } from '../../../helpers/marshalling.js';
|
|
4
4
|
|
|
5
5
|
// This file was automatically generated. DO NOT EDIT.
|
|
6
|
-
|
|
7
6
|
const unmarshalSecretHashedValue = data => {
|
|
8
7
|
if (!isJSONObject(data)) {
|
|
9
8
|
throw new TypeError(`Unmarshalling the type 'SecretHashedValue' failed as data isn't a dictionary.`);
|
|
10
9
|
}
|
|
11
|
-
|
|
12
10
|
return {
|
|
13
11
|
hashedValue: data.hashed_value,
|
|
14
12
|
key: data.key
|
|
15
13
|
};
|
|
16
14
|
};
|
|
17
|
-
|
|
15
|
+
const unmarshalTriggerMnqNatsClientConfig = data => {
|
|
16
|
+
if (!isJSONObject(data)) {
|
|
17
|
+
throw new TypeError(`Unmarshalling the type 'TriggerMnqNatsClientConfig' failed as data isn't a dictionary.`);
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
mnqNamespaceId: data.mnq_namespace_id,
|
|
21
|
+
subject: data.subject
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
const unmarshalTriggerMnqSqsClientConfig = data => {
|
|
25
|
+
if (!isJSONObject(data)) {
|
|
26
|
+
throw new TypeError(`Unmarshalling the type 'TriggerMnqSqsClientConfig' failed as data isn't a dictionary.`);
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
mnqNamespaceId: data.mnq_namespace_id,
|
|
30
|
+
queue: data.queue
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
const unmarshalTriggerSqsClientConfig = data => {
|
|
34
|
+
if (!isJSONObject(data)) {
|
|
35
|
+
throw new TypeError(`Unmarshalling the type 'TriggerSqsClientConfig' failed as data isn't a dictionary.`);
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
accessKey: data.access_key,
|
|
39
|
+
endpoint: data.endpoint,
|
|
40
|
+
queueUrl: data.queue_url,
|
|
41
|
+
secretKey: data.secret_key
|
|
42
|
+
};
|
|
43
|
+
};
|
|
18
44
|
const unmarshalCron = data => {
|
|
19
45
|
if (!isJSONObject(data)) {
|
|
20
46
|
throw new TypeError(`Unmarshalling the type 'Cron' failed as data isn't a dictionary.`);
|
|
21
47
|
}
|
|
22
|
-
|
|
23
48
|
return {
|
|
24
49
|
args: data.args,
|
|
25
50
|
functionId: data.function_id,
|
|
26
51
|
id: data.id,
|
|
52
|
+
name: data.name,
|
|
27
53
|
schedule: data.schedule,
|
|
28
54
|
status: data.status
|
|
29
55
|
};
|
|
@@ -32,7 +58,6 @@ const unmarshalDomain = data => {
|
|
|
32
58
|
if (!isJSONObject(data)) {
|
|
33
59
|
throw new TypeError(`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`);
|
|
34
60
|
}
|
|
35
|
-
|
|
36
61
|
return {
|
|
37
62
|
errorMessage: data.error_message,
|
|
38
63
|
functionId: data.function_id,
|
|
@@ -46,7 +71,6 @@ const unmarshalFunction = data => {
|
|
|
46
71
|
if (!isJSONObject(data)) {
|
|
47
72
|
throw new TypeError(`Unmarshalling the type 'Function' failed as data isn't a dictionary.`);
|
|
48
73
|
}
|
|
49
|
-
|
|
50
74
|
return {
|
|
51
75
|
cpuLimit: data.cpu_limit,
|
|
52
76
|
description: data.description,
|
|
@@ -70,12 +94,10 @@ const unmarshalFunction = data => {
|
|
|
70
94
|
timeout: data.timeout
|
|
71
95
|
};
|
|
72
96
|
};
|
|
73
|
-
|
|
74
97
|
const unmarshalLog = data => {
|
|
75
98
|
if (!isJSONObject(data)) {
|
|
76
99
|
throw new TypeError(`Unmarshalling the type 'Log' failed as data isn't a dictionary.`);
|
|
77
100
|
}
|
|
78
|
-
|
|
79
101
|
return {
|
|
80
102
|
id: data.id,
|
|
81
103
|
level: data.level,
|
|
@@ -85,12 +107,10 @@ const unmarshalLog = data => {
|
|
|
85
107
|
timestamp: unmarshalDate(data.timestamp)
|
|
86
108
|
};
|
|
87
109
|
};
|
|
88
|
-
|
|
89
110
|
const unmarshalNamespace = data => {
|
|
90
111
|
if (!isJSONObject(data)) {
|
|
91
112
|
throw new TypeError(`Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`);
|
|
92
113
|
}
|
|
93
|
-
|
|
94
114
|
return {
|
|
95
115
|
description: data.description,
|
|
96
116
|
environmentVariables: data.environment_variables,
|
|
@@ -106,12 +126,10 @@ const unmarshalNamespace = data => {
|
|
|
106
126
|
status: data.status
|
|
107
127
|
};
|
|
108
128
|
};
|
|
109
|
-
|
|
110
129
|
const unmarshalRuntime = data => {
|
|
111
130
|
if (!isJSONObject(data)) {
|
|
112
131
|
throw new TypeError(`Unmarshalling the type 'Runtime' failed as data isn't a dictionary.`);
|
|
113
132
|
}
|
|
114
|
-
|
|
115
133
|
return {
|
|
116
134
|
codeSample: data.code_sample,
|
|
117
135
|
defaultHandler: data.default_handler,
|
|
@@ -124,13 +142,12 @@ const unmarshalRuntime = data => {
|
|
|
124
142
|
version: data.version
|
|
125
143
|
};
|
|
126
144
|
};
|
|
127
|
-
|
|
128
145
|
const unmarshalToken = data => {
|
|
129
146
|
if (!isJSONObject(data)) {
|
|
130
147
|
throw new TypeError(`Unmarshalling the type 'Token' failed as data isn't a dictionary.`);
|
|
131
148
|
}
|
|
132
|
-
|
|
133
149
|
return {
|
|
150
|
+
description: data.description,
|
|
134
151
|
expiresAt: unmarshalDate(data.expires_at),
|
|
135
152
|
functionId: data.function_id,
|
|
136
153
|
id: data.id,
|
|
@@ -140,11 +157,27 @@ const unmarshalToken = data => {
|
|
|
140
157
|
token: data.token
|
|
141
158
|
};
|
|
142
159
|
};
|
|
160
|
+
const unmarshalTrigger = data => {
|
|
161
|
+
if (!isJSONObject(data)) {
|
|
162
|
+
throw new TypeError(`Unmarshalling the type 'Trigger' failed as data isn't a dictionary.`);
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
description: data.description,
|
|
166
|
+
errorMessage: data.error_message,
|
|
167
|
+
functionId: data.function_id,
|
|
168
|
+
id: data.id,
|
|
169
|
+
inputType: data.input_type,
|
|
170
|
+
name: data.name,
|
|
171
|
+
scwNatsConfig: data.scw_nats_config ? unmarshalTriggerMnqNatsClientConfig(data.scw_nats_config) : undefined,
|
|
172
|
+
scwSqsConfig: data.scw_sqs_config ? unmarshalTriggerMnqSqsClientConfig(data.scw_sqs_config) : undefined,
|
|
173
|
+
sqsConfig: data.sqs_config ? unmarshalTriggerSqsClientConfig(data.sqs_config) : undefined,
|
|
174
|
+
status: data.status
|
|
175
|
+
};
|
|
176
|
+
};
|
|
143
177
|
const unmarshalDownloadURL = data => {
|
|
144
178
|
if (!isJSONObject(data)) {
|
|
145
179
|
throw new TypeError(`Unmarshalling the type 'DownloadURL' failed as data isn't a dictionary.`);
|
|
146
180
|
}
|
|
147
|
-
|
|
148
181
|
return {
|
|
149
182
|
headers: data.headers,
|
|
150
183
|
url: data.url
|
|
@@ -154,7 +187,6 @@ const unmarshalListCronsResponse = data => {
|
|
|
154
187
|
if (!isJSONObject(data)) {
|
|
155
188
|
throw new TypeError(`Unmarshalling the type 'ListCronsResponse' failed as data isn't a dictionary.`);
|
|
156
189
|
}
|
|
157
|
-
|
|
158
190
|
return {
|
|
159
191
|
crons: unmarshalArrayOfObject(data.crons, unmarshalCron),
|
|
160
192
|
totalCount: data.total_count
|
|
@@ -164,7 +196,6 @@ const unmarshalListDomainsResponse = data => {
|
|
|
164
196
|
if (!isJSONObject(data)) {
|
|
165
197
|
throw new TypeError(`Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`);
|
|
166
198
|
}
|
|
167
|
-
|
|
168
199
|
return {
|
|
169
200
|
domains: unmarshalArrayOfObject(data.domains, unmarshalDomain),
|
|
170
201
|
totalCount: data.total_count
|
|
@@ -174,7 +205,6 @@ const unmarshalListFunctionRuntimesResponse = data => {
|
|
|
174
205
|
if (!isJSONObject(data)) {
|
|
175
206
|
throw new TypeError(`Unmarshalling the type 'ListFunctionRuntimesResponse' failed as data isn't a dictionary.`);
|
|
176
207
|
}
|
|
177
|
-
|
|
178
208
|
return {
|
|
179
209
|
runtimes: unmarshalArrayOfObject(data.runtimes, unmarshalRuntime),
|
|
180
210
|
totalCount: data.total_count
|
|
@@ -184,7 +214,6 @@ const unmarshalListFunctionsResponse = data => {
|
|
|
184
214
|
if (!isJSONObject(data)) {
|
|
185
215
|
throw new TypeError(`Unmarshalling the type 'ListFunctionsResponse' failed as data isn't a dictionary.`);
|
|
186
216
|
}
|
|
187
|
-
|
|
188
217
|
return {
|
|
189
218
|
functions: unmarshalArrayOfObject(data.functions, unmarshalFunction),
|
|
190
219
|
totalCount: data.total_count
|
|
@@ -194,7 +223,6 @@ const unmarshalListLogsResponse = data => {
|
|
|
194
223
|
if (!isJSONObject(data)) {
|
|
195
224
|
throw new TypeError(`Unmarshalling the type 'ListLogsResponse' failed as data isn't a dictionary.`);
|
|
196
225
|
}
|
|
197
|
-
|
|
198
226
|
return {
|
|
199
227
|
logs: unmarshalArrayOfObject(data.logs, unmarshalLog),
|
|
200
228
|
totalCount: data.total_count
|
|
@@ -204,7 +232,6 @@ const unmarshalListNamespacesResponse = data => {
|
|
|
204
232
|
if (!isJSONObject(data)) {
|
|
205
233
|
throw new TypeError(`Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`);
|
|
206
234
|
}
|
|
207
|
-
|
|
208
235
|
return {
|
|
209
236
|
namespaces: unmarshalArrayOfObject(data.namespaces, unmarshalNamespace),
|
|
210
237
|
totalCount: data.total_count
|
|
@@ -214,31 +241,65 @@ const unmarshalListTokensResponse = data => {
|
|
|
214
241
|
if (!isJSONObject(data)) {
|
|
215
242
|
throw new TypeError(`Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`);
|
|
216
243
|
}
|
|
217
|
-
|
|
218
244
|
return {
|
|
219
245
|
tokens: unmarshalArrayOfObject(data.tokens, unmarshalToken),
|
|
220
246
|
totalCount: data.total_count
|
|
221
247
|
};
|
|
222
248
|
};
|
|
249
|
+
const unmarshalListTriggersResponse = data => {
|
|
250
|
+
if (!isJSONObject(data)) {
|
|
251
|
+
throw new TypeError(`Unmarshalling the type 'ListTriggersResponse' failed as data isn't a dictionary.`);
|
|
252
|
+
}
|
|
253
|
+
return {
|
|
254
|
+
totalCount: data.total_count,
|
|
255
|
+
triggers: unmarshalArrayOfObject(data.triggers, unmarshalTrigger)
|
|
256
|
+
};
|
|
257
|
+
};
|
|
223
258
|
const unmarshalUploadURL = data => {
|
|
224
259
|
if (!isJSONObject(data)) {
|
|
225
260
|
throw new TypeError(`Unmarshalling the type 'UploadURL' failed as data isn't a dictionary.`);
|
|
226
261
|
}
|
|
227
|
-
|
|
228
262
|
return {
|
|
229
263
|
headers: data.headers,
|
|
230
264
|
url: data.url
|
|
231
265
|
};
|
|
232
266
|
};
|
|
233
|
-
|
|
267
|
+
const marshalCreateTriggerRequestMnqNatsClientConfig = (request, defaults) => ({
|
|
268
|
+
mnq_namespace_id: request.mnqNamespaceId,
|
|
269
|
+
subject: request.subject
|
|
270
|
+
});
|
|
271
|
+
const marshalCreateTriggerRequestMnqSqsClientConfig = (request, defaults) => ({
|
|
272
|
+
mnq_namespace_id: request.mnqNamespaceId,
|
|
273
|
+
queue: request.queue
|
|
274
|
+
});
|
|
275
|
+
const marshalCreateTriggerRequestSqsClientConfig = (request, defaults) => ({
|
|
276
|
+
access_key: request.accessKey,
|
|
277
|
+
endpoint: request.endpoint,
|
|
278
|
+
queue_url: request.queueUrl,
|
|
279
|
+
secret_key: request.secretKey
|
|
280
|
+
});
|
|
234
281
|
const marshalSecret = (request, defaults) => ({
|
|
235
282
|
key: request.key,
|
|
236
283
|
value: request.value
|
|
237
284
|
});
|
|
238
|
-
|
|
285
|
+
const marshalUpdateTriggerRequestMnqNatsClientConfig = (request, defaults) => ({
|
|
286
|
+
mnq_namespace_id: request.mnqNamespaceId,
|
|
287
|
+
subject: request.subject
|
|
288
|
+
});
|
|
289
|
+
const marshalUpdateTriggerRequestMnqSqsClientConfig = (request, defaults) => ({
|
|
290
|
+
mnq_namespace_id: request.mnqNamespaceId,
|
|
291
|
+
queue: request.queue
|
|
292
|
+
});
|
|
293
|
+
const marshalUpdateTriggerRequestSqsClientConfig = (request, defaults) => ({
|
|
294
|
+
access_key: request.accessKey,
|
|
295
|
+
endpoint: request.endpoint,
|
|
296
|
+
queue_url: request.queueUrl,
|
|
297
|
+
secret_key: request.secretKey
|
|
298
|
+
});
|
|
239
299
|
const marshalCreateCronRequest = (request, defaults) => ({
|
|
240
300
|
args: request.args,
|
|
241
301
|
function_id: request.functionId,
|
|
302
|
+
name: request.name,
|
|
242
303
|
schedule: request.schedule
|
|
243
304
|
});
|
|
244
305
|
const marshalCreateDomainRequest = (request, defaults) => ({
|
|
@@ -249,14 +310,14 @@ const marshalCreateFunctionRequest = (request, defaults) => ({
|
|
|
249
310
|
description: request.description,
|
|
250
311
|
environment_variables: request.environmentVariables,
|
|
251
312
|
handler: request.handler,
|
|
252
|
-
http_option: request.httpOption,
|
|
313
|
+
http_option: request.httpOption ?? 'unknown_http_option',
|
|
253
314
|
max_scale: request.maxScale,
|
|
254
315
|
memory_limit: request.memoryLimit,
|
|
255
316
|
min_scale: request.minScale,
|
|
256
317
|
name: request.name || randomName('fn'),
|
|
257
318
|
namespace_id: request.namespaceId,
|
|
258
|
-
privacy: request.privacy,
|
|
259
|
-
runtime: request.runtime,
|
|
319
|
+
privacy: request.privacy ?? 'unknown_privacy',
|
|
320
|
+
runtime: request.runtime ?? 'unknown_runtime',
|
|
260
321
|
secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined,
|
|
261
322
|
timeout: request.timeout
|
|
262
323
|
});
|
|
@@ -268,6 +329,7 @@ const marshalCreateNamespaceRequest = (request, defaults) => ({
|
|
|
268
329
|
secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined
|
|
269
330
|
});
|
|
270
331
|
const marshalCreateTokenRequest = (request, defaults) => ({
|
|
332
|
+
description: request.description,
|
|
271
333
|
expires_at: request.expiresAt,
|
|
272
334
|
...resolveOneOf([{
|
|
273
335
|
param: 'function_id',
|
|
@@ -277,22 +339,38 @@ const marshalCreateTokenRequest = (request, defaults) => ({
|
|
|
277
339
|
value: request.namespaceId
|
|
278
340
|
}])
|
|
279
341
|
});
|
|
342
|
+
const marshalCreateTriggerRequest = (request, defaults) => ({
|
|
343
|
+
description: request.description,
|
|
344
|
+
function_id: request.functionId,
|
|
345
|
+
name: request.name,
|
|
346
|
+
...resolveOneOf([{
|
|
347
|
+
param: 'scw_sqs_config',
|
|
348
|
+
value: request.scwSqsConfig ? marshalCreateTriggerRequestMnqSqsClientConfig(request.scwSqsConfig) : undefined
|
|
349
|
+
}, {
|
|
350
|
+
param: 'sqs_config',
|
|
351
|
+
value: request.sqsConfig ? marshalCreateTriggerRequestSqsClientConfig(request.sqsConfig) : undefined
|
|
352
|
+
}, {
|
|
353
|
+
param: 'scw_nats_config',
|
|
354
|
+
value: request.scwNatsConfig ? marshalCreateTriggerRequestMnqNatsClientConfig(request.scwNatsConfig) : undefined
|
|
355
|
+
}])
|
|
356
|
+
});
|
|
280
357
|
const marshalUpdateCronRequest = (request, defaults) => ({
|
|
281
358
|
args: request.args,
|
|
282
359
|
function_id: request.functionId,
|
|
360
|
+
name: request.name,
|
|
283
361
|
schedule: request.schedule
|
|
284
362
|
});
|
|
285
363
|
const marshalUpdateFunctionRequest = (request, defaults) => ({
|
|
286
364
|
description: request.description,
|
|
287
365
|
environment_variables: request.environmentVariables,
|
|
288
366
|
handler: request.handler,
|
|
289
|
-
http_option: request.httpOption,
|
|
367
|
+
http_option: request.httpOption ?? 'unknown_http_option',
|
|
290
368
|
max_scale: request.maxScale,
|
|
291
369
|
memory_limit: request.memoryLimit,
|
|
292
370
|
min_scale: request.minScale,
|
|
293
|
-
privacy: request.privacy,
|
|
371
|
+
privacy: request.privacy ?? 'unknown_privacy',
|
|
294
372
|
redeploy: request.redeploy,
|
|
295
|
-
runtime: request.runtime,
|
|
373
|
+
runtime: request.runtime ?? 'unknown_runtime',
|
|
296
374
|
secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined,
|
|
297
375
|
timeout: request.timeout
|
|
298
376
|
});
|
|
@@ -301,5 +379,19 @@ const marshalUpdateNamespaceRequest = (request, defaults) => ({
|
|
|
301
379
|
environment_variables: request.environmentVariables,
|
|
302
380
|
secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined
|
|
303
381
|
});
|
|
382
|
+
const marshalUpdateTriggerRequest = (request, defaults) => ({
|
|
383
|
+
description: request.description,
|
|
384
|
+
name: request.name,
|
|
385
|
+
...resolveOneOf([{
|
|
386
|
+
param: 'scw_sqs_config',
|
|
387
|
+
value: request.scwSqsConfig ? marshalUpdateTriggerRequestMnqSqsClientConfig(request.scwSqsConfig) : undefined
|
|
388
|
+
}, {
|
|
389
|
+
param: 'sqs_config',
|
|
390
|
+
value: request.sqsConfig ? marshalUpdateTriggerRequestSqsClientConfig(request.sqsConfig) : undefined
|
|
391
|
+
}, {
|
|
392
|
+
param: 'scw_nats_config',
|
|
393
|
+
value: request.scwNatsConfig ? marshalUpdateTriggerRequestMnqNatsClientConfig(request.scwNatsConfig) : undefined
|
|
394
|
+
}])
|
|
395
|
+
});
|
|
304
396
|
|
|
305
|
-
export { marshalCreateCronRequest, marshalCreateDomainRequest, marshalCreateFunctionRequest, marshalCreateNamespaceRequest, marshalCreateTokenRequest, marshalUpdateCronRequest, marshalUpdateFunctionRequest, marshalUpdateNamespaceRequest, unmarshalCron, unmarshalDomain, unmarshalDownloadURL, unmarshalFunction, unmarshalListCronsResponse, unmarshalListDomainsResponse, unmarshalListFunctionRuntimesResponse, unmarshalListFunctionsResponse, unmarshalListLogsResponse, unmarshalListNamespacesResponse, unmarshalListTokensResponse, unmarshalNamespace, unmarshalToken, unmarshalUploadURL };
|
|
397
|
+
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
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
export {
|
|
1
|
+
import * as index_gen from './v1alpha1/index.gen.js';
|
|
2
|
+
export { index_gen as v1alpha1 };
|