@appconda/nextjs 1.0.18 → 1.0.19
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/Cache/Adapter.js +1 -0
- package/dist/Cache/Adapters/Filesystem.js +102 -0
- package/dist/Cache/Adapters/Memory.js +46 -0
- package/dist/Cache/Adapters/None.js +27 -0
- package/dist/Cache/Adapters/Redis.js +79 -0
- package/dist/Cache/Adapters/Sharding.js +72 -0
- package/dist/Cache/Cache.js +51 -0
- package/dist/Cache/index.js +5 -0
- package/dist/Cache/test.js +0 -0
- package/dist/Services.js +28 -0
- package/dist/actions/actionClient.js +35 -0
- package/dist/actions/index.js +1 -0
- package/dist/actions/nodes.js +9 -0
- package/dist/client.js +334 -0
- package/dist/decorators/Cache.js +78 -0
- package/dist/decorators/CacheKey.js +8 -0
- package/dist/decorators/Invalidate.js +46 -0
- package/dist/enums/api-service.js +14 -0
- package/dist/enums/api.js +6 -0
- package/dist/enums/auth-method.js +10 -0
- package/dist/enums/authentication-factor.js +7 -0
- package/dist/enums/authenticator-type.js +4 -0
- package/dist/enums/browser.js +17 -0
- package/dist/enums/compression.js +6 -0
- package/dist/enums/credit-card.js +19 -0
- package/dist/enums/database-usage-range.js +6 -0
- package/dist/enums/email-template-locale.js +134 -0
- package/dist/enums/email-template-type.js +10 -0
- package/dist/enums/entities/EntityLimitType.js +5 -0
- package/dist/enums/entities/PropertyAttributeName.js +28 -0
- package/dist/enums/entities/PropertyCondition.js +9 -0
- package/dist/enums/entities/PropertyType.js +17 -0
- package/dist/enums/entities/PropertyValueType.js +7 -0
- package/dist/enums/entities/RowAccess.js +1 -0
- package/dist/enums/entities/ViewFilterCondition.js +13 -0
- package/dist/enums/execution-method.js +9 -0
- package/dist/enums/flag.js +198 -0
- package/dist/enums/function-usage-range.js +6 -0
- package/dist/enums/image-format.js +8 -0
- package/dist/enums/image-gravity.js +12 -0
- package/dist/enums/index-type.js +6 -0
- package/dist/enums/messaging-provider-type.js +6 -0
- package/dist/enums/name.js +15 -0
- package/dist/enums/o-auth-provider copy.js +42 -0
- package/dist/enums/o-auth-provider.js +42 -0
- package/dist/enums/password-hash.js +14 -0
- package/dist/enums/platform-type.js +18 -0
- package/dist/enums/project-usage-range.js +5 -0
- package/dist/enums/region.js +5 -0
- package/dist/enums/relation-mutate.js +6 -0
- package/dist/enums/relationship-type.js +7 -0
- package/dist/enums/resource-type.js +5 -0
- package/dist/enums/runtime.js +49 -0
- package/dist/enums/s-m-t-p-secure.js +4 -0
- package/dist/enums/shared/ApplicationLayout.js +5 -0
- package/dist/enums/shared/Colors.js +25 -0
- package/dist/enums/shared/InputType.js +7 -0
- package/dist/enums/shared/Periodicity.js +8 -0
- package/dist/enums/shared/SvgIcon.js +38 -0
- package/dist/enums/shared/Theme.js +5 -0
- package/dist/enums/sms-template-locale.js +134 -0
- package/dist/enums/sms-template-type.js +7 -0
- package/dist/enums/smtp-encryption.js +6 -0
- package/dist/enums/storage-usage-range.js +6 -0
- package/dist/enums/subscriptions/PricingModel.js +11 -0
- package/dist/enums/subscriptions/SubscriptionBillingPeriod.js +10 -0
- package/dist/enums/subscriptions/SubscriptionFeatureLimitType.js +12 -0
- package/dist/enums/subscriptions/SubscriptionPriceType.js +7 -0
- package/dist/enums/tenants/LinkedAccountStatus.js +6 -0
- package/dist/enums/tenants/TenantUserJoined.js +7 -0
- package/dist/enums/tenants/TenantUserStatus.js +7 -0
- package/dist/enums/tenants/TenantUserType.js +6 -0
- package/dist/enums/user-usage-range.js +6 -0
- package/dist/getAppcondaClient.js +42 -0
- package/dist/getSDKForCurrentUser.js +62 -0
- package/dist/id.js +44 -0
- package/dist/iife/sdk.js +7063 -7805
- package/dist/index.js +12558 -0
- package/dist/index.js.map +1 -0
- package/dist/inputFile.js +16 -0
- package/dist/lib/Registry/Registry.js +55 -0
- package/dist/lib/Registry/index.js +1 -0
- package/dist/models.js +1 -0
- package/dist/permission.js +53 -0
- package/dist/query.js +203 -0
- package/dist/role.js +93 -0
- package/dist/service-client.js +13 -0
- package/dist/service.js +22 -0
- package/dist/services/account.js +1259 -0
- package/dist/services/applets.js +39 -0
- package/dist/services/avatars.js +250 -0
- package/dist/services/community.js +68 -0
- package/dist/services/configuration.js +10 -0
- package/dist/services/databases.js +1735 -0
- package/dist/services/functions.js +809 -0
- package/dist/services/graphql.js +56 -0
- package/dist/services/health.js +462 -0
- package/dist/services/locale.js +143 -0
- package/dist/services/messaging.js +1919 -0
- package/dist/services/node.js +10 -0
- package/dist/services/permissions.js +89 -0
- package/dist/services/pricing.js +20 -0
- package/dist/services/projects.js +1525 -0
- package/dist/services/roles.js +71 -0
- package/dist/services/schema.js +47 -0
- package/dist/services/storage.js +473 -0
- package/dist/services/subscription.js +45 -0
- package/dist/services/teams.js +394 -0
- package/dist/services/tenant-subscription.js +51 -0
- package/dist/services/tenant.js +124 -0
- package/dist/services/users.js +1282 -0
- package/dist/services/waitlist.js +11 -0
- package/package.json +5 -12
- package/tsconfig.json +2 -1
- package/dist/cjs/sdk.js +0 -13300
- package/dist/cjs/sdk.js.map +0 -1
- package/dist/esm/sdk.js +0 -13278
- package/dist/esm/sdk.js.map +0 -1
@@ -0,0 +1,809 @@
|
|
1
|
+
import { AppcondaException } from '../client';
|
2
|
+
export class Functions {
|
3
|
+
constructor(client) {
|
4
|
+
this.client = client;
|
5
|
+
}
|
6
|
+
/**
|
7
|
+
* List functions
|
8
|
+
*
|
9
|
+
* Get a list of all the project's functions. You can use the query params to filter your results.
|
10
|
+
*
|
11
|
+
* @param {string[]} queries
|
12
|
+
* @param {string} search
|
13
|
+
* @throws {AppcondaException}
|
14
|
+
* @returns {Promise<Models.FunctionList>}
|
15
|
+
*/
|
16
|
+
async list(queries, search) {
|
17
|
+
const apiPath = '/functions';
|
18
|
+
const payload = {};
|
19
|
+
if (typeof queries !== 'undefined') {
|
20
|
+
payload['queries'] = queries;
|
21
|
+
}
|
22
|
+
if (typeof search !== 'undefined') {
|
23
|
+
payload['search'] = search;
|
24
|
+
}
|
25
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
26
|
+
const apiHeaders = {
|
27
|
+
'content-type': 'application/json',
|
28
|
+
};
|
29
|
+
return await this.client.call('get', uri, apiHeaders, payload);
|
30
|
+
}
|
31
|
+
/**
|
32
|
+
* Create function
|
33
|
+
*
|
34
|
+
* Create a new function. You can pass a list of [permissions](https://appconda.io/docs/permissions) to allow different project users or team with access to execute the function using the client API.
|
35
|
+
*
|
36
|
+
* @param {string} functionId
|
37
|
+
* @param {string} name
|
38
|
+
* @param {Runtime} runtime
|
39
|
+
* @param {string[]} execute
|
40
|
+
* @param {string[]} events
|
41
|
+
* @param {string} schedule
|
42
|
+
* @param {number} timeout
|
43
|
+
* @param {boolean} enabled
|
44
|
+
* @param {boolean} logging
|
45
|
+
* @param {string} entrypoint
|
46
|
+
* @param {string} commands
|
47
|
+
* @param {string[]} scopes
|
48
|
+
* @param {string} installationId
|
49
|
+
* @param {string} providerRepositoryId
|
50
|
+
* @param {string} providerBranch
|
51
|
+
* @param {boolean} providerSilentMode
|
52
|
+
* @param {string} providerRootDirectory
|
53
|
+
* @param {string} templateRepository
|
54
|
+
* @param {string} templateOwner
|
55
|
+
* @param {string} templateRootDirectory
|
56
|
+
* @param {string} templateVersion
|
57
|
+
* @param {string} specification
|
58
|
+
* @throws {AppcondaException}
|
59
|
+
* @returns {Promise<Models.Function>}
|
60
|
+
*/
|
61
|
+
async create(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, scopes, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory, templateRepository, templateOwner, templateRootDirectory, templateVersion, specification) {
|
62
|
+
if (typeof functionId === 'undefined') {
|
63
|
+
throw new AppcondaException('Missing required parameter: "functionId"');
|
64
|
+
}
|
65
|
+
if (typeof name === 'undefined') {
|
66
|
+
throw new AppcondaException('Missing required parameter: "name"');
|
67
|
+
}
|
68
|
+
if (typeof runtime === 'undefined') {
|
69
|
+
throw new AppcondaException('Missing required parameter: "runtime"');
|
70
|
+
}
|
71
|
+
const apiPath = '/functions';
|
72
|
+
const payload = {};
|
73
|
+
if (typeof functionId !== 'undefined') {
|
74
|
+
payload['functionId'] = functionId;
|
75
|
+
}
|
76
|
+
if (typeof name !== 'undefined') {
|
77
|
+
payload['name'] = name;
|
78
|
+
}
|
79
|
+
if (typeof runtime !== 'undefined') {
|
80
|
+
payload['runtime'] = runtime;
|
81
|
+
}
|
82
|
+
if (typeof execute !== 'undefined') {
|
83
|
+
payload['execute'] = execute;
|
84
|
+
}
|
85
|
+
if (typeof events !== 'undefined') {
|
86
|
+
payload['events'] = events;
|
87
|
+
}
|
88
|
+
if (typeof schedule !== 'undefined') {
|
89
|
+
payload['schedule'] = schedule;
|
90
|
+
}
|
91
|
+
if (typeof timeout !== 'undefined') {
|
92
|
+
payload['timeout'] = timeout;
|
93
|
+
}
|
94
|
+
if (typeof enabled !== 'undefined') {
|
95
|
+
payload['enabled'] = enabled;
|
96
|
+
}
|
97
|
+
if (typeof logging !== 'undefined') {
|
98
|
+
payload['logging'] = logging;
|
99
|
+
}
|
100
|
+
if (typeof entrypoint !== 'undefined') {
|
101
|
+
payload['entrypoint'] = entrypoint;
|
102
|
+
}
|
103
|
+
if (typeof commands !== 'undefined') {
|
104
|
+
payload['commands'] = commands;
|
105
|
+
}
|
106
|
+
if (typeof scopes !== 'undefined') {
|
107
|
+
payload['scopes'] = scopes;
|
108
|
+
}
|
109
|
+
if (typeof installationId !== 'undefined') {
|
110
|
+
payload['installationId'] = installationId;
|
111
|
+
}
|
112
|
+
if (typeof providerRepositoryId !== 'undefined') {
|
113
|
+
payload['providerRepositoryId'] = providerRepositoryId;
|
114
|
+
}
|
115
|
+
if (typeof providerBranch !== 'undefined') {
|
116
|
+
payload['providerBranch'] = providerBranch;
|
117
|
+
}
|
118
|
+
if (typeof providerSilentMode !== 'undefined') {
|
119
|
+
payload['providerSilentMode'] = providerSilentMode;
|
120
|
+
}
|
121
|
+
if (typeof providerRootDirectory !== 'undefined') {
|
122
|
+
payload['providerRootDirectory'] = providerRootDirectory;
|
123
|
+
}
|
124
|
+
if (typeof templateRepository !== 'undefined') {
|
125
|
+
payload['templateRepository'] = templateRepository;
|
126
|
+
}
|
127
|
+
if (typeof templateOwner !== 'undefined') {
|
128
|
+
payload['templateOwner'] = templateOwner;
|
129
|
+
}
|
130
|
+
if (typeof templateRootDirectory !== 'undefined') {
|
131
|
+
payload['templateRootDirectory'] = templateRootDirectory;
|
132
|
+
}
|
133
|
+
if (typeof templateVersion !== 'undefined') {
|
134
|
+
payload['templateVersion'] = templateVersion;
|
135
|
+
}
|
136
|
+
if (typeof specification !== 'undefined') {
|
137
|
+
payload['specification'] = specification;
|
138
|
+
}
|
139
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
140
|
+
const apiHeaders = {
|
141
|
+
'content-type': 'application/json',
|
142
|
+
};
|
143
|
+
return await this.client.call('post', uri, apiHeaders, payload);
|
144
|
+
}
|
145
|
+
/**
|
146
|
+
* List runtimes
|
147
|
+
*
|
148
|
+
* Get a list of all runtimes that are currently active on your instance.
|
149
|
+
*
|
150
|
+
* @throws {AppcondaException}
|
151
|
+
* @returns {Promise<Models.RuntimeList>}
|
152
|
+
*/
|
153
|
+
async listRuntimes() {
|
154
|
+
const apiPath = '/functions/runtimes';
|
155
|
+
const payload = {};
|
156
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
157
|
+
const apiHeaders = {
|
158
|
+
'content-type': 'application/json',
|
159
|
+
};
|
160
|
+
return await this.client.call('get', uri, apiHeaders, payload);
|
161
|
+
}
|
162
|
+
/**
|
163
|
+
* List available function runtime specifications
|
164
|
+
*
|
165
|
+
* List allowed function specifications for this instance.
|
166
|
+
|
167
|
+
*
|
168
|
+
* @throws {AppcondaException}
|
169
|
+
* @returns {Promise<Models.SpecificationList>}
|
170
|
+
*/
|
171
|
+
async listSpecifications() {
|
172
|
+
const apiPath = '/functions/specifications';
|
173
|
+
const payload = {};
|
174
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
175
|
+
const apiHeaders = {
|
176
|
+
'content-type': 'application/json',
|
177
|
+
};
|
178
|
+
return await this.client.call('get', uri, apiHeaders, payload);
|
179
|
+
}
|
180
|
+
/**
|
181
|
+
* Get function
|
182
|
+
*
|
183
|
+
* Get a function by its unique ID.
|
184
|
+
*
|
185
|
+
* @param {string} functionId
|
186
|
+
* @throws {AppcondaException}
|
187
|
+
* @returns {Promise<Models.Function>}
|
188
|
+
*/
|
189
|
+
async get(functionId) {
|
190
|
+
if (typeof functionId === 'undefined') {
|
191
|
+
throw new AppcondaException('Missing required parameter: "functionId"');
|
192
|
+
}
|
193
|
+
const apiPath = '/functions/{functionId}'.replace('{functionId}', functionId);
|
194
|
+
const payload = {};
|
195
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
196
|
+
const apiHeaders = {
|
197
|
+
'content-type': 'application/json',
|
198
|
+
};
|
199
|
+
return await this.client.call('get', uri, apiHeaders, payload);
|
200
|
+
}
|
201
|
+
/**
|
202
|
+
* Update function
|
203
|
+
*
|
204
|
+
* Update function by its unique ID.
|
205
|
+
*
|
206
|
+
* @param {string} functionId
|
207
|
+
* @param {string} name
|
208
|
+
* @param {Runtime} runtime
|
209
|
+
* @param {string[]} execute
|
210
|
+
* @param {string[]} events
|
211
|
+
* @param {string} schedule
|
212
|
+
* @param {number} timeout
|
213
|
+
* @param {boolean} enabled
|
214
|
+
* @param {boolean} logging
|
215
|
+
* @param {string} entrypoint
|
216
|
+
* @param {string} commands
|
217
|
+
* @param {string[]} scopes
|
218
|
+
* @param {string} installationId
|
219
|
+
* @param {string} providerRepositoryId
|
220
|
+
* @param {string} providerBranch
|
221
|
+
* @param {boolean} providerSilentMode
|
222
|
+
* @param {string} providerRootDirectory
|
223
|
+
* @param {string} specification
|
224
|
+
* @throws {AppcondaException}
|
225
|
+
* @returns {Promise<Models.Function>}
|
226
|
+
*/
|
227
|
+
async update(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, scopes, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory, specification) {
|
228
|
+
if (typeof functionId === 'undefined') {
|
229
|
+
throw new AppcondaException('Missing required parameter: "functionId"');
|
230
|
+
}
|
231
|
+
if (typeof name === 'undefined') {
|
232
|
+
throw new AppcondaException('Missing required parameter: "name"');
|
233
|
+
}
|
234
|
+
const apiPath = '/functions/{functionId}'.replace('{functionId}', functionId);
|
235
|
+
const payload = {};
|
236
|
+
if (typeof name !== 'undefined') {
|
237
|
+
payload['name'] = name;
|
238
|
+
}
|
239
|
+
if (typeof runtime !== 'undefined') {
|
240
|
+
payload['runtime'] = runtime;
|
241
|
+
}
|
242
|
+
if (typeof execute !== 'undefined') {
|
243
|
+
payload['execute'] = execute;
|
244
|
+
}
|
245
|
+
if (typeof events !== 'undefined') {
|
246
|
+
payload['events'] = events;
|
247
|
+
}
|
248
|
+
if (typeof schedule !== 'undefined') {
|
249
|
+
payload['schedule'] = schedule;
|
250
|
+
}
|
251
|
+
if (typeof timeout !== 'undefined') {
|
252
|
+
payload['timeout'] = timeout;
|
253
|
+
}
|
254
|
+
if (typeof enabled !== 'undefined') {
|
255
|
+
payload['enabled'] = enabled;
|
256
|
+
}
|
257
|
+
if (typeof logging !== 'undefined') {
|
258
|
+
payload['logging'] = logging;
|
259
|
+
}
|
260
|
+
if (typeof entrypoint !== 'undefined') {
|
261
|
+
payload['entrypoint'] = entrypoint;
|
262
|
+
}
|
263
|
+
if (typeof commands !== 'undefined') {
|
264
|
+
payload['commands'] = commands;
|
265
|
+
}
|
266
|
+
if (typeof scopes !== 'undefined') {
|
267
|
+
payload['scopes'] = scopes;
|
268
|
+
}
|
269
|
+
if (typeof installationId !== 'undefined') {
|
270
|
+
payload['installationId'] = installationId;
|
271
|
+
}
|
272
|
+
if (typeof providerRepositoryId !== 'undefined') {
|
273
|
+
payload['providerRepositoryId'] = providerRepositoryId;
|
274
|
+
}
|
275
|
+
if (typeof providerBranch !== 'undefined') {
|
276
|
+
payload['providerBranch'] = providerBranch;
|
277
|
+
}
|
278
|
+
if (typeof providerSilentMode !== 'undefined') {
|
279
|
+
payload['providerSilentMode'] = providerSilentMode;
|
280
|
+
}
|
281
|
+
if (typeof providerRootDirectory !== 'undefined') {
|
282
|
+
payload['providerRootDirectory'] = providerRootDirectory;
|
283
|
+
}
|
284
|
+
if (typeof specification !== 'undefined') {
|
285
|
+
payload['specification'] = specification;
|
286
|
+
}
|
287
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
288
|
+
const apiHeaders = {
|
289
|
+
'content-type': 'application/json',
|
290
|
+
};
|
291
|
+
return await this.client.call('put', uri, apiHeaders, payload);
|
292
|
+
}
|
293
|
+
/**
|
294
|
+
* Delete function
|
295
|
+
*
|
296
|
+
* Delete a function by its unique ID.
|
297
|
+
*
|
298
|
+
* @param {string} functionId
|
299
|
+
* @throws {AppcondaException}
|
300
|
+
* @returns {Promise<{}>}
|
301
|
+
*/
|
302
|
+
async delete(functionId) {
|
303
|
+
if (typeof functionId === 'undefined') {
|
304
|
+
throw new AppcondaException('Missing required parameter: "functionId"');
|
305
|
+
}
|
306
|
+
const apiPath = '/functions/{functionId}'.replace('{functionId}', functionId);
|
307
|
+
const payload = {};
|
308
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
309
|
+
const apiHeaders = {
|
310
|
+
'content-type': 'application/json',
|
311
|
+
};
|
312
|
+
return await this.client.call('delete', uri, apiHeaders, payload);
|
313
|
+
}
|
314
|
+
/**
|
315
|
+
* List deployments
|
316
|
+
*
|
317
|
+
* Get a list of all the project's code deployments. You can use the query params to filter your results.
|
318
|
+
*
|
319
|
+
* @param {string} functionId
|
320
|
+
* @param {string[]} queries
|
321
|
+
* @param {string} search
|
322
|
+
* @throws {AppcondaException}
|
323
|
+
* @returns {Promise<Models.DeploymentList>}
|
324
|
+
*/
|
325
|
+
async listDeployments(functionId, queries, search) {
|
326
|
+
if (typeof functionId === 'undefined') {
|
327
|
+
throw new AppcondaException('Missing required parameter: "functionId"');
|
328
|
+
}
|
329
|
+
const apiPath = '/functions/{functionId}/deployments'.replace('{functionId}', functionId);
|
330
|
+
const payload = {};
|
331
|
+
if (typeof queries !== 'undefined') {
|
332
|
+
payload['queries'] = queries;
|
333
|
+
}
|
334
|
+
if (typeof search !== 'undefined') {
|
335
|
+
payload['search'] = search;
|
336
|
+
}
|
337
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
338
|
+
const apiHeaders = {
|
339
|
+
'content-type': 'application/json',
|
340
|
+
};
|
341
|
+
return await this.client.call('get', uri, apiHeaders, payload);
|
342
|
+
}
|
343
|
+
/**
|
344
|
+
* Create deployment
|
345
|
+
*
|
346
|
+
* Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.
|
347
|
+
|
348
|
+
This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appconda Cloud Functions tutorial](https://appconda.io/docs/functions).
|
349
|
+
|
350
|
+
Use the "command" param to set the entrypoint used to execute your code.
|
351
|
+
*
|
352
|
+
* @param {string} functionId
|
353
|
+
* @param {File} code
|
354
|
+
* @param {boolean} activate
|
355
|
+
* @param {string} entrypoint
|
356
|
+
* @param {string} commands
|
357
|
+
* @throws {AppcondaException}
|
358
|
+
* @returns {Promise<Models.Deployment>}
|
359
|
+
*/
|
360
|
+
async createDeployment(functionId, code, activate, entrypoint, commands, onProgress = (progress) => { }) {
|
361
|
+
if (typeof functionId === 'undefined') {
|
362
|
+
throw new AppcondaException('Missing required parameter: "functionId"');
|
363
|
+
}
|
364
|
+
if (typeof code === 'undefined') {
|
365
|
+
throw new AppcondaException('Missing required parameter: "code"');
|
366
|
+
}
|
367
|
+
if (typeof activate === 'undefined') {
|
368
|
+
throw new AppcondaException('Missing required parameter: "activate"');
|
369
|
+
}
|
370
|
+
const apiPath = '/functions/{functionId}/deployments'.replace('{functionId}', functionId);
|
371
|
+
const payload = {};
|
372
|
+
if (typeof entrypoint !== 'undefined') {
|
373
|
+
payload['entrypoint'] = entrypoint;
|
374
|
+
}
|
375
|
+
if (typeof commands !== 'undefined') {
|
376
|
+
payload['commands'] = commands;
|
377
|
+
}
|
378
|
+
if (typeof code !== 'undefined') {
|
379
|
+
payload['code'] = code;
|
380
|
+
}
|
381
|
+
if (typeof activate !== 'undefined') {
|
382
|
+
payload['activate'] = activate;
|
383
|
+
}
|
384
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
385
|
+
const apiHeaders = {
|
386
|
+
'content-type': 'multipart/form-data',
|
387
|
+
};
|
388
|
+
return await this.client.chunkedUpload('post', uri, apiHeaders, payload, onProgress);
|
389
|
+
}
|
390
|
+
/**
|
391
|
+
* Get deployment
|
392
|
+
*
|
393
|
+
* Get a code deployment by its unique ID.
|
394
|
+
*
|
395
|
+
* @param {string} functionId
|
396
|
+
* @param {string} deploymentId
|
397
|
+
* @throws {AppcondaException}
|
398
|
+
* @returns {Promise<Models.Deployment>}
|
399
|
+
*/
|
400
|
+
async getDeployment(functionId, deploymentId) {
|
401
|
+
if (typeof functionId === 'undefined') {
|
402
|
+
throw new AppcondaException('Missing required parameter: "functionId"');
|
403
|
+
}
|
404
|
+
if (typeof deploymentId === 'undefined') {
|
405
|
+
throw new AppcondaException('Missing required parameter: "deploymentId"');
|
406
|
+
}
|
407
|
+
const apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
|
408
|
+
const payload = {};
|
409
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
410
|
+
const apiHeaders = {
|
411
|
+
'content-type': 'application/json',
|
412
|
+
};
|
413
|
+
return await this.client.call('get', uri, apiHeaders, payload);
|
414
|
+
}
|
415
|
+
/**
|
416
|
+
* Update deployment
|
417
|
+
*
|
418
|
+
* Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint.
|
419
|
+
*
|
420
|
+
* @param {string} functionId
|
421
|
+
* @param {string} deploymentId
|
422
|
+
* @throws {AppcondaException}
|
423
|
+
* @returns {Promise<Models.Function>}
|
424
|
+
*/
|
425
|
+
async updateDeployment(functionId, deploymentId) {
|
426
|
+
if (typeof functionId === 'undefined') {
|
427
|
+
throw new AppcondaException('Missing required parameter: "functionId"');
|
428
|
+
}
|
429
|
+
if (typeof deploymentId === 'undefined') {
|
430
|
+
throw new AppcondaException('Missing required parameter: "deploymentId"');
|
431
|
+
}
|
432
|
+
const apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
|
433
|
+
const payload = {};
|
434
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
435
|
+
const apiHeaders = {
|
436
|
+
'content-type': 'application/json',
|
437
|
+
};
|
438
|
+
return await this.client.call('patch', uri, apiHeaders, payload);
|
439
|
+
}
|
440
|
+
/**
|
441
|
+
* Delete deployment
|
442
|
+
*
|
443
|
+
* Delete a code deployment by its unique ID.
|
444
|
+
*
|
445
|
+
* @param {string} functionId
|
446
|
+
* @param {string} deploymentId
|
447
|
+
* @throws {AppcondaException}
|
448
|
+
* @returns {Promise<{}>}
|
449
|
+
*/
|
450
|
+
async deleteDeployment(functionId, deploymentId) {
|
451
|
+
if (typeof functionId === 'undefined') {
|
452
|
+
throw new AppcondaException('Missing required parameter: "functionId"');
|
453
|
+
}
|
454
|
+
if (typeof deploymentId === 'undefined') {
|
455
|
+
throw new AppcondaException('Missing required parameter: "deploymentId"');
|
456
|
+
}
|
457
|
+
const apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
|
458
|
+
const payload = {};
|
459
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
460
|
+
const apiHeaders = {
|
461
|
+
'content-type': 'application/json',
|
462
|
+
};
|
463
|
+
return await this.client.call('delete', uri, apiHeaders, payload);
|
464
|
+
}
|
465
|
+
/**
|
466
|
+
* Rebuild deployment
|
467
|
+
*
|
468
|
+
*
|
469
|
+
* @param {string} functionId
|
470
|
+
* @param {string} deploymentId
|
471
|
+
* @param {string} buildId
|
472
|
+
* @throws {AppcondaException}
|
473
|
+
* @returns {Promise<{}>}
|
474
|
+
*/
|
475
|
+
async createBuild(functionId, deploymentId, buildId) {
|
476
|
+
if (typeof functionId === 'undefined') {
|
477
|
+
throw new AppcondaException('Missing required parameter: "functionId"');
|
478
|
+
}
|
479
|
+
if (typeof deploymentId === 'undefined') {
|
480
|
+
throw new AppcondaException('Missing required parameter: "deploymentId"');
|
481
|
+
}
|
482
|
+
const apiPath = '/functions/{functionId}/deployments/{deploymentId}/build'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
|
483
|
+
const payload = {};
|
484
|
+
if (typeof buildId !== 'undefined') {
|
485
|
+
payload['buildId'] = buildId;
|
486
|
+
}
|
487
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
488
|
+
const apiHeaders = {
|
489
|
+
'content-type': 'application/json',
|
490
|
+
};
|
491
|
+
return await this.client.call('post', uri, apiHeaders, payload);
|
492
|
+
}
|
493
|
+
/**
|
494
|
+
* Cancel deployment
|
495
|
+
*
|
496
|
+
*
|
497
|
+
* @param {string} functionId
|
498
|
+
* @param {string} deploymentId
|
499
|
+
* @throws {AppcondaException}
|
500
|
+
* @returns {Promise<Models.Build>}
|
501
|
+
*/
|
502
|
+
async updateDeploymentBuild(functionId, deploymentId) {
|
503
|
+
if (typeof functionId === 'undefined') {
|
504
|
+
throw new AppcondaException('Missing required parameter: "functionId"');
|
505
|
+
}
|
506
|
+
if (typeof deploymentId === 'undefined') {
|
507
|
+
throw new AppcondaException('Missing required parameter: "deploymentId"');
|
508
|
+
}
|
509
|
+
const apiPath = '/functions/{functionId}/deployments/{deploymentId}/build'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
|
510
|
+
const payload = {};
|
511
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
512
|
+
const apiHeaders = {
|
513
|
+
'content-type': 'application/json',
|
514
|
+
};
|
515
|
+
return await this.client.call('patch', uri, apiHeaders, payload);
|
516
|
+
}
|
517
|
+
/**
|
518
|
+
* Download deployment
|
519
|
+
*
|
520
|
+
* Get a Deployment's contents by its unique ID. This endpoint supports range requests for partial or streaming file download.
|
521
|
+
*
|
522
|
+
* @param {string} functionId
|
523
|
+
* @param {string} deploymentId
|
524
|
+
* @throws {AppcondaException}
|
525
|
+
* @returns {Promise<ArrayBuffer>}
|
526
|
+
*/
|
527
|
+
async getDeploymentDownload(functionId, deploymentId) {
|
528
|
+
if (typeof functionId === 'undefined') {
|
529
|
+
throw new AppcondaException('Missing required parameter: "functionId"');
|
530
|
+
}
|
531
|
+
if (typeof deploymentId === 'undefined') {
|
532
|
+
throw new AppcondaException('Missing required parameter: "deploymentId"');
|
533
|
+
}
|
534
|
+
const apiPath = '/functions/{functionId}/deployments/{deploymentId}/download'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
|
535
|
+
const payload = {};
|
536
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
537
|
+
const apiHeaders = {
|
538
|
+
'content-type': 'application/json',
|
539
|
+
};
|
540
|
+
return await this.client.call('get', uri, apiHeaders, payload, 'arrayBuffer');
|
541
|
+
}
|
542
|
+
/**
|
543
|
+
* List executions
|
544
|
+
*
|
545
|
+
* Get a list of all the current user function execution logs. You can use the query params to filter your results.
|
546
|
+
*
|
547
|
+
* @param {string} functionId
|
548
|
+
* @param {string[]} queries
|
549
|
+
* @param {string} search
|
550
|
+
* @throws {AppcondaException}
|
551
|
+
* @returns {Promise<Models.ExecutionList>}
|
552
|
+
*/
|
553
|
+
async listExecutions(functionId, queries, search) {
|
554
|
+
if (typeof functionId === 'undefined') {
|
555
|
+
throw new AppcondaException('Missing required parameter: "functionId"');
|
556
|
+
}
|
557
|
+
const apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId);
|
558
|
+
const payload = {};
|
559
|
+
if (typeof queries !== 'undefined') {
|
560
|
+
payload['queries'] = queries;
|
561
|
+
}
|
562
|
+
if (typeof search !== 'undefined') {
|
563
|
+
payload['search'] = search;
|
564
|
+
}
|
565
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
566
|
+
const apiHeaders = {
|
567
|
+
'content-type': 'application/json',
|
568
|
+
};
|
569
|
+
return await this.client.call('get', uri, apiHeaders, payload);
|
570
|
+
}
|
571
|
+
/**
|
572
|
+
* Create execution
|
573
|
+
*
|
574
|
+
* Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
|
575
|
+
*
|
576
|
+
* @param {string} functionId
|
577
|
+
* @param {string} body
|
578
|
+
* @param {boolean} async
|
579
|
+
* @param {string} xpath
|
580
|
+
* @param {ExecutionMethod} method
|
581
|
+
* @param {object} headers
|
582
|
+
* @param {string} scheduledAt
|
583
|
+
* @throws {AppcondaException}
|
584
|
+
* @returns {Promise<Models.Execution>}
|
585
|
+
*/
|
586
|
+
async createExecution(functionId, body, async, xpath, method, headers, scheduledAt) {
|
587
|
+
if (typeof functionId === 'undefined') {
|
588
|
+
throw new AppcondaException('Missing required parameter: "functionId"');
|
589
|
+
}
|
590
|
+
const apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId);
|
591
|
+
const payload = {};
|
592
|
+
if (typeof body !== 'undefined') {
|
593
|
+
payload['body'] = body;
|
594
|
+
}
|
595
|
+
if (typeof async !== 'undefined') {
|
596
|
+
payload['async'] = async;
|
597
|
+
}
|
598
|
+
if (typeof xpath !== 'undefined') {
|
599
|
+
payload['path'] = xpath;
|
600
|
+
}
|
601
|
+
if (typeof method !== 'undefined') {
|
602
|
+
payload['method'] = method;
|
603
|
+
}
|
604
|
+
if (typeof headers !== 'undefined') {
|
605
|
+
payload['headers'] = headers;
|
606
|
+
}
|
607
|
+
if (typeof scheduledAt !== 'undefined') {
|
608
|
+
payload['scheduledAt'] = scheduledAt;
|
609
|
+
}
|
610
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
611
|
+
const apiHeaders = {
|
612
|
+
'content-type': 'application/json',
|
613
|
+
};
|
614
|
+
return await this.client.call('post', uri, apiHeaders, payload);
|
615
|
+
}
|
616
|
+
/**
|
617
|
+
* Get execution
|
618
|
+
*
|
619
|
+
* Get a function execution log by its unique ID.
|
620
|
+
*
|
621
|
+
* @param {string} functionId
|
622
|
+
* @param {string} executionId
|
623
|
+
* @throws {AppcondaException}
|
624
|
+
* @returns {Promise<Models.Execution>}
|
625
|
+
*/
|
626
|
+
async getExecution(functionId, executionId) {
|
627
|
+
if (typeof functionId === 'undefined') {
|
628
|
+
throw new AppcondaException('Missing required parameter: "functionId"');
|
629
|
+
}
|
630
|
+
if (typeof executionId === 'undefined') {
|
631
|
+
throw new AppcondaException('Missing required parameter: "executionId"');
|
632
|
+
}
|
633
|
+
const apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId);
|
634
|
+
const payload = {};
|
635
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
636
|
+
const apiHeaders = {
|
637
|
+
'content-type': 'application/json',
|
638
|
+
};
|
639
|
+
return await this.client.call('get', uri, apiHeaders, payload);
|
640
|
+
}
|
641
|
+
/**
|
642
|
+
* Delete execution
|
643
|
+
*
|
644
|
+
* Delete a function execution by its unique ID.
|
645
|
+
|
646
|
+
*
|
647
|
+
* @param {string} functionId
|
648
|
+
* @param {string} executionId
|
649
|
+
* @throws {AppcondaException}
|
650
|
+
* @returns {Promise<{}>}
|
651
|
+
*/
|
652
|
+
async deleteExecution(functionId, executionId) {
|
653
|
+
if (typeof functionId === 'undefined') {
|
654
|
+
throw new AppcondaException('Missing required parameter: "functionId"');
|
655
|
+
}
|
656
|
+
if (typeof executionId === 'undefined') {
|
657
|
+
throw new AppcondaException('Missing required parameter: "executionId"');
|
658
|
+
}
|
659
|
+
const apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId);
|
660
|
+
const payload = {};
|
661
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
662
|
+
const apiHeaders = {
|
663
|
+
'content-type': 'application/json',
|
664
|
+
};
|
665
|
+
return await this.client.call('delete', uri, apiHeaders, payload);
|
666
|
+
}
|
667
|
+
/**
|
668
|
+
* List variables
|
669
|
+
*
|
670
|
+
* Get a list of all variables of a specific function.
|
671
|
+
*
|
672
|
+
* @param {string} functionId
|
673
|
+
* @throws {AppcondaException}
|
674
|
+
* @returns {Promise<Models.VariableList>}
|
675
|
+
*/
|
676
|
+
async listVariables(functionId) {
|
677
|
+
if (typeof functionId === 'undefined') {
|
678
|
+
throw new AppcondaException('Missing required parameter: "functionId"');
|
679
|
+
}
|
680
|
+
const apiPath = '/functions/{functionId}/variables'.replace('{functionId}', functionId);
|
681
|
+
const payload = {};
|
682
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
683
|
+
const apiHeaders = {
|
684
|
+
'content-type': 'application/json',
|
685
|
+
};
|
686
|
+
return await this.client.call('get', uri, apiHeaders, payload);
|
687
|
+
}
|
688
|
+
/**
|
689
|
+
* Create variable
|
690
|
+
*
|
691
|
+
* Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.
|
692
|
+
*
|
693
|
+
* @param {string} functionId
|
694
|
+
* @param {string} key
|
695
|
+
* @param {string} value
|
696
|
+
* @throws {AppcondaException}
|
697
|
+
* @returns {Promise<Models.Variable>}
|
698
|
+
*/
|
699
|
+
async createVariable(functionId, key, value) {
|
700
|
+
if (typeof functionId === 'undefined') {
|
701
|
+
throw new AppcondaException('Missing required parameter: "functionId"');
|
702
|
+
}
|
703
|
+
if (typeof key === 'undefined') {
|
704
|
+
throw new AppcondaException('Missing required parameter: "key"');
|
705
|
+
}
|
706
|
+
if (typeof value === 'undefined') {
|
707
|
+
throw new AppcondaException('Missing required parameter: "value"');
|
708
|
+
}
|
709
|
+
const apiPath = '/functions/{functionId}/variables'.replace('{functionId}', functionId);
|
710
|
+
const payload = {};
|
711
|
+
if (typeof key !== 'undefined') {
|
712
|
+
payload['key'] = key;
|
713
|
+
}
|
714
|
+
if (typeof value !== 'undefined') {
|
715
|
+
payload['value'] = value;
|
716
|
+
}
|
717
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
718
|
+
const apiHeaders = {
|
719
|
+
'content-type': 'application/json',
|
720
|
+
};
|
721
|
+
return await this.client.call('post', uri, apiHeaders, payload);
|
722
|
+
}
|
723
|
+
/**
|
724
|
+
* Get variable
|
725
|
+
*
|
726
|
+
* Get a variable by its unique ID.
|
727
|
+
*
|
728
|
+
* @param {string} functionId
|
729
|
+
* @param {string} variableId
|
730
|
+
* @throws {AppcondaException}
|
731
|
+
* @returns {Promise<Models.Variable>}
|
732
|
+
*/
|
733
|
+
async getVariable(functionId, variableId) {
|
734
|
+
if (typeof functionId === 'undefined') {
|
735
|
+
throw new AppcondaException('Missing required parameter: "functionId"');
|
736
|
+
}
|
737
|
+
if (typeof variableId === 'undefined') {
|
738
|
+
throw new AppcondaException('Missing required parameter: "variableId"');
|
739
|
+
}
|
740
|
+
const apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);
|
741
|
+
const payload = {};
|
742
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
743
|
+
const apiHeaders = {
|
744
|
+
'content-type': 'application/json',
|
745
|
+
};
|
746
|
+
return await this.client.call('get', uri, apiHeaders, payload);
|
747
|
+
}
|
748
|
+
/**
|
749
|
+
* Update variable
|
750
|
+
*
|
751
|
+
* Update variable by its unique ID.
|
752
|
+
*
|
753
|
+
* @param {string} functionId
|
754
|
+
* @param {string} variableId
|
755
|
+
* @param {string} key
|
756
|
+
* @param {string} value
|
757
|
+
* @throws {AppcondaException}
|
758
|
+
* @returns {Promise<Models.Variable>}
|
759
|
+
*/
|
760
|
+
async updateVariable(functionId, variableId, key, value) {
|
761
|
+
if (typeof functionId === 'undefined') {
|
762
|
+
throw new AppcondaException('Missing required parameter: "functionId"');
|
763
|
+
}
|
764
|
+
if (typeof variableId === 'undefined') {
|
765
|
+
throw new AppcondaException('Missing required parameter: "variableId"');
|
766
|
+
}
|
767
|
+
if (typeof key === 'undefined') {
|
768
|
+
throw new AppcondaException('Missing required parameter: "key"');
|
769
|
+
}
|
770
|
+
const apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);
|
771
|
+
const payload = {};
|
772
|
+
if (typeof key !== 'undefined') {
|
773
|
+
payload['key'] = key;
|
774
|
+
}
|
775
|
+
if (typeof value !== 'undefined') {
|
776
|
+
payload['value'] = value;
|
777
|
+
}
|
778
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
779
|
+
const apiHeaders = {
|
780
|
+
'content-type': 'application/json',
|
781
|
+
};
|
782
|
+
return await this.client.call('put', uri, apiHeaders, payload);
|
783
|
+
}
|
784
|
+
/**
|
785
|
+
* Delete variable
|
786
|
+
*
|
787
|
+
* Delete a variable by its unique ID.
|
788
|
+
*
|
789
|
+
* @param {string} functionId
|
790
|
+
* @param {string} variableId
|
791
|
+
* @throws {AppcondaException}
|
792
|
+
* @returns {Promise<{}>}
|
793
|
+
*/
|
794
|
+
async deleteVariable(functionId, variableId) {
|
795
|
+
if (typeof functionId === 'undefined') {
|
796
|
+
throw new AppcondaException('Missing required parameter: "functionId"');
|
797
|
+
}
|
798
|
+
if (typeof variableId === 'undefined') {
|
799
|
+
throw new AppcondaException('Missing required parameter: "variableId"');
|
800
|
+
}
|
801
|
+
const apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);
|
802
|
+
const payload = {};
|
803
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
804
|
+
const apiHeaders = {
|
805
|
+
'content-type': 'application/json',
|
806
|
+
};
|
807
|
+
return await this.client.call('delete', uri, apiHeaders, payload);
|
808
|
+
}
|
809
|
+
}
|