@revenexx/sdk 0.0.2
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/LICENSE +21 -0
- package/README.md +148 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/sdk.js +16340 -0
- package/dist/cjs/sdk.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/sdk.js +16250 -0
- package/dist/esm/sdk.js.map +1 -0
- package/dist/iife/sdk.js +20101 -0
- package/package.json +56 -0
- package/src/channel.ts +158 -0
- package/src/client.ts +950 -0
- package/src/enums/adapter.ts +4 -0
- package/src/enums/attribute-boolean-status.ts +7 -0
- package/src/enums/attribute-datetime-status.ts +7 -0
- package/src/enums/attribute-email-status.ts +7 -0
- package/src/enums/attribute-enum-status.ts +7 -0
- package/src/enums/attribute-float-status.ts +7 -0
- package/src/enums/attribute-integer-status.ts +7 -0
- package/src/enums/attribute-ip-status.ts +7 -0
- package/src/enums/attribute-line-status.ts +7 -0
- package/src/enums/attribute-longtext-status.ts +7 -0
- package/src/enums/attribute-mediumtext-status.ts +7 -0
- package/src/enums/attribute-point-status.ts +7 -0
- package/src/enums/attribute-polygon-status.ts +7 -0
- package/src/enums/attribute-relationship-status.ts +7 -0
- package/src/enums/attribute-string-status.ts +7 -0
- package/src/enums/attribute-text-status.ts +7 -0
- package/src/enums/attribute-url-status.ts +7 -0
- package/src/enums/attribute-varchar-status.ts +7 -0
- package/src/enums/build-runtime.ts +73 -0
- package/src/enums/code.ts +16 -0
- package/src/enums/collection.ts +4 -0
- package/src/enums/column-boolean-status.ts +7 -0
- package/src/enums/column-datetime-status.ts +7 -0
- package/src/enums/column-email-status.ts +7 -0
- package/src/enums/column-enum-status.ts +7 -0
- package/src/enums/column-float-status.ts +7 -0
- package/src/enums/column-integer-status.ts +7 -0
- package/src/enums/column-ip-status.ts +7 -0
- package/src/enums/column-line-status.ts +7 -0
- package/src/enums/column-longtext-status.ts +7 -0
- package/src/enums/column-mediumtext-status.ts +7 -0
- package/src/enums/column-point-status.ts +7 -0
- package/src/enums/column-polygon-status.ts +7 -0
- package/src/enums/column-relationship-status.ts +7 -0
- package/src/enums/column-string-status.ts +7 -0
- package/src/enums/column-text-status.ts +7 -0
- package/src/enums/column-url-status.ts +7 -0
- package/src/enums/column-varchar-status.ts +7 -0
- package/src/enums/compression.ts +5 -0
- package/src/enums/database-type.ts +4 -0
- package/src/enums/deployment-status.ts +8 -0
- package/src/enums/execution-status.ts +7 -0
- package/src/enums/execution-trigger.ts +5 -0
- package/src/enums/framework.ts +17 -0
- package/src/enums/gravity.ts +11 -0
- package/src/enums/health-antivirus-status.ts +5 -0
- package/src/enums/health-status-status.ts +4 -0
- package/src/enums/index-status.ts +7 -0
- package/src/enums/message-status.ts +7 -0
- package/src/enums/method.ts +9 -0
- package/src/enums/output.ts +9 -0
- package/src/enums/permissions.ts +22 -0
- package/src/enums/priority.ts +4 -0
- package/src/enums/range.ts +5 -0
- package/src/enums/runtime.ts +73 -0
- package/src/enums/runtimes.ts +73 -0
- package/src/enums/scopes.ts +57 -0
- package/src/enums/theme.ts +4 -0
- package/src/enums/timezone.ts +421 -0
- package/src/enums/type.ts +5 -0
- package/src/enums/use-cases.ts +9 -0
- package/src/id.ts +47 -0
- package/src/index.ts +92 -0
- package/src/models.ts +6013 -0
- package/src/operator.ts +308 -0
- package/src/permission.ts +57 -0
- package/src/query.ts +576 -0
- package/src/role.ts +100 -0
- package/src/service.ts +30 -0
- package/src/services/apps.ts +2473 -0
- package/src/services/avatars.ts +744 -0
- package/src/services/carts.ts +1057 -0
- package/src/services/channels.ts +227 -0
- package/src/services/customers.ts +729 -0
- package/src/services/greetings.ts +294 -0
- package/src/services/locale.ts +198 -0
- package/src/services/markets.ts +796 -0
- package/src/services/messaging.ts +3463 -0
- package/src/services/products.ts +3100 -0
- package/src/services/realtime.ts +537 -0
- package/src/services/search.ts +346 -0
- package/src/services/sites.ts +1847 -0
- package/src/services/storage.ts +1076 -0
- package/src/services/tokens.ts +314 -0
- package/types/channel.d.ts +74 -0
- package/types/client.d.ts +211 -0
- package/types/enums/adapter.d.ts +4 -0
- package/types/enums/attribute-boolean-status.d.ts +7 -0
- package/types/enums/attribute-datetime-status.d.ts +7 -0
- package/types/enums/attribute-email-status.d.ts +7 -0
- package/types/enums/attribute-enum-status.d.ts +7 -0
- package/types/enums/attribute-float-status.d.ts +7 -0
- package/types/enums/attribute-integer-status.d.ts +7 -0
- package/types/enums/attribute-ip-status.d.ts +7 -0
- package/types/enums/attribute-line-status.d.ts +7 -0
- package/types/enums/attribute-longtext-status.d.ts +7 -0
- package/types/enums/attribute-mediumtext-status.d.ts +7 -0
- package/types/enums/attribute-point-status.d.ts +7 -0
- package/types/enums/attribute-polygon-status.d.ts +7 -0
- package/types/enums/attribute-relationship-status.d.ts +7 -0
- package/types/enums/attribute-string-status.d.ts +7 -0
- package/types/enums/attribute-text-status.d.ts +7 -0
- package/types/enums/attribute-url-status.d.ts +7 -0
- package/types/enums/attribute-varchar-status.d.ts +7 -0
- package/types/enums/build-runtime.d.ts +73 -0
- package/types/enums/code.d.ts +16 -0
- package/types/enums/collection.d.ts +4 -0
- package/types/enums/column-boolean-status.d.ts +7 -0
- package/types/enums/column-datetime-status.d.ts +7 -0
- package/types/enums/column-email-status.d.ts +7 -0
- package/types/enums/column-enum-status.d.ts +7 -0
- package/types/enums/column-float-status.d.ts +7 -0
- package/types/enums/column-integer-status.d.ts +7 -0
- package/types/enums/column-ip-status.d.ts +7 -0
- package/types/enums/column-line-status.d.ts +7 -0
- package/types/enums/column-longtext-status.d.ts +7 -0
- package/types/enums/column-mediumtext-status.d.ts +7 -0
- package/types/enums/column-point-status.d.ts +7 -0
- package/types/enums/column-polygon-status.d.ts +7 -0
- package/types/enums/column-relationship-status.d.ts +7 -0
- package/types/enums/column-string-status.d.ts +7 -0
- package/types/enums/column-text-status.d.ts +7 -0
- package/types/enums/column-url-status.d.ts +7 -0
- package/types/enums/column-varchar-status.d.ts +7 -0
- package/types/enums/compression.d.ts +5 -0
- package/types/enums/database-type.d.ts +4 -0
- package/types/enums/deployment-status.d.ts +8 -0
- package/types/enums/execution-status.d.ts +7 -0
- package/types/enums/execution-trigger.d.ts +5 -0
- package/types/enums/framework.d.ts +17 -0
- package/types/enums/gravity.d.ts +11 -0
- package/types/enums/health-antivirus-status.d.ts +5 -0
- package/types/enums/health-status-status.d.ts +4 -0
- package/types/enums/index-status.d.ts +7 -0
- package/types/enums/message-status.d.ts +7 -0
- package/types/enums/method.d.ts +9 -0
- package/types/enums/output.d.ts +9 -0
- package/types/enums/permissions.d.ts +22 -0
- package/types/enums/priority.d.ts +4 -0
- package/types/enums/range.d.ts +5 -0
- package/types/enums/runtime.d.ts +73 -0
- package/types/enums/runtimes.d.ts +73 -0
- package/types/enums/scopes.d.ts +57 -0
- package/types/enums/theme.d.ts +4 -0
- package/types/enums/timezone.d.ts +421 -0
- package/types/enums/type.d.ts +5 -0
- package/types/enums/use-cases.d.ts +9 -0
- package/types/id.d.ts +20 -0
- package/types/index.d.ts +92 -0
- package/types/models.d.ts +5830 -0
- package/types/operator.d.ts +180 -0
- package/types/permission.d.ts +43 -0
- package/types/query.d.ts +442 -0
- package/types/role.d.ts +70 -0
- package/types/service.d.ts +11 -0
- package/types/services/apps.d.ts +932 -0
- package/types/services/avatars.d.ts +318 -0
- package/types/services/carts.d.ts +352 -0
- package/types/services/channels.d.ts +75 -0
- package/types/services/customers.d.ts +231 -0
- package/types/services/greetings.d.ts +101 -0
- package/types/services/locale.d.ts +64 -0
- package/types/services/markets.d.ts +274 -0
- package/types/services/messaging.d.ts +1324 -0
- package/types/services/products.d.ts +1014 -0
- package/types/services/realtime.d.ts +134 -0
- package/types/services/search.d.ts +131 -0
- package/types/services/sites.d.ts +689 -0
- package/types/services/storage.d.ts +421 -0
- package/types/services/tokens.d.ts +119 -0
|
@@ -0,0 +1,2473 @@
|
|
|
1
|
+
import { Service } from '../service';
|
|
2
|
+
import { RevenexxException, Client, type Payload, UploadProgress } from '../client';
|
|
3
|
+
import type { Models } from '../models';
|
|
4
|
+
|
|
5
|
+
import { Runtime } from '../enums/runtime';
|
|
6
|
+
import { Scopes } from '../enums/scopes';
|
|
7
|
+
import { Runtimes } from '../enums/runtimes';
|
|
8
|
+
import { UseCases } from '../enums/use-cases';
|
|
9
|
+
import { Range } from '../enums/range';
|
|
10
|
+
import { Type } from '../enums/type';
|
|
11
|
+
import { Method } from '../enums/method';
|
|
12
|
+
|
|
13
|
+
export class Apps {
|
|
14
|
+
client: Client;
|
|
15
|
+
|
|
16
|
+
constructor(client: Client) {
|
|
17
|
+
this.client = client;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* List all Apps in the active project. Pass `search` to filter by name.
|
|
22
|
+
*
|
|
23
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId
|
|
24
|
+
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
25
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
26
|
+
* @throws {RevenexxException}
|
|
27
|
+
* @returns {Promise<Models.FunctionList>}
|
|
28
|
+
*/
|
|
29
|
+
appsList(params?: { queries?: string[], search?: string, total?: boolean }): Promise<Models.FunctionList>;
|
|
30
|
+
/**
|
|
31
|
+
* List all Apps in the active project. Pass `search` to filter by name.
|
|
32
|
+
*
|
|
33
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId
|
|
34
|
+
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
35
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
36
|
+
* @throws {RevenexxException}
|
|
37
|
+
* @returns {Promise<Models.FunctionList>}
|
|
38
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
39
|
+
*/
|
|
40
|
+
appsList(queries?: string[], search?: string, total?: boolean): Promise<Models.FunctionList>;
|
|
41
|
+
appsList(
|
|
42
|
+
paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[],
|
|
43
|
+
...rest: [(string)?, (boolean)?]
|
|
44
|
+
): Promise<Models.FunctionList> {
|
|
45
|
+
let params: { queries?: string[], search?: string, total?: boolean };
|
|
46
|
+
|
|
47
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
48
|
+
params = (paramsOrFirst || {}) as { queries?: string[], search?: string, total?: boolean };
|
|
49
|
+
} else {
|
|
50
|
+
params = {
|
|
51
|
+
queries: paramsOrFirst as string[],
|
|
52
|
+
search: rest[0] as string,
|
|
53
|
+
total: rest[1] as boolean
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const queries = params.queries;
|
|
58
|
+
const search = params.search;
|
|
59
|
+
const total = params.total;
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
const apiPath = '/v1/apps';
|
|
63
|
+
const payload: Payload = {};
|
|
64
|
+
if (typeof queries !== 'undefined') {
|
|
65
|
+
payload['queries'] = queries;
|
|
66
|
+
}
|
|
67
|
+
if (typeof search !== 'undefined') {
|
|
68
|
+
payload['search'] = search;
|
|
69
|
+
}
|
|
70
|
+
if (typeof total !== 'undefined') {
|
|
71
|
+
payload['total'] = total;
|
|
72
|
+
}
|
|
73
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
74
|
+
|
|
75
|
+
const apiHeaders: { [header: string]: string } = {
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return this.client.call(
|
|
79
|
+
'get',
|
|
80
|
+
uri,
|
|
81
|
+
apiHeaders,
|
|
82
|
+
payload
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Create a new revenexx App. An App is the deployment surface for code that runs on the platform — backend jobs, APIs, integrations. The created App owns subsequent deployments and executions.
|
|
88
|
+
*
|
|
89
|
+
* Phase 1 mirrors the underlying Functions runtime 1:1; future phases will add manifest validation, registry coupling and schema migrations.
|
|
90
|
+
*
|
|
91
|
+
* @param {string} params.functionId - Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
92
|
+
* @param {string} params.name - Function name. Max length: 128 chars.
|
|
93
|
+
* @param {Runtime} params.runtime - Execution runtime.
|
|
94
|
+
* @param {string} params.commands - Build Commands.
|
|
95
|
+
* @param {boolean} params.enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
|
|
96
|
+
* @param {string} params.entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory".
|
|
97
|
+
* @param {string[]} params.events - Events list. Maximum of 100 events are allowed.
|
|
98
|
+
* @param {string[]} params.execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
|
|
99
|
+
* @param {string} params.installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
|
|
100
|
+
* @param {boolean} params.logging - When disabled, executions will exclude logs and errors, and will be slightly faster.
|
|
101
|
+
* @param {string} params.providerBranch - Production branch for the repo linked to the function.
|
|
102
|
+
* @param {string} params.providerRepositoryId - Repository ID of the repo linked to the function.
|
|
103
|
+
* @param {string} params.providerRootDirectory - Path to function code in the linked repo.
|
|
104
|
+
* @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
|
|
105
|
+
* @param {string} params.schedule - Schedule CRON syntax.
|
|
106
|
+
* @param {Scopes[]} params.scopes - List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.
|
|
107
|
+
* @param {string} params.specification - Runtime specification for the function and builds.
|
|
108
|
+
* @param {number} params.timeout - Function maximum execution time in seconds.
|
|
109
|
+
* @throws {RevenexxException}
|
|
110
|
+
* @returns {Promise<Models.Function>}
|
|
111
|
+
*/
|
|
112
|
+
appsCreate(params: { functionId: string, name: string, runtime: Runtime, commands?: string, enabled?: boolean, entrypoint?: string, events?: string[], execute?: string[], installationId?: string, logging?: boolean, providerBranch?: string, providerRepositoryId?: string, providerRootDirectory?: string, providerSilentMode?: boolean, schedule?: string, scopes?: Scopes[], specification?: string, timeout?: number }): Promise<Models.Function>;
|
|
113
|
+
/**
|
|
114
|
+
* Create a new revenexx App. An App is the deployment surface for code that runs on the platform — backend jobs, APIs, integrations. The created App owns subsequent deployments and executions.
|
|
115
|
+
*
|
|
116
|
+
* Phase 1 mirrors the underlying Functions runtime 1:1; future phases will add manifest validation, registry coupling and schema migrations.
|
|
117
|
+
*
|
|
118
|
+
* @param {string} functionId - Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
119
|
+
* @param {string} name - Function name. Max length: 128 chars.
|
|
120
|
+
* @param {Runtime} runtime - Execution runtime.
|
|
121
|
+
* @param {string} commands - Build Commands.
|
|
122
|
+
* @param {boolean} enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
|
|
123
|
+
* @param {string} entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory".
|
|
124
|
+
* @param {string[]} events - Events list. Maximum of 100 events are allowed.
|
|
125
|
+
* @param {string[]} execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
|
|
126
|
+
* @param {string} installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
|
|
127
|
+
* @param {boolean} logging - When disabled, executions will exclude logs and errors, and will be slightly faster.
|
|
128
|
+
* @param {string} providerBranch - Production branch for the repo linked to the function.
|
|
129
|
+
* @param {string} providerRepositoryId - Repository ID of the repo linked to the function.
|
|
130
|
+
* @param {string} providerRootDirectory - Path to function code in the linked repo.
|
|
131
|
+
* @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
|
|
132
|
+
* @param {string} schedule - Schedule CRON syntax.
|
|
133
|
+
* @param {Scopes[]} scopes - List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.
|
|
134
|
+
* @param {string} specification - Runtime specification for the function and builds.
|
|
135
|
+
* @param {number} timeout - Function maximum execution time in seconds.
|
|
136
|
+
* @throws {RevenexxException}
|
|
137
|
+
* @returns {Promise<Models.Function>}
|
|
138
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
139
|
+
*/
|
|
140
|
+
appsCreate(functionId: string, name: string, runtime: Runtime, commands?: string, enabled?: boolean, entrypoint?: string, events?: string[], execute?: string[], installationId?: string, logging?: boolean, providerBranch?: string, providerRepositoryId?: string, providerRootDirectory?: string, providerSilentMode?: boolean, schedule?: string, scopes?: Scopes[], specification?: string, timeout?: number): Promise<Models.Function>;
|
|
141
|
+
appsCreate(
|
|
142
|
+
paramsOrFirst: { functionId: string, name: string, runtime: Runtime, commands?: string, enabled?: boolean, entrypoint?: string, events?: string[], execute?: string[], installationId?: string, logging?: boolean, providerBranch?: string, providerRepositoryId?: string, providerRootDirectory?: string, providerSilentMode?: boolean, schedule?: string, scopes?: Scopes[], specification?: string, timeout?: number } | string,
|
|
143
|
+
...rest: [(string)?, (Runtime)?, (string)?, (boolean)?, (string)?, (string[])?, (string[])?, (string)?, (boolean)?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (Scopes[])?, (string)?, (number)?]
|
|
144
|
+
): Promise<Models.Function> {
|
|
145
|
+
let params: { functionId: string, name: string, runtime: Runtime, commands?: string, enabled?: boolean, entrypoint?: string, events?: string[], execute?: string[], installationId?: string, logging?: boolean, providerBranch?: string, providerRepositoryId?: string, providerRootDirectory?: string, providerSilentMode?: boolean, schedule?: string, scopes?: Scopes[], specification?: string, timeout?: number };
|
|
146
|
+
|
|
147
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
148
|
+
params = (paramsOrFirst || {}) as { functionId: string, name: string, runtime: Runtime, commands?: string, enabled?: boolean, entrypoint?: string, events?: string[], execute?: string[], installationId?: string, logging?: boolean, providerBranch?: string, providerRepositoryId?: string, providerRootDirectory?: string, providerSilentMode?: boolean, schedule?: string, scopes?: Scopes[], specification?: string, timeout?: number };
|
|
149
|
+
} else {
|
|
150
|
+
params = {
|
|
151
|
+
functionId: paramsOrFirst as string,
|
|
152
|
+
name: rest[0] as string,
|
|
153
|
+
runtime: rest[1] as Runtime,
|
|
154
|
+
commands: rest[2] as string,
|
|
155
|
+
enabled: rest[3] as boolean,
|
|
156
|
+
entrypoint: rest[4] as string,
|
|
157
|
+
events: rest[5] as string[],
|
|
158
|
+
execute: rest[6] as string[],
|
|
159
|
+
installationId: rest[7] as string,
|
|
160
|
+
logging: rest[8] as boolean,
|
|
161
|
+
providerBranch: rest[9] as string,
|
|
162
|
+
providerRepositoryId: rest[10] as string,
|
|
163
|
+
providerRootDirectory: rest[11] as string,
|
|
164
|
+
providerSilentMode: rest[12] as boolean,
|
|
165
|
+
schedule: rest[13] as string,
|
|
166
|
+
scopes: rest[14] as Scopes[],
|
|
167
|
+
specification: rest[15] as string,
|
|
168
|
+
timeout: rest[16] as number
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const functionId = params.functionId;
|
|
173
|
+
const name = params.name;
|
|
174
|
+
const runtime = params.runtime;
|
|
175
|
+
const commands = params.commands;
|
|
176
|
+
const enabled = params.enabled;
|
|
177
|
+
const entrypoint = params.entrypoint;
|
|
178
|
+
const events = params.events;
|
|
179
|
+
const execute = params.execute;
|
|
180
|
+
const installationId = params.installationId;
|
|
181
|
+
const logging = params.logging;
|
|
182
|
+
const providerBranch = params.providerBranch;
|
|
183
|
+
const providerRepositoryId = params.providerRepositoryId;
|
|
184
|
+
const providerRootDirectory = params.providerRootDirectory;
|
|
185
|
+
const providerSilentMode = params.providerSilentMode;
|
|
186
|
+
const schedule = params.schedule;
|
|
187
|
+
const scopes = params.scopes;
|
|
188
|
+
const specification = params.specification;
|
|
189
|
+
const timeout = params.timeout;
|
|
190
|
+
|
|
191
|
+
if (typeof functionId === 'undefined') {
|
|
192
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
193
|
+
}
|
|
194
|
+
if (typeof name === 'undefined') {
|
|
195
|
+
throw new RevenexxException('Missing required parameter: "name"');
|
|
196
|
+
}
|
|
197
|
+
if (typeof runtime === 'undefined') {
|
|
198
|
+
throw new RevenexxException('Missing required parameter: "runtime"');
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const apiPath = '/v1/apps';
|
|
202
|
+
const payload: Payload = {};
|
|
203
|
+
if (typeof commands !== 'undefined') {
|
|
204
|
+
payload['commands'] = commands;
|
|
205
|
+
}
|
|
206
|
+
if (typeof enabled !== 'undefined') {
|
|
207
|
+
payload['enabled'] = enabled;
|
|
208
|
+
}
|
|
209
|
+
if (typeof entrypoint !== 'undefined') {
|
|
210
|
+
payload['entrypoint'] = entrypoint;
|
|
211
|
+
}
|
|
212
|
+
if (typeof events !== 'undefined') {
|
|
213
|
+
payload['events'] = events;
|
|
214
|
+
}
|
|
215
|
+
if (typeof execute !== 'undefined') {
|
|
216
|
+
payload['execute'] = execute;
|
|
217
|
+
}
|
|
218
|
+
if (typeof functionId !== 'undefined') {
|
|
219
|
+
payload['functionId'] = functionId;
|
|
220
|
+
}
|
|
221
|
+
if (typeof installationId !== 'undefined') {
|
|
222
|
+
payload['installationId'] = installationId;
|
|
223
|
+
}
|
|
224
|
+
if (typeof logging !== 'undefined') {
|
|
225
|
+
payload['logging'] = logging;
|
|
226
|
+
}
|
|
227
|
+
if (typeof name !== 'undefined') {
|
|
228
|
+
payload['name'] = name;
|
|
229
|
+
}
|
|
230
|
+
if (typeof providerBranch !== 'undefined') {
|
|
231
|
+
payload['providerBranch'] = providerBranch;
|
|
232
|
+
}
|
|
233
|
+
if (typeof providerRepositoryId !== 'undefined') {
|
|
234
|
+
payload['providerRepositoryId'] = providerRepositoryId;
|
|
235
|
+
}
|
|
236
|
+
if (typeof providerRootDirectory !== 'undefined') {
|
|
237
|
+
payload['providerRootDirectory'] = providerRootDirectory;
|
|
238
|
+
}
|
|
239
|
+
if (typeof providerSilentMode !== 'undefined') {
|
|
240
|
+
payload['providerSilentMode'] = providerSilentMode;
|
|
241
|
+
}
|
|
242
|
+
if (typeof runtime !== 'undefined') {
|
|
243
|
+
payload['runtime'] = runtime;
|
|
244
|
+
}
|
|
245
|
+
if (typeof schedule !== 'undefined') {
|
|
246
|
+
payload['schedule'] = schedule;
|
|
247
|
+
}
|
|
248
|
+
if (typeof scopes !== 'undefined') {
|
|
249
|
+
payload['scopes'] = scopes;
|
|
250
|
+
}
|
|
251
|
+
if (typeof specification !== 'undefined') {
|
|
252
|
+
payload['specification'] = specification;
|
|
253
|
+
}
|
|
254
|
+
if (typeof timeout !== 'undefined') {
|
|
255
|
+
payload['timeout'] = timeout;
|
|
256
|
+
}
|
|
257
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
258
|
+
|
|
259
|
+
const apiHeaders: { [header: string]: string } = {
|
|
260
|
+
'content-type': 'application/json',
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
return this.client.call(
|
|
264
|
+
'post',
|
|
265
|
+
uri,
|
|
266
|
+
apiHeaders,
|
|
267
|
+
payload
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* List apps published to the Marketplace. Proxies the App Registry on Console with `?published=true` filter.
|
|
273
|
+
*
|
|
274
|
+
* @param {string} params.search - Search by app name, title or vendor.
|
|
275
|
+
* @param {number} params.perPage - Items per page.
|
|
276
|
+
* @param {number} params.page - Page number.
|
|
277
|
+
* @throws {RevenexxException}
|
|
278
|
+
* @returns {Promise<{}>}
|
|
279
|
+
*/
|
|
280
|
+
appsListMarketplace(params?: { search?: string, perPage?: number, page?: number }): Promise<{}>;
|
|
281
|
+
/**
|
|
282
|
+
* List apps published to the Marketplace. Proxies the App Registry on Console with `?published=true` filter.
|
|
283
|
+
*
|
|
284
|
+
* @param {string} search - Search by app name, title or vendor.
|
|
285
|
+
* @param {number} perPage - Items per page.
|
|
286
|
+
* @param {number} page - Page number.
|
|
287
|
+
* @throws {RevenexxException}
|
|
288
|
+
* @returns {Promise<{}>}
|
|
289
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
290
|
+
*/
|
|
291
|
+
appsListMarketplace(search?: string, perPage?: number, page?: number): Promise<{}>;
|
|
292
|
+
appsListMarketplace(
|
|
293
|
+
paramsOrFirst?: { search?: string, perPage?: number, page?: number } | string,
|
|
294
|
+
...rest: [(number)?, (number)?]
|
|
295
|
+
): Promise<{}> {
|
|
296
|
+
let params: { search?: string, perPage?: number, page?: number };
|
|
297
|
+
|
|
298
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
299
|
+
params = (paramsOrFirst || {}) as { search?: string, perPage?: number, page?: number };
|
|
300
|
+
} else {
|
|
301
|
+
params = {
|
|
302
|
+
search: paramsOrFirst as string,
|
|
303
|
+
perPage: rest[0] as number,
|
|
304
|
+
page: rest[1] as number
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
const search = params.search;
|
|
309
|
+
const perPage = params.perPage;
|
|
310
|
+
const page = params.page;
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
const apiPath = '/v1/apps/marketplace';
|
|
314
|
+
const payload: Payload = {};
|
|
315
|
+
if (typeof search !== 'undefined') {
|
|
316
|
+
payload['search'] = search;
|
|
317
|
+
}
|
|
318
|
+
if (typeof perPage !== 'undefined') {
|
|
319
|
+
payload['per_page'] = perPage;
|
|
320
|
+
}
|
|
321
|
+
if (typeof page !== 'undefined') {
|
|
322
|
+
payload['page'] = page;
|
|
323
|
+
}
|
|
324
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
325
|
+
|
|
326
|
+
const apiHeaders: { [header: string]: string } = {
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
return this.client.call(
|
|
330
|
+
'get',
|
|
331
|
+
uri,
|
|
332
|
+
apiHeaders,
|
|
333
|
+
payload
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Install a Marketplace app on the calling project's tenant. Body: { owner, name }.
|
|
339
|
+
*
|
|
340
|
+
* @param {string} params.name - App name.
|
|
341
|
+
* @param {string} params.owner - Owner tenant slug of the app being installed.
|
|
342
|
+
* @throws {RevenexxException}
|
|
343
|
+
* @returns {Promise<{}>}
|
|
344
|
+
*/
|
|
345
|
+
appsInstallFromMarketplace(params: { name: string, owner: string }): Promise<{}>;
|
|
346
|
+
/**
|
|
347
|
+
* Install a Marketplace app on the calling project's tenant. Body: { owner, name }.
|
|
348
|
+
*
|
|
349
|
+
* @param {string} name - App name.
|
|
350
|
+
* @param {string} owner - Owner tenant slug of the app being installed.
|
|
351
|
+
* @throws {RevenexxException}
|
|
352
|
+
* @returns {Promise<{}>}
|
|
353
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
354
|
+
*/
|
|
355
|
+
appsInstallFromMarketplace(name: string, owner: string): Promise<{}>;
|
|
356
|
+
appsInstallFromMarketplace(
|
|
357
|
+
paramsOrFirst: { name: string, owner: string } | string,
|
|
358
|
+
...rest: [(string)?]
|
|
359
|
+
): Promise<{}> {
|
|
360
|
+
let params: { name: string, owner: string };
|
|
361
|
+
|
|
362
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
363
|
+
params = (paramsOrFirst || {}) as { name: string, owner: string };
|
|
364
|
+
} else {
|
|
365
|
+
params = {
|
|
366
|
+
name: paramsOrFirst as string,
|
|
367
|
+
owner: rest[0] as string
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
const name = params.name;
|
|
372
|
+
const owner = params.owner;
|
|
373
|
+
|
|
374
|
+
if (typeof name === 'undefined') {
|
|
375
|
+
throw new RevenexxException('Missing required parameter: "name"');
|
|
376
|
+
}
|
|
377
|
+
if (typeof owner === 'undefined') {
|
|
378
|
+
throw new RevenexxException('Missing required parameter: "owner"');
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
const apiPath = '/v1/apps/marketplace/install';
|
|
382
|
+
const payload: Payload = {};
|
|
383
|
+
if (typeof name !== 'undefined') {
|
|
384
|
+
payload['name'] = name;
|
|
385
|
+
}
|
|
386
|
+
if (typeof owner !== 'undefined') {
|
|
387
|
+
payload['owner'] = owner;
|
|
388
|
+
}
|
|
389
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
390
|
+
|
|
391
|
+
const apiHeaders: { [header: string]: string } = {
|
|
392
|
+
'content-type': 'application/json',
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
return this.client.call(
|
|
396
|
+
'post',
|
|
397
|
+
uri,
|
|
398
|
+
apiHeaders,
|
|
399
|
+
payload
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Get a list of all runtimes available for an App. Identical content to `functions.listRuntimes()`.
|
|
405
|
+
*
|
|
406
|
+
* @throws {RevenexxException}
|
|
407
|
+
* @returns {Promise<Models.RuntimeList>}
|
|
408
|
+
*/
|
|
409
|
+
appsListRuntimes(): Promise<Models.RuntimeList> {
|
|
410
|
+
|
|
411
|
+
const apiPath = '/v1/apps/runtimes';
|
|
412
|
+
const payload: Payload = {};
|
|
413
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
414
|
+
|
|
415
|
+
const apiHeaders: { [header: string]: string } = {
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
return this.client.call(
|
|
419
|
+
'get',
|
|
420
|
+
uri,
|
|
421
|
+
apiHeaders,
|
|
422
|
+
payload
|
|
423
|
+
);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* List the compute specifications (CPU + memory) available to Apps in this project.
|
|
428
|
+
*
|
|
429
|
+
* @throws {RevenexxException}
|
|
430
|
+
* @returns {Promise<Models.SpecificationList>}
|
|
431
|
+
*/
|
|
432
|
+
appsListSpecifications(): Promise<Models.SpecificationList> {
|
|
433
|
+
|
|
434
|
+
const apiPath = '/v1/apps/specifications';
|
|
435
|
+
const payload: Payload = {};
|
|
436
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
437
|
+
|
|
438
|
+
const apiHeaders: { [header: string]: string } = {
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
return this.client.call(
|
|
442
|
+
'get',
|
|
443
|
+
uri,
|
|
444
|
+
apiHeaders,
|
|
445
|
+
payload
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* List the curated catalogue of App templates that can be used as starting points.
|
|
451
|
+
*
|
|
452
|
+
* @param {Runtimes[]} params.runtimes - List of runtimes allowed for filtering function templates. Maximum of 100 runtimes are allowed.
|
|
453
|
+
* @param {UseCases[]} params.useCases - List of use cases allowed for filtering function templates. Maximum of 100 use cases are allowed.
|
|
454
|
+
* @param {number} params.limit - Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.
|
|
455
|
+
* @param {number} params.offset - Offset the list of returned templates. Maximum offset is 5000.
|
|
456
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
457
|
+
* @throws {RevenexxException}
|
|
458
|
+
* @returns {Promise<Models.TemplateFunctionList>}
|
|
459
|
+
*/
|
|
460
|
+
appsListTemplates(params?: { runtimes?: Runtimes[], useCases?: UseCases[], limit?: number, offset?: number, total?: boolean }): Promise<Models.TemplateFunctionList>;
|
|
461
|
+
/**
|
|
462
|
+
* List the curated catalogue of App templates that can be used as starting points.
|
|
463
|
+
*
|
|
464
|
+
* @param {Runtimes[]} runtimes - List of runtimes allowed for filtering function templates. Maximum of 100 runtimes are allowed.
|
|
465
|
+
* @param {UseCases[]} useCases - List of use cases allowed for filtering function templates. Maximum of 100 use cases are allowed.
|
|
466
|
+
* @param {number} limit - Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.
|
|
467
|
+
* @param {number} offset - Offset the list of returned templates. Maximum offset is 5000.
|
|
468
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
469
|
+
* @throws {RevenexxException}
|
|
470
|
+
* @returns {Promise<Models.TemplateFunctionList>}
|
|
471
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
472
|
+
*/
|
|
473
|
+
appsListTemplates(runtimes?: Runtimes[], useCases?: UseCases[], limit?: number, offset?: number, total?: boolean): Promise<Models.TemplateFunctionList>;
|
|
474
|
+
appsListTemplates(
|
|
475
|
+
paramsOrFirst?: { runtimes?: Runtimes[], useCases?: UseCases[], limit?: number, offset?: number, total?: boolean } | Runtimes[],
|
|
476
|
+
...rest: [(UseCases[])?, (number)?, (number)?, (boolean)?]
|
|
477
|
+
): Promise<Models.TemplateFunctionList> {
|
|
478
|
+
let params: { runtimes?: Runtimes[], useCases?: UseCases[], limit?: number, offset?: number, total?: boolean };
|
|
479
|
+
|
|
480
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('runtimes' in paramsOrFirst || 'useCases' in paramsOrFirst || 'limit' in paramsOrFirst || 'offset' in paramsOrFirst || 'total' in paramsOrFirst))) {
|
|
481
|
+
params = (paramsOrFirst || {}) as { runtimes?: Runtimes[], useCases?: UseCases[], limit?: number, offset?: number, total?: boolean };
|
|
482
|
+
} else {
|
|
483
|
+
params = {
|
|
484
|
+
runtimes: paramsOrFirst as Runtimes[],
|
|
485
|
+
useCases: rest[0] as UseCases[],
|
|
486
|
+
limit: rest[1] as number,
|
|
487
|
+
offset: rest[2] as number,
|
|
488
|
+
total: rest[3] as boolean
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
const runtimes = params.runtimes;
|
|
493
|
+
const useCases = params.useCases;
|
|
494
|
+
const limit = params.limit;
|
|
495
|
+
const offset = params.offset;
|
|
496
|
+
const total = params.total;
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
const apiPath = '/v1/apps/templates';
|
|
500
|
+
const payload: Payload = {};
|
|
501
|
+
if (typeof runtimes !== 'undefined') {
|
|
502
|
+
payload['runtimes'] = runtimes;
|
|
503
|
+
}
|
|
504
|
+
if (typeof useCases !== 'undefined') {
|
|
505
|
+
payload['useCases'] = useCases;
|
|
506
|
+
}
|
|
507
|
+
if (typeof limit !== 'undefined') {
|
|
508
|
+
payload['limit'] = limit;
|
|
509
|
+
}
|
|
510
|
+
if (typeof offset !== 'undefined') {
|
|
511
|
+
payload['offset'] = offset;
|
|
512
|
+
}
|
|
513
|
+
if (typeof total !== 'undefined') {
|
|
514
|
+
payload['total'] = total;
|
|
515
|
+
}
|
|
516
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
517
|
+
|
|
518
|
+
const apiHeaders: { [header: string]: string } = {
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
return this.client.call(
|
|
522
|
+
'get',
|
|
523
|
+
uri,
|
|
524
|
+
apiHeaders,
|
|
525
|
+
payload
|
|
526
|
+
);
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Get a single App template by its ID.
|
|
531
|
+
*
|
|
532
|
+
* @param {string} params.templateId - Template ID.
|
|
533
|
+
* @throws {RevenexxException}
|
|
534
|
+
* @returns {Promise<Models.TemplateFunction>}
|
|
535
|
+
*/
|
|
536
|
+
appsGetTemplate(params: { templateId: string }): Promise<Models.TemplateFunction>;
|
|
537
|
+
/**
|
|
538
|
+
* Get a single App template by its ID.
|
|
539
|
+
*
|
|
540
|
+
* @param {string} templateId - Template ID.
|
|
541
|
+
* @throws {RevenexxException}
|
|
542
|
+
* @returns {Promise<Models.TemplateFunction>}
|
|
543
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
544
|
+
*/
|
|
545
|
+
appsGetTemplate(templateId: string): Promise<Models.TemplateFunction>;
|
|
546
|
+
appsGetTemplate(
|
|
547
|
+
paramsOrFirst: { templateId: string } | string
|
|
548
|
+
): Promise<Models.TemplateFunction> {
|
|
549
|
+
let params: { templateId: string };
|
|
550
|
+
|
|
551
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
552
|
+
params = (paramsOrFirst || {}) as { templateId: string };
|
|
553
|
+
} else {
|
|
554
|
+
params = {
|
|
555
|
+
templateId: paramsOrFirst as string
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
const templateId = params.templateId;
|
|
560
|
+
|
|
561
|
+
if (typeof templateId === 'undefined') {
|
|
562
|
+
throw new RevenexxException('Missing required parameter: "templateId"');
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
const apiPath = '/v1/apps/templates/{templateId}'.replace('{templateId}', templateId);
|
|
566
|
+
const payload: Payload = {};
|
|
567
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
568
|
+
|
|
569
|
+
const apiHeaders: { [header: string]: string } = {
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
return this.client.call(
|
|
573
|
+
'get',
|
|
574
|
+
uri,
|
|
575
|
+
apiHeaders,
|
|
576
|
+
payload
|
|
577
|
+
);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* Get aggregated usage stats across all Apps in the project for the requested time range.
|
|
582
|
+
*
|
|
583
|
+
* @param {Range} params.range - Date range.
|
|
584
|
+
* @throws {RevenexxException}
|
|
585
|
+
* @returns {Promise<Models.UsageFunctions>}
|
|
586
|
+
*/
|
|
587
|
+
appsListUsage(params?: { range?: Range }): Promise<Models.UsageFunctions>;
|
|
588
|
+
/**
|
|
589
|
+
* Get aggregated usage stats across all Apps in the project for the requested time range.
|
|
590
|
+
*
|
|
591
|
+
* @param {Range} range - Date range.
|
|
592
|
+
* @throws {RevenexxException}
|
|
593
|
+
* @returns {Promise<Models.UsageFunctions>}
|
|
594
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
595
|
+
*/
|
|
596
|
+
appsListUsage(range?: Range): Promise<Models.UsageFunctions>;
|
|
597
|
+
appsListUsage(
|
|
598
|
+
paramsOrFirst?: { range?: Range } | Range
|
|
599
|
+
): Promise<Models.UsageFunctions> {
|
|
600
|
+
let params: { range?: Range };
|
|
601
|
+
|
|
602
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
603
|
+
params = (paramsOrFirst || {}) as { range?: Range };
|
|
604
|
+
} else {
|
|
605
|
+
params = {
|
|
606
|
+
range: paramsOrFirst as Range
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
const range = params.range;
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
const apiPath = '/v1/apps/usage';
|
|
614
|
+
const payload: Payload = {};
|
|
615
|
+
if (typeof range !== 'undefined') {
|
|
616
|
+
payload['range'] = range;
|
|
617
|
+
}
|
|
618
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
619
|
+
|
|
620
|
+
const apiHeaders: { [header: string]: string } = {
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
return this.client.call(
|
|
624
|
+
'get',
|
|
625
|
+
uri,
|
|
626
|
+
apiHeaders,
|
|
627
|
+
payload
|
|
628
|
+
);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* Delete an App and all of its deployments. Cascades to the App Registry — Console removes the matching `RegisteredApp` row.
|
|
633
|
+
*
|
|
634
|
+
* @param {string} params.functionId - App ID.
|
|
635
|
+
* @throws {RevenexxException}
|
|
636
|
+
* @returns {Promise<{}>}
|
|
637
|
+
*/
|
|
638
|
+
appsDelete(params: { functionId: string }): Promise<{}>;
|
|
639
|
+
/**
|
|
640
|
+
* Delete an App and all of its deployments. Cascades to the App Registry — Console removes the matching `RegisteredApp` row.
|
|
641
|
+
*
|
|
642
|
+
* @param {string} functionId - App ID.
|
|
643
|
+
* @throws {RevenexxException}
|
|
644
|
+
* @returns {Promise<{}>}
|
|
645
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
646
|
+
*/
|
|
647
|
+
appsDelete(functionId: string): Promise<{}>;
|
|
648
|
+
appsDelete(
|
|
649
|
+
paramsOrFirst: { functionId: string } | string
|
|
650
|
+
): Promise<{}> {
|
|
651
|
+
let params: { functionId: string };
|
|
652
|
+
|
|
653
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
654
|
+
params = (paramsOrFirst || {}) as { functionId: string };
|
|
655
|
+
} else {
|
|
656
|
+
params = {
|
|
657
|
+
functionId: paramsOrFirst as string
|
|
658
|
+
};
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
const functionId = params.functionId;
|
|
662
|
+
|
|
663
|
+
if (typeof functionId === 'undefined') {
|
|
664
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
const apiPath = '/v1/apps/{functionId}'.replace('{functionId}', functionId);
|
|
668
|
+
const payload: Payload = {};
|
|
669
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
670
|
+
|
|
671
|
+
const apiHeaders: { [header: string]: string } = {
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
return this.client.call(
|
|
675
|
+
'delete',
|
|
676
|
+
uri,
|
|
677
|
+
apiHeaders,
|
|
678
|
+
payload
|
|
679
|
+
);
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* Get an App by its unique ID.
|
|
684
|
+
*
|
|
685
|
+
* @param {string} params.functionId - Function ID.
|
|
686
|
+
* @throws {RevenexxException}
|
|
687
|
+
* @returns {Promise<Models.Function>}
|
|
688
|
+
*/
|
|
689
|
+
appsGet(params: { functionId: string }): Promise<Models.Function>;
|
|
690
|
+
/**
|
|
691
|
+
* Get an App by its unique ID.
|
|
692
|
+
*
|
|
693
|
+
* @param {string} functionId - Function ID.
|
|
694
|
+
* @throws {RevenexxException}
|
|
695
|
+
* @returns {Promise<Models.Function>}
|
|
696
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
697
|
+
*/
|
|
698
|
+
appsGet(functionId: string): Promise<Models.Function>;
|
|
699
|
+
appsGet(
|
|
700
|
+
paramsOrFirst: { functionId: string } | string
|
|
701
|
+
): Promise<Models.Function> {
|
|
702
|
+
let params: { functionId: string };
|
|
703
|
+
|
|
704
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
705
|
+
params = (paramsOrFirst || {}) as { functionId: string };
|
|
706
|
+
} else {
|
|
707
|
+
params = {
|
|
708
|
+
functionId: paramsOrFirst as string
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
const functionId = params.functionId;
|
|
713
|
+
|
|
714
|
+
if (typeof functionId === 'undefined') {
|
|
715
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
const apiPath = '/v1/apps/{functionId}'.replace('{functionId}', functionId);
|
|
719
|
+
const payload: Payload = {};
|
|
720
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
721
|
+
|
|
722
|
+
const apiHeaders: { [header: string]: string } = {
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
return this.client.call(
|
|
726
|
+
'get',
|
|
727
|
+
uri,
|
|
728
|
+
apiHeaders,
|
|
729
|
+
payload
|
|
730
|
+
);
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* Update an App. Use this endpoint to rename, change runtime, schedule, environment variables and other configuration.
|
|
735
|
+
*
|
|
736
|
+
* @param {string} params.functionId - Function ID.
|
|
737
|
+
* @param {string} params.name - Function name. Max length: 128 chars.
|
|
738
|
+
* @param {string} params.commands - Build Commands.
|
|
739
|
+
* @param {boolean} params.enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
|
|
740
|
+
* @param {string} params.entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory".
|
|
741
|
+
* @param {string[]} params.events - Events list. Maximum of 100 events are allowed.
|
|
742
|
+
* @param {string[]} params.execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
|
|
743
|
+
* @param {string} params.installationId - Appwrite Installation ID for VCS (Version Controle System) deployment.
|
|
744
|
+
* @param {boolean} params.logging - When disabled, executions will exclude logs and errors, and will be slightly faster.
|
|
745
|
+
* @param {string} params.providerBranch - Production branch for the repo linked to the function
|
|
746
|
+
* @param {string} params.providerRepositoryId - Repository ID of the repo linked to the function
|
|
747
|
+
* @param {string} params.providerRootDirectory - Path to function code in the linked repo.
|
|
748
|
+
* @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
|
|
749
|
+
* @param {Runtime} params.runtime - Execution runtime.
|
|
750
|
+
* @param {string} params.schedule - Schedule CRON syntax.
|
|
751
|
+
* @param {Scopes[]} params.scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.
|
|
752
|
+
* @param {string} params.specification - Runtime specification for the function and builds.
|
|
753
|
+
* @param {number} params.timeout - Maximum execution time in seconds.
|
|
754
|
+
* @throws {RevenexxException}
|
|
755
|
+
* @returns {Promise<Models.Function>}
|
|
756
|
+
*/
|
|
757
|
+
appsUpdate(params: { functionId: string, name: string, commands?: string, enabled?: boolean, entrypoint?: string, events?: string[], execute?: string[], installationId?: string, logging?: boolean, providerBranch?: string, providerRepositoryId?: string, providerRootDirectory?: string, providerSilentMode?: boolean, runtime?: Runtime, schedule?: string, scopes?: Scopes[], specification?: string, timeout?: number }): Promise<Models.Function>;
|
|
758
|
+
/**
|
|
759
|
+
* Update an App. Use this endpoint to rename, change runtime, schedule, environment variables and other configuration.
|
|
760
|
+
*
|
|
761
|
+
* @param {string} functionId - Function ID.
|
|
762
|
+
* @param {string} name - Function name. Max length: 128 chars.
|
|
763
|
+
* @param {string} commands - Build Commands.
|
|
764
|
+
* @param {boolean} enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
|
|
765
|
+
* @param {string} entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory".
|
|
766
|
+
* @param {string[]} events - Events list. Maximum of 100 events are allowed.
|
|
767
|
+
* @param {string[]} execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
|
|
768
|
+
* @param {string} installationId - Appwrite Installation ID for VCS (Version Controle System) deployment.
|
|
769
|
+
* @param {boolean} logging - When disabled, executions will exclude logs and errors, and will be slightly faster.
|
|
770
|
+
* @param {string} providerBranch - Production branch for the repo linked to the function
|
|
771
|
+
* @param {string} providerRepositoryId - Repository ID of the repo linked to the function
|
|
772
|
+
* @param {string} providerRootDirectory - Path to function code in the linked repo.
|
|
773
|
+
* @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
|
|
774
|
+
* @param {Runtime} runtime - Execution runtime.
|
|
775
|
+
* @param {string} schedule - Schedule CRON syntax.
|
|
776
|
+
* @param {Scopes[]} scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.
|
|
777
|
+
* @param {string} specification - Runtime specification for the function and builds.
|
|
778
|
+
* @param {number} timeout - Maximum execution time in seconds.
|
|
779
|
+
* @throws {RevenexxException}
|
|
780
|
+
* @returns {Promise<Models.Function>}
|
|
781
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
782
|
+
*/
|
|
783
|
+
appsUpdate(functionId: string, name: string, commands?: string, enabled?: boolean, entrypoint?: string, events?: string[], execute?: string[], installationId?: string, logging?: boolean, providerBranch?: string, providerRepositoryId?: string, providerRootDirectory?: string, providerSilentMode?: boolean, runtime?: Runtime, schedule?: string, scopes?: Scopes[], specification?: string, timeout?: number): Promise<Models.Function>;
|
|
784
|
+
appsUpdate(
|
|
785
|
+
paramsOrFirst: { functionId: string, name: string, commands?: string, enabled?: boolean, entrypoint?: string, events?: string[], execute?: string[], installationId?: string, logging?: boolean, providerBranch?: string, providerRepositoryId?: string, providerRootDirectory?: string, providerSilentMode?: boolean, runtime?: Runtime, schedule?: string, scopes?: Scopes[], specification?: string, timeout?: number } | string,
|
|
786
|
+
...rest: [(string)?, (string)?, (boolean)?, (string)?, (string[])?, (string[])?, (string)?, (boolean)?, (string)?, (string)?, (string)?, (boolean)?, (Runtime)?, (string)?, (Scopes[])?, (string)?, (number)?]
|
|
787
|
+
): Promise<Models.Function> {
|
|
788
|
+
let params: { functionId: string, name: string, commands?: string, enabled?: boolean, entrypoint?: string, events?: string[], execute?: string[], installationId?: string, logging?: boolean, providerBranch?: string, providerRepositoryId?: string, providerRootDirectory?: string, providerSilentMode?: boolean, runtime?: Runtime, schedule?: string, scopes?: Scopes[], specification?: string, timeout?: number };
|
|
789
|
+
|
|
790
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
791
|
+
params = (paramsOrFirst || {}) as { functionId: string, name: string, commands?: string, enabled?: boolean, entrypoint?: string, events?: string[], execute?: string[], installationId?: string, logging?: boolean, providerBranch?: string, providerRepositoryId?: string, providerRootDirectory?: string, providerSilentMode?: boolean, runtime?: Runtime, schedule?: string, scopes?: Scopes[], specification?: string, timeout?: number };
|
|
792
|
+
} else {
|
|
793
|
+
params = {
|
|
794
|
+
functionId: paramsOrFirst as string,
|
|
795
|
+
name: rest[0] as string,
|
|
796
|
+
commands: rest[1] as string,
|
|
797
|
+
enabled: rest[2] as boolean,
|
|
798
|
+
entrypoint: rest[3] as string,
|
|
799
|
+
events: rest[4] as string[],
|
|
800
|
+
execute: rest[5] as string[],
|
|
801
|
+
installationId: rest[6] as string,
|
|
802
|
+
logging: rest[7] as boolean,
|
|
803
|
+
providerBranch: rest[8] as string,
|
|
804
|
+
providerRepositoryId: rest[9] as string,
|
|
805
|
+
providerRootDirectory: rest[10] as string,
|
|
806
|
+
providerSilentMode: rest[11] as boolean,
|
|
807
|
+
runtime: rest[12] as Runtime,
|
|
808
|
+
schedule: rest[13] as string,
|
|
809
|
+
scopes: rest[14] as Scopes[],
|
|
810
|
+
specification: rest[15] as string,
|
|
811
|
+
timeout: rest[16] as number
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
const functionId = params.functionId;
|
|
816
|
+
const name = params.name;
|
|
817
|
+
const commands = params.commands;
|
|
818
|
+
const enabled = params.enabled;
|
|
819
|
+
const entrypoint = params.entrypoint;
|
|
820
|
+
const events = params.events;
|
|
821
|
+
const execute = params.execute;
|
|
822
|
+
const installationId = params.installationId;
|
|
823
|
+
const logging = params.logging;
|
|
824
|
+
const providerBranch = params.providerBranch;
|
|
825
|
+
const providerRepositoryId = params.providerRepositoryId;
|
|
826
|
+
const providerRootDirectory = params.providerRootDirectory;
|
|
827
|
+
const providerSilentMode = params.providerSilentMode;
|
|
828
|
+
const runtime = params.runtime;
|
|
829
|
+
const schedule = params.schedule;
|
|
830
|
+
const scopes = params.scopes;
|
|
831
|
+
const specification = params.specification;
|
|
832
|
+
const timeout = params.timeout;
|
|
833
|
+
|
|
834
|
+
if (typeof functionId === 'undefined') {
|
|
835
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
836
|
+
}
|
|
837
|
+
if (typeof name === 'undefined') {
|
|
838
|
+
throw new RevenexxException('Missing required parameter: "name"');
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
const apiPath = '/v1/apps/{functionId}'.replace('{functionId}', functionId);
|
|
842
|
+
const payload: Payload = {};
|
|
843
|
+
if (typeof commands !== 'undefined') {
|
|
844
|
+
payload['commands'] = commands;
|
|
845
|
+
}
|
|
846
|
+
if (typeof enabled !== 'undefined') {
|
|
847
|
+
payload['enabled'] = enabled;
|
|
848
|
+
}
|
|
849
|
+
if (typeof entrypoint !== 'undefined') {
|
|
850
|
+
payload['entrypoint'] = entrypoint;
|
|
851
|
+
}
|
|
852
|
+
if (typeof events !== 'undefined') {
|
|
853
|
+
payload['events'] = events;
|
|
854
|
+
}
|
|
855
|
+
if (typeof execute !== 'undefined') {
|
|
856
|
+
payload['execute'] = execute;
|
|
857
|
+
}
|
|
858
|
+
if (typeof installationId !== 'undefined') {
|
|
859
|
+
payload['installationId'] = installationId;
|
|
860
|
+
}
|
|
861
|
+
if (typeof logging !== 'undefined') {
|
|
862
|
+
payload['logging'] = logging;
|
|
863
|
+
}
|
|
864
|
+
if (typeof name !== 'undefined') {
|
|
865
|
+
payload['name'] = name;
|
|
866
|
+
}
|
|
867
|
+
if (typeof providerBranch !== 'undefined') {
|
|
868
|
+
payload['providerBranch'] = providerBranch;
|
|
869
|
+
}
|
|
870
|
+
if (typeof providerRepositoryId !== 'undefined') {
|
|
871
|
+
payload['providerRepositoryId'] = providerRepositoryId;
|
|
872
|
+
}
|
|
873
|
+
if (typeof providerRootDirectory !== 'undefined') {
|
|
874
|
+
payload['providerRootDirectory'] = providerRootDirectory;
|
|
875
|
+
}
|
|
876
|
+
if (typeof providerSilentMode !== 'undefined') {
|
|
877
|
+
payload['providerSilentMode'] = providerSilentMode;
|
|
878
|
+
}
|
|
879
|
+
if (typeof runtime !== 'undefined') {
|
|
880
|
+
payload['runtime'] = runtime;
|
|
881
|
+
}
|
|
882
|
+
if (typeof schedule !== 'undefined') {
|
|
883
|
+
payload['schedule'] = schedule;
|
|
884
|
+
}
|
|
885
|
+
if (typeof scopes !== 'undefined') {
|
|
886
|
+
payload['scopes'] = scopes;
|
|
887
|
+
}
|
|
888
|
+
if (typeof specification !== 'undefined') {
|
|
889
|
+
payload['specification'] = specification;
|
|
890
|
+
}
|
|
891
|
+
if (typeof timeout !== 'undefined') {
|
|
892
|
+
payload['timeout'] = timeout;
|
|
893
|
+
}
|
|
894
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
895
|
+
|
|
896
|
+
const apiHeaders: { [header: string]: string } = {
|
|
897
|
+
'content-type': 'application/json',
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
return this.client.call(
|
|
901
|
+
'put',
|
|
902
|
+
uri,
|
|
903
|
+
apiHeaders,
|
|
904
|
+
payload
|
|
905
|
+
);
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
/**
|
|
909
|
+
* Set the active deployment for an App. The chosen deployment must already be `ready`.
|
|
910
|
+
*
|
|
911
|
+
* @param {string} params.functionId - Function ID.
|
|
912
|
+
* @param {string} params.deploymentId - Deployment ID.
|
|
913
|
+
* @throws {RevenexxException}
|
|
914
|
+
* @returns {Promise<Models.Function>}
|
|
915
|
+
*/
|
|
916
|
+
appsUpdateDeployment(params: { functionId: string, deploymentId: string }): Promise<Models.Function>;
|
|
917
|
+
/**
|
|
918
|
+
* Set the active deployment for an App. The chosen deployment must already be `ready`.
|
|
919
|
+
*
|
|
920
|
+
* @param {string} functionId - Function ID.
|
|
921
|
+
* @param {string} deploymentId - Deployment ID.
|
|
922
|
+
* @throws {RevenexxException}
|
|
923
|
+
* @returns {Promise<Models.Function>}
|
|
924
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
925
|
+
*/
|
|
926
|
+
appsUpdateDeployment(functionId: string, deploymentId: string): Promise<Models.Function>;
|
|
927
|
+
appsUpdateDeployment(
|
|
928
|
+
paramsOrFirst: { functionId: string, deploymentId: string } | string,
|
|
929
|
+
...rest: [(string)?]
|
|
930
|
+
): Promise<Models.Function> {
|
|
931
|
+
let params: { functionId: string, deploymentId: string };
|
|
932
|
+
|
|
933
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
934
|
+
params = (paramsOrFirst || {}) as { functionId: string, deploymentId: string };
|
|
935
|
+
} else {
|
|
936
|
+
params = {
|
|
937
|
+
functionId: paramsOrFirst as string,
|
|
938
|
+
deploymentId: rest[0] as string
|
|
939
|
+
};
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
const functionId = params.functionId;
|
|
943
|
+
const deploymentId = params.deploymentId;
|
|
944
|
+
|
|
945
|
+
if (typeof functionId === 'undefined') {
|
|
946
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
947
|
+
}
|
|
948
|
+
if (typeof deploymentId === 'undefined') {
|
|
949
|
+
throw new RevenexxException('Missing required parameter: "deploymentId"');
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
const apiPath = '/v1/apps/{functionId}/deployment'.replace('{functionId}', functionId);
|
|
953
|
+
const payload: Payload = {};
|
|
954
|
+
if (typeof deploymentId !== 'undefined') {
|
|
955
|
+
payload['deploymentId'] = deploymentId;
|
|
956
|
+
}
|
|
957
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
958
|
+
|
|
959
|
+
const apiHeaders: { [header: string]: string } = {
|
|
960
|
+
'content-type': 'application/json',
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
return this.client.call(
|
|
964
|
+
'patch',
|
|
965
|
+
uri,
|
|
966
|
+
apiHeaders,
|
|
967
|
+
payload
|
|
968
|
+
);
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
/**
|
|
972
|
+
* List the deployment history of an App.
|
|
973
|
+
*
|
|
974
|
+
* @param {string} params.functionId - Function ID.
|
|
975
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
|
|
976
|
+
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
977
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
978
|
+
* @throws {RevenexxException}
|
|
979
|
+
* @returns {Promise<Models.DeploymentList>}
|
|
980
|
+
*/
|
|
981
|
+
appsListDeployments(params: { functionId: string, queries?: string[], search?: string, total?: boolean }): Promise<Models.DeploymentList>;
|
|
982
|
+
/**
|
|
983
|
+
* List the deployment history of an App.
|
|
984
|
+
*
|
|
985
|
+
* @param {string} functionId - Function ID.
|
|
986
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
|
|
987
|
+
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
988
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
989
|
+
* @throws {RevenexxException}
|
|
990
|
+
* @returns {Promise<Models.DeploymentList>}
|
|
991
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
992
|
+
*/
|
|
993
|
+
appsListDeployments(functionId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.DeploymentList>;
|
|
994
|
+
appsListDeployments(
|
|
995
|
+
paramsOrFirst: { functionId: string, queries?: string[], search?: string, total?: boolean } | string,
|
|
996
|
+
...rest: [(string[])?, (string)?, (boolean)?]
|
|
997
|
+
): Promise<Models.DeploymentList> {
|
|
998
|
+
let params: { functionId: string, queries?: string[], search?: string, total?: boolean };
|
|
999
|
+
|
|
1000
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1001
|
+
params = (paramsOrFirst || {}) as { functionId: string, queries?: string[], search?: string, total?: boolean };
|
|
1002
|
+
} else {
|
|
1003
|
+
params = {
|
|
1004
|
+
functionId: paramsOrFirst as string,
|
|
1005
|
+
queries: rest[0] as string[],
|
|
1006
|
+
search: rest[1] as string,
|
|
1007
|
+
total: rest[2] as boolean
|
|
1008
|
+
};
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
const functionId = params.functionId;
|
|
1012
|
+
const queries = params.queries;
|
|
1013
|
+
const search = params.search;
|
|
1014
|
+
const total = params.total;
|
|
1015
|
+
|
|
1016
|
+
if (typeof functionId === 'undefined') {
|
|
1017
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
const apiPath = '/v1/apps/{functionId}/deployments'.replace('{functionId}', functionId);
|
|
1021
|
+
const payload: Payload = {};
|
|
1022
|
+
if (typeof queries !== 'undefined') {
|
|
1023
|
+
payload['queries'] = queries;
|
|
1024
|
+
}
|
|
1025
|
+
if (typeof search !== 'undefined') {
|
|
1026
|
+
payload['search'] = search;
|
|
1027
|
+
}
|
|
1028
|
+
if (typeof total !== 'undefined') {
|
|
1029
|
+
payload['total'] = total;
|
|
1030
|
+
}
|
|
1031
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1032
|
+
|
|
1033
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
return this.client.call(
|
|
1037
|
+
'get',
|
|
1038
|
+
uri,
|
|
1039
|
+
apiHeaders,
|
|
1040
|
+
payload
|
|
1041
|
+
);
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
/**
|
|
1045
|
+
* Upload a new code deployment for an App. Accepts a `.tar.gz`
|
|
1046
|
+
* archive containing the App source. Phase 2 will extract the
|
|
1047
|
+
* manifest from this archive and validate it against the App
|
|
1048
|
+
* Registry before kicking off the build.
|
|
1049
|
+
*
|
|
1050
|
+
* @param {string} params.functionId - Function ID.
|
|
1051
|
+
* @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
|
|
1052
|
+
* @param {string} params.code - Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.
|
|
1053
|
+
* @param {string} params.commands - Build Commands.
|
|
1054
|
+
* @param {string} params.entrypoint - Entrypoint File.
|
|
1055
|
+
* @throws {RevenexxException}
|
|
1056
|
+
* @returns {Promise<Models.Deployment>}
|
|
1057
|
+
*/
|
|
1058
|
+
appsCreateDeployment(params: { functionId: string, activate: boolean, code: string, commands?: string, entrypoint?: string, onProgress?: (progress: UploadProgress) => void }): Promise<Models.Deployment>;
|
|
1059
|
+
/**
|
|
1060
|
+
* Upload a new code deployment for an App. Accepts a `.tar.gz`
|
|
1061
|
+
* archive containing the App source. Phase 2 will extract the
|
|
1062
|
+
* manifest from this archive and validate it against the App
|
|
1063
|
+
* Registry before kicking off the build.
|
|
1064
|
+
*
|
|
1065
|
+
* @param {string} functionId - Function ID.
|
|
1066
|
+
* @param {boolean} activate - Automatically activate the deployment when it is finished building.
|
|
1067
|
+
* @param {string} code - Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.
|
|
1068
|
+
* @param {string} commands - Build Commands.
|
|
1069
|
+
* @param {string} entrypoint - Entrypoint File.
|
|
1070
|
+
* @throws {RevenexxException}
|
|
1071
|
+
* @returns {Promise<Models.Deployment>}
|
|
1072
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1073
|
+
*/
|
|
1074
|
+
appsCreateDeployment(functionId: string, activate: boolean, code: string, commands?: string, entrypoint?: string, onProgress?: (progress: UploadProgress) => void): Promise<Models.Deployment>;
|
|
1075
|
+
appsCreateDeployment(
|
|
1076
|
+
paramsOrFirst: { functionId: string, activate: boolean, code: string, commands?: string, entrypoint?: string, onProgress?: (progress: UploadProgress) => void } | string,
|
|
1077
|
+
...rest: [(boolean)?, (string)?, (string)?, (string)?,((progress: UploadProgress) => void)?]
|
|
1078
|
+
): Promise<Models.Deployment> {
|
|
1079
|
+
let params: { functionId: string, activate: boolean, code: string, commands?: string, entrypoint?: string };
|
|
1080
|
+
let onProgress: ((progress: UploadProgress) => void);
|
|
1081
|
+
|
|
1082
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1083
|
+
params = (paramsOrFirst || {}) as { functionId: string, activate: boolean, code: string, commands?: string, entrypoint?: string };
|
|
1084
|
+
onProgress = paramsOrFirst?.onProgress as ((progress: UploadProgress) => void);
|
|
1085
|
+
} else {
|
|
1086
|
+
params = {
|
|
1087
|
+
functionId: paramsOrFirst as string,
|
|
1088
|
+
activate: rest[0] as boolean,
|
|
1089
|
+
code: rest[1] as string,
|
|
1090
|
+
commands: rest[2] as string,
|
|
1091
|
+
entrypoint: rest[3] as string
|
|
1092
|
+
};
|
|
1093
|
+
onProgress = rest[4] as ((progress: UploadProgress) => void);
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
const functionId = params.functionId;
|
|
1097
|
+
const activate = params.activate;
|
|
1098
|
+
const code = params.code;
|
|
1099
|
+
const commands = params.commands;
|
|
1100
|
+
const entrypoint = params.entrypoint;
|
|
1101
|
+
|
|
1102
|
+
if (typeof functionId === 'undefined') {
|
|
1103
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
1104
|
+
}
|
|
1105
|
+
if (typeof activate === 'undefined') {
|
|
1106
|
+
throw new RevenexxException('Missing required parameter: "activate"');
|
|
1107
|
+
}
|
|
1108
|
+
if (typeof code === 'undefined') {
|
|
1109
|
+
throw new RevenexxException('Missing required parameter: "code"');
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
const apiPath = '/v1/apps/{functionId}/deployments'.replace('{functionId}', functionId);
|
|
1113
|
+
const payload: Payload = {};
|
|
1114
|
+
if (typeof activate !== 'undefined') {
|
|
1115
|
+
payload['activate'] = activate;
|
|
1116
|
+
}
|
|
1117
|
+
if (typeof code !== 'undefined') {
|
|
1118
|
+
payload['code'] = code;
|
|
1119
|
+
}
|
|
1120
|
+
if (typeof commands !== 'undefined') {
|
|
1121
|
+
payload['commands'] = commands;
|
|
1122
|
+
}
|
|
1123
|
+
if (typeof entrypoint !== 'undefined') {
|
|
1124
|
+
payload['entrypoint'] = entrypoint;
|
|
1125
|
+
}
|
|
1126
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1127
|
+
|
|
1128
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1129
|
+
'content-type': 'multipart/form-data',
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
return this.client.chunkedUpload(
|
|
1133
|
+
'post',
|
|
1134
|
+
uri,
|
|
1135
|
+
apiHeaders,
|
|
1136
|
+
payload,
|
|
1137
|
+
onProgress
|
|
1138
|
+
);
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
/**
|
|
1142
|
+
* Re-deploy an existing build under a new deployment ID. Useful for promoting a known-good preview build to production without rebuilding.
|
|
1143
|
+
*
|
|
1144
|
+
* @param {string} params.functionId - Function ID.
|
|
1145
|
+
* @param {string} params.deploymentId - Deployment ID.
|
|
1146
|
+
* @param {string} params.buildId - Build unique ID.
|
|
1147
|
+
* @throws {RevenexxException}
|
|
1148
|
+
* @returns {Promise<Models.Deployment>}
|
|
1149
|
+
*/
|
|
1150
|
+
appsCreateDuplicateDeployment(params: { functionId: string, deploymentId: string, buildId?: string }): Promise<Models.Deployment>;
|
|
1151
|
+
/**
|
|
1152
|
+
* Re-deploy an existing build under a new deployment ID. Useful for promoting a known-good preview build to production without rebuilding.
|
|
1153
|
+
*
|
|
1154
|
+
* @param {string} functionId - Function ID.
|
|
1155
|
+
* @param {string} deploymentId - Deployment ID.
|
|
1156
|
+
* @param {string} buildId - Build unique ID.
|
|
1157
|
+
* @throws {RevenexxException}
|
|
1158
|
+
* @returns {Promise<Models.Deployment>}
|
|
1159
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1160
|
+
*/
|
|
1161
|
+
appsCreateDuplicateDeployment(functionId: string, deploymentId: string, buildId?: string): Promise<Models.Deployment>;
|
|
1162
|
+
appsCreateDuplicateDeployment(
|
|
1163
|
+
paramsOrFirst: { functionId: string, deploymentId: string, buildId?: string } | string,
|
|
1164
|
+
...rest: [(string)?, (string)?]
|
|
1165
|
+
): Promise<Models.Deployment> {
|
|
1166
|
+
let params: { functionId: string, deploymentId: string, buildId?: string };
|
|
1167
|
+
|
|
1168
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1169
|
+
params = (paramsOrFirst || {}) as { functionId: string, deploymentId: string, buildId?: string };
|
|
1170
|
+
} else {
|
|
1171
|
+
params = {
|
|
1172
|
+
functionId: paramsOrFirst as string,
|
|
1173
|
+
deploymentId: rest[0] as string,
|
|
1174
|
+
buildId: rest[1] as string
|
|
1175
|
+
};
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
const functionId = params.functionId;
|
|
1179
|
+
const deploymentId = params.deploymentId;
|
|
1180
|
+
const buildId = params.buildId;
|
|
1181
|
+
|
|
1182
|
+
if (typeof functionId === 'undefined') {
|
|
1183
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
1184
|
+
}
|
|
1185
|
+
if (typeof deploymentId === 'undefined') {
|
|
1186
|
+
throw new RevenexxException('Missing required parameter: "deploymentId"');
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
const apiPath = '/v1/apps/{functionId}/deployments/duplicate'.replace('{functionId}', functionId);
|
|
1190
|
+
const payload: Payload = {};
|
|
1191
|
+
if (typeof buildId !== 'undefined') {
|
|
1192
|
+
payload['buildId'] = buildId;
|
|
1193
|
+
}
|
|
1194
|
+
if (typeof deploymentId !== 'undefined') {
|
|
1195
|
+
payload['deploymentId'] = deploymentId;
|
|
1196
|
+
}
|
|
1197
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1198
|
+
|
|
1199
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1200
|
+
'content-type': 'application/json',
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
return this.client.call(
|
|
1204
|
+
'post',
|
|
1205
|
+
uri,
|
|
1206
|
+
apiHeaders,
|
|
1207
|
+
payload
|
|
1208
|
+
);
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
/**
|
|
1212
|
+
* Create a new App deployment from a template in the App Templates catalogue.
|
|
1213
|
+
*
|
|
1214
|
+
* @param {string} params.functionId - Function ID.
|
|
1215
|
+
* @param {string} params.owner - The name of the owner of the template.
|
|
1216
|
+
* @param {string} params.reference - Reference value, can be a commit hash, branch name, or release tag
|
|
1217
|
+
* @param {string} params.repository - Repository name of the template.
|
|
1218
|
+
* @param {string} params.rootDirectory - Path to function code in the template repo.
|
|
1219
|
+
* @param {Type} params.type - Type for the reference provided. Can be commit, branch, or tag
|
|
1220
|
+
* @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
|
|
1221
|
+
* @throws {RevenexxException}
|
|
1222
|
+
* @returns {Promise<Models.Deployment>}
|
|
1223
|
+
*/
|
|
1224
|
+
appsCreateTemplateDeployment(params: { functionId: string, owner: string, reference: string, repository: string, rootDirectory: string, type: Type, activate?: boolean }): Promise<Models.Deployment>;
|
|
1225
|
+
/**
|
|
1226
|
+
* Create a new App deployment from a template in the App Templates catalogue.
|
|
1227
|
+
*
|
|
1228
|
+
* @param {string} functionId - Function ID.
|
|
1229
|
+
* @param {string} owner - The name of the owner of the template.
|
|
1230
|
+
* @param {string} reference - Reference value, can be a commit hash, branch name, or release tag
|
|
1231
|
+
* @param {string} repository - Repository name of the template.
|
|
1232
|
+
* @param {string} rootDirectory - Path to function code in the template repo.
|
|
1233
|
+
* @param {Type} type - Type for the reference provided. Can be commit, branch, or tag
|
|
1234
|
+
* @param {boolean} activate - Automatically activate the deployment when it is finished building.
|
|
1235
|
+
* @throws {RevenexxException}
|
|
1236
|
+
* @returns {Promise<Models.Deployment>}
|
|
1237
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1238
|
+
*/
|
|
1239
|
+
appsCreateTemplateDeployment(functionId: string, owner: string, reference: string, repository: string, rootDirectory: string, type: Type, activate?: boolean): Promise<Models.Deployment>;
|
|
1240
|
+
appsCreateTemplateDeployment(
|
|
1241
|
+
paramsOrFirst: { functionId: string, owner: string, reference: string, repository: string, rootDirectory: string, type: Type, activate?: boolean } | string,
|
|
1242
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (Type)?, (boolean)?]
|
|
1243
|
+
): Promise<Models.Deployment> {
|
|
1244
|
+
let params: { functionId: string, owner: string, reference: string, repository: string, rootDirectory: string, type: Type, activate?: boolean };
|
|
1245
|
+
|
|
1246
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1247
|
+
params = (paramsOrFirst || {}) as { functionId: string, owner: string, reference: string, repository: string, rootDirectory: string, type: Type, activate?: boolean };
|
|
1248
|
+
} else {
|
|
1249
|
+
params = {
|
|
1250
|
+
functionId: paramsOrFirst as string,
|
|
1251
|
+
owner: rest[0] as string,
|
|
1252
|
+
reference: rest[1] as string,
|
|
1253
|
+
repository: rest[2] as string,
|
|
1254
|
+
rootDirectory: rest[3] as string,
|
|
1255
|
+
type: rest[4] as Type,
|
|
1256
|
+
activate: rest[5] as boolean
|
|
1257
|
+
};
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
const functionId = params.functionId;
|
|
1261
|
+
const owner = params.owner;
|
|
1262
|
+
const reference = params.reference;
|
|
1263
|
+
const repository = params.repository;
|
|
1264
|
+
const rootDirectory = params.rootDirectory;
|
|
1265
|
+
const type = params.type;
|
|
1266
|
+
const activate = params.activate;
|
|
1267
|
+
|
|
1268
|
+
if (typeof functionId === 'undefined') {
|
|
1269
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
1270
|
+
}
|
|
1271
|
+
if (typeof owner === 'undefined') {
|
|
1272
|
+
throw new RevenexxException('Missing required parameter: "owner"');
|
|
1273
|
+
}
|
|
1274
|
+
if (typeof reference === 'undefined') {
|
|
1275
|
+
throw new RevenexxException('Missing required parameter: "reference"');
|
|
1276
|
+
}
|
|
1277
|
+
if (typeof repository === 'undefined') {
|
|
1278
|
+
throw new RevenexxException('Missing required parameter: "repository"');
|
|
1279
|
+
}
|
|
1280
|
+
if (typeof rootDirectory === 'undefined') {
|
|
1281
|
+
throw new RevenexxException('Missing required parameter: "rootDirectory"');
|
|
1282
|
+
}
|
|
1283
|
+
if (typeof type === 'undefined') {
|
|
1284
|
+
throw new RevenexxException('Missing required parameter: "type"');
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
const apiPath = '/v1/apps/{functionId}/deployments/template'.replace('{functionId}', functionId);
|
|
1288
|
+
const payload: Payload = {};
|
|
1289
|
+
if (typeof activate !== 'undefined') {
|
|
1290
|
+
payload['activate'] = activate;
|
|
1291
|
+
}
|
|
1292
|
+
if (typeof owner !== 'undefined') {
|
|
1293
|
+
payload['owner'] = owner;
|
|
1294
|
+
}
|
|
1295
|
+
if (typeof reference !== 'undefined') {
|
|
1296
|
+
payload['reference'] = reference;
|
|
1297
|
+
}
|
|
1298
|
+
if (typeof repository !== 'undefined') {
|
|
1299
|
+
payload['repository'] = repository;
|
|
1300
|
+
}
|
|
1301
|
+
if (typeof rootDirectory !== 'undefined') {
|
|
1302
|
+
payload['rootDirectory'] = rootDirectory;
|
|
1303
|
+
}
|
|
1304
|
+
if (typeof type !== 'undefined') {
|
|
1305
|
+
payload['type'] = type;
|
|
1306
|
+
}
|
|
1307
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1308
|
+
|
|
1309
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1310
|
+
'content-type': 'application/json',
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
return this.client.call(
|
|
1314
|
+
'post',
|
|
1315
|
+
uri,
|
|
1316
|
+
apiHeaders,
|
|
1317
|
+
payload
|
|
1318
|
+
);
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
/**
|
|
1322
|
+
* Trigger a new deployment from the App's connected Git repository.
|
|
1323
|
+
*
|
|
1324
|
+
* @param {string} params.functionId - Function ID.
|
|
1325
|
+
* @param {string} params.reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
|
|
1326
|
+
* @param {Type} params.type - Type of reference passed. Allowed values are: branch, commit
|
|
1327
|
+
* @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
|
|
1328
|
+
* @throws {RevenexxException}
|
|
1329
|
+
* @returns {Promise<Models.Deployment>}
|
|
1330
|
+
*/
|
|
1331
|
+
appsCreateVcsDeployment(params: { functionId: string, reference: string, type: Type, activate?: boolean }): Promise<Models.Deployment>;
|
|
1332
|
+
/**
|
|
1333
|
+
* Trigger a new deployment from the App's connected Git repository.
|
|
1334
|
+
*
|
|
1335
|
+
* @param {string} functionId - Function ID.
|
|
1336
|
+
* @param {string} reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
|
|
1337
|
+
* @param {Type} type - Type of reference passed. Allowed values are: branch, commit
|
|
1338
|
+
* @param {boolean} activate - Automatically activate the deployment when it is finished building.
|
|
1339
|
+
* @throws {RevenexxException}
|
|
1340
|
+
* @returns {Promise<Models.Deployment>}
|
|
1341
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1342
|
+
*/
|
|
1343
|
+
appsCreateVcsDeployment(functionId: string, reference: string, type: Type, activate?: boolean): Promise<Models.Deployment>;
|
|
1344
|
+
appsCreateVcsDeployment(
|
|
1345
|
+
paramsOrFirst: { functionId: string, reference: string, type: Type, activate?: boolean } | string,
|
|
1346
|
+
...rest: [(string)?, (Type)?, (boolean)?]
|
|
1347
|
+
): Promise<Models.Deployment> {
|
|
1348
|
+
let params: { functionId: string, reference: string, type: Type, activate?: boolean };
|
|
1349
|
+
|
|
1350
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1351
|
+
params = (paramsOrFirst || {}) as { functionId: string, reference: string, type: Type, activate?: boolean };
|
|
1352
|
+
} else {
|
|
1353
|
+
params = {
|
|
1354
|
+
functionId: paramsOrFirst as string,
|
|
1355
|
+
reference: rest[0] as string,
|
|
1356
|
+
type: rest[1] as Type,
|
|
1357
|
+
activate: rest[2] as boolean
|
|
1358
|
+
};
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
const functionId = params.functionId;
|
|
1362
|
+
const reference = params.reference;
|
|
1363
|
+
const type = params.type;
|
|
1364
|
+
const activate = params.activate;
|
|
1365
|
+
|
|
1366
|
+
if (typeof functionId === 'undefined') {
|
|
1367
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
1368
|
+
}
|
|
1369
|
+
if (typeof reference === 'undefined') {
|
|
1370
|
+
throw new RevenexxException('Missing required parameter: "reference"');
|
|
1371
|
+
}
|
|
1372
|
+
if (typeof type === 'undefined') {
|
|
1373
|
+
throw new RevenexxException('Missing required parameter: "type"');
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
const apiPath = '/v1/apps/{functionId}/deployments/vcs'.replace('{functionId}', functionId);
|
|
1377
|
+
const payload: Payload = {};
|
|
1378
|
+
if (typeof activate !== 'undefined') {
|
|
1379
|
+
payload['activate'] = activate;
|
|
1380
|
+
}
|
|
1381
|
+
if (typeof reference !== 'undefined') {
|
|
1382
|
+
payload['reference'] = reference;
|
|
1383
|
+
}
|
|
1384
|
+
if (typeof type !== 'undefined') {
|
|
1385
|
+
payload['type'] = type;
|
|
1386
|
+
}
|
|
1387
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1388
|
+
|
|
1389
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1390
|
+
'content-type': 'application/json',
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
return this.client.call(
|
|
1394
|
+
'post',
|
|
1395
|
+
uri,
|
|
1396
|
+
apiHeaders,
|
|
1397
|
+
payload
|
|
1398
|
+
);
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
/**
|
|
1402
|
+
* Delete a deployment. The active deployment cannot be deleted while it is active — switch first via the deployment-update endpoint.
|
|
1403
|
+
*
|
|
1404
|
+
* @param {string} params.functionId - Function ID.
|
|
1405
|
+
* @param {string} params.deploymentId - Deployment ID.
|
|
1406
|
+
* @throws {RevenexxException}
|
|
1407
|
+
* @returns {Promise<{}>}
|
|
1408
|
+
*/
|
|
1409
|
+
appsDeleteDeployment(params: { functionId: string, deploymentId: string }): Promise<{}>;
|
|
1410
|
+
/**
|
|
1411
|
+
* Delete a deployment. The active deployment cannot be deleted while it is active — switch first via the deployment-update endpoint.
|
|
1412
|
+
*
|
|
1413
|
+
* @param {string} functionId - Function ID.
|
|
1414
|
+
* @param {string} deploymentId - Deployment ID.
|
|
1415
|
+
* @throws {RevenexxException}
|
|
1416
|
+
* @returns {Promise<{}>}
|
|
1417
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1418
|
+
*/
|
|
1419
|
+
appsDeleteDeployment(functionId: string, deploymentId: string): Promise<{}>;
|
|
1420
|
+
appsDeleteDeployment(
|
|
1421
|
+
paramsOrFirst: { functionId: string, deploymentId: string } | string,
|
|
1422
|
+
...rest: [(string)?]
|
|
1423
|
+
): Promise<{}> {
|
|
1424
|
+
let params: { functionId: string, deploymentId: string };
|
|
1425
|
+
|
|
1426
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1427
|
+
params = (paramsOrFirst || {}) as { functionId: string, deploymentId: string };
|
|
1428
|
+
} else {
|
|
1429
|
+
params = {
|
|
1430
|
+
functionId: paramsOrFirst as string,
|
|
1431
|
+
deploymentId: rest[0] as string
|
|
1432
|
+
};
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
const functionId = params.functionId;
|
|
1436
|
+
const deploymentId = params.deploymentId;
|
|
1437
|
+
|
|
1438
|
+
if (typeof functionId === 'undefined') {
|
|
1439
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
1440
|
+
}
|
|
1441
|
+
if (typeof deploymentId === 'undefined') {
|
|
1442
|
+
throw new RevenexxException('Missing required parameter: "deploymentId"');
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
const apiPath = '/v1/apps/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
|
|
1446
|
+
const payload: Payload = {};
|
|
1447
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1448
|
+
|
|
1449
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
return this.client.call(
|
|
1453
|
+
'delete',
|
|
1454
|
+
uri,
|
|
1455
|
+
apiHeaders,
|
|
1456
|
+
payload
|
|
1457
|
+
);
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
/**
|
|
1461
|
+
* Get a deployment by its unique ID.
|
|
1462
|
+
*
|
|
1463
|
+
* @param {string} params.functionId - Function ID.
|
|
1464
|
+
* @param {string} params.deploymentId - Deployment ID.
|
|
1465
|
+
* @throws {RevenexxException}
|
|
1466
|
+
* @returns {Promise<Models.Deployment>}
|
|
1467
|
+
*/
|
|
1468
|
+
appsGetDeployment(params: { functionId: string, deploymentId: string }): Promise<Models.Deployment>;
|
|
1469
|
+
/**
|
|
1470
|
+
* Get a deployment by its unique ID.
|
|
1471
|
+
*
|
|
1472
|
+
* @param {string} functionId - Function ID.
|
|
1473
|
+
* @param {string} deploymentId - Deployment ID.
|
|
1474
|
+
* @throws {RevenexxException}
|
|
1475
|
+
* @returns {Promise<Models.Deployment>}
|
|
1476
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1477
|
+
*/
|
|
1478
|
+
appsGetDeployment(functionId: string, deploymentId: string): Promise<Models.Deployment>;
|
|
1479
|
+
appsGetDeployment(
|
|
1480
|
+
paramsOrFirst: { functionId: string, deploymentId: string } | string,
|
|
1481
|
+
...rest: [(string)?]
|
|
1482
|
+
): Promise<Models.Deployment> {
|
|
1483
|
+
let params: { functionId: string, deploymentId: string };
|
|
1484
|
+
|
|
1485
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1486
|
+
params = (paramsOrFirst || {}) as { functionId: string, deploymentId: string };
|
|
1487
|
+
} else {
|
|
1488
|
+
params = {
|
|
1489
|
+
functionId: paramsOrFirst as string,
|
|
1490
|
+
deploymentId: rest[0] as string
|
|
1491
|
+
};
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
const functionId = params.functionId;
|
|
1495
|
+
const deploymentId = params.deploymentId;
|
|
1496
|
+
|
|
1497
|
+
if (typeof functionId === 'undefined') {
|
|
1498
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
1499
|
+
}
|
|
1500
|
+
if (typeof deploymentId === 'undefined') {
|
|
1501
|
+
throw new RevenexxException('Missing required parameter: "deploymentId"');
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
const apiPath = '/v1/apps/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
|
|
1505
|
+
const payload: Payload = {};
|
|
1506
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1507
|
+
|
|
1508
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
return this.client.call(
|
|
1512
|
+
'get',
|
|
1513
|
+
uri,
|
|
1514
|
+
apiHeaders,
|
|
1515
|
+
payload
|
|
1516
|
+
);
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
/**
|
|
1520
|
+
* Get a redirect URL to download the source archive of an App deployment. Useful for re-running a build locally or auditing what was deployed.
|
|
1521
|
+
*
|
|
1522
|
+
* @param {string} params.functionId - Function ID.
|
|
1523
|
+
* @param {string} params.deploymentId - Deployment ID.
|
|
1524
|
+
* @param {Type} params.type - Deployment file to download. Can be: "source", "output".
|
|
1525
|
+
* @throws {RevenexxException}
|
|
1526
|
+
* @returns {Promise<{}>}
|
|
1527
|
+
*/
|
|
1528
|
+
appsGetDeploymentDownload(params: { functionId: string, deploymentId: string, type?: Type }): Promise<{}>;
|
|
1529
|
+
/**
|
|
1530
|
+
* Get a redirect URL to download the source archive of an App deployment. Useful for re-running a build locally or auditing what was deployed.
|
|
1531
|
+
*
|
|
1532
|
+
* @param {string} functionId - Function ID.
|
|
1533
|
+
* @param {string} deploymentId - Deployment ID.
|
|
1534
|
+
* @param {Type} type - Deployment file to download. Can be: "source", "output".
|
|
1535
|
+
* @throws {RevenexxException}
|
|
1536
|
+
* @returns {Promise<{}>}
|
|
1537
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1538
|
+
*/
|
|
1539
|
+
appsGetDeploymentDownload(functionId: string, deploymentId: string, type?: Type): Promise<{}>;
|
|
1540
|
+
appsGetDeploymentDownload(
|
|
1541
|
+
paramsOrFirst: { functionId: string, deploymentId: string, type?: Type } | string,
|
|
1542
|
+
...rest: [(string)?, (Type)?]
|
|
1543
|
+
): Promise<{}> {
|
|
1544
|
+
let params: { functionId: string, deploymentId: string, type?: Type };
|
|
1545
|
+
|
|
1546
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1547
|
+
params = (paramsOrFirst || {}) as { functionId: string, deploymentId: string, type?: Type };
|
|
1548
|
+
} else {
|
|
1549
|
+
params = {
|
|
1550
|
+
functionId: paramsOrFirst as string,
|
|
1551
|
+
deploymentId: rest[0] as string,
|
|
1552
|
+
type: rest[1] as Type
|
|
1553
|
+
};
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
const functionId = params.functionId;
|
|
1557
|
+
const deploymentId = params.deploymentId;
|
|
1558
|
+
const type = params.type;
|
|
1559
|
+
|
|
1560
|
+
if (typeof functionId === 'undefined') {
|
|
1561
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
1562
|
+
}
|
|
1563
|
+
if (typeof deploymentId === 'undefined') {
|
|
1564
|
+
throw new RevenexxException('Missing required parameter: "deploymentId"');
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
const apiPath = '/v1/apps/{functionId}/deployments/{deploymentId}/download'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
|
|
1568
|
+
const payload: Payload = {};
|
|
1569
|
+
if (typeof type !== 'undefined') {
|
|
1570
|
+
payload['type'] = type;
|
|
1571
|
+
}
|
|
1572
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1573
|
+
|
|
1574
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
return this.client.call(
|
|
1578
|
+
'get',
|
|
1579
|
+
uri,
|
|
1580
|
+
apiHeaders,
|
|
1581
|
+
payload
|
|
1582
|
+
);
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
/**
|
|
1586
|
+
* Cancel an in-progress deployment build. Used by the Cockpit "Cancel build" affordance.
|
|
1587
|
+
*
|
|
1588
|
+
* @param {string} params.functionId - Function ID.
|
|
1589
|
+
* @param {string} params.deploymentId - Deployment ID.
|
|
1590
|
+
* @throws {RevenexxException}
|
|
1591
|
+
* @returns {Promise<Models.Deployment>}
|
|
1592
|
+
*/
|
|
1593
|
+
appsUpdateDeploymentStatus(params: { functionId: string, deploymentId: string }): Promise<Models.Deployment>;
|
|
1594
|
+
/**
|
|
1595
|
+
* Cancel an in-progress deployment build. Used by the Cockpit "Cancel build" affordance.
|
|
1596
|
+
*
|
|
1597
|
+
* @param {string} functionId - Function ID.
|
|
1598
|
+
* @param {string} deploymentId - Deployment ID.
|
|
1599
|
+
* @throws {RevenexxException}
|
|
1600
|
+
* @returns {Promise<Models.Deployment>}
|
|
1601
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1602
|
+
*/
|
|
1603
|
+
appsUpdateDeploymentStatus(functionId: string, deploymentId: string): Promise<Models.Deployment>;
|
|
1604
|
+
appsUpdateDeploymentStatus(
|
|
1605
|
+
paramsOrFirst: { functionId: string, deploymentId: string } | string,
|
|
1606
|
+
...rest: [(string)?]
|
|
1607
|
+
): Promise<Models.Deployment> {
|
|
1608
|
+
let params: { functionId: string, deploymentId: string };
|
|
1609
|
+
|
|
1610
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1611
|
+
params = (paramsOrFirst || {}) as { functionId: string, deploymentId: string };
|
|
1612
|
+
} else {
|
|
1613
|
+
params = {
|
|
1614
|
+
functionId: paramsOrFirst as string,
|
|
1615
|
+
deploymentId: rest[0] as string
|
|
1616
|
+
};
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
const functionId = params.functionId;
|
|
1620
|
+
const deploymentId = params.deploymentId;
|
|
1621
|
+
|
|
1622
|
+
if (typeof functionId === 'undefined') {
|
|
1623
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
1624
|
+
}
|
|
1625
|
+
if (typeof deploymentId === 'undefined') {
|
|
1626
|
+
throw new RevenexxException('Missing required parameter: "deploymentId"');
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
const apiPath = '/v1/apps/{functionId}/deployments/{deploymentId}/status'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
|
|
1630
|
+
const payload: Payload = {};
|
|
1631
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1632
|
+
|
|
1633
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
return this.client.call(
|
|
1637
|
+
'patch',
|
|
1638
|
+
uri,
|
|
1639
|
+
apiHeaders,
|
|
1640
|
+
payload
|
|
1641
|
+
);
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
/**
|
|
1645
|
+
* List the execution history of an App.
|
|
1646
|
+
*
|
|
1647
|
+
* @param {string} params.functionId - Function ID.
|
|
1648
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
|
|
1649
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
1650
|
+
* @throws {RevenexxException}
|
|
1651
|
+
* @returns {Promise<Models.ExecutionList>}
|
|
1652
|
+
*/
|
|
1653
|
+
appsListExecutions(params: { functionId: string, queries?: string[], total?: boolean }): Promise<Models.ExecutionList>;
|
|
1654
|
+
/**
|
|
1655
|
+
* List the execution history of an App.
|
|
1656
|
+
*
|
|
1657
|
+
* @param {string} functionId - Function ID.
|
|
1658
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
|
|
1659
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
1660
|
+
* @throws {RevenexxException}
|
|
1661
|
+
* @returns {Promise<Models.ExecutionList>}
|
|
1662
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1663
|
+
*/
|
|
1664
|
+
appsListExecutions(functionId: string, queries?: string[], total?: boolean): Promise<Models.ExecutionList>;
|
|
1665
|
+
appsListExecutions(
|
|
1666
|
+
paramsOrFirst: { functionId: string, queries?: string[], total?: boolean } | string,
|
|
1667
|
+
...rest: [(string[])?, (boolean)?]
|
|
1668
|
+
): Promise<Models.ExecutionList> {
|
|
1669
|
+
let params: { functionId: string, queries?: string[], total?: boolean };
|
|
1670
|
+
|
|
1671
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1672
|
+
params = (paramsOrFirst || {}) as { functionId: string, queries?: string[], total?: boolean };
|
|
1673
|
+
} else {
|
|
1674
|
+
params = {
|
|
1675
|
+
functionId: paramsOrFirst as string,
|
|
1676
|
+
queries: rest[0] as string[],
|
|
1677
|
+
total: rest[1] as boolean
|
|
1678
|
+
};
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
const functionId = params.functionId;
|
|
1682
|
+
const queries = params.queries;
|
|
1683
|
+
const total = params.total;
|
|
1684
|
+
|
|
1685
|
+
if (typeof functionId === 'undefined') {
|
|
1686
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
const apiPath = '/v1/apps/{functionId}/executions'.replace('{functionId}', functionId);
|
|
1690
|
+
const payload: Payload = {};
|
|
1691
|
+
if (typeof queries !== 'undefined') {
|
|
1692
|
+
payload['queries'] = queries;
|
|
1693
|
+
}
|
|
1694
|
+
if (typeof total !== 'undefined') {
|
|
1695
|
+
payload['total'] = total;
|
|
1696
|
+
}
|
|
1697
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1698
|
+
|
|
1699
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
return this.client.call(
|
|
1703
|
+
'get',
|
|
1704
|
+
uri,
|
|
1705
|
+
apiHeaders,
|
|
1706
|
+
payload
|
|
1707
|
+
);
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
/**
|
|
1711
|
+
* Trigger an App execution. Use the optional `body`, `path`, `method` and `headers` parameters to invoke the App as if from an HTTP request.
|
|
1712
|
+
*
|
|
1713
|
+
* @param {string} params.functionId - Function ID.
|
|
1714
|
+
* @param {boolean} params.async - Execute code in the background. Default value is false.
|
|
1715
|
+
* @param {string} params.body - HTTP body of execution. Default value is empty string.
|
|
1716
|
+
* @param {object} params.headers - HTTP headers of execution. Defaults to empty.
|
|
1717
|
+
* @param {Method} params.method - HTTP method of execution. Default value is POST.
|
|
1718
|
+
* @param {string} params.xpath - HTTP path of execution. Path can include query params. Default value is /
|
|
1719
|
+
* @param {string} params.scheduledAt - Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.
|
|
1720
|
+
* @throws {RevenexxException}
|
|
1721
|
+
* @returns {Promise<Models.Execution>}
|
|
1722
|
+
*/
|
|
1723
|
+
appsCreateExecution(params: { functionId: string, async?: boolean, body?: string, headers?: object, method?: Method, xpath?: string, scheduledAt?: string }): Promise<Models.Execution>;
|
|
1724
|
+
/**
|
|
1725
|
+
* Trigger an App execution. Use the optional `body`, `path`, `method` and `headers` parameters to invoke the App as if from an HTTP request.
|
|
1726
|
+
*
|
|
1727
|
+
* @param {string} functionId - Function ID.
|
|
1728
|
+
* @param {boolean} async - Execute code in the background. Default value is false.
|
|
1729
|
+
* @param {string} body - HTTP body of execution. Default value is empty string.
|
|
1730
|
+
* @param {object} headers - HTTP headers of execution. Defaults to empty.
|
|
1731
|
+
* @param {Method} method - HTTP method of execution. Default value is POST.
|
|
1732
|
+
* @param {string} xpath - HTTP path of execution. Path can include query params. Default value is /
|
|
1733
|
+
* @param {string} scheduledAt - Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.
|
|
1734
|
+
* @throws {RevenexxException}
|
|
1735
|
+
* @returns {Promise<Models.Execution>}
|
|
1736
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1737
|
+
*/
|
|
1738
|
+
appsCreateExecution(functionId: string, async?: boolean, body?: string, headers?: object, method?: Method, xpath?: string, scheduledAt?: string): Promise<Models.Execution>;
|
|
1739
|
+
appsCreateExecution(
|
|
1740
|
+
paramsOrFirst: { functionId: string, async?: boolean, body?: string, headers?: object, method?: Method, xpath?: string, scheduledAt?: string } | string,
|
|
1741
|
+
...rest: [(boolean)?, (string)?, (object)?, (Method)?, (string)?, (string)?]
|
|
1742
|
+
): Promise<Models.Execution> {
|
|
1743
|
+
let params: { functionId: string, async?: boolean, body?: string, headers?: object, method?: Method, xpath?: string, scheduledAt?: string };
|
|
1744
|
+
|
|
1745
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1746
|
+
params = (paramsOrFirst || {}) as { functionId: string, async?: boolean, body?: string, headers?: object, method?: Method, xpath?: string, scheduledAt?: string };
|
|
1747
|
+
} else {
|
|
1748
|
+
params = {
|
|
1749
|
+
functionId: paramsOrFirst as string,
|
|
1750
|
+
async: rest[0] as boolean,
|
|
1751
|
+
body: rest[1] as string,
|
|
1752
|
+
headers: rest[2] as object,
|
|
1753
|
+
method: rest[3] as Method,
|
|
1754
|
+
xpath: rest[4] as string,
|
|
1755
|
+
scheduledAt: rest[5] as string
|
|
1756
|
+
};
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
const functionId = params.functionId;
|
|
1760
|
+
const async = params.async;
|
|
1761
|
+
const body = params.body;
|
|
1762
|
+
const headers = params.headers;
|
|
1763
|
+
const method = params.method;
|
|
1764
|
+
const xpath = params.xpath;
|
|
1765
|
+
const scheduledAt = params.scheduledAt;
|
|
1766
|
+
|
|
1767
|
+
if (typeof functionId === 'undefined') {
|
|
1768
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
const apiPath = '/v1/apps/{functionId}/executions'.replace('{functionId}', functionId);
|
|
1772
|
+
const payload: Payload = {};
|
|
1773
|
+
if (typeof async !== 'undefined') {
|
|
1774
|
+
payload['async'] = async;
|
|
1775
|
+
}
|
|
1776
|
+
if (typeof body !== 'undefined') {
|
|
1777
|
+
payload['body'] = body;
|
|
1778
|
+
}
|
|
1779
|
+
if (typeof headers !== 'undefined') {
|
|
1780
|
+
payload['headers'] = headers;
|
|
1781
|
+
}
|
|
1782
|
+
if (typeof method !== 'undefined') {
|
|
1783
|
+
payload['method'] = method;
|
|
1784
|
+
}
|
|
1785
|
+
if (typeof xpath !== 'undefined') {
|
|
1786
|
+
payload['path'] = xpath;
|
|
1787
|
+
}
|
|
1788
|
+
if (typeof scheduledAt !== 'undefined') {
|
|
1789
|
+
payload['scheduledAt'] = scheduledAt;
|
|
1790
|
+
}
|
|
1791
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1792
|
+
|
|
1793
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1794
|
+
'content-type': 'application/json',
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
return this.client.call(
|
|
1798
|
+
'post',
|
|
1799
|
+
uri,
|
|
1800
|
+
apiHeaders,
|
|
1801
|
+
payload
|
|
1802
|
+
);
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
/**
|
|
1806
|
+
* Delete an App execution by its unique ID.
|
|
1807
|
+
*
|
|
1808
|
+
* @param {string} params.functionId - Function ID.
|
|
1809
|
+
* @param {string} params.executionId - Execution ID.
|
|
1810
|
+
* @throws {RevenexxException}
|
|
1811
|
+
* @returns {Promise<{}>}
|
|
1812
|
+
*/
|
|
1813
|
+
appsDeleteExecution(params: { functionId: string, executionId: string }): Promise<{}>;
|
|
1814
|
+
/**
|
|
1815
|
+
* Delete an App execution by its unique ID.
|
|
1816
|
+
*
|
|
1817
|
+
* @param {string} functionId - Function ID.
|
|
1818
|
+
* @param {string} executionId - Execution ID.
|
|
1819
|
+
* @throws {RevenexxException}
|
|
1820
|
+
* @returns {Promise<{}>}
|
|
1821
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1822
|
+
*/
|
|
1823
|
+
appsDeleteExecution(functionId: string, executionId: string): Promise<{}>;
|
|
1824
|
+
appsDeleteExecution(
|
|
1825
|
+
paramsOrFirst: { functionId: string, executionId: string } | string,
|
|
1826
|
+
...rest: [(string)?]
|
|
1827
|
+
): Promise<{}> {
|
|
1828
|
+
let params: { functionId: string, executionId: string };
|
|
1829
|
+
|
|
1830
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1831
|
+
params = (paramsOrFirst || {}) as { functionId: string, executionId: string };
|
|
1832
|
+
} else {
|
|
1833
|
+
params = {
|
|
1834
|
+
functionId: paramsOrFirst as string,
|
|
1835
|
+
executionId: rest[0] as string
|
|
1836
|
+
};
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
const functionId = params.functionId;
|
|
1840
|
+
const executionId = params.executionId;
|
|
1841
|
+
|
|
1842
|
+
if (typeof functionId === 'undefined') {
|
|
1843
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
1844
|
+
}
|
|
1845
|
+
if (typeof executionId === 'undefined') {
|
|
1846
|
+
throw new RevenexxException('Missing required parameter: "executionId"');
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
const apiPath = '/v1/apps/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId);
|
|
1850
|
+
const payload: Payload = {};
|
|
1851
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1852
|
+
|
|
1853
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
return this.client.call(
|
|
1857
|
+
'delete',
|
|
1858
|
+
uri,
|
|
1859
|
+
apiHeaders,
|
|
1860
|
+
payload
|
|
1861
|
+
);
|
|
1862
|
+
}
|
|
1863
|
+
|
|
1864
|
+
/**
|
|
1865
|
+
* Get an App execution by its unique ID.
|
|
1866
|
+
*
|
|
1867
|
+
* @param {string} params.functionId - Function ID.
|
|
1868
|
+
* @param {string} params.executionId - Execution ID.
|
|
1869
|
+
* @throws {RevenexxException}
|
|
1870
|
+
* @returns {Promise<Models.Execution>}
|
|
1871
|
+
*/
|
|
1872
|
+
appsGetExecution(params: { functionId: string, executionId: string }): Promise<Models.Execution>;
|
|
1873
|
+
/**
|
|
1874
|
+
* Get an App execution by its unique ID.
|
|
1875
|
+
*
|
|
1876
|
+
* @param {string} functionId - Function ID.
|
|
1877
|
+
* @param {string} executionId - Execution ID.
|
|
1878
|
+
* @throws {RevenexxException}
|
|
1879
|
+
* @returns {Promise<Models.Execution>}
|
|
1880
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1881
|
+
*/
|
|
1882
|
+
appsGetExecution(functionId: string, executionId: string): Promise<Models.Execution>;
|
|
1883
|
+
appsGetExecution(
|
|
1884
|
+
paramsOrFirst: { functionId: string, executionId: string } | string,
|
|
1885
|
+
...rest: [(string)?]
|
|
1886
|
+
): Promise<Models.Execution> {
|
|
1887
|
+
let params: { functionId: string, executionId: string };
|
|
1888
|
+
|
|
1889
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1890
|
+
params = (paramsOrFirst || {}) as { functionId: string, executionId: string };
|
|
1891
|
+
} else {
|
|
1892
|
+
params = {
|
|
1893
|
+
functionId: paramsOrFirst as string,
|
|
1894
|
+
executionId: rest[0] as string
|
|
1895
|
+
};
|
|
1896
|
+
}
|
|
1897
|
+
|
|
1898
|
+
const functionId = params.functionId;
|
|
1899
|
+
const executionId = params.executionId;
|
|
1900
|
+
|
|
1901
|
+
if (typeof functionId === 'undefined') {
|
|
1902
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
1903
|
+
}
|
|
1904
|
+
if (typeof executionId === 'undefined') {
|
|
1905
|
+
throw new RevenexxException('Missing required parameter: "executionId"');
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
const apiPath = '/v1/apps/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId);
|
|
1909
|
+
const payload: Payload = {};
|
|
1910
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1911
|
+
|
|
1912
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
return this.client.call(
|
|
1916
|
+
'get',
|
|
1917
|
+
uri,
|
|
1918
|
+
apiHeaders,
|
|
1919
|
+
payload
|
|
1920
|
+
);
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
/**
|
|
1924
|
+
* Read-through view of the App's App Registry row — visibility + Marketplace publish flag. Used by Cockpit to render the Publish/Unpublish button correctly on cold load.
|
|
1925
|
+
*
|
|
1926
|
+
* @param {string} params.functionId - App ID.
|
|
1927
|
+
* @throws {RevenexxException}
|
|
1928
|
+
* @returns {Promise<{}>}
|
|
1929
|
+
*/
|
|
1930
|
+
appsGetMarketplaceStatus(params: { functionId: string }): Promise<{}>;
|
|
1931
|
+
/**
|
|
1932
|
+
* Read-through view of the App's App Registry row — visibility + Marketplace publish flag. Used by Cockpit to render the Publish/Unpublish button correctly on cold load.
|
|
1933
|
+
*
|
|
1934
|
+
* @param {string} functionId - App ID.
|
|
1935
|
+
* @throws {RevenexxException}
|
|
1936
|
+
* @returns {Promise<{}>}
|
|
1937
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1938
|
+
*/
|
|
1939
|
+
appsGetMarketplaceStatus(functionId: string): Promise<{}>;
|
|
1940
|
+
appsGetMarketplaceStatus(
|
|
1941
|
+
paramsOrFirst: { functionId: string } | string
|
|
1942
|
+
): Promise<{}> {
|
|
1943
|
+
let params: { functionId: string };
|
|
1944
|
+
|
|
1945
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1946
|
+
params = (paramsOrFirst || {}) as { functionId: string };
|
|
1947
|
+
} else {
|
|
1948
|
+
params = {
|
|
1949
|
+
functionId: paramsOrFirst as string
|
|
1950
|
+
};
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
const functionId = params.functionId;
|
|
1954
|
+
|
|
1955
|
+
if (typeof functionId === 'undefined') {
|
|
1956
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
const apiPath = '/v1/apps/{functionId}/marketplace-status'.replace('{functionId}', functionId);
|
|
1960
|
+
const payload: Payload = {};
|
|
1961
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1962
|
+
|
|
1963
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1966
|
+
return this.client.call(
|
|
1967
|
+
'get',
|
|
1968
|
+
uri,
|
|
1969
|
+
apiHeaders,
|
|
1970
|
+
payload
|
|
1971
|
+
);
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
/**
|
|
1975
|
+
* Remove this App from the Marketplace listing. Existing tenant installations are unaffected. Idempotent.
|
|
1976
|
+
*
|
|
1977
|
+
* @param {string} params.functionId - App ID.
|
|
1978
|
+
* @throws {RevenexxException}
|
|
1979
|
+
* @returns {Promise<{}>}
|
|
1980
|
+
*/
|
|
1981
|
+
appsUnpublish(params: { functionId: string }): Promise<{}>;
|
|
1982
|
+
/**
|
|
1983
|
+
* Remove this App from the Marketplace listing. Existing tenant installations are unaffected. Idempotent.
|
|
1984
|
+
*
|
|
1985
|
+
* @param {string} functionId - App ID.
|
|
1986
|
+
* @throws {RevenexxException}
|
|
1987
|
+
* @returns {Promise<{}>}
|
|
1988
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1989
|
+
*/
|
|
1990
|
+
appsUnpublish(functionId: string): Promise<{}>;
|
|
1991
|
+
appsUnpublish(
|
|
1992
|
+
paramsOrFirst: { functionId: string } | string
|
|
1993
|
+
): Promise<{}> {
|
|
1994
|
+
let params: { functionId: string };
|
|
1995
|
+
|
|
1996
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1997
|
+
params = (paramsOrFirst || {}) as { functionId: string };
|
|
1998
|
+
} else {
|
|
1999
|
+
params = {
|
|
2000
|
+
functionId: paramsOrFirst as string
|
|
2001
|
+
};
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
const functionId = params.functionId;
|
|
2005
|
+
|
|
2006
|
+
if (typeof functionId === 'undefined') {
|
|
2007
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
const apiPath = '/v1/apps/{functionId}/publish'.replace('{functionId}', functionId);
|
|
2011
|
+
const payload: Payload = {};
|
|
2012
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2013
|
+
|
|
2014
|
+
const apiHeaders: { [header: string]: string } = {
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
return this.client.call(
|
|
2018
|
+
'delete',
|
|
2019
|
+
uri,
|
|
2020
|
+
apiHeaders,
|
|
2021
|
+
payload
|
|
2022
|
+
);
|
|
2023
|
+
}
|
|
2024
|
+
|
|
2025
|
+
/**
|
|
2026
|
+
* Publish this App to the Marketplace. The App must have at
|
|
2027
|
+
* least one `ready` deployment with a registered manifest,
|
|
2028
|
+
* and its visibility (derived from `billing.json`) must be
|
|
2029
|
+
* `public` or `included`. Idempotent.
|
|
2030
|
+
*
|
|
2031
|
+
* @param {string} params.functionId - App ID.
|
|
2032
|
+
* @throws {RevenexxException}
|
|
2033
|
+
* @returns {Promise<{}>}
|
|
2034
|
+
*/
|
|
2035
|
+
appsPublish(params: { functionId: string }): Promise<{}>;
|
|
2036
|
+
/**
|
|
2037
|
+
* Publish this App to the Marketplace. The App must have at
|
|
2038
|
+
* least one `ready` deployment with a registered manifest,
|
|
2039
|
+
* and its visibility (derived from `billing.json`) must be
|
|
2040
|
+
* `public` or `included`. Idempotent.
|
|
2041
|
+
*
|
|
2042
|
+
* @param {string} functionId - App ID.
|
|
2043
|
+
* @throws {RevenexxException}
|
|
2044
|
+
* @returns {Promise<{}>}
|
|
2045
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2046
|
+
*/
|
|
2047
|
+
appsPublish(functionId: string): Promise<{}>;
|
|
2048
|
+
appsPublish(
|
|
2049
|
+
paramsOrFirst: { functionId: string } | string
|
|
2050
|
+
): Promise<{}> {
|
|
2051
|
+
let params: { functionId: string };
|
|
2052
|
+
|
|
2053
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2054
|
+
params = (paramsOrFirst || {}) as { functionId: string };
|
|
2055
|
+
} else {
|
|
2056
|
+
params = {
|
|
2057
|
+
functionId: paramsOrFirst as string
|
|
2058
|
+
};
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
const functionId = params.functionId;
|
|
2062
|
+
|
|
2063
|
+
if (typeof functionId === 'undefined') {
|
|
2064
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
const apiPath = '/v1/apps/{functionId}/publish'.replace('{functionId}', functionId);
|
|
2068
|
+
const payload: Payload = {};
|
|
2069
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2070
|
+
|
|
2071
|
+
const apiHeaders: { [header: string]: string } = {
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
return this.client.call(
|
|
2075
|
+
'post',
|
|
2076
|
+
uri,
|
|
2077
|
+
apiHeaders,
|
|
2078
|
+
payload
|
|
2079
|
+
);
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
/**
|
|
2083
|
+
* Get usage stats for a single App over the requested time range.
|
|
2084
|
+
*
|
|
2085
|
+
* @param {string} params.functionId - Function ID.
|
|
2086
|
+
* @param {Range} params.range - Date range.
|
|
2087
|
+
* @throws {RevenexxException}
|
|
2088
|
+
* @returns {Promise<Models.UsageFunction>}
|
|
2089
|
+
*/
|
|
2090
|
+
appsGetUsage(params: { functionId: string, range?: Range }): Promise<Models.UsageFunction>;
|
|
2091
|
+
/**
|
|
2092
|
+
* Get usage stats for a single App over the requested time range.
|
|
2093
|
+
*
|
|
2094
|
+
* @param {string} functionId - Function ID.
|
|
2095
|
+
* @param {Range} range - Date range.
|
|
2096
|
+
* @throws {RevenexxException}
|
|
2097
|
+
* @returns {Promise<Models.UsageFunction>}
|
|
2098
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2099
|
+
*/
|
|
2100
|
+
appsGetUsage(functionId: string, range?: Range): Promise<Models.UsageFunction>;
|
|
2101
|
+
appsGetUsage(
|
|
2102
|
+
paramsOrFirst: { functionId: string, range?: Range } | string,
|
|
2103
|
+
...rest: [(Range)?]
|
|
2104
|
+
): Promise<Models.UsageFunction> {
|
|
2105
|
+
let params: { functionId: string, range?: Range };
|
|
2106
|
+
|
|
2107
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2108
|
+
params = (paramsOrFirst || {}) as { functionId: string, range?: Range };
|
|
2109
|
+
} else {
|
|
2110
|
+
params = {
|
|
2111
|
+
functionId: paramsOrFirst as string,
|
|
2112
|
+
range: rest[0] as Range
|
|
2113
|
+
};
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
const functionId = params.functionId;
|
|
2117
|
+
const range = params.range;
|
|
2118
|
+
|
|
2119
|
+
if (typeof functionId === 'undefined') {
|
|
2120
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
2121
|
+
}
|
|
2122
|
+
|
|
2123
|
+
const apiPath = '/v1/apps/{functionId}/usage'.replace('{functionId}', functionId);
|
|
2124
|
+
const payload: Payload = {};
|
|
2125
|
+
if (typeof range !== 'undefined') {
|
|
2126
|
+
payload['range'] = range;
|
|
2127
|
+
}
|
|
2128
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2129
|
+
|
|
2130
|
+
const apiHeaders: { [header: string]: string } = {
|
|
2131
|
+
}
|
|
2132
|
+
|
|
2133
|
+
return this.client.call(
|
|
2134
|
+
'get',
|
|
2135
|
+
uri,
|
|
2136
|
+
apiHeaders,
|
|
2137
|
+
payload
|
|
2138
|
+
);
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
/**
|
|
2142
|
+
* List all environment variables defined for the App.
|
|
2143
|
+
*
|
|
2144
|
+
* @param {string} params.functionId - Function unique ID.
|
|
2145
|
+
* @throws {RevenexxException}
|
|
2146
|
+
* @returns {Promise<Models.VariableList>}
|
|
2147
|
+
*/
|
|
2148
|
+
appsListVariables(params: { functionId: string }): Promise<Models.VariableList>;
|
|
2149
|
+
/**
|
|
2150
|
+
* List all environment variables defined for the App.
|
|
2151
|
+
*
|
|
2152
|
+
* @param {string} functionId - Function unique ID.
|
|
2153
|
+
* @throws {RevenexxException}
|
|
2154
|
+
* @returns {Promise<Models.VariableList>}
|
|
2155
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2156
|
+
*/
|
|
2157
|
+
appsListVariables(functionId: string): Promise<Models.VariableList>;
|
|
2158
|
+
appsListVariables(
|
|
2159
|
+
paramsOrFirst: { functionId: string } | string
|
|
2160
|
+
): Promise<Models.VariableList> {
|
|
2161
|
+
let params: { functionId: string };
|
|
2162
|
+
|
|
2163
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2164
|
+
params = (paramsOrFirst || {}) as { functionId: string };
|
|
2165
|
+
} else {
|
|
2166
|
+
params = {
|
|
2167
|
+
functionId: paramsOrFirst as string
|
|
2168
|
+
};
|
|
2169
|
+
}
|
|
2170
|
+
|
|
2171
|
+
const functionId = params.functionId;
|
|
2172
|
+
|
|
2173
|
+
if (typeof functionId === 'undefined') {
|
|
2174
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2177
|
+
const apiPath = '/v1/apps/{functionId}/variables'.replace('{functionId}', functionId);
|
|
2178
|
+
const payload: Payload = {};
|
|
2179
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2180
|
+
|
|
2181
|
+
const apiHeaders: { [header: string]: string } = {
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2184
|
+
return this.client.call(
|
|
2185
|
+
'get',
|
|
2186
|
+
uri,
|
|
2187
|
+
apiHeaders,
|
|
2188
|
+
payload
|
|
2189
|
+
);
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2192
|
+
/**
|
|
2193
|
+
* Create a new App environment variable. These are passed into the App at runtime as `process.env.*`.
|
|
2194
|
+
*
|
|
2195
|
+
* @param {string} params.functionId - Function unique ID.
|
|
2196
|
+
* @param {string} params.key - Variable key. Max length: 255 chars.
|
|
2197
|
+
* @param {string} params.value - Variable value. Max length: 8192 chars.
|
|
2198
|
+
* @param {boolean} params.secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime.
|
|
2199
|
+
* @throws {RevenexxException}
|
|
2200
|
+
* @returns {Promise<Models.Variable>}
|
|
2201
|
+
*/
|
|
2202
|
+
appsCreateVariable(params: { functionId: string, key: string, value: string, secret?: boolean }): Promise<Models.Variable>;
|
|
2203
|
+
/**
|
|
2204
|
+
* Create a new App environment variable. These are passed into the App at runtime as `process.env.*`.
|
|
2205
|
+
*
|
|
2206
|
+
* @param {string} functionId - Function unique ID.
|
|
2207
|
+
* @param {string} key - Variable key. Max length: 255 chars.
|
|
2208
|
+
* @param {string} value - Variable value. Max length: 8192 chars.
|
|
2209
|
+
* @param {boolean} secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime.
|
|
2210
|
+
* @throws {RevenexxException}
|
|
2211
|
+
* @returns {Promise<Models.Variable>}
|
|
2212
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2213
|
+
*/
|
|
2214
|
+
appsCreateVariable(functionId: string, key: string, value: string, secret?: boolean): Promise<Models.Variable>;
|
|
2215
|
+
appsCreateVariable(
|
|
2216
|
+
paramsOrFirst: { functionId: string, key: string, value: string, secret?: boolean } | string,
|
|
2217
|
+
...rest: [(string)?, (string)?, (boolean)?]
|
|
2218
|
+
): Promise<Models.Variable> {
|
|
2219
|
+
let params: { functionId: string, key: string, value: string, secret?: boolean };
|
|
2220
|
+
|
|
2221
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2222
|
+
params = (paramsOrFirst || {}) as { functionId: string, key: string, value: string, secret?: boolean };
|
|
2223
|
+
} else {
|
|
2224
|
+
params = {
|
|
2225
|
+
functionId: paramsOrFirst as string,
|
|
2226
|
+
key: rest[0] as string,
|
|
2227
|
+
value: rest[1] as string,
|
|
2228
|
+
secret: rest[2] as boolean
|
|
2229
|
+
};
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
const functionId = params.functionId;
|
|
2233
|
+
const key = params.key;
|
|
2234
|
+
const value = params.value;
|
|
2235
|
+
const secret = params.secret;
|
|
2236
|
+
|
|
2237
|
+
if (typeof functionId === 'undefined') {
|
|
2238
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
2239
|
+
}
|
|
2240
|
+
if (typeof key === 'undefined') {
|
|
2241
|
+
throw new RevenexxException('Missing required parameter: "key"');
|
|
2242
|
+
}
|
|
2243
|
+
if (typeof value === 'undefined') {
|
|
2244
|
+
throw new RevenexxException('Missing required parameter: "value"');
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
const apiPath = '/v1/apps/{functionId}/variables'.replace('{functionId}', functionId);
|
|
2248
|
+
const payload: Payload = {};
|
|
2249
|
+
if (typeof key !== 'undefined') {
|
|
2250
|
+
payload['key'] = key;
|
|
2251
|
+
}
|
|
2252
|
+
if (typeof secret !== 'undefined') {
|
|
2253
|
+
payload['secret'] = secret;
|
|
2254
|
+
}
|
|
2255
|
+
if (typeof value !== 'undefined') {
|
|
2256
|
+
payload['value'] = value;
|
|
2257
|
+
}
|
|
2258
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2259
|
+
|
|
2260
|
+
const apiHeaders: { [header: string]: string } = {
|
|
2261
|
+
'content-type': 'application/json',
|
|
2262
|
+
}
|
|
2263
|
+
|
|
2264
|
+
return this.client.call(
|
|
2265
|
+
'post',
|
|
2266
|
+
uri,
|
|
2267
|
+
apiHeaders,
|
|
2268
|
+
payload
|
|
2269
|
+
);
|
|
2270
|
+
}
|
|
2271
|
+
|
|
2272
|
+
/**
|
|
2273
|
+
* Delete an App environment variable.
|
|
2274
|
+
*
|
|
2275
|
+
* @param {string} params.functionId - Function unique ID.
|
|
2276
|
+
* @param {string} params.variableId - Variable unique ID.
|
|
2277
|
+
* @throws {RevenexxException}
|
|
2278
|
+
* @returns {Promise<{}>}
|
|
2279
|
+
*/
|
|
2280
|
+
appsDeleteVariable(params: { functionId: string, variableId: string }): Promise<{}>;
|
|
2281
|
+
/**
|
|
2282
|
+
* Delete an App environment variable.
|
|
2283
|
+
*
|
|
2284
|
+
* @param {string} functionId - Function unique ID.
|
|
2285
|
+
* @param {string} variableId - Variable unique ID.
|
|
2286
|
+
* @throws {RevenexxException}
|
|
2287
|
+
* @returns {Promise<{}>}
|
|
2288
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2289
|
+
*/
|
|
2290
|
+
appsDeleteVariable(functionId: string, variableId: string): Promise<{}>;
|
|
2291
|
+
appsDeleteVariable(
|
|
2292
|
+
paramsOrFirst: { functionId: string, variableId: string } | string,
|
|
2293
|
+
...rest: [(string)?]
|
|
2294
|
+
): Promise<{}> {
|
|
2295
|
+
let params: { functionId: string, variableId: string };
|
|
2296
|
+
|
|
2297
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2298
|
+
params = (paramsOrFirst || {}) as { functionId: string, variableId: string };
|
|
2299
|
+
} else {
|
|
2300
|
+
params = {
|
|
2301
|
+
functionId: paramsOrFirst as string,
|
|
2302
|
+
variableId: rest[0] as string
|
|
2303
|
+
};
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2306
|
+
const functionId = params.functionId;
|
|
2307
|
+
const variableId = params.variableId;
|
|
2308
|
+
|
|
2309
|
+
if (typeof functionId === 'undefined') {
|
|
2310
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
2311
|
+
}
|
|
2312
|
+
if (typeof variableId === 'undefined') {
|
|
2313
|
+
throw new RevenexxException('Missing required parameter: "variableId"');
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
const apiPath = '/v1/apps/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);
|
|
2317
|
+
const payload: Payload = {};
|
|
2318
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2319
|
+
|
|
2320
|
+
const apiHeaders: { [header: string]: string } = {
|
|
2321
|
+
}
|
|
2322
|
+
|
|
2323
|
+
return this.client.call(
|
|
2324
|
+
'delete',
|
|
2325
|
+
uri,
|
|
2326
|
+
apiHeaders,
|
|
2327
|
+
payload
|
|
2328
|
+
);
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
/**
|
|
2332
|
+
* Get an App variable by its unique ID.
|
|
2333
|
+
*
|
|
2334
|
+
* @param {string} params.functionId - Function unique ID.
|
|
2335
|
+
* @param {string} params.variableId - Variable unique ID.
|
|
2336
|
+
* @throws {RevenexxException}
|
|
2337
|
+
* @returns {Promise<Models.Variable>}
|
|
2338
|
+
*/
|
|
2339
|
+
appsGetVariable(params: { functionId: string, variableId: string }): Promise<Models.Variable>;
|
|
2340
|
+
/**
|
|
2341
|
+
* Get an App variable by its unique ID.
|
|
2342
|
+
*
|
|
2343
|
+
* @param {string} functionId - Function unique ID.
|
|
2344
|
+
* @param {string} variableId - Variable unique ID.
|
|
2345
|
+
* @throws {RevenexxException}
|
|
2346
|
+
* @returns {Promise<Models.Variable>}
|
|
2347
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2348
|
+
*/
|
|
2349
|
+
appsGetVariable(functionId: string, variableId: string): Promise<Models.Variable>;
|
|
2350
|
+
appsGetVariable(
|
|
2351
|
+
paramsOrFirst: { functionId: string, variableId: string } | string,
|
|
2352
|
+
...rest: [(string)?]
|
|
2353
|
+
): Promise<Models.Variable> {
|
|
2354
|
+
let params: { functionId: string, variableId: string };
|
|
2355
|
+
|
|
2356
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2357
|
+
params = (paramsOrFirst || {}) as { functionId: string, variableId: string };
|
|
2358
|
+
} else {
|
|
2359
|
+
params = {
|
|
2360
|
+
functionId: paramsOrFirst as string,
|
|
2361
|
+
variableId: rest[0] as string
|
|
2362
|
+
};
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
const functionId = params.functionId;
|
|
2366
|
+
const variableId = params.variableId;
|
|
2367
|
+
|
|
2368
|
+
if (typeof functionId === 'undefined') {
|
|
2369
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
2370
|
+
}
|
|
2371
|
+
if (typeof variableId === 'undefined') {
|
|
2372
|
+
throw new RevenexxException('Missing required parameter: "variableId"');
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
const apiPath = '/v1/apps/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);
|
|
2376
|
+
const payload: Payload = {};
|
|
2377
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2378
|
+
|
|
2379
|
+
const apiHeaders: { [header: string]: string } = {
|
|
2380
|
+
}
|
|
2381
|
+
|
|
2382
|
+
return this.client.call(
|
|
2383
|
+
'get',
|
|
2384
|
+
uri,
|
|
2385
|
+
apiHeaders,
|
|
2386
|
+
payload
|
|
2387
|
+
);
|
|
2388
|
+
}
|
|
2389
|
+
|
|
2390
|
+
/**
|
|
2391
|
+
* Update an App environment variable.
|
|
2392
|
+
*
|
|
2393
|
+
* @param {string} params.functionId - Function unique ID.
|
|
2394
|
+
* @param {string} params.variableId - Variable unique ID.
|
|
2395
|
+
* @param {string} params.key - Variable key. Max length: 255 chars.
|
|
2396
|
+
* @param {boolean} params.secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime.
|
|
2397
|
+
* @param {string} params.value - Variable value. Max length: 8192 chars.
|
|
2398
|
+
* @throws {RevenexxException}
|
|
2399
|
+
* @returns {Promise<Models.Variable>}
|
|
2400
|
+
*/
|
|
2401
|
+
appsUpdateVariable(params: { functionId: string, variableId: string, key: string, secret?: boolean, value?: string }): Promise<Models.Variable>;
|
|
2402
|
+
/**
|
|
2403
|
+
* Update an App environment variable.
|
|
2404
|
+
*
|
|
2405
|
+
* @param {string} functionId - Function unique ID.
|
|
2406
|
+
* @param {string} variableId - Variable unique ID.
|
|
2407
|
+
* @param {string} key - Variable key. Max length: 255 chars.
|
|
2408
|
+
* @param {boolean} secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime.
|
|
2409
|
+
* @param {string} value - Variable value. Max length: 8192 chars.
|
|
2410
|
+
* @throws {RevenexxException}
|
|
2411
|
+
* @returns {Promise<Models.Variable>}
|
|
2412
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2413
|
+
*/
|
|
2414
|
+
appsUpdateVariable(functionId: string, variableId: string, key: string, secret?: boolean, value?: string): Promise<Models.Variable>;
|
|
2415
|
+
appsUpdateVariable(
|
|
2416
|
+
paramsOrFirst: { functionId: string, variableId: string, key: string, secret?: boolean, value?: string } | string,
|
|
2417
|
+
...rest: [(string)?, (string)?, (boolean)?, (string)?]
|
|
2418
|
+
): Promise<Models.Variable> {
|
|
2419
|
+
let params: { functionId: string, variableId: string, key: string, secret?: boolean, value?: string };
|
|
2420
|
+
|
|
2421
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2422
|
+
params = (paramsOrFirst || {}) as { functionId: string, variableId: string, key: string, secret?: boolean, value?: string };
|
|
2423
|
+
} else {
|
|
2424
|
+
params = {
|
|
2425
|
+
functionId: paramsOrFirst as string,
|
|
2426
|
+
variableId: rest[0] as string,
|
|
2427
|
+
key: rest[1] as string,
|
|
2428
|
+
secret: rest[2] as boolean,
|
|
2429
|
+
value: rest[3] as string
|
|
2430
|
+
};
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2433
|
+
const functionId = params.functionId;
|
|
2434
|
+
const variableId = params.variableId;
|
|
2435
|
+
const key = params.key;
|
|
2436
|
+
const secret = params.secret;
|
|
2437
|
+
const value = params.value;
|
|
2438
|
+
|
|
2439
|
+
if (typeof functionId === 'undefined') {
|
|
2440
|
+
throw new RevenexxException('Missing required parameter: "functionId"');
|
|
2441
|
+
}
|
|
2442
|
+
if (typeof variableId === 'undefined') {
|
|
2443
|
+
throw new RevenexxException('Missing required parameter: "variableId"');
|
|
2444
|
+
}
|
|
2445
|
+
if (typeof key === 'undefined') {
|
|
2446
|
+
throw new RevenexxException('Missing required parameter: "key"');
|
|
2447
|
+
}
|
|
2448
|
+
|
|
2449
|
+
const apiPath = '/v1/apps/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);
|
|
2450
|
+
const payload: Payload = {};
|
|
2451
|
+
if (typeof key !== 'undefined') {
|
|
2452
|
+
payload['key'] = key;
|
|
2453
|
+
}
|
|
2454
|
+
if (typeof secret !== 'undefined') {
|
|
2455
|
+
payload['secret'] = secret;
|
|
2456
|
+
}
|
|
2457
|
+
if (typeof value !== 'undefined') {
|
|
2458
|
+
payload['value'] = value;
|
|
2459
|
+
}
|
|
2460
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2461
|
+
|
|
2462
|
+
const apiHeaders: { [header: string]: string } = {
|
|
2463
|
+
'content-type': 'application/json',
|
|
2464
|
+
}
|
|
2465
|
+
|
|
2466
|
+
return this.client.call(
|
|
2467
|
+
'put',
|
|
2468
|
+
uri,
|
|
2469
|
+
apiHeaders,
|
|
2470
|
+
payload
|
|
2471
|
+
);
|
|
2472
|
+
}
|
|
2473
|
+
}
|