@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,1847 @@
|
|
|
1
|
+
import { Service } from '../service';
|
|
2
|
+
import { RevenexxException, Client, type Payload, UploadProgress } from '../client';
|
|
3
|
+
import type { Models } from '../models';
|
|
4
|
+
|
|
5
|
+
import { BuildRuntime } from '../enums/build-runtime';
|
|
6
|
+
import { Framework } from '../enums/framework';
|
|
7
|
+
import { Adapter } from '../enums/adapter';
|
|
8
|
+
import { Type } from '../enums/type';
|
|
9
|
+
|
|
10
|
+
export class Sites {
|
|
11
|
+
client: Client;
|
|
12
|
+
|
|
13
|
+
constructor(client: Client) {
|
|
14
|
+
this.client = client;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Get a list of all the project's sites. You can use the query params to filter your results.
|
|
19
|
+
*
|
|
20
|
+
* @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, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId
|
|
21
|
+
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
22
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
23
|
+
* @throws {RevenexxException}
|
|
24
|
+
* @returns {Promise<Models.SiteList>}
|
|
25
|
+
*/
|
|
26
|
+
sitesList(params?: { queries?: string[], search?: string, total?: boolean }): Promise<Models.SiteList>;
|
|
27
|
+
/**
|
|
28
|
+
* Get a list of all the project's sites. You can use the query params to filter your results.
|
|
29
|
+
*
|
|
30
|
+
* @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, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId
|
|
31
|
+
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
32
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
33
|
+
* @throws {RevenexxException}
|
|
34
|
+
* @returns {Promise<Models.SiteList>}
|
|
35
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
36
|
+
*/
|
|
37
|
+
sitesList(queries?: string[], search?: string, total?: boolean): Promise<Models.SiteList>;
|
|
38
|
+
sitesList(
|
|
39
|
+
paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[],
|
|
40
|
+
...rest: [(string)?, (boolean)?]
|
|
41
|
+
): Promise<Models.SiteList> {
|
|
42
|
+
let params: { queries?: string[], search?: string, total?: boolean };
|
|
43
|
+
|
|
44
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
45
|
+
params = (paramsOrFirst || {}) as { queries?: string[], search?: string, total?: boolean };
|
|
46
|
+
} else {
|
|
47
|
+
params = {
|
|
48
|
+
queries: paramsOrFirst as string[],
|
|
49
|
+
search: rest[0] as string,
|
|
50
|
+
total: rest[1] as boolean
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const queries = params.queries;
|
|
55
|
+
const search = params.search;
|
|
56
|
+
const total = params.total;
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
const apiPath = '/v1/sites';
|
|
60
|
+
const payload: Payload = {};
|
|
61
|
+
if (typeof queries !== 'undefined') {
|
|
62
|
+
payload['queries'] = queries;
|
|
63
|
+
}
|
|
64
|
+
if (typeof search !== 'undefined') {
|
|
65
|
+
payload['search'] = search;
|
|
66
|
+
}
|
|
67
|
+
if (typeof total !== 'undefined') {
|
|
68
|
+
payload['total'] = total;
|
|
69
|
+
}
|
|
70
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
71
|
+
|
|
72
|
+
const apiHeaders: { [header: string]: string } = {
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return this.client.call(
|
|
76
|
+
'get',
|
|
77
|
+
uri,
|
|
78
|
+
apiHeaders,
|
|
79
|
+
payload
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Create a new site.
|
|
85
|
+
*
|
|
86
|
+
* @param {BuildRuntime} params.buildRuntime - Runtime to use during build step.
|
|
87
|
+
* @param {Framework} params.framework - Sites framework.
|
|
88
|
+
* @param {string} params.name - Site name. Max length: 128 chars.
|
|
89
|
+
* @param {string} params.siteId - Site 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.
|
|
90
|
+
* @param {Adapter} params.adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr
|
|
91
|
+
* @param {string} params.buildCommand - Build Command.
|
|
92
|
+
* @param {boolean} params.enabled - Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
|
|
93
|
+
* @param {string} params.fallbackFile - Fallback file for single page application sites.
|
|
94
|
+
* @param {string} params.installCommand - Install Command.
|
|
95
|
+
* @param {string} params.installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
|
|
96
|
+
* @param {boolean} params.logging - When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
|
|
97
|
+
* @param {string} params.outputDirectory - Output Directory for site.
|
|
98
|
+
* @param {string} params.providerBranch - Production branch for the repo linked to the site.
|
|
99
|
+
* @param {string} params.providerRepositoryId - Repository ID of the repo linked to the site.
|
|
100
|
+
* @param {string} params.providerRootDirectory - Path to site code in the linked repo.
|
|
101
|
+
* @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
|
|
102
|
+
* @param {string} params.specification - Framework specification for the site and builds.
|
|
103
|
+
* @param {number} params.timeout - Maximum request time in seconds.
|
|
104
|
+
* @throws {RevenexxException}
|
|
105
|
+
* @returns {Promise<Models.Site>}
|
|
106
|
+
*/
|
|
107
|
+
sitesCreate(params: { buildRuntime: BuildRuntime, framework: Framework, name: string, siteId: string, adapter?: Adapter, buildCommand?: string, enabled?: boolean, fallbackFile?: string, installCommand?: string, installationId?: string, logging?: boolean, outputDirectory?: string, providerBranch?: string, providerRepositoryId?: string, providerRootDirectory?: string, providerSilentMode?: boolean, specification?: string, timeout?: number }): Promise<Models.Site>;
|
|
108
|
+
/**
|
|
109
|
+
* Create a new site.
|
|
110
|
+
*
|
|
111
|
+
* @param {BuildRuntime} buildRuntime - Runtime to use during build step.
|
|
112
|
+
* @param {Framework} framework - Sites framework.
|
|
113
|
+
* @param {string} name - Site name. Max length: 128 chars.
|
|
114
|
+
* @param {string} siteId - Site 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.
|
|
115
|
+
* @param {Adapter} adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr
|
|
116
|
+
* @param {string} buildCommand - Build Command.
|
|
117
|
+
* @param {boolean} enabled - Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
|
|
118
|
+
* @param {string} fallbackFile - Fallback file for single page application sites.
|
|
119
|
+
* @param {string} installCommand - Install Command.
|
|
120
|
+
* @param {string} installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
|
|
121
|
+
* @param {boolean} logging - When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
|
|
122
|
+
* @param {string} outputDirectory - Output Directory for site.
|
|
123
|
+
* @param {string} providerBranch - Production branch for the repo linked to the site.
|
|
124
|
+
* @param {string} providerRepositoryId - Repository ID of the repo linked to the site.
|
|
125
|
+
* @param {string} providerRootDirectory - Path to site code in the linked repo.
|
|
126
|
+
* @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
|
|
127
|
+
* @param {string} specification - Framework specification for the site and builds.
|
|
128
|
+
* @param {number} timeout - Maximum request time in seconds.
|
|
129
|
+
* @throws {RevenexxException}
|
|
130
|
+
* @returns {Promise<Models.Site>}
|
|
131
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
132
|
+
*/
|
|
133
|
+
sitesCreate(buildRuntime: BuildRuntime, framework: Framework, name: string, siteId: string, adapter?: Adapter, buildCommand?: string, enabled?: boolean, fallbackFile?: string, installCommand?: string, installationId?: string, logging?: boolean, outputDirectory?: string, providerBranch?: string, providerRepositoryId?: string, providerRootDirectory?: string, providerSilentMode?: boolean, specification?: string, timeout?: number): Promise<Models.Site>;
|
|
134
|
+
sitesCreate(
|
|
135
|
+
paramsOrFirst: { buildRuntime: BuildRuntime, framework: Framework, name: string, siteId: string, adapter?: Adapter, buildCommand?: string, enabled?: boolean, fallbackFile?: string, installCommand?: string, installationId?: string, logging?: boolean, outputDirectory?: string, providerBranch?: string, providerRepositoryId?: string, providerRootDirectory?: string, providerSilentMode?: boolean, specification?: string, timeout?: number } | BuildRuntime,
|
|
136
|
+
...rest: [(Framework)?, (string)?, (string)?, (Adapter)?, (string)?, (boolean)?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (number)?]
|
|
137
|
+
): Promise<Models.Site> {
|
|
138
|
+
let params: { buildRuntime: BuildRuntime, framework: Framework, name: string, siteId: string, adapter?: Adapter, buildCommand?: string, enabled?: boolean, fallbackFile?: string, installCommand?: string, installationId?: string, logging?: boolean, outputDirectory?: string, providerBranch?: string, providerRepositoryId?: string, providerRootDirectory?: string, providerSilentMode?: boolean, specification?: string, timeout?: number };
|
|
139
|
+
|
|
140
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('buildRuntime' in paramsOrFirst || 'framework' in paramsOrFirst || 'name' in paramsOrFirst || 'siteId' in paramsOrFirst || 'adapter' in paramsOrFirst || 'buildCommand' in paramsOrFirst || 'enabled' in paramsOrFirst || 'fallbackFile' in paramsOrFirst || 'installCommand' in paramsOrFirst || 'installationId' in paramsOrFirst || 'logging' in paramsOrFirst || 'outputDirectory' in paramsOrFirst || 'providerBranch' in paramsOrFirst || 'providerRepositoryId' in paramsOrFirst || 'providerRootDirectory' in paramsOrFirst || 'providerSilentMode' in paramsOrFirst || 'specification' in paramsOrFirst || 'timeout' in paramsOrFirst))) {
|
|
141
|
+
params = (paramsOrFirst || {}) as { buildRuntime: BuildRuntime, framework: Framework, name: string, siteId: string, adapter?: Adapter, buildCommand?: string, enabled?: boolean, fallbackFile?: string, installCommand?: string, installationId?: string, logging?: boolean, outputDirectory?: string, providerBranch?: string, providerRepositoryId?: string, providerRootDirectory?: string, providerSilentMode?: boolean, specification?: string, timeout?: number };
|
|
142
|
+
} else {
|
|
143
|
+
params = {
|
|
144
|
+
buildRuntime: paramsOrFirst as BuildRuntime,
|
|
145
|
+
framework: rest[0] as Framework,
|
|
146
|
+
name: rest[1] as string,
|
|
147
|
+
siteId: rest[2] as string,
|
|
148
|
+
adapter: rest[3] as Adapter,
|
|
149
|
+
buildCommand: rest[4] as string,
|
|
150
|
+
enabled: rest[5] as boolean,
|
|
151
|
+
fallbackFile: rest[6] as string,
|
|
152
|
+
installCommand: rest[7] as string,
|
|
153
|
+
installationId: rest[8] as string,
|
|
154
|
+
logging: rest[9] as boolean,
|
|
155
|
+
outputDirectory: rest[10] as string,
|
|
156
|
+
providerBranch: rest[11] as string,
|
|
157
|
+
providerRepositoryId: rest[12] as string,
|
|
158
|
+
providerRootDirectory: rest[13] as string,
|
|
159
|
+
providerSilentMode: rest[14] as boolean,
|
|
160
|
+
specification: rest[15] as string,
|
|
161
|
+
timeout: rest[16] as number
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const buildRuntime = params.buildRuntime;
|
|
166
|
+
const framework = params.framework;
|
|
167
|
+
const name = params.name;
|
|
168
|
+
const siteId = params.siteId;
|
|
169
|
+
const adapter = params.adapter;
|
|
170
|
+
const buildCommand = params.buildCommand;
|
|
171
|
+
const enabled = params.enabled;
|
|
172
|
+
const fallbackFile = params.fallbackFile;
|
|
173
|
+
const installCommand = params.installCommand;
|
|
174
|
+
const installationId = params.installationId;
|
|
175
|
+
const logging = params.logging;
|
|
176
|
+
const outputDirectory = params.outputDirectory;
|
|
177
|
+
const providerBranch = params.providerBranch;
|
|
178
|
+
const providerRepositoryId = params.providerRepositoryId;
|
|
179
|
+
const providerRootDirectory = params.providerRootDirectory;
|
|
180
|
+
const providerSilentMode = params.providerSilentMode;
|
|
181
|
+
const specification = params.specification;
|
|
182
|
+
const timeout = params.timeout;
|
|
183
|
+
|
|
184
|
+
if (typeof buildRuntime === 'undefined') {
|
|
185
|
+
throw new RevenexxException('Missing required parameter: "buildRuntime"');
|
|
186
|
+
}
|
|
187
|
+
if (typeof framework === 'undefined') {
|
|
188
|
+
throw new RevenexxException('Missing required parameter: "framework"');
|
|
189
|
+
}
|
|
190
|
+
if (typeof name === 'undefined') {
|
|
191
|
+
throw new RevenexxException('Missing required parameter: "name"');
|
|
192
|
+
}
|
|
193
|
+
if (typeof siteId === 'undefined') {
|
|
194
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const apiPath = '/v1/sites';
|
|
198
|
+
const payload: Payload = {};
|
|
199
|
+
if (typeof adapter !== 'undefined') {
|
|
200
|
+
payload['adapter'] = adapter;
|
|
201
|
+
}
|
|
202
|
+
if (typeof buildCommand !== 'undefined') {
|
|
203
|
+
payload['buildCommand'] = buildCommand;
|
|
204
|
+
}
|
|
205
|
+
if (typeof buildRuntime !== 'undefined') {
|
|
206
|
+
payload['buildRuntime'] = buildRuntime;
|
|
207
|
+
}
|
|
208
|
+
if (typeof enabled !== 'undefined') {
|
|
209
|
+
payload['enabled'] = enabled;
|
|
210
|
+
}
|
|
211
|
+
if (typeof fallbackFile !== 'undefined') {
|
|
212
|
+
payload['fallbackFile'] = fallbackFile;
|
|
213
|
+
}
|
|
214
|
+
if (typeof framework !== 'undefined') {
|
|
215
|
+
payload['framework'] = framework;
|
|
216
|
+
}
|
|
217
|
+
if (typeof installCommand !== 'undefined') {
|
|
218
|
+
payload['installCommand'] = installCommand;
|
|
219
|
+
}
|
|
220
|
+
if (typeof installationId !== 'undefined') {
|
|
221
|
+
payload['installationId'] = installationId;
|
|
222
|
+
}
|
|
223
|
+
if (typeof logging !== 'undefined') {
|
|
224
|
+
payload['logging'] = logging;
|
|
225
|
+
}
|
|
226
|
+
if (typeof name !== 'undefined') {
|
|
227
|
+
payload['name'] = name;
|
|
228
|
+
}
|
|
229
|
+
if (typeof outputDirectory !== 'undefined') {
|
|
230
|
+
payload['outputDirectory'] = outputDirectory;
|
|
231
|
+
}
|
|
232
|
+
if (typeof providerBranch !== 'undefined') {
|
|
233
|
+
payload['providerBranch'] = providerBranch;
|
|
234
|
+
}
|
|
235
|
+
if (typeof providerRepositoryId !== 'undefined') {
|
|
236
|
+
payload['providerRepositoryId'] = providerRepositoryId;
|
|
237
|
+
}
|
|
238
|
+
if (typeof providerRootDirectory !== 'undefined') {
|
|
239
|
+
payload['providerRootDirectory'] = providerRootDirectory;
|
|
240
|
+
}
|
|
241
|
+
if (typeof providerSilentMode !== 'undefined') {
|
|
242
|
+
payload['providerSilentMode'] = providerSilentMode;
|
|
243
|
+
}
|
|
244
|
+
if (typeof siteId !== 'undefined') {
|
|
245
|
+
payload['siteId'] = siteId;
|
|
246
|
+
}
|
|
247
|
+
if (typeof specification !== 'undefined') {
|
|
248
|
+
payload['specification'] = specification;
|
|
249
|
+
}
|
|
250
|
+
if (typeof timeout !== 'undefined') {
|
|
251
|
+
payload['timeout'] = timeout;
|
|
252
|
+
}
|
|
253
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
254
|
+
|
|
255
|
+
const apiHeaders: { [header: string]: string } = {
|
|
256
|
+
'content-type': 'application/json',
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
return this.client.call(
|
|
260
|
+
'post',
|
|
261
|
+
uri,
|
|
262
|
+
apiHeaders,
|
|
263
|
+
payload
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Get a list of all frameworks that are currently available on the server instance.
|
|
269
|
+
*
|
|
270
|
+
* @throws {RevenexxException}
|
|
271
|
+
* @returns {Promise<Models.FrameworkList>}
|
|
272
|
+
*/
|
|
273
|
+
sitesListFrameworks(): Promise<Models.FrameworkList> {
|
|
274
|
+
|
|
275
|
+
const apiPath = '/v1/sites/frameworks';
|
|
276
|
+
const payload: Payload = {};
|
|
277
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
278
|
+
|
|
279
|
+
const apiHeaders: { [header: string]: string } = {
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
return this.client.call(
|
|
283
|
+
'get',
|
|
284
|
+
uri,
|
|
285
|
+
apiHeaders,
|
|
286
|
+
payload
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* List allowed site specifications for this instance.
|
|
292
|
+
*
|
|
293
|
+
* @throws {RevenexxException}
|
|
294
|
+
* @returns {Promise<Models.SpecificationList>}
|
|
295
|
+
*/
|
|
296
|
+
sitesListSpecifications(): Promise<Models.SpecificationList> {
|
|
297
|
+
|
|
298
|
+
const apiPath = '/v1/sites/specifications';
|
|
299
|
+
const payload: Payload = {};
|
|
300
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
301
|
+
|
|
302
|
+
const apiHeaders: { [header: string]: string } = {
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
return this.client.call(
|
|
306
|
+
'get',
|
|
307
|
+
uri,
|
|
308
|
+
apiHeaders,
|
|
309
|
+
payload
|
|
310
|
+
);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Delete a site by its unique ID.
|
|
315
|
+
*
|
|
316
|
+
* @param {string} params.siteId - Site ID.
|
|
317
|
+
* @throws {RevenexxException}
|
|
318
|
+
* @returns {Promise<{}>}
|
|
319
|
+
*/
|
|
320
|
+
sitesDelete(params: { siteId: string }): Promise<{}>;
|
|
321
|
+
/**
|
|
322
|
+
* Delete a site by its unique ID.
|
|
323
|
+
*
|
|
324
|
+
* @param {string} siteId - Site ID.
|
|
325
|
+
* @throws {RevenexxException}
|
|
326
|
+
* @returns {Promise<{}>}
|
|
327
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
328
|
+
*/
|
|
329
|
+
sitesDelete(siteId: string): Promise<{}>;
|
|
330
|
+
sitesDelete(
|
|
331
|
+
paramsOrFirst: { siteId: string } | string
|
|
332
|
+
): Promise<{}> {
|
|
333
|
+
let params: { siteId: string };
|
|
334
|
+
|
|
335
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
336
|
+
params = (paramsOrFirst || {}) as { siteId: string };
|
|
337
|
+
} else {
|
|
338
|
+
params = {
|
|
339
|
+
siteId: paramsOrFirst as string
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
const siteId = params.siteId;
|
|
344
|
+
|
|
345
|
+
if (typeof siteId === 'undefined') {
|
|
346
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
const apiPath = '/v1/sites/{siteId}'.replace('{siteId}', siteId);
|
|
350
|
+
const payload: Payload = {};
|
|
351
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
352
|
+
|
|
353
|
+
const apiHeaders: { [header: string]: string } = {
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
return this.client.call(
|
|
357
|
+
'delete',
|
|
358
|
+
uri,
|
|
359
|
+
apiHeaders,
|
|
360
|
+
payload
|
|
361
|
+
);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Get a site by its unique ID.
|
|
366
|
+
*
|
|
367
|
+
* @param {string} params.siteId - Site ID.
|
|
368
|
+
* @throws {RevenexxException}
|
|
369
|
+
* @returns {Promise<Models.Site>}
|
|
370
|
+
*/
|
|
371
|
+
sitesGet(params: { siteId: string }): Promise<Models.Site>;
|
|
372
|
+
/**
|
|
373
|
+
* Get a site by its unique ID.
|
|
374
|
+
*
|
|
375
|
+
* @param {string} siteId - Site ID.
|
|
376
|
+
* @throws {RevenexxException}
|
|
377
|
+
* @returns {Promise<Models.Site>}
|
|
378
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
379
|
+
*/
|
|
380
|
+
sitesGet(siteId: string): Promise<Models.Site>;
|
|
381
|
+
sitesGet(
|
|
382
|
+
paramsOrFirst: { siteId: string } | string
|
|
383
|
+
): Promise<Models.Site> {
|
|
384
|
+
let params: { siteId: string };
|
|
385
|
+
|
|
386
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
387
|
+
params = (paramsOrFirst || {}) as { siteId: string };
|
|
388
|
+
} else {
|
|
389
|
+
params = {
|
|
390
|
+
siteId: paramsOrFirst as string
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
const siteId = params.siteId;
|
|
395
|
+
|
|
396
|
+
if (typeof siteId === 'undefined') {
|
|
397
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
const apiPath = '/v1/sites/{siteId}'.replace('{siteId}', siteId);
|
|
401
|
+
const payload: Payload = {};
|
|
402
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
403
|
+
|
|
404
|
+
const apiHeaders: { [header: string]: string } = {
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
return this.client.call(
|
|
408
|
+
'get',
|
|
409
|
+
uri,
|
|
410
|
+
apiHeaders,
|
|
411
|
+
payload
|
|
412
|
+
);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Update site by its unique ID.
|
|
417
|
+
*
|
|
418
|
+
* @param {string} params.siteId - Site ID.
|
|
419
|
+
* @param {Framework} params.framework - Sites framework.
|
|
420
|
+
* @param {string} params.name - Site name. Max length: 128 chars.
|
|
421
|
+
* @param {Adapter} params.adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr
|
|
422
|
+
* @param {string} params.buildCommand - Build Command.
|
|
423
|
+
* @param {BuildRuntime} params.buildRuntime - Runtime to use during build step.
|
|
424
|
+
* @param {boolean} params.enabled - Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
|
|
425
|
+
* @param {string} params.fallbackFile - Fallback file for single page application sites.
|
|
426
|
+
* @param {string} params.installCommand - Install Command.
|
|
427
|
+
* @param {string} params.installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
|
|
428
|
+
* @param {boolean} params.logging - When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
|
|
429
|
+
* @param {string} params.outputDirectory - Output Directory for site.
|
|
430
|
+
* @param {string} params.providerBranch - Production branch for the repo linked to the site.
|
|
431
|
+
* @param {string} params.providerRepositoryId - Repository ID of the repo linked to the site.
|
|
432
|
+
* @param {string} params.providerRootDirectory - Path to site code in the linked repo.
|
|
433
|
+
* @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
|
|
434
|
+
* @param {string} params.specification - Framework specification for the site and builds.
|
|
435
|
+
* @param {number} params.timeout - Maximum request time in seconds.
|
|
436
|
+
* @throws {RevenexxException}
|
|
437
|
+
* @returns {Promise<Models.Site>}
|
|
438
|
+
*/
|
|
439
|
+
sitesUpdate(params: { siteId: string, framework: Framework, name: string, adapter?: Adapter, buildCommand?: string, buildRuntime?: BuildRuntime, enabled?: boolean, fallbackFile?: string, installCommand?: string, installationId?: string, logging?: boolean, outputDirectory?: string, providerBranch?: string, providerRepositoryId?: string, providerRootDirectory?: string, providerSilentMode?: boolean, specification?: string, timeout?: number }): Promise<Models.Site>;
|
|
440
|
+
/**
|
|
441
|
+
* Update site by its unique ID.
|
|
442
|
+
*
|
|
443
|
+
* @param {string} siteId - Site ID.
|
|
444
|
+
* @param {Framework} framework - Sites framework.
|
|
445
|
+
* @param {string} name - Site name. Max length: 128 chars.
|
|
446
|
+
* @param {Adapter} adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr
|
|
447
|
+
* @param {string} buildCommand - Build Command.
|
|
448
|
+
* @param {BuildRuntime} buildRuntime - Runtime to use during build step.
|
|
449
|
+
* @param {boolean} enabled - Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
|
|
450
|
+
* @param {string} fallbackFile - Fallback file for single page application sites.
|
|
451
|
+
* @param {string} installCommand - Install Command.
|
|
452
|
+
* @param {string} installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
|
|
453
|
+
* @param {boolean} logging - When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
|
|
454
|
+
* @param {string} outputDirectory - Output Directory for site.
|
|
455
|
+
* @param {string} providerBranch - Production branch for the repo linked to the site.
|
|
456
|
+
* @param {string} providerRepositoryId - Repository ID of the repo linked to the site.
|
|
457
|
+
* @param {string} providerRootDirectory - Path to site code in the linked repo.
|
|
458
|
+
* @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
|
|
459
|
+
* @param {string} specification - Framework specification for the site and builds.
|
|
460
|
+
* @param {number} timeout - Maximum request time in seconds.
|
|
461
|
+
* @throws {RevenexxException}
|
|
462
|
+
* @returns {Promise<Models.Site>}
|
|
463
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
464
|
+
*/
|
|
465
|
+
sitesUpdate(siteId: string, framework: Framework, name: string, adapter?: Adapter, buildCommand?: string, buildRuntime?: BuildRuntime, enabled?: boolean, fallbackFile?: string, installCommand?: string, installationId?: string, logging?: boolean, outputDirectory?: string, providerBranch?: string, providerRepositoryId?: string, providerRootDirectory?: string, providerSilentMode?: boolean, specification?: string, timeout?: number): Promise<Models.Site>;
|
|
466
|
+
sitesUpdate(
|
|
467
|
+
paramsOrFirst: { siteId: string, framework: Framework, name: string, adapter?: Adapter, buildCommand?: string, buildRuntime?: BuildRuntime, enabled?: boolean, fallbackFile?: string, installCommand?: string, installationId?: string, logging?: boolean, outputDirectory?: string, providerBranch?: string, providerRepositoryId?: string, providerRootDirectory?: string, providerSilentMode?: boolean, specification?: string, timeout?: number } | string,
|
|
468
|
+
...rest: [(Framework)?, (string)?, (Adapter)?, (string)?, (BuildRuntime)?, (boolean)?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (number)?]
|
|
469
|
+
): Promise<Models.Site> {
|
|
470
|
+
let params: { siteId: string, framework: Framework, name: string, adapter?: Adapter, buildCommand?: string, buildRuntime?: BuildRuntime, enabled?: boolean, fallbackFile?: string, installCommand?: string, installationId?: string, logging?: boolean, outputDirectory?: string, providerBranch?: string, providerRepositoryId?: string, providerRootDirectory?: string, providerSilentMode?: boolean, specification?: string, timeout?: number };
|
|
471
|
+
|
|
472
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
473
|
+
params = (paramsOrFirst || {}) as { siteId: string, framework: Framework, name: string, adapter?: Adapter, buildCommand?: string, buildRuntime?: BuildRuntime, enabled?: boolean, fallbackFile?: string, installCommand?: string, installationId?: string, logging?: boolean, outputDirectory?: string, providerBranch?: string, providerRepositoryId?: string, providerRootDirectory?: string, providerSilentMode?: boolean, specification?: string, timeout?: number };
|
|
474
|
+
} else {
|
|
475
|
+
params = {
|
|
476
|
+
siteId: paramsOrFirst as string,
|
|
477
|
+
framework: rest[0] as Framework,
|
|
478
|
+
name: rest[1] as string,
|
|
479
|
+
adapter: rest[2] as Adapter,
|
|
480
|
+
buildCommand: rest[3] as string,
|
|
481
|
+
buildRuntime: rest[4] as BuildRuntime,
|
|
482
|
+
enabled: rest[5] as boolean,
|
|
483
|
+
fallbackFile: rest[6] as string,
|
|
484
|
+
installCommand: rest[7] as string,
|
|
485
|
+
installationId: rest[8] as string,
|
|
486
|
+
logging: rest[9] as boolean,
|
|
487
|
+
outputDirectory: rest[10] as string,
|
|
488
|
+
providerBranch: rest[11] as string,
|
|
489
|
+
providerRepositoryId: rest[12] as string,
|
|
490
|
+
providerRootDirectory: rest[13] as string,
|
|
491
|
+
providerSilentMode: rest[14] as boolean,
|
|
492
|
+
specification: rest[15] as string,
|
|
493
|
+
timeout: rest[16] as number
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
const siteId = params.siteId;
|
|
498
|
+
const framework = params.framework;
|
|
499
|
+
const name = params.name;
|
|
500
|
+
const adapter = params.adapter;
|
|
501
|
+
const buildCommand = params.buildCommand;
|
|
502
|
+
const buildRuntime = params.buildRuntime;
|
|
503
|
+
const enabled = params.enabled;
|
|
504
|
+
const fallbackFile = params.fallbackFile;
|
|
505
|
+
const installCommand = params.installCommand;
|
|
506
|
+
const installationId = params.installationId;
|
|
507
|
+
const logging = params.logging;
|
|
508
|
+
const outputDirectory = params.outputDirectory;
|
|
509
|
+
const providerBranch = params.providerBranch;
|
|
510
|
+
const providerRepositoryId = params.providerRepositoryId;
|
|
511
|
+
const providerRootDirectory = params.providerRootDirectory;
|
|
512
|
+
const providerSilentMode = params.providerSilentMode;
|
|
513
|
+
const specification = params.specification;
|
|
514
|
+
const timeout = params.timeout;
|
|
515
|
+
|
|
516
|
+
if (typeof siteId === 'undefined') {
|
|
517
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
518
|
+
}
|
|
519
|
+
if (typeof framework === 'undefined') {
|
|
520
|
+
throw new RevenexxException('Missing required parameter: "framework"');
|
|
521
|
+
}
|
|
522
|
+
if (typeof name === 'undefined') {
|
|
523
|
+
throw new RevenexxException('Missing required parameter: "name"');
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
const apiPath = '/v1/sites/{siteId}'.replace('{siteId}', siteId);
|
|
527
|
+
const payload: Payload = {};
|
|
528
|
+
if (typeof adapter !== 'undefined') {
|
|
529
|
+
payload['adapter'] = adapter;
|
|
530
|
+
}
|
|
531
|
+
if (typeof buildCommand !== 'undefined') {
|
|
532
|
+
payload['buildCommand'] = buildCommand;
|
|
533
|
+
}
|
|
534
|
+
if (typeof buildRuntime !== 'undefined') {
|
|
535
|
+
payload['buildRuntime'] = buildRuntime;
|
|
536
|
+
}
|
|
537
|
+
if (typeof enabled !== 'undefined') {
|
|
538
|
+
payload['enabled'] = enabled;
|
|
539
|
+
}
|
|
540
|
+
if (typeof fallbackFile !== 'undefined') {
|
|
541
|
+
payload['fallbackFile'] = fallbackFile;
|
|
542
|
+
}
|
|
543
|
+
if (typeof framework !== 'undefined') {
|
|
544
|
+
payload['framework'] = framework;
|
|
545
|
+
}
|
|
546
|
+
if (typeof installCommand !== 'undefined') {
|
|
547
|
+
payload['installCommand'] = installCommand;
|
|
548
|
+
}
|
|
549
|
+
if (typeof installationId !== 'undefined') {
|
|
550
|
+
payload['installationId'] = installationId;
|
|
551
|
+
}
|
|
552
|
+
if (typeof logging !== 'undefined') {
|
|
553
|
+
payload['logging'] = logging;
|
|
554
|
+
}
|
|
555
|
+
if (typeof name !== 'undefined') {
|
|
556
|
+
payload['name'] = name;
|
|
557
|
+
}
|
|
558
|
+
if (typeof outputDirectory !== 'undefined') {
|
|
559
|
+
payload['outputDirectory'] = outputDirectory;
|
|
560
|
+
}
|
|
561
|
+
if (typeof providerBranch !== 'undefined') {
|
|
562
|
+
payload['providerBranch'] = providerBranch;
|
|
563
|
+
}
|
|
564
|
+
if (typeof providerRepositoryId !== 'undefined') {
|
|
565
|
+
payload['providerRepositoryId'] = providerRepositoryId;
|
|
566
|
+
}
|
|
567
|
+
if (typeof providerRootDirectory !== 'undefined') {
|
|
568
|
+
payload['providerRootDirectory'] = providerRootDirectory;
|
|
569
|
+
}
|
|
570
|
+
if (typeof providerSilentMode !== 'undefined') {
|
|
571
|
+
payload['providerSilentMode'] = providerSilentMode;
|
|
572
|
+
}
|
|
573
|
+
if (typeof specification !== 'undefined') {
|
|
574
|
+
payload['specification'] = specification;
|
|
575
|
+
}
|
|
576
|
+
if (typeof timeout !== 'undefined') {
|
|
577
|
+
payload['timeout'] = timeout;
|
|
578
|
+
}
|
|
579
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
580
|
+
|
|
581
|
+
const apiHeaders: { [header: string]: string } = {
|
|
582
|
+
'content-type': 'application/json',
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
return this.client.call(
|
|
586
|
+
'put',
|
|
587
|
+
uri,
|
|
588
|
+
apiHeaders,
|
|
589
|
+
payload
|
|
590
|
+
);
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.
|
|
595
|
+
*
|
|
596
|
+
* @param {string} params.siteId - Site ID.
|
|
597
|
+
* @param {string} params.deploymentId - Deployment ID.
|
|
598
|
+
* @throws {RevenexxException}
|
|
599
|
+
* @returns {Promise<Models.Site>}
|
|
600
|
+
*/
|
|
601
|
+
sitesUpdateSiteDeployment(params: { siteId: string, deploymentId: string }): Promise<Models.Site>;
|
|
602
|
+
/**
|
|
603
|
+
* Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.
|
|
604
|
+
*
|
|
605
|
+
* @param {string} siteId - Site ID.
|
|
606
|
+
* @param {string} deploymentId - Deployment ID.
|
|
607
|
+
* @throws {RevenexxException}
|
|
608
|
+
* @returns {Promise<Models.Site>}
|
|
609
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
610
|
+
*/
|
|
611
|
+
sitesUpdateSiteDeployment(siteId: string, deploymentId: string): Promise<Models.Site>;
|
|
612
|
+
sitesUpdateSiteDeployment(
|
|
613
|
+
paramsOrFirst: { siteId: string, deploymentId: string } | string,
|
|
614
|
+
...rest: [(string)?]
|
|
615
|
+
): Promise<Models.Site> {
|
|
616
|
+
let params: { siteId: string, deploymentId: string };
|
|
617
|
+
|
|
618
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
619
|
+
params = (paramsOrFirst || {}) as { siteId: string, deploymentId: string };
|
|
620
|
+
} else {
|
|
621
|
+
params = {
|
|
622
|
+
siteId: paramsOrFirst as string,
|
|
623
|
+
deploymentId: rest[0] as string
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
const siteId = params.siteId;
|
|
628
|
+
const deploymentId = params.deploymentId;
|
|
629
|
+
|
|
630
|
+
if (typeof siteId === 'undefined') {
|
|
631
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
632
|
+
}
|
|
633
|
+
if (typeof deploymentId === 'undefined') {
|
|
634
|
+
throw new RevenexxException('Missing required parameter: "deploymentId"');
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
const apiPath = '/v1/sites/{siteId}/deployment'.replace('{siteId}', siteId);
|
|
638
|
+
const payload: Payload = {};
|
|
639
|
+
if (typeof deploymentId !== 'undefined') {
|
|
640
|
+
payload['deploymentId'] = deploymentId;
|
|
641
|
+
}
|
|
642
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
643
|
+
|
|
644
|
+
const apiHeaders: { [header: string]: string } = {
|
|
645
|
+
'content-type': 'application/json',
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
return this.client.call(
|
|
649
|
+
'patch',
|
|
650
|
+
uri,
|
|
651
|
+
apiHeaders,
|
|
652
|
+
payload
|
|
653
|
+
);
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* Get a list of all the site's code deployments. You can use the query params to filter your results.
|
|
658
|
+
*
|
|
659
|
+
* @param {string} params.siteId - Site ID.
|
|
660
|
+
* @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
|
|
661
|
+
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
662
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
663
|
+
* @throws {RevenexxException}
|
|
664
|
+
* @returns {Promise<Models.DeploymentList>}
|
|
665
|
+
*/
|
|
666
|
+
sitesListDeployments(params: { siteId: string, queries?: string[], search?: string, total?: boolean }): Promise<Models.DeploymentList>;
|
|
667
|
+
/**
|
|
668
|
+
* Get a list of all the site's code deployments. You can use the query params to filter your results.
|
|
669
|
+
*
|
|
670
|
+
* @param {string} siteId - Site ID.
|
|
671
|
+
* @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
|
|
672
|
+
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
673
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
674
|
+
* @throws {RevenexxException}
|
|
675
|
+
* @returns {Promise<Models.DeploymentList>}
|
|
676
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
677
|
+
*/
|
|
678
|
+
sitesListDeployments(siteId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.DeploymentList>;
|
|
679
|
+
sitesListDeployments(
|
|
680
|
+
paramsOrFirst: { siteId: string, queries?: string[], search?: string, total?: boolean } | string,
|
|
681
|
+
...rest: [(string[])?, (string)?, (boolean)?]
|
|
682
|
+
): Promise<Models.DeploymentList> {
|
|
683
|
+
let params: { siteId: string, queries?: string[], search?: string, total?: boolean };
|
|
684
|
+
|
|
685
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
686
|
+
params = (paramsOrFirst || {}) as { siteId: string, queries?: string[], search?: string, total?: boolean };
|
|
687
|
+
} else {
|
|
688
|
+
params = {
|
|
689
|
+
siteId: paramsOrFirst as string,
|
|
690
|
+
queries: rest[0] as string[],
|
|
691
|
+
search: rest[1] as string,
|
|
692
|
+
total: rest[2] as boolean
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
const siteId = params.siteId;
|
|
697
|
+
const queries = params.queries;
|
|
698
|
+
const search = params.search;
|
|
699
|
+
const total = params.total;
|
|
700
|
+
|
|
701
|
+
if (typeof siteId === 'undefined') {
|
|
702
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
const apiPath = '/v1/sites/{siteId}/deployments'.replace('{siteId}', siteId);
|
|
706
|
+
const payload: Payload = {};
|
|
707
|
+
if (typeof queries !== 'undefined') {
|
|
708
|
+
payload['queries'] = queries;
|
|
709
|
+
}
|
|
710
|
+
if (typeof search !== 'undefined') {
|
|
711
|
+
payload['search'] = search;
|
|
712
|
+
}
|
|
713
|
+
if (typeof total !== 'undefined') {
|
|
714
|
+
payload['total'] = total;
|
|
715
|
+
}
|
|
716
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
717
|
+
|
|
718
|
+
const apiHeaders: { [header: string]: string } = {
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
return this.client.call(
|
|
722
|
+
'get',
|
|
723
|
+
uri,
|
|
724
|
+
apiHeaders,
|
|
725
|
+
payload
|
|
726
|
+
);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
/**
|
|
730
|
+
* Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID.
|
|
731
|
+
*
|
|
732
|
+
* @param {string} params.siteId - Site ID.
|
|
733
|
+
* @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
|
|
734
|
+
* @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.
|
|
735
|
+
* @param {string} params.buildCommand - Build Commands.
|
|
736
|
+
* @param {string} params.installCommand - Install Commands.
|
|
737
|
+
* @param {string} params.outputDirectory - Output Directory.
|
|
738
|
+
* @throws {RevenexxException}
|
|
739
|
+
* @returns {Promise<Models.Deployment>}
|
|
740
|
+
*/
|
|
741
|
+
sitesCreateDeployment(params: { siteId: string, activate: boolean, code: string, buildCommand?: string, installCommand?: string, outputDirectory?: string, onProgress?: (progress: UploadProgress) => void }): Promise<Models.Deployment>;
|
|
742
|
+
/**
|
|
743
|
+
* Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID.
|
|
744
|
+
*
|
|
745
|
+
* @param {string} siteId - Site ID.
|
|
746
|
+
* @param {boolean} activate - Automatically activate the deployment when it is finished building.
|
|
747
|
+
* @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.
|
|
748
|
+
* @param {string} buildCommand - Build Commands.
|
|
749
|
+
* @param {string} installCommand - Install Commands.
|
|
750
|
+
* @param {string} outputDirectory - Output Directory.
|
|
751
|
+
* @throws {RevenexxException}
|
|
752
|
+
* @returns {Promise<Models.Deployment>}
|
|
753
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
754
|
+
*/
|
|
755
|
+
sitesCreateDeployment(siteId: string, activate: boolean, code: string, buildCommand?: string, installCommand?: string, outputDirectory?: string, onProgress?: (progress: UploadProgress) => void): Promise<Models.Deployment>;
|
|
756
|
+
sitesCreateDeployment(
|
|
757
|
+
paramsOrFirst: { siteId: string, activate: boolean, code: string, buildCommand?: string, installCommand?: string, outputDirectory?: string, onProgress?: (progress: UploadProgress) => void } | string,
|
|
758
|
+
...rest: [(boolean)?, (string)?, (string)?, (string)?, (string)?,((progress: UploadProgress) => void)?]
|
|
759
|
+
): Promise<Models.Deployment> {
|
|
760
|
+
let params: { siteId: string, activate: boolean, code: string, buildCommand?: string, installCommand?: string, outputDirectory?: string };
|
|
761
|
+
let onProgress: ((progress: UploadProgress) => void);
|
|
762
|
+
|
|
763
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
764
|
+
params = (paramsOrFirst || {}) as { siteId: string, activate: boolean, code: string, buildCommand?: string, installCommand?: string, outputDirectory?: string };
|
|
765
|
+
onProgress = paramsOrFirst?.onProgress as ((progress: UploadProgress) => void);
|
|
766
|
+
} else {
|
|
767
|
+
params = {
|
|
768
|
+
siteId: paramsOrFirst as string,
|
|
769
|
+
activate: rest[0] as boolean,
|
|
770
|
+
code: rest[1] as string,
|
|
771
|
+
buildCommand: rest[2] as string,
|
|
772
|
+
installCommand: rest[3] as string,
|
|
773
|
+
outputDirectory: rest[4] as string
|
|
774
|
+
};
|
|
775
|
+
onProgress = rest[5] as ((progress: UploadProgress) => void);
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
const siteId = params.siteId;
|
|
779
|
+
const activate = params.activate;
|
|
780
|
+
const code = params.code;
|
|
781
|
+
const buildCommand = params.buildCommand;
|
|
782
|
+
const installCommand = params.installCommand;
|
|
783
|
+
const outputDirectory = params.outputDirectory;
|
|
784
|
+
|
|
785
|
+
if (typeof siteId === 'undefined') {
|
|
786
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
787
|
+
}
|
|
788
|
+
if (typeof activate === 'undefined') {
|
|
789
|
+
throw new RevenexxException('Missing required parameter: "activate"');
|
|
790
|
+
}
|
|
791
|
+
if (typeof code === 'undefined') {
|
|
792
|
+
throw new RevenexxException('Missing required parameter: "code"');
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
const apiPath = '/v1/sites/{siteId}/deployments'.replace('{siteId}', siteId);
|
|
796
|
+
const payload: Payload = {};
|
|
797
|
+
if (typeof activate !== 'undefined') {
|
|
798
|
+
payload['activate'] = activate;
|
|
799
|
+
}
|
|
800
|
+
if (typeof buildCommand !== 'undefined') {
|
|
801
|
+
payload['buildCommand'] = buildCommand;
|
|
802
|
+
}
|
|
803
|
+
if (typeof code !== 'undefined') {
|
|
804
|
+
payload['code'] = code;
|
|
805
|
+
}
|
|
806
|
+
if (typeof installCommand !== 'undefined') {
|
|
807
|
+
payload['installCommand'] = installCommand;
|
|
808
|
+
}
|
|
809
|
+
if (typeof outputDirectory !== 'undefined') {
|
|
810
|
+
payload['outputDirectory'] = outputDirectory;
|
|
811
|
+
}
|
|
812
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
813
|
+
|
|
814
|
+
const apiHeaders: { [header: string]: string } = {
|
|
815
|
+
'content-type': 'multipart/form-data',
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
return this.client.chunkedUpload(
|
|
819
|
+
'post',
|
|
820
|
+
uri,
|
|
821
|
+
apiHeaders,
|
|
822
|
+
payload,
|
|
823
|
+
onProgress
|
|
824
|
+
);
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
* Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.
|
|
829
|
+
*
|
|
830
|
+
* @param {string} params.siteId - Site ID.
|
|
831
|
+
* @param {string} params.deploymentId - Deployment ID.
|
|
832
|
+
* @throws {RevenexxException}
|
|
833
|
+
* @returns {Promise<Models.Deployment>}
|
|
834
|
+
*/
|
|
835
|
+
sitesCreateDuplicateDeployment(params: { siteId: string, deploymentId: string }): Promise<Models.Deployment>;
|
|
836
|
+
/**
|
|
837
|
+
* Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.
|
|
838
|
+
*
|
|
839
|
+
* @param {string} siteId - Site ID.
|
|
840
|
+
* @param {string} deploymentId - Deployment ID.
|
|
841
|
+
* @throws {RevenexxException}
|
|
842
|
+
* @returns {Promise<Models.Deployment>}
|
|
843
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
844
|
+
*/
|
|
845
|
+
sitesCreateDuplicateDeployment(siteId: string, deploymentId: string): Promise<Models.Deployment>;
|
|
846
|
+
sitesCreateDuplicateDeployment(
|
|
847
|
+
paramsOrFirst: { siteId: string, deploymentId: string } | string,
|
|
848
|
+
...rest: [(string)?]
|
|
849
|
+
): Promise<Models.Deployment> {
|
|
850
|
+
let params: { siteId: string, deploymentId: string };
|
|
851
|
+
|
|
852
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
853
|
+
params = (paramsOrFirst || {}) as { siteId: string, deploymentId: string };
|
|
854
|
+
} else {
|
|
855
|
+
params = {
|
|
856
|
+
siteId: paramsOrFirst as string,
|
|
857
|
+
deploymentId: rest[0] as string
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
const siteId = params.siteId;
|
|
862
|
+
const deploymentId = params.deploymentId;
|
|
863
|
+
|
|
864
|
+
if (typeof siteId === 'undefined') {
|
|
865
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
866
|
+
}
|
|
867
|
+
if (typeof deploymentId === 'undefined') {
|
|
868
|
+
throw new RevenexxException('Missing required parameter: "deploymentId"');
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
const apiPath = '/v1/sites/{siteId}/deployments/duplicate'.replace('{siteId}', siteId);
|
|
872
|
+
const payload: Payload = {};
|
|
873
|
+
if (typeof deploymentId !== 'undefined') {
|
|
874
|
+
payload['deploymentId'] = deploymentId;
|
|
875
|
+
}
|
|
876
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
877
|
+
|
|
878
|
+
const apiHeaders: { [header: string]: string } = {
|
|
879
|
+
'content-type': 'application/json',
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
return this.client.call(
|
|
883
|
+
'post',
|
|
884
|
+
uri,
|
|
885
|
+
apiHeaders,
|
|
886
|
+
payload
|
|
887
|
+
);
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
/**
|
|
891
|
+
* Create a deployment based on a template.
|
|
892
|
+
*
|
|
893
|
+
* Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/sites/templates) to find the template details.
|
|
894
|
+
*
|
|
895
|
+
* @param {string} params.siteId - Site ID.
|
|
896
|
+
* @param {string} params.owner - The name of the owner of the template.
|
|
897
|
+
* @param {string} params.reference - Reference value, can be a commit hash, branch name, or release tag
|
|
898
|
+
* @param {string} params.repository - Repository name of the template.
|
|
899
|
+
* @param {string} params.rootDirectory - Path to site code in the template repo.
|
|
900
|
+
* @param {Type} params.type - Type for the reference provided. Can be commit, branch, or tag
|
|
901
|
+
* @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
|
|
902
|
+
* @throws {RevenexxException}
|
|
903
|
+
* @returns {Promise<Models.Deployment>}
|
|
904
|
+
*/
|
|
905
|
+
sitesCreateTemplateDeployment(params: { siteId: string, owner: string, reference: string, repository: string, rootDirectory: string, type: Type, activate?: boolean }): Promise<Models.Deployment>;
|
|
906
|
+
/**
|
|
907
|
+
* Create a deployment based on a template.
|
|
908
|
+
*
|
|
909
|
+
* Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/sites/templates) to find the template details.
|
|
910
|
+
*
|
|
911
|
+
* @param {string} siteId - Site ID.
|
|
912
|
+
* @param {string} owner - The name of the owner of the template.
|
|
913
|
+
* @param {string} reference - Reference value, can be a commit hash, branch name, or release tag
|
|
914
|
+
* @param {string} repository - Repository name of the template.
|
|
915
|
+
* @param {string} rootDirectory - Path to site code in the template repo.
|
|
916
|
+
* @param {Type} type - Type for the reference provided. Can be commit, branch, or tag
|
|
917
|
+
* @param {boolean} activate - Automatically activate the deployment when it is finished building.
|
|
918
|
+
* @throws {RevenexxException}
|
|
919
|
+
* @returns {Promise<Models.Deployment>}
|
|
920
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
921
|
+
*/
|
|
922
|
+
sitesCreateTemplateDeployment(siteId: string, owner: string, reference: string, repository: string, rootDirectory: string, type: Type, activate?: boolean): Promise<Models.Deployment>;
|
|
923
|
+
sitesCreateTemplateDeployment(
|
|
924
|
+
paramsOrFirst: { siteId: string, owner: string, reference: string, repository: string, rootDirectory: string, type: Type, activate?: boolean } | string,
|
|
925
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (Type)?, (boolean)?]
|
|
926
|
+
): Promise<Models.Deployment> {
|
|
927
|
+
let params: { siteId: string, owner: string, reference: string, repository: string, rootDirectory: string, type: Type, activate?: boolean };
|
|
928
|
+
|
|
929
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
930
|
+
params = (paramsOrFirst || {}) as { siteId: string, owner: string, reference: string, repository: string, rootDirectory: string, type: Type, activate?: boolean };
|
|
931
|
+
} else {
|
|
932
|
+
params = {
|
|
933
|
+
siteId: paramsOrFirst as string,
|
|
934
|
+
owner: rest[0] as string,
|
|
935
|
+
reference: rest[1] as string,
|
|
936
|
+
repository: rest[2] as string,
|
|
937
|
+
rootDirectory: rest[3] as string,
|
|
938
|
+
type: rest[4] as Type,
|
|
939
|
+
activate: rest[5] as boolean
|
|
940
|
+
};
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
const siteId = params.siteId;
|
|
944
|
+
const owner = params.owner;
|
|
945
|
+
const reference = params.reference;
|
|
946
|
+
const repository = params.repository;
|
|
947
|
+
const rootDirectory = params.rootDirectory;
|
|
948
|
+
const type = params.type;
|
|
949
|
+
const activate = params.activate;
|
|
950
|
+
|
|
951
|
+
if (typeof siteId === 'undefined') {
|
|
952
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
953
|
+
}
|
|
954
|
+
if (typeof owner === 'undefined') {
|
|
955
|
+
throw new RevenexxException('Missing required parameter: "owner"');
|
|
956
|
+
}
|
|
957
|
+
if (typeof reference === 'undefined') {
|
|
958
|
+
throw new RevenexxException('Missing required parameter: "reference"');
|
|
959
|
+
}
|
|
960
|
+
if (typeof repository === 'undefined') {
|
|
961
|
+
throw new RevenexxException('Missing required parameter: "repository"');
|
|
962
|
+
}
|
|
963
|
+
if (typeof rootDirectory === 'undefined') {
|
|
964
|
+
throw new RevenexxException('Missing required parameter: "rootDirectory"');
|
|
965
|
+
}
|
|
966
|
+
if (typeof type === 'undefined') {
|
|
967
|
+
throw new RevenexxException('Missing required parameter: "type"');
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
const apiPath = '/v1/sites/{siteId}/deployments/template'.replace('{siteId}', siteId);
|
|
971
|
+
const payload: Payload = {};
|
|
972
|
+
if (typeof activate !== 'undefined') {
|
|
973
|
+
payload['activate'] = activate;
|
|
974
|
+
}
|
|
975
|
+
if (typeof owner !== 'undefined') {
|
|
976
|
+
payload['owner'] = owner;
|
|
977
|
+
}
|
|
978
|
+
if (typeof reference !== 'undefined') {
|
|
979
|
+
payload['reference'] = reference;
|
|
980
|
+
}
|
|
981
|
+
if (typeof repository !== 'undefined') {
|
|
982
|
+
payload['repository'] = repository;
|
|
983
|
+
}
|
|
984
|
+
if (typeof rootDirectory !== 'undefined') {
|
|
985
|
+
payload['rootDirectory'] = rootDirectory;
|
|
986
|
+
}
|
|
987
|
+
if (typeof type !== 'undefined') {
|
|
988
|
+
payload['type'] = type;
|
|
989
|
+
}
|
|
990
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
991
|
+
|
|
992
|
+
const apiHeaders: { [header: string]: string } = {
|
|
993
|
+
'content-type': 'application/json',
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
return this.client.call(
|
|
997
|
+
'post',
|
|
998
|
+
uri,
|
|
999
|
+
apiHeaders,
|
|
1000
|
+
payload
|
|
1001
|
+
);
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
/**
|
|
1005
|
+
* Create a deployment when a site is connected to VCS.
|
|
1006
|
+
*
|
|
1007
|
+
* This endpoint lets you create deployment from a branch, commit, or a tag.
|
|
1008
|
+
*
|
|
1009
|
+
* @param {string} params.siteId - Site ID.
|
|
1010
|
+
* @param {string} params.reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
|
|
1011
|
+
* @param {Type} params.type - Type of reference passed. Allowed values are: branch, commit
|
|
1012
|
+
* @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
|
|
1013
|
+
* @throws {RevenexxException}
|
|
1014
|
+
* @returns {Promise<Models.Deployment>}
|
|
1015
|
+
*/
|
|
1016
|
+
sitesCreateVcsDeployment(params: { siteId: string, reference: string, type: Type, activate?: boolean }): Promise<Models.Deployment>;
|
|
1017
|
+
/**
|
|
1018
|
+
* Create a deployment when a site is connected to VCS.
|
|
1019
|
+
*
|
|
1020
|
+
* This endpoint lets you create deployment from a branch, commit, or a tag.
|
|
1021
|
+
*
|
|
1022
|
+
* @param {string} siteId - Site ID.
|
|
1023
|
+
* @param {string} reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
|
|
1024
|
+
* @param {Type} type - Type of reference passed. Allowed values are: branch, commit
|
|
1025
|
+
* @param {boolean} activate - Automatically activate the deployment when it is finished building.
|
|
1026
|
+
* @throws {RevenexxException}
|
|
1027
|
+
* @returns {Promise<Models.Deployment>}
|
|
1028
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1029
|
+
*/
|
|
1030
|
+
sitesCreateVcsDeployment(siteId: string, reference: string, type: Type, activate?: boolean): Promise<Models.Deployment>;
|
|
1031
|
+
sitesCreateVcsDeployment(
|
|
1032
|
+
paramsOrFirst: { siteId: string, reference: string, type: Type, activate?: boolean } | string,
|
|
1033
|
+
...rest: [(string)?, (Type)?, (boolean)?]
|
|
1034
|
+
): Promise<Models.Deployment> {
|
|
1035
|
+
let params: { siteId: string, reference: string, type: Type, activate?: boolean };
|
|
1036
|
+
|
|
1037
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1038
|
+
params = (paramsOrFirst || {}) as { siteId: string, reference: string, type: Type, activate?: boolean };
|
|
1039
|
+
} else {
|
|
1040
|
+
params = {
|
|
1041
|
+
siteId: paramsOrFirst as string,
|
|
1042
|
+
reference: rest[0] as string,
|
|
1043
|
+
type: rest[1] as Type,
|
|
1044
|
+
activate: rest[2] as boolean
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
const siteId = params.siteId;
|
|
1049
|
+
const reference = params.reference;
|
|
1050
|
+
const type = params.type;
|
|
1051
|
+
const activate = params.activate;
|
|
1052
|
+
|
|
1053
|
+
if (typeof siteId === 'undefined') {
|
|
1054
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
1055
|
+
}
|
|
1056
|
+
if (typeof reference === 'undefined') {
|
|
1057
|
+
throw new RevenexxException('Missing required parameter: "reference"');
|
|
1058
|
+
}
|
|
1059
|
+
if (typeof type === 'undefined') {
|
|
1060
|
+
throw new RevenexxException('Missing required parameter: "type"');
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
const apiPath = '/v1/sites/{siteId}/deployments/vcs'.replace('{siteId}', siteId);
|
|
1064
|
+
const payload: Payload = {};
|
|
1065
|
+
if (typeof activate !== 'undefined') {
|
|
1066
|
+
payload['activate'] = activate;
|
|
1067
|
+
}
|
|
1068
|
+
if (typeof reference !== 'undefined') {
|
|
1069
|
+
payload['reference'] = reference;
|
|
1070
|
+
}
|
|
1071
|
+
if (typeof type !== 'undefined') {
|
|
1072
|
+
payload['type'] = type;
|
|
1073
|
+
}
|
|
1074
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1075
|
+
|
|
1076
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1077
|
+
'content-type': 'application/json',
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
return this.client.call(
|
|
1081
|
+
'post',
|
|
1082
|
+
uri,
|
|
1083
|
+
apiHeaders,
|
|
1084
|
+
payload
|
|
1085
|
+
);
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
/**
|
|
1089
|
+
* Delete a site deployment by its unique ID.
|
|
1090
|
+
*
|
|
1091
|
+
* @param {string} params.siteId - Site ID.
|
|
1092
|
+
* @param {string} params.deploymentId - Deployment ID.
|
|
1093
|
+
* @throws {RevenexxException}
|
|
1094
|
+
* @returns {Promise<{}>}
|
|
1095
|
+
*/
|
|
1096
|
+
sitesDeleteDeployment(params: { siteId: string, deploymentId: string }): Promise<{}>;
|
|
1097
|
+
/**
|
|
1098
|
+
* Delete a site deployment by its unique ID.
|
|
1099
|
+
*
|
|
1100
|
+
* @param {string} siteId - Site ID.
|
|
1101
|
+
* @param {string} deploymentId - Deployment ID.
|
|
1102
|
+
* @throws {RevenexxException}
|
|
1103
|
+
* @returns {Promise<{}>}
|
|
1104
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1105
|
+
*/
|
|
1106
|
+
sitesDeleteDeployment(siteId: string, deploymentId: string): Promise<{}>;
|
|
1107
|
+
sitesDeleteDeployment(
|
|
1108
|
+
paramsOrFirst: { siteId: string, deploymentId: string } | string,
|
|
1109
|
+
...rest: [(string)?]
|
|
1110
|
+
): Promise<{}> {
|
|
1111
|
+
let params: { siteId: string, deploymentId: string };
|
|
1112
|
+
|
|
1113
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1114
|
+
params = (paramsOrFirst || {}) as { siteId: string, deploymentId: string };
|
|
1115
|
+
} else {
|
|
1116
|
+
params = {
|
|
1117
|
+
siteId: paramsOrFirst as string,
|
|
1118
|
+
deploymentId: rest[0] as string
|
|
1119
|
+
};
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
const siteId = params.siteId;
|
|
1123
|
+
const deploymentId = params.deploymentId;
|
|
1124
|
+
|
|
1125
|
+
if (typeof siteId === 'undefined') {
|
|
1126
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
1127
|
+
}
|
|
1128
|
+
if (typeof deploymentId === 'undefined') {
|
|
1129
|
+
throw new RevenexxException('Missing required parameter: "deploymentId"');
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
const apiPath = '/v1/sites/{siteId}/deployments/{deploymentId}'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId);
|
|
1133
|
+
const payload: Payload = {};
|
|
1134
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1135
|
+
|
|
1136
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
return this.client.call(
|
|
1140
|
+
'delete',
|
|
1141
|
+
uri,
|
|
1142
|
+
apiHeaders,
|
|
1143
|
+
payload
|
|
1144
|
+
);
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
/**
|
|
1148
|
+
* Get a site deployment by its unique ID.
|
|
1149
|
+
*
|
|
1150
|
+
* @param {string} params.siteId - Site ID.
|
|
1151
|
+
* @param {string} params.deploymentId - Deployment ID.
|
|
1152
|
+
* @throws {RevenexxException}
|
|
1153
|
+
* @returns {Promise<Models.Deployment>}
|
|
1154
|
+
*/
|
|
1155
|
+
sitesGetDeployment(params: { siteId: string, deploymentId: string }): Promise<Models.Deployment>;
|
|
1156
|
+
/**
|
|
1157
|
+
* Get a site deployment by its unique ID.
|
|
1158
|
+
*
|
|
1159
|
+
* @param {string} siteId - Site ID.
|
|
1160
|
+
* @param {string} deploymentId - Deployment ID.
|
|
1161
|
+
* @throws {RevenexxException}
|
|
1162
|
+
* @returns {Promise<Models.Deployment>}
|
|
1163
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1164
|
+
*/
|
|
1165
|
+
sitesGetDeployment(siteId: string, deploymentId: string): Promise<Models.Deployment>;
|
|
1166
|
+
sitesGetDeployment(
|
|
1167
|
+
paramsOrFirst: { siteId: string, deploymentId: string } | string,
|
|
1168
|
+
...rest: [(string)?]
|
|
1169
|
+
): Promise<Models.Deployment> {
|
|
1170
|
+
let params: { siteId: string, deploymentId: string };
|
|
1171
|
+
|
|
1172
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1173
|
+
params = (paramsOrFirst || {}) as { siteId: string, deploymentId: string };
|
|
1174
|
+
} else {
|
|
1175
|
+
params = {
|
|
1176
|
+
siteId: paramsOrFirst as string,
|
|
1177
|
+
deploymentId: rest[0] as string
|
|
1178
|
+
};
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
const siteId = params.siteId;
|
|
1182
|
+
const deploymentId = params.deploymentId;
|
|
1183
|
+
|
|
1184
|
+
if (typeof siteId === 'undefined') {
|
|
1185
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
1186
|
+
}
|
|
1187
|
+
if (typeof deploymentId === 'undefined') {
|
|
1188
|
+
throw new RevenexxException('Missing required parameter: "deploymentId"');
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
const apiPath = '/v1/sites/{siteId}/deployments/{deploymentId}'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId);
|
|
1192
|
+
const payload: Payload = {};
|
|
1193
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1194
|
+
|
|
1195
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
return this.client.call(
|
|
1199
|
+
'get',
|
|
1200
|
+
uri,
|
|
1201
|
+
apiHeaders,
|
|
1202
|
+
payload
|
|
1203
|
+
);
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
/**
|
|
1207
|
+
* Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
|
1208
|
+
*
|
|
1209
|
+
* @param {string} params.siteId - Site ID.
|
|
1210
|
+
* @param {string} params.deploymentId - Deployment ID.
|
|
1211
|
+
* @param {Type} params.type - Deployment file to download. Can be: "source", "output".
|
|
1212
|
+
* @throws {RevenexxException}
|
|
1213
|
+
* @returns {Promise<{}>}
|
|
1214
|
+
*/
|
|
1215
|
+
sitesGetDeploymentDownload(params: { siteId: string, deploymentId: string, type?: Type }): Promise<{}>;
|
|
1216
|
+
/**
|
|
1217
|
+
* Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
|
1218
|
+
*
|
|
1219
|
+
* @param {string} siteId - Site ID.
|
|
1220
|
+
* @param {string} deploymentId - Deployment ID.
|
|
1221
|
+
* @param {Type} type - Deployment file to download. Can be: "source", "output".
|
|
1222
|
+
* @throws {RevenexxException}
|
|
1223
|
+
* @returns {Promise<{}>}
|
|
1224
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1225
|
+
*/
|
|
1226
|
+
sitesGetDeploymentDownload(siteId: string, deploymentId: string, type?: Type): Promise<{}>;
|
|
1227
|
+
sitesGetDeploymentDownload(
|
|
1228
|
+
paramsOrFirst: { siteId: string, deploymentId: string, type?: Type } | string,
|
|
1229
|
+
...rest: [(string)?, (Type)?]
|
|
1230
|
+
): Promise<{}> {
|
|
1231
|
+
let params: { siteId: string, deploymentId: string, type?: Type };
|
|
1232
|
+
|
|
1233
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1234
|
+
params = (paramsOrFirst || {}) as { siteId: string, deploymentId: string, type?: Type };
|
|
1235
|
+
} else {
|
|
1236
|
+
params = {
|
|
1237
|
+
siteId: paramsOrFirst as string,
|
|
1238
|
+
deploymentId: rest[0] as string,
|
|
1239
|
+
type: rest[1] as Type
|
|
1240
|
+
};
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
const siteId = params.siteId;
|
|
1244
|
+
const deploymentId = params.deploymentId;
|
|
1245
|
+
const type = params.type;
|
|
1246
|
+
|
|
1247
|
+
if (typeof siteId === 'undefined') {
|
|
1248
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
1249
|
+
}
|
|
1250
|
+
if (typeof deploymentId === 'undefined') {
|
|
1251
|
+
throw new RevenexxException('Missing required parameter: "deploymentId"');
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
const apiPath = '/v1/sites/{siteId}/deployments/{deploymentId}/download'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId);
|
|
1255
|
+
const payload: Payload = {};
|
|
1256
|
+
if (typeof type !== 'undefined') {
|
|
1257
|
+
payload['type'] = type;
|
|
1258
|
+
}
|
|
1259
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1260
|
+
|
|
1261
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
return this.client.call(
|
|
1265
|
+
'get',
|
|
1266
|
+
uri,
|
|
1267
|
+
apiHeaders,
|
|
1268
|
+
payload
|
|
1269
|
+
);
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
/**
|
|
1273
|
+
* Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.
|
|
1274
|
+
*
|
|
1275
|
+
* @param {string} params.siteId - Site ID.
|
|
1276
|
+
* @param {string} params.deploymentId - Deployment ID.
|
|
1277
|
+
* @throws {RevenexxException}
|
|
1278
|
+
* @returns {Promise<Models.Deployment>}
|
|
1279
|
+
*/
|
|
1280
|
+
sitesUpdateDeploymentStatus(params: { siteId: string, deploymentId: string }): Promise<Models.Deployment>;
|
|
1281
|
+
/**
|
|
1282
|
+
* Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.
|
|
1283
|
+
*
|
|
1284
|
+
* @param {string} siteId - Site ID.
|
|
1285
|
+
* @param {string} deploymentId - Deployment ID.
|
|
1286
|
+
* @throws {RevenexxException}
|
|
1287
|
+
* @returns {Promise<Models.Deployment>}
|
|
1288
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1289
|
+
*/
|
|
1290
|
+
sitesUpdateDeploymentStatus(siteId: string, deploymentId: string): Promise<Models.Deployment>;
|
|
1291
|
+
sitesUpdateDeploymentStatus(
|
|
1292
|
+
paramsOrFirst: { siteId: string, deploymentId: string } | string,
|
|
1293
|
+
...rest: [(string)?]
|
|
1294
|
+
): Promise<Models.Deployment> {
|
|
1295
|
+
let params: { siteId: string, deploymentId: string };
|
|
1296
|
+
|
|
1297
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1298
|
+
params = (paramsOrFirst || {}) as { siteId: string, deploymentId: string };
|
|
1299
|
+
} else {
|
|
1300
|
+
params = {
|
|
1301
|
+
siteId: paramsOrFirst as string,
|
|
1302
|
+
deploymentId: rest[0] as string
|
|
1303
|
+
};
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
const siteId = params.siteId;
|
|
1307
|
+
const deploymentId = params.deploymentId;
|
|
1308
|
+
|
|
1309
|
+
if (typeof siteId === 'undefined') {
|
|
1310
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
1311
|
+
}
|
|
1312
|
+
if (typeof deploymentId === 'undefined') {
|
|
1313
|
+
throw new RevenexxException('Missing required parameter: "deploymentId"');
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
const apiPath = '/v1/sites/{siteId}/deployments/{deploymentId}/status'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId);
|
|
1317
|
+
const payload: Payload = {};
|
|
1318
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1319
|
+
|
|
1320
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
return this.client.call(
|
|
1324
|
+
'patch',
|
|
1325
|
+
uri,
|
|
1326
|
+
apiHeaders,
|
|
1327
|
+
payload
|
|
1328
|
+
);
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
/**
|
|
1332
|
+
* Get a list of all site logs. You can use the query params to filter your results.
|
|
1333
|
+
*
|
|
1334
|
+
* @param {string} params.siteId - Site ID.
|
|
1335
|
+
* @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
|
|
1336
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
1337
|
+
* @throws {RevenexxException}
|
|
1338
|
+
* @returns {Promise<Models.ExecutionList>}
|
|
1339
|
+
*/
|
|
1340
|
+
sitesListLogs(params: { siteId: string, queries?: string[], total?: boolean }): Promise<Models.ExecutionList>;
|
|
1341
|
+
/**
|
|
1342
|
+
* Get a list of all site logs. You can use the query params to filter your results.
|
|
1343
|
+
*
|
|
1344
|
+
* @param {string} siteId - Site ID.
|
|
1345
|
+
* @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
|
|
1346
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
1347
|
+
* @throws {RevenexxException}
|
|
1348
|
+
* @returns {Promise<Models.ExecutionList>}
|
|
1349
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1350
|
+
*/
|
|
1351
|
+
sitesListLogs(siteId: string, queries?: string[], total?: boolean): Promise<Models.ExecutionList>;
|
|
1352
|
+
sitesListLogs(
|
|
1353
|
+
paramsOrFirst: { siteId: string, queries?: string[], total?: boolean } | string,
|
|
1354
|
+
...rest: [(string[])?, (boolean)?]
|
|
1355
|
+
): Promise<Models.ExecutionList> {
|
|
1356
|
+
let params: { siteId: string, queries?: string[], total?: boolean };
|
|
1357
|
+
|
|
1358
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1359
|
+
params = (paramsOrFirst || {}) as { siteId: string, queries?: string[], total?: boolean };
|
|
1360
|
+
} else {
|
|
1361
|
+
params = {
|
|
1362
|
+
siteId: paramsOrFirst as string,
|
|
1363
|
+
queries: rest[0] as string[],
|
|
1364
|
+
total: rest[1] as boolean
|
|
1365
|
+
};
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
const siteId = params.siteId;
|
|
1369
|
+
const queries = params.queries;
|
|
1370
|
+
const total = params.total;
|
|
1371
|
+
|
|
1372
|
+
if (typeof siteId === 'undefined') {
|
|
1373
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
const apiPath = '/v1/sites/{siteId}/logs'.replace('{siteId}', siteId);
|
|
1377
|
+
const payload: Payload = {};
|
|
1378
|
+
if (typeof queries !== 'undefined') {
|
|
1379
|
+
payload['queries'] = queries;
|
|
1380
|
+
}
|
|
1381
|
+
if (typeof total !== 'undefined') {
|
|
1382
|
+
payload['total'] = total;
|
|
1383
|
+
}
|
|
1384
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1385
|
+
|
|
1386
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
return this.client.call(
|
|
1390
|
+
'get',
|
|
1391
|
+
uri,
|
|
1392
|
+
apiHeaders,
|
|
1393
|
+
payload
|
|
1394
|
+
);
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
/**
|
|
1398
|
+
* Delete a site log by its unique ID.
|
|
1399
|
+
*
|
|
1400
|
+
* @param {string} params.siteId - Site ID.
|
|
1401
|
+
* @param {string} params.logId - Log ID.
|
|
1402
|
+
* @throws {RevenexxException}
|
|
1403
|
+
* @returns {Promise<{}>}
|
|
1404
|
+
*/
|
|
1405
|
+
sitesDeleteLog(params: { siteId: string, logId: string }): Promise<{}>;
|
|
1406
|
+
/**
|
|
1407
|
+
* Delete a site log by its unique ID.
|
|
1408
|
+
*
|
|
1409
|
+
* @param {string} siteId - Site ID.
|
|
1410
|
+
* @param {string} logId - Log ID.
|
|
1411
|
+
* @throws {RevenexxException}
|
|
1412
|
+
* @returns {Promise<{}>}
|
|
1413
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1414
|
+
*/
|
|
1415
|
+
sitesDeleteLog(siteId: string, logId: string): Promise<{}>;
|
|
1416
|
+
sitesDeleteLog(
|
|
1417
|
+
paramsOrFirst: { siteId: string, logId: string } | string,
|
|
1418
|
+
...rest: [(string)?]
|
|
1419
|
+
): Promise<{}> {
|
|
1420
|
+
let params: { siteId: string, logId: string };
|
|
1421
|
+
|
|
1422
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1423
|
+
params = (paramsOrFirst || {}) as { siteId: string, logId: string };
|
|
1424
|
+
} else {
|
|
1425
|
+
params = {
|
|
1426
|
+
siteId: paramsOrFirst as string,
|
|
1427
|
+
logId: rest[0] as string
|
|
1428
|
+
};
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
const siteId = params.siteId;
|
|
1432
|
+
const logId = params.logId;
|
|
1433
|
+
|
|
1434
|
+
if (typeof siteId === 'undefined') {
|
|
1435
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
1436
|
+
}
|
|
1437
|
+
if (typeof logId === 'undefined') {
|
|
1438
|
+
throw new RevenexxException('Missing required parameter: "logId"');
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
const apiPath = '/v1/sites/{siteId}/logs/{logId}'.replace('{siteId}', siteId).replace('{logId}', logId);
|
|
1442
|
+
const payload: Payload = {};
|
|
1443
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1444
|
+
|
|
1445
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
return this.client.call(
|
|
1449
|
+
'delete',
|
|
1450
|
+
uri,
|
|
1451
|
+
apiHeaders,
|
|
1452
|
+
payload
|
|
1453
|
+
);
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
/**
|
|
1457
|
+
* Get a site request log by its unique ID.
|
|
1458
|
+
*
|
|
1459
|
+
* @param {string} params.siteId - Site ID.
|
|
1460
|
+
* @param {string} params.logId - Log ID.
|
|
1461
|
+
* @throws {RevenexxException}
|
|
1462
|
+
* @returns {Promise<Models.Execution>}
|
|
1463
|
+
*/
|
|
1464
|
+
sitesGetLog(params: { siteId: string, logId: string }): Promise<Models.Execution>;
|
|
1465
|
+
/**
|
|
1466
|
+
* Get a site request log by its unique ID.
|
|
1467
|
+
*
|
|
1468
|
+
* @param {string} siteId - Site ID.
|
|
1469
|
+
* @param {string} logId - Log ID.
|
|
1470
|
+
* @throws {RevenexxException}
|
|
1471
|
+
* @returns {Promise<Models.Execution>}
|
|
1472
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1473
|
+
*/
|
|
1474
|
+
sitesGetLog(siteId: string, logId: string): Promise<Models.Execution>;
|
|
1475
|
+
sitesGetLog(
|
|
1476
|
+
paramsOrFirst: { siteId: string, logId: string } | string,
|
|
1477
|
+
...rest: [(string)?]
|
|
1478
|
+
): Promise<Models.Execution> {
|
|
1479
|
+
let params: { siteId: string, logId: string };
|
|
1480
|
+
|
|
1481
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1482
|
+
params = (paramsOrFirst || {}) as { siteId: string, logId: string };
|
|
1483
|
+
} else {
|
|
1484
|
+
params = {
|
|
1485
|
+
siteId: paramsOrFirst as string,
|
|
1486
|
+
logId: rest[0] as string
|
|
1487
|
+
};
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
const siteId = params.siteId;
|
|
1491
|
+
const logId = params.logId;
|
|
1492
|
+
|
|
1493
|
+
if (typeof siteId === 'undefined') {
|
|
1494
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
1495
|
+
}
|
|
1496
|
+
if (typeof logId === 'undefined') {
|
|
1497
|
+
throw new RevenexxException('Missing required parameter: "logId"');
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
const apiPath = '/v1/sites/{siteId}/logs/{logId}'.replace('{siteId}', siteId).replace('{logId}', logId);
|
|
1501
|
+
const payload: Payload = {};
|
|
1502
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1503
|
+
|
|
1504
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
return this.client.call(
|
|
1508
|
+
'get',
|
|
1509
|
+
uri,
|
|
1510
|
+
apiHeaders,
|
|
1511
|
+
payload
|
|
1512
|
+
);
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
/**
|
|
1516
|
+
* Get a list of all variables of a specific site.
|
|
1517
|
+
*
|
|
1518
|
+
* @param {string} params.siteId - Site unique ID.
|
|
1519
|
+
* @throws {RevenexxException}
|
|
1520
|
+
* @returns {Promise<Models.VariableList>}
|
|
1521
|
+
*/
|
|
1522
|
+
sitesListVariables(params: { siteId: string }): Promise<Models.VariableList>;
|
|
1523
|
+
/**
|
|
1524
|
+
* Get a list of all variables of a specific site.
|
|
1525
|
+
*
|
|
1526
|
+
* @param {string} siteId - Site unique ID.
|
|
1527
|
+
* @throws {RevenexxException}
|
|
1528
|
+
* @returns {Promise<Models.VariableList>}
|
|
1529
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1530
|
+
*/
|
|
1531
|
+
sitesListVariables(siteId: string): Promise<Models.VariableList>;
|
|
1532
|
+
sitesListVariables(
|
|
1533
|
+
paramsOrFirst: { siteId: string } | string
|
|
1534
|
+
): Promise<Models.VariableList> {
|
|
1535
|
+
let params: { siteId: string };
|
|
1536
|
+
|
|
1537
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1538
|
+
params = (paramsOrFirst || {}) as { siteId: string };
|
|
1539
|
+
} else {
|
|
1540
|
+
params = {
|
|
1541
|
+
siteId: paramsOrFirst as string
|
|
1542
|
+
};
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
const siteId = params.siteId;
|
|
1546
|
+
|
|
1547
|
+
if (typeof siteId === 'undefined') {
|
|
1548
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
const apiPath = '/v1/sites/{siteId}/variables'.replace('{siteId}', siteId);
|
|
1552
|
+
const payload: Payload = {};
|
|
1553
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1554
|
+
|
|
1555
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
return this.client.call(
|
|
1559
|
+
'get',
|
|
1560
|
+
uri,
|
|
1561
|
+
apiHeaders,
|
|
1562
|
+
payload
|
|
1563
|
+
);
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
/**
|
|
1567
|
+
* Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.
|
|
1568
|
+
*
|
|
1569
|
+
* @param {string} params.siteId - Site unique ID.
|
|
1570
|
+
* @param {string} params.key - Variable key. Max length: 255 chars.
|
|
1571
|
+
* @param {string} params.value - Variable value. Max length: 8192 chars.
|
|
1572
|
+
* @param {boolean} params.secret - Secret variables can be updated or deleted, but only sites can read them during build and runtime.
|
|
1573
|
+
* @throws {RevenexxException}
|
|
1574
|
+
* @returns {Promise<Models.Variable>}
|
|
1575
|
+
*/
|
|
1576
|
+
sitesCreateVariable(params: { siteId: string, key: string, value: string, secret?: boolean }): Promise<Models.Variable>;
|
|
1577
|
+
/**
|
|
1578
|
+
* Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.
|
|
1579
|
+
*
|
|
1580
|
+
* @param {string} siteId - Site unique ID.
|
|
1581
|
+
* @param {string} key - Variable key. Max length: 255 chars.
|
|
1582
|
+
* @param {string} value - Variable value. Max length: 8192 chars.
|
|
1583
|
+
* @param {boolean} secret - Secret variables can be updated or deleted, but only sites can read them during build and runtime.
|
|
1584
|
+
* @throws {RevenexxException}
|
|
1585
|
+
* @returns {Promise<Models.Variable>}
|
|
1586
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1587
|
+
*/
|
|
1588
|
+
sitesCreateVariable(siteId: string, key: string, value: string, secret?: boolean): Promise<Models.Variable>;
|
|
1589
|
+
sitesCreateVariable(
|
|
1590
|
+
paramsOrFirst: { siteId: string, key: string, value: string, secret?: boolean } | string,
|
|
1591
|
+
...rest: [(string)?, (string)?, (boolean)?]
|
|
1592
|
+
): Promise<Models.Variable> {
|
|
1593
|
+
let params: { siteId: string, key: string, value: string, secret?: boolean };
|
|
1594
|
+
|
|
1595
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1596
|
+
params = (paramsOrFirst || {}) as { siteId: string, key: string, value: string, secret?: boolean };
|
|
1597
|
+
} else {
|
|
1598
|
+
params = {
|
|
1599
|
+
siteId: paramsOrFirst as string,
|
|
1600
|
+
key: rest[0] as string,
|
|
1601
|
+
value: rest[1] as string,
|
|
1602
|
+
secret: rest[2] as boolean
|
|
1603
|
+
};
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
const siteId = params.siteId;
|
|
1607
|
+
const key = params.key;
|
|
1608
|
+
const value = params.value;
|
|
1609
|
+
const secret = params.secret;
|
|
1610
|
+
|
|
1611
|
+
if (typeof siteId === 'undefined') {
|
|
1612
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
1613
|
+
}
|
|
1614
|
+
if (typeof key === 'undefined') {
|
|
1615
|
+
throw new RevenexxException('Missing required parameter: "key"');
|
|
1616
|
+
}
|
|
1617
|
+
if (typeof value === 'undefined') {
|
|
1618
|
+
throw new RevenexxException('Missing required parameter: "value"');
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
const apiPath = '/v1/sites/{siteId}/variables'.replace('{siteId}', siteId);
|
|
1622
|
+
const payload: Payload = {};
|
|
1623
|
+
if (typeof key !== 'undefined') {
|
|
1624
|
+
payload['key'] = key;
|
|
1625
|
+
}
|
|
1626
|
+
if (typeof secret !== 'undefined') {
|
|
1627
|
+
payload['secret'] = secret;
|
|
1628
|
+
}
|
|
1629
|
+
if (typeof value !== 'undefined') {
|
|
1630
|
+
payload['value'] = value;
|
|
1631
|
+
}
|
|
1632
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1633
|
+
|
|
1634
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1635
|
+
'content-type': 'application/json',
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
return this.client.call(
|
|
1639
|
+
'post',
|
|
1640
|
+
uri,
|
|
1641
|
+
apiHeaders,
|
|
1642
|
+
payload
|
|
1643
|
+
);
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
/**
|
|
1647
|
+
* Delete a variable by its unique ID.
|
|
1648
|
+
*
|
|
1649
|
+
* @param {string} params.siteId - Site unique ID.
|
|
1650
|
+
* @param {string} params.variableId - Variable unique ID.
|
|
1651
|
+
* @throws {RevenexxException}
|
|
1652
|
+
* @returns {Promise<{}>}
|
|
1653
|
+
*/
|
|
1654
|
+
sitesDeleteVariable(params: { siteId: string, variableId: string }): Promise<{}>;
|
|
1655
|
+
/**
|
|
1656
|
+
* Delete a variable by its unique ID.
|
|
1657
|
+
*
|
|
1658
|
+
* @param {string} siteId - Site unique ID.
|
|
1659
|
+
* @param {string} variableId - Variable unique ID.
|
|
1660
|
+
* @throws {RevenexxException}
|
|
1661
|
+
* @returns {Promise<{}>}
|
|
1662
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1663
|
+
*/
|
|
1664
|
+
sitesDeleteVariable(siteId: string, variableId: string): Promise<{}>;
|
|
1665
|
+
sitesDeleteVariable(
|
|
1666
|
+
paramsOrFirst: { siteId: string, variableId: string } | string,
|
|
1667
|
+
...rest: [(string)?]
|
|
1668
|
+
): Promise<{}> {
|
|
1669
|
+
let params: { siteId: string, variableId: string };
|
|
1670
|
+
|
|
1671
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1672
|
+
params = (paramsOrFirst || {}) as { siteId: string, variableId: string };
|
|
1673
|
+
} else {
|
|
1674
|
+
params = {
|
|
1675
|
+
siteId: paramsOrFirst as string,
|
|
1676
|
+
variableId: rest[0] as string
|
|
1677
|
+
};
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
const siteId = params.siteId;
|
|
1681
|
+
const variableId = params.variableId;
|
|
1682
|
+
|
|
1683
|
+
if (typeof siteId === 'undefined') {
|
|
1684
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
1685
|
+
}
|
|
1686
|
+
if (typeof variableId === 'undefined') {
|
|
1687
|
+
throw new RevenexxException('Missing required parameter: "variableId"');
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
const apiPath = '/v1/sites/{siteId}/variables/{variableId}'.replace('{siteId}', siteId).replace('{variableId}', variableId);
|
|
1691
|
+
const payload: Payload = {};
|
|
1692
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1693
|
+
|
|
1694
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
return this.client.call(
|
|
1698
|
+
'delete',
|
|
1699
|
+
uri,
|
|
1700
|
+
apiHeaders,
|
|
1701
|
+
payload
|
|
1702
|
+
);
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
/**
|
|
1706
|
+
* Get a variable by its unique ID.
|
|
1707
|
+
*
|
|
1708
|
+
* @param {string} params.siteId - Site unique ID.
|
|
1709
|
+
* @param {string} params.variableId - Variable unique ID.
|
|
1710
|
+
* @throws {RevenexxException}
|
|
1711
|
+
* @returns {Promise<Models.Variable>}
|
|
1712
|
+
*/
|
|
1713
|
+
sitesGetVariable(params: { siteId: string, variableId: string }): Promise<Models.Variable>;
|
|
1714
|
+
/**
|
|
1715
|
+
* Get a variable by its unique ID.
|
|
1716
|
+
*
|
|
1717
|
+
* @param {string} siteId - Site unique ID.
|
|
1718
|
+
* @param {string} variableId - Variable unique ID.
|
|
1719
|
+
* @throws {RevenexxException}
|
|
1720
|
+
* @returns {Promise<Models.Variable>}
|
|
1721
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1722
|
+
*/
|
|
1723
|
+
sitesGetVariable(siteId: string, variableId: string): Promise<Models.Variable>;
|
|
1724
|
+
sitesGetVariable(
|
|
1725
|
+
paramsOrFirst: { siteId: string, variableId: string } | string,
|
|
1726
|
+
...rest: [(string)?]
|
|
1727
|
+
): Promise<Models.Variable> {
|
|
1728
|
+
let params: { siteId: string, variableId: string };
|
|
1729
|
+
|
|
1730
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1731
|
+
params = (paramsOrFirst || {}) as { siteId: string, variableId: string };
|
|
1732
|
+
} else {
|
|
1733
|
+
params = {
|
|
1734
|
+
siteId: paramsOrFirst as string,
|
|
1735
|
+
variableId: rest[0] as string
|
|
1736
|
+
};
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
const siteId = params.siteId;
|
|
1740
|
+
const variableId = params.variableId;
|
|
1741
|
+
|
|
1742
|
+
if (typeof siteId === 'undefined') {
|
|
1743
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
1744
|
+
}
|
|
1745
|
+
if (typeof variableId === 'undefined') {
|
|
1746
|
+
throw new RevenexxException('Missing required parameter: "variableId"');
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
const apiPath = '/v1/sites/{siteId}/variables/{variableId}'.replace('{siteId}', siteId).replace('{variableId}', variableId);
|
|
1750
|
+
const payload: Payload = {};
|
|
1751
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1752
|
+
|
|
1753
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
return this.client.call(
|
|
1757
|
+
'get',
|
|
1758
|
+
uri,
|
|
1759
|
+
apiHeaders,
|
|
1760
|
+
payload
|
|
1761
|
+
);
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
/**
|
|
1765
|
+
* Update variable by its unique ID.
|
|
1766
|
+
*
|
|
1767
|
+
* @param {string} params.siteId - Site unique ID.
|
|
1768
|
+
* @param {string} params.variableId - Variable unique ID.
|
|
1769
|
+
* @param {string} params.key - Variable key. Max length: 255 chars.
|
|
1770
|
+
* @param {boolean} params.secret - Secret variables can be updated or deleted, but only sites can read them during build and runtime.
|
|
1771
|
+
* @param {string} params.value - Variable value. Max length: 8192 chars.
|
|
1772
|
+
* @throws {RevenexxException}
|
|
1773
|
+
* @returns {Promise<Models.Variable>}
|
|
1774
|
+
*/
|
|
1775
|
+
sitesUpdateVariable(params: { siteId: string, variableId: string, key: string, secret?: boolean, value?: string }): Promise<Models.Variable>;
|
|
1776
|
+
/**
|
|
1777
|
+
* Update variable by its unique ID.
|
|
1778
|
+
*
|
|
1779
|
+
* @param {string} siteId - Site unique ID.
|
|
1780
|
+
* @param {string} variableId - Variable unique ID.
|
|
1781
|
+
* @param {string} key - Variable key. Max length: 255 chars.
|
|
1782
|
+
* @param {boolean} secret - Secret variables can be updated or deleted, but only sites can read them during build and runtime.
|
|
1783
|
+
* @param {string} value - Variable value. Max length: 8192 chars.
|
|
1784
|
+
* @throws {RevenexxException}
|
|
1785
|
+
* @returns {Promise<Models.Variable>}
|
|
1786
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1787
|
+
*/
|
|
1788
|
+
sitesUpdateVariable(siteId: string, variableId: string, key: string, secret?: boolean, value?: string): Promise<Models.Variable>;
|
|
1789
|
+
sitesUpdateVariable(
|
|
1790
|
+
paramsOrFirst: { siteId: string, variableId: string, key: string, secret?: boolean, value?: string } | string,
|
|
1791
|
+
...rest: [(string)?, (string)?, (boolean)?, (string)?]
|
|
1792
|
+
): Promise<Models.Variable> {
|
|
1793
|
+
let params: { siteId: string, variableId: string, key: string, secret?: boolean, value?: string };
|
|
1794
|
+
|
|
1795
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1796
|
+
params = (paramsOrFirst || {}) as { siteId: string, variableId: string, key: string, secret?: boolean, value?: string };
|
|
1797
|
+
} else {
|
|
1798
|
+
params = {
|
|
1799
|
+
siteId: paramsOrFirst as string,
|
|
1800
|
+
variableId: rest[0] as string,
|
|
1801
|
+
key: rest[1] as string,
|
|
1802
|
+
secret: rest[2] as boolean,
|
|
1803
|
+
value: rest[3] as string
|
|
1804
|
+
};
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
const siteId = params.siteId;
|
|
1808
|
+
const variableId = params.variableId;
|
|
1809
|
+
const key = params.key;
|
|
1810
|
+
const secret = params.secret;
|
|
1811
|
+
const value = params.value;
|
|
1812
|
+
|
|
1813
|
+
if (typeof siteId === 'undefined') {
|
|
1814
|
+
throw new RevenexxException('Missing required parameter: "siteId"');
|
|
1815
|
+
}
|
|
1816
|
+
if (typeof variableId === 'undefined') {
|
|
1817
|
+
throw new RevenexxException('Missing required parameter: "variableId"');
|
|
1818
|
+
}
|
|
1819
|
+
if (typeof key === 'undefined') {
|
|
1820
|
+
throw new RevenexxException('Missing required parameter: "key"');
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
const apiPath = '/v1/sites/{siteId}/variables/{variableId}'.replace('{siteId}', siteId).replace('{variableId}', variableId);
|
|
1824
|
+
const payload: Payload = {};
|
|
1825
|
+
if (typeof key !== 'undefined') {
|
|
1826
|
+
payload['key'] = key;
|
|
1827
|
+
}
|
|
1828
|
+
if (typeof secret !== 'undefined') {
|
|
1829
|
+
payload['secret'] = secret;
|
|
1830
|
+
}
|
|
1831
|
+
if (typeof value !== 'undefined') {
|
|
1832
|
+
payload['value'] = value;
|
|
1833
|
+
}
|
|
1834
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1835
|
+
|
|
1836
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1837
|
+
'content-type': 'application/json',
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
return this.client.call(
|
|
1841
|
+
'put',
|
|
1842
|
+
uri,
|
|
1843
|
+
apiHeaders,
|
|
1844
|
+
payload
|
|
1845
|
+
);
|
|
1846
|
+
}
|
|
1847
|
+
}
|