node-appwrite 22.1.3 → 23.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/client.d.mts +33 -0
- package/dist/client.d.ts +33 -0
- package/dist/client.js +52 -4
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +52 -4
- package/dist/client.mjs.map +1 -1
- package/dist/enums/backup-services.d.mts +3 -0
- package/dist/enums/backup-services.d.ts +3 -0
- package/dist/enums/backup-services.js +3 -0
- package/dist/enums/backup-services.js.map +1 -1
- package/dist/enums/backup-services.mjs +3 -0
- package/dist/enums/backup-services.mjs.map +1 -1
- package/dist/enums/database-type.d.mts +3 -1
- package/dist/enums/database-type.d.ts +3 -1
- package/dist/enums/database-type.js +2 -0
- package/dist/enums/database-type.js.map +1 -1
- package/dist/enums/database-type.mjs +2 -0
- package/dist/enums/database-type.mjs.map +1 -1
- package/dist/enums/databases-index-type.d.mts +8 -0
- package/dist/enums/databases-index-type.d.ts +8 -0
- package/dist/enums/databases-index-type.js +13 -0
- package/dist/enums/databases-index-type.js.map +1 -0
- package/dist/enums/databases-index-type.mjs +12 -0
- package/dist/enums/databases-index-type.mjs.map +1 -0
- package/dist/enums/scopes.d.mts +4 -0
- package/dist/enums/scopes.d.ts +4 -0
- package/dist/enums/scopes.js +4 -0
- package/dist/enums/scopes.js.map +1 -1
- package/dist/enums/scopes.mjs +4 -0
- package/dist/enums/scopes.mjs.map +1 -1
- package/dist/enums/{index-type.d.mts → tables-db-index-type.d.mts} +2 -2
- package/dist/enums/{index-type.d.ts → tables-db-index-type.d.ts} +2 -2
- package/dist/enums/tables-db-index-type.js +13 -0
- package/dist/enums/tables-db-index-type.js.map +1 -0
- package/dist/enums/tables-db-index-type.mjs +12 -0
- package/dist/enums/tables-db-index-type.mjs.map +1 -0
- package/dist/enums/template-reference-type.d.mts +1 -1
- package/dist/enums/template-reference-type.d.ts +1 -1
- package/dist/enums/template-reference-type.js +1 -1
- package/dist/enums/template-reference-type.js.map +1 -1
- package/dist/enums/template-reference-type.mjs +1 -1
- package/dist/enums/template-reference-type.mjs.map +1 -1
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +18 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -1
- package/dist/index.mjs.map +1 -1
- package/dist/models.d.mts +107 -9
- package/dist/models.d.ts +107 -9
- package/dist/services/databases.d.mts +5 -5
- package/dist/services/databases.d.ts +5 -5
- package/dist/services/databases.js.map +1 -1
- package/dist/services/databases.mjs.map +1 -1
- package/dist/services/functions.d.mts +20 -8
- package/dist/services/functions.d.ts +20 -8
- package/dist/services/functions.js +28 -8
- package/dist/services/functions.js.map +1 -1
- package/dist/services/functions.mjs +28 -8
- package/dist/services/functions.mjs.map +1 -1
- package/dist/services/health.d.mts +0 -95
- package/dist/services/health.d.ts +0 -95
- package/dist/services/health.js +0 -120
- package/dist/services/health.js.map +1 -1
- package/dist/services/health.mjs +0 -120
- package/dist/services/health.mjs.map +1 -1
- package/dist/services/project.d.mts +136 -0
- package/dist/services/project.d.ts +136 -0
- package/dist/services/project.js +183 -0
- package/dist/services/project.js.map +1 -0
- package/dist/services/project.mjs +182 -0
- package/dist/services/project.mjs.map +1 -0
- package/dist/services/sites.d.mts +26 -8
- package/dist/services/sites.d.ts +26 -8
- package/dist/services/sites.js +55 -25
- package/dist/services/sites.js.map +1 -1
- package/dist/services/sites.mjs +55 -25
- package/dist/services/sites.mjs.map +1 -1
- package/dist/services/tables-db.d.mts +5 -5
- package/dist/services/tables-db.d.ts +5 -5
- package/dist/services/tables-db.js.map +1 -1
- package/dist/services/tables-db.mjs.map +1 -1
- package/dist/services/users.d.mts +26 -2
- package/dist/services/users.d.ts +26 -2
- package/dist/services/users.js +34 -0
- package/dist/services/users.js.map +1 -1
- package/dist/services/users.mjs +34 -0
- package/dist/services/users.mjs.map +1 -1
- package/dist/services/webhooks.d.mts +179 -0
- package/dist/services/webhooks.d.ts +179 -0
- package/dist/services/webhooks.js +261 -0
- package/dist/services/webhooks.js.map +1 -0
- package/dist/services/webhooks.mjs +260 -0
- package/dist/services/webhooks.mjs.map +1 -0
- package/package.json +5 -3
- package/dist/enums/index-type.js +0 -13
- package/dist/enums/index-type.js.map +0 -1
- package/dist/enums/index-type.mjs +0 -12
- package/dist/enums/index-type.mjs.map +0 -1
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var client = require('../client');
|
|
4
|
+
|
|
5
|
+
class Project {
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
listVariables(paramsOrFirst, ...rest) {
|
|
10
|
+
let params;
|
|
11
|
+
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
12
|
+
params = paramsOrFirst || {};
|
|
13
|
+
} else {
|
|
14
|
+
params = {
|
|
15
|
+
queries: paramsOrFirst,
|
|
16
|
+
total: rest[0]
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const queries = params.queries;
|
|
20
|
+
const total = params.total;
|
|
21
|
+
const apiPath = "/project/variables";
|
|
22
|
+
const payload = {};
|
|
23
|
+
if (typeof queries !== "undefined") {
|
|
24
|
+
payload["queries"] = queries;
|
|
25
|
+
}
|
|
26
|
+
if (typeof total !== "undefined") {
|
|
27
|
+
payload["total"] = total;
|
|
28
|
+
}
|
|
29
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
30
|
+
const apiHeaders = {};
|
|
31
|
+
return this.client.call(
|
|
32
|
+
"get",
|
|
33
|
+
uri,
|
|
34
|
+
apiHeaders,
|
|
35
|
+
payload
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
createVariable(paramsOrFirst, ...rest) {
|
|
39
|
+
let params;
|
|
40
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
41
|
+
params = paramsOrFirst || {};
|
|
42
|
+
} else {
|
|
43
|
+
params = {
|
|
44
|
+
variableId: paramsOrFirst,
|
|
45
|
+
key: rest[0],
|
|
46
|
+
value: rest[1],
|
|
47
|
+
secret: rest[2]
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
const variableId = params.variableId;
|
|
51
|
+
const key = params.key;
|
|
52
|
+
const value = params.value;
|
|
53
|
+
const secret = params.secret;
|
|
54
|
+
if (typeof variableId === "undefined") {
|
|
55
|
+
throw new client.AppwriteException('Missing required parameter: "variableId"');
|
|
56
|
+
}
|
|
57
|
+
if (typeof key === "undefined") {
|
|
58
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
59
|
+
}
|
|
60
|
+
if (typeof value === "undefined") {
|
|
61
|
+
throw new client.AppwriteException('Missing required parameter: "value"');
|
|
62
|
+
}
|
|
63
|
+
const apiPath = "/project/variables";
|
|
64
|
+
const payload = {};
|
|
65
|
+
if (typeof variableId !== "undefined") {
|
|
66
|
+
payload["variableId"] = variableId;
|
|
67
|
+
}
|
|
68
|
+
if (typeof key !== "undefined") {
|
|
69
|
+
payload["key"] = key;
|
|
70
|
+
}
|
|
71
|
+
if (typeof value !== "undefined") {
|
|
72
|
+
payload["value"] = value;
|
|
73
|
+
}
|
|
74
|
+
if (typeof secret !== "undefined") {
|
|
75
|
+
payload["secret"] = secret;
|
|
76
|
+
}
|
|
77
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
78
|
+
const apiHeaders = {
|
|
79
|
+
"content-type": "application/json"
|
|
80
|
+
};
|
|
81
|
+
return this.client.call(
|
|
82
|
+
"post",
|
|
83
|
+
uri,
|
|
84
|
+
apiHeaders,
|
|
85
|
+
payload
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
getVariable(paramsOrFirst) {
|
|
89
|
+
let params;
|
|
90
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
91
|
+
params = paramsOrFirst || {};
|
|
92
|
+
} else {
|
|
93
|
+
params = {
|
|
94
|
+
variableId: paramsOrFirst
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
const variableId = params.variableId;
|
|
98
|
+
if (typeof variableId === "undefined") {
|
|
99
|
+
throw new client.AppwriteException('Missing required parameter: "variableId"');
|
|
100
|
+
}
|
|
101
|
+
const apiPath = "/project/variables/{variableId}".replace("{variableId}", variableId);
|
|
102
|
+
const payload = {};
|
|
103
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
104
|
+
const apiHeaders = {};
|
|
105
|
+
return this.client.call(
|
|
106
|
+
"get",
|
|
107
|
+
uri,
|
|
108
|
+
apiHeaders,
|
|
109
|
+
payload
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
updateVariable(paramsOrFirst, ...rest) {
|
|
113
|
+
let params;
|
|
114
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
115
|
+
params = paramsOrFirst || {};
|
|
116
|
+
} else {
|
|
117
|
+
params = {
|
|
118
|
+
variableId: paramsOrFirst,
|
|
119
|
+
key: rest[0],
|
|
120
|
+
value: rest[1],
|
|
121
|
+
secret: rest[2]
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
const variableId = params.variableId;
|
|
125
|
+
const key = params.key;
|
|
126
|
+
const value = params.value;
|
|
127
|
+
const secret = params.secret;
|
|
128
|
+
if (typeof variableId === "undefined") {
|
|
129
|
+
throw new client.AppwriteException('Missing required parameter: "variableId"');
|
|
130
|
+
}
|
|
131
|
+
const apiPath = "/project/variables/{variableId}".replace("{variableId}", variableId);
|
|
132
|
+
const payload = {};
|
|
133
|
+
if (typeof key !== "undefined") {
|
|
134
|
+
payload["key"] = key;
|
|
135
|
+
}
|
|
136
|
+
if (typeof value !== "undefined") {
|
|
137
|
+
payload["value"] = value;
|
|
138
|
+
}
|
|
139
|
+
if (typeof secret !== "undefined") {
|
|
140
|
+
payload["secret"] = secret;
|
|
141
|
+
}
|
|
142
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
143
|
+
const apiHeaders = {
|
|
144
|
+
"content-type": "application/json"
|
|
145
|
+
};
|
|
146
|
+
return this.client.call(
|
|
147
|
+
"put",
|
|
148
|
+
uri,
|
|
149
|
+
apiHeaders,
|
|
150
|
+
payload
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
deleteVariable(paramsOrFirst) {
|
|
154
|
+
let params;
|
|
155
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
156
|
+
params = paramsOrFirst || {};
|
|
157
|
+
} else {
|
|
158
|
+
params = {
|
|
159
|
+
variableId: paramsOrFirst
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
const variableId = params.variableId;
|
|
163
|
+
if (typeof variableId === "undefined") {
|
|
164
|
+
throw new client.AppwriteException('Missing required parameter: "variableId"');
|
|
165
|
+
}
|
|
166
|
+
const apiPath = "/project/variables/{variableId}".replace("{variableId}", variableId);
|
|
167
|
+
const payload = {};
|
|
168
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
169
|
+
const apiHeaders = {
|
|
170
|
+
"content-type": "application/json"
|
|
171
|
+
};
|
|
172
|
+
return this.client.call(
|
|
173
|
+
"delete",
|
|
174
|
+
uri,
|
|
175
|
+
apiHeaders,
|
|
176
|
+
payload
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
exports.Project = Project;
|
|
182
|
+
//# sourceMappingURL=out.js.map
|
|
183
|
+
//# sourceMappingURL=project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/services/project.ts"],"names":[],"mappings":"AAAA,SAAS,yBAA+D;AAIjE,MAAM,QAAQ;AAAA,EAGjB,YAAY,QAAgB;AACxB,SAAK,SAAS;AAAA,EAClB;AAAA,EAqBA,cACI,kBACG,MACyB;AAC5B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UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C;AAAA,MAC7C,gBAAgB;AAAA,IACpB;AAEA,WAAO,KAAK,OAAO;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AACJ","sourcesContent":["import { AppwriteException, Client, type Payload, UploadProgress } from '../client';\nimport type { Models } from '../models';\n\n\nexport class Project {\n client: Client;\n\n constructor(client: Client) {\n this.client = client;\n }\n\n /**\n * Get a list of all project environment variables.\n *\n * @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: key, resourceType, resourceId, secret\n * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.\n * @throws {AppwriteException}\n * @returns {Promise<Models.VariableList>}\n */\n listVariables(params?: { queries?: string[], total?: boolean }): Promise<Models.VariableList>;\n /**\n * Get a list of all project environment variables.\n *\n * @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: key, resourceType, resourceId, secret\n * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.\n * @throws {AppwriteException}\n * @returns {Promise<Models.VariableList>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n listVariables(queries?: string[], total?: boolean): Promise<Models.VariableList>;\n listVariables(\n paramsOrFirst?: { queries?: string[], total?: boolean } | string[],\n ...rest: [(boolean)?] \n ): Promise<Models.VariableList> {\n let params: { queries?: string[], total?: boolean };\n \n if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean };\n } else {\n params = {\n queries: paramsOrFirst as string[],\n total: rest[0] as boolean \n };\n }\n \n const queries = params.queries;\n const total = params.total;\n\n\n const apiPath = '/project/variables';\n const payload: Payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof total !== 'undefined') {\n payload['total'] = total;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Create a new project environment variable. These variables can be accessed by all functions and sites in the project.\n *\n * @param {string} params.variableId - Variable 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.\n * @param {string} params.key - Variable key. Max length: 255 chars.\n * @param {string} params.value - Variable value. Max length: 8192 chars.\n * @param {boolean} params.secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Variable>}\n */\n createVariable(params: { variableId: string, key: string, value: string, secret?: boolean }): Promise<Models.Variable>;\n /**\n * Create a new project environment variable. These variables can be accessed by all functions and sites in the project.\n *\n * @param {string} variableId - Variable 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.\n * @param {string} key - Variable key. Max length: 255 chars.\n * @param {string} value - Variable value. Max length: 8192 chars.\n * @param {boolean} secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Variable>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n createVariable(variableId: string, key: string, value: string, secret?: boolean): Promise<Models.Variable>;\n createVariable(\n paramsOrFirst: { variableId: string, key: string, value: string, secret?: boolean } | string,\n ...rest: [(string)?, (string)?, (boolean)?] \n ): Promise<Models.Variable> {\n let params: { variableId: string, key: string, value: string, secret?: boolean };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { variableId: string, key: string, value: string, secret?: boolean };\n } else {\n params = {\n variableId: paramsOrFirst as string,\n key: rest[0] as string,\n value: rest[1] as string,\n secret: rest[2] as boolean \n };\n }\n \n const variableId = params.variableId;\n const key = params.key;\n const value = params.value;\n const secret = params.secret;\n\n if (typeof variableId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"variableId\"');\n }\n if (typeof key === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"key\"');\n }\n if (typeof value === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"value\"');\n }\n\n const apiPath = '/project/variables';\n const payload: Payload = {};\n if (typeof variableId !== 'undefined') {\n payload['variableId'] = variableId;\n }\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n if (typeof value !== 'undefined') {\n payload['value'] = value;\n }\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'post',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Get a variable by its unique ID. \n *\n * @param {string} params.variableId - Variable ID.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Variable>}\n */\n getVariable(params: { variableId: string }): Promise<Models.Variable>;\n /**\n * Get a variable by its unique ID. \n *\n * @param {string} variableId - Variable ID.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Variable>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getVariable(variableId: string): Promise<Models.Variable>;\n getVariable(\n paramsOrFirst: { variableId: string } | string \n ): Promise<Models.Variable> {\n let params: { variableId: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { variableId: string };\n } else {\n params = {\n variableId: paramsOrFirst as string \n };\n }\n \n const variableId = params.variableId;\n\n if (typeof variableId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"variableId\"');\n }\n\n const apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Update variable by its unique ID.\n *\n * @param {string} params.variableId - Variable ID.\n * @param {string} params.key - Variable key. Max length: 255 chars.\n * @param {string} params.value - Variable value. Max length: 8192 chars.\n * @param {boolean} params.secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Variable>}\n */\n updateVariable(params: { variableId: string, key?: string, value?: string, secret?: boolean }): Promise<Models.Variable>;\n /**\n * Update variable by its unique ID.\n *\n * @param {string} variableId - Variable ID.\n * @param {string} key - Variable key. Max length: 255 chars.\n * @param {string} value - Variable value. Max length: 8192 chars.\n * @param {boolean} secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Variable>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n updateVariable(variableId: string, key?: string, value?: string, secret?: boolean): Promise<Models.Variable>;\n updateVariable(\n paramsOrFirst: { variableId: string, key?: string, value?: string, secret?: boolean } | string,\n ...rest: [(string)?, (string)?, (boolean)?] \n ): Promise<Models.Variable> {\n let params: { variableId: string, key?: string, value?: string, secret?: boolean };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { variableId: string, key?: string, value?: string, secret?: boolean };\n } else {\n params = {\n variableId: paramsOrFirst as string,\n key: rest[0] as string,\n value: rest[1] as string,\n secret: rest[2] as boolean \n };\n }\n \n const variableId = params.variableId;\n const key = params.key;\n const value = params.value;\n const secret = params.secret;\n\n if (typeof variableId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"variableId\"');\n }\n\n const apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);\n const payload: Payload = {};\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n if (typeof value !== 'undefined') {\n payload['value'] = value;\n }\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'put',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Delete a variable by its unique ID. \n *\n * @param {string} params.variableId - Variable ID.\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n */\n deleteVariable(params: { variableId: string }): Promise<{}>;\n /**\n * Delete a variable by its unique ID. \n *\n * @param {string} variableId - Variable ID.\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n deleteVariable(variableId: string): Promise<{}>;\n deleteVariable(\n paramsOrFirst: { variableId: string } | string \n ): Promise<{}> {\n let params: { variableId: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { variableId: string };\n } else {\n params = {\n variableId: paramsOrFirst as string \n };\n }\n \n const variableId = params.variableId;\n\n if (typeof variableId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"variableId\"');\n }\n\n const apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'delete',\n uri,\n apiHeaders,\n payload,\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { AppwriteException } from '../client.mjs';
|
|
2
|
+
|
|
3
|
+
// src/services/project.ts
|
|
4
|
+
var Project = class {
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
listVariables(paramsOrFirst, ...rest) {
|
|
9
|
+
let params;
|
|
10
|
+
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11
|
+
params = paramsOrFirst || {};
|
|
12
|
+
} else {
|
|
13
|
+
params = {
|
|
14
|
+
queries: paramsOrFirst,
|
|
15
|
+
total: rest[0]
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
const queries = params.queries;
|
|
19
|
+
const total = params.total;
|
|
20
|
+
const apiPath = "/project/variables";
|
|
21
|
+
const payload = {};
|
|
22
|
+
if (typeof queries !== "undefined") {
|
|
23
|
+
payload["queries"] = queries;
|
|
24
|
+
}
|
|
25
|
+
if (typeof total !== "undefined") {
|
|
26
|
+
payload["total"] = total;
|
|
27
|
+
}
|
|
28
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
29
|
+
const apiHeaders = {};
|
|
30
|
+
return this.client.call(
|
|
31
|
+
"get",
|
|
32
|
+
uri,
|
|
33
|
+
apiHeaders,
|
|
34
|
+
payload
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
createVariable(paramsOrFirst, ...rest) {
|
|
38
|
+
let params;
|
|
39
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
40
|
+
params = paramsOrFirst || {};
|
|
41
|
+
} else {
|
|
42
|
+
params = {
|
|
43
|
+
variableId: paramsOrFirst,
|
|
44
|
+
key: rest[0],
|
|
45
|
+
value: rest[1],
|
|
46
|
+
secret: rest[2]
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
const variableId = params.variableId;
|
|
50
|
+
const key = params.key;
|
|
51
|
+
const value = params.value;
|
|
52
|
+
const secret = params.secret;
|
|
53
|
+
if (typeof variableId === "undefined") {
|
|
54
|
+
throw new AppwriteException('Missing required parameter: "variableId"');
|
|
55
|
+
}
|
|
56
|
+
if (typeof key === "undefined") {
|
|
57
|
+
throw new AppwriteException('Missing required parameter: "key"');
|
|
58
|
+
}
|
|
59
|
+
if (typeof value === "undefined") {
|
|
60
|
+
throw new AppwriteException('Missing required parameter: "value"');
|
|
61
|
+
}
|
|
62
|
+
const apiPath = "/project/variables";
|
|
63
|
+
const payload = {};
|
|
64
|
+
if (typeof variableId !== "undefined") {
|
|
65
|
+
payload["variableId"] = variableId;
|
|
66
|
+
}
|
|
67
|
+
if (typeof key !== "undefined") {
|
|
68
|
+
payload["key"] = key;
|
|
69
|
+
}
|
|
70
|
+
if (typeof value !== "undefined") {
|
|
71
|
+
payload["value"] = value;
|
|
72
|
+
}
|
|
73
|
+
if (typeof secret !== "undefined") {
|
|
74
|
+
payload["secret"] = secret;
|
|
75
|
+
}
|
|
76
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
77
|
+
const apiHeaders = {
|
|
78
|
+
"content-type": "application/json"
|
|
79
|
+
};
|
|
80
|
+
return this.client.call(
|
|
81
|
+
"post",
|
|
82
|
+
uri,
|
|
83
|
+
apiHeaders,
|
|
84
|
+
payload
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
getVariable(paramsOrFirst) {
|
|
88
|
+
let params;
|
|
89
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
90
|
+
params = paramsOrFirst || {};
|
|
91
|
+
} else {
|
|
92
|
+
params = {
|
|
93
|
+
variableId: paramsOrFirst
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const variableId = params.variableId;
|
|
97
|
+
if (typeof variableId === "undefined") {
|
|
98
|
+
throw new AppwriteException('Missing required parameter: "variableId"');
|
|
99
|
+
}
|
|
100
|
+
const apiPath = "/project/variables/{variableId}".replace("{variableId}", variableId);
|
|
101
|
+
const payload = {};
|
|
102
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
103
|
+
const apiHeaders = {};
|
|
104
|
+
return this.client.call(
|
|
105
|
+
"get",
|
|
106
|
+
uri,
|
|
107
|
+
apiHeaders,
|
|
108
|
+
payload
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
updateVariable(paramsOrFirst, ...rest) {
|
|
112
|
+
let params;
|
|
113
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
114
|
+
params = paramsOrFirst || {};
|
|
115
|
+
} else {
|
|
116
|
+
params = {
|
|
117
|
+
variableId: paramsOrFirst,
|
|
118
|
+
key: rest[0],
|
|
119
|
+
value: rest[1],
|
|
120
|
+
secret: rest[2]
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
const variableId = params.variableId;
|
|
124
|
+
const key = params.key;
|
|
125
|
+
const value = params.value;
|
|
126
|
+
const secret = params.secret;
|
|
127
|
+
if (typeof variableId === "undefined") {
|
|
128
|
+
throw new AppwriteException('Missing required parameter: "variableId"');
|
|
129
|
+
}
|
|
130
|
+
const apiPath = "/project/variables/{variableId}".replace("{variableId}", variableId);
|
|
131
|
+
const payload = {};
|
|
132
|
+
if (typeof key !== "undefined") {
|
|
133
|
+
payload["key"] = key;
|
|
134
|
+
}
|
|
135
|
+
if (typeof value !== "undefined") {
|
|
136
|
+
payload["value"] = value;
|
|
137
|
+
}
|
|
138
|
+
if (typeof secret !== "undefined") {
|
|
139
|
+
payload["secret"] = secret;
|
|
140
|
+
}
|
|
141
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
142
|
+
const apiHeaders = {
|
|
143
|
+
"content-type": "application/json"
|
|
144
|
+
};
|
|
145
|
+
return this.client.call(
|
|
146
|
+
"put",
|
|
147
|
+
uri,
|
|
148
|
+
apiHeaders,
|
|
149
|
+
payload
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
deleteVariable(paramsOrFirst) {
|
|
153
|
+
let params;
|
|
154
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
155
|
+
params = paramsOrFirst || {};
|
|
156
|
+
} else {
|
|
157
|
+
params = {
|
|
158
|
+
variableId: paramsOrFirst
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
const variableId = params.variableId;
|
|
162
|
+
if (typeof variableId === "undefined") {
|
|
163
|
+
throw new AppwriteException('Missing required parameter: "variableId"');
|
|
164
|
+
}
|
|
165
|
+
const apiPath = "/project/variables/{variableId}".replace("{variableId}", variableId);
|
|
166
|
+
const payload = {};
|
|
167
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
168
|
+
const apiHeaders = {
|
|
169
|
+
"content-type": "application/json"
|
|
170
|
+
};
|
|
171
|
+
return this.client.call(
|
|
172
|
+
"delete",
|
|
173
|
+
uri,
|
|
174
|
+
apiHeaders,
|
|
175
|
+
payload
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
export { Project };
|
|
181
|
+
//# sourceMappingURL=out.js.map
|
|
182
|
+
//# sourceMappingURL=project.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/services/project.ts"],"names":[],"mappings":";AAAA,SAAS,yBAA+D;AAIjE,IAAM,UAAN,MAAc;AAAA,EAGjB,YAAY,QAAgB;AACxB,SAAK,SAAS;AAAA,EAClB;AAAA,EAqBA,cACI,kBACG,MACyB;AAC5B,QAAI;AAEJ,QAAI,CAAC,iBAAkB,iBAAiB,OAAO,kBAAkB,YAAY,CAAC,MAAM,QAAQ,aAAa,GAAI;AACzG,eAAU,iBAAiB,CAAC;AAAA,IAChC,OAAO;AACH,eAAS;AAAA,QACL,SAAS;AAAA,QACT,OAAO,KAAK,CAAC;AAAA,MACjB;AAAA,IACJ;AAEA,UAAM,UAAU,OAAO;AACvB,UAAM,QAAQ,OAAO;AAGrB,UAAM,UAAU;AAChB,UAAM,UAAmB,CAAC;AAC1B,QAAI,OAAO,YAAY,aAAa;AAChC,cAAQ,SAAS,IAAI;AAAA,IACzB;AACA,QAAI,OAAO,UAAU,aAAa;AAC9B,cAAQ,OAAO,IAAI;AAAA,IACvB;AACA,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,O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AAAA,IACrB;AACA,QAAI,OAAO,UAAU,aAAa;AAC9B,cAAQ,OAAO,IAAI;AAAA,IACvB;AACA,QAAI,OAAO,WAAW,aAAa;AAC/B,cAAQ,QAAQ,IAAI;AAAA,IACxB;AACA,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C;AAAA,MAC7C,gBAAgB;AAAA,IACpB;AAEA,WAAO,KAAK,OAAO;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAAA,EAmBA,eACI,eACW;AACX,QAAI;AAEJ,QAAK,iBAAiB,OAAO,kBAAkB,YAAY,CAAC,MAAM,QAAQ,aAAa,GAAI;AACvF,eAAU,iBAAiB,CAAC;AAAA,IAChC,OAAO;AACH,eAAS;AAAA,QACL,YAAY;AAAA,MAChB;AAAA,IACJ;AAEA,UAAM,aAAa,OAAO;AAE1B,QAAI,OAAO,eAAe,aAAa;AACnC,YAAM,IAAI,kBAAkB,0CAA0C;AAAA,IAC1E;AAEA,UAAM,UAAU,kCAAkC,QAAQ,gBAAgB,UAAU;AACpF,UAAM,UAAmB,CAAC;AAC1B,UAAM,MAAM,IAAI,IAAI,KAAK,OAAO,OAAO,WAAW,OAAO;AAEzD,UAAM,aAA2C;AAAA,MAC7C,gBAAgB;AAAA,IACpB;AAEA,WAAO,KAAK,OAAO;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AACJ","sourcesContent":["import { AppwriteException, Client, type Payload, UploadProgress } from '../client';\nimport type { Models } from '../models';\n\n\nexport class Project {\n client: Client;\n\n constructor(client: Client) {\n this.client = client;\n }\n\n /**\n * Get a list of all project environment variables.\n *\n * @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: key, resourceType, resourceId, secret\n * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.\n * @throws {AppwriteException}\n * @returns {Promise<Models.VariableList>}\n */\n listVariables(params?: { queries?: string[], total?: boolean }): Promise<Models.VariableList>;\n /**\n * Get a list of all project environment variables.\n *\n * @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: key, resourceType, resourceId, secret\n * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.\n * @throws {AppwriteException}\n * @returns {Promise<Models.VariableList>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n listVariables(queries?: string[], total?: boolean): Promise<Models.VariableList>;\n listVariables(\n paramsOrFirst?: { queries?: string[], total?: boolean } | string[],\n ...rest: [(boolean)?] \n ): Promise<Models.VariableList> {\n let params: { queries?: string[], total?: boolean };\n \n if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean };\n } else {\n params = {\n queries: paramsOrFirst as string[],\n total: rest[0] as boolean \n };\n }\n \n const queries = params.queries;\n const total = params.total;\n\n\n const apiPath = '/project/variables';\n const payload: Payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof total !== 'undefined') {\n payload['total'] = total;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Create a new project environment variable. These variables can be accessed by all functions and sites in the project.\n *\n * @param {string} params.variableId - Variable 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.\n * @param {string} params.key - Variable key. Max length: 255 chars.\n * @param {string} params.value - Variable value. Max length: 8192 chars.\n * @param {boolean} params.secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Variable>}\n */\n createVariable(params: { variableId: string, key: string, value: string, secret?: boolean }): Promise<Models.Variable>;\n /**\n * Create a new project environment variable. These variables can be accessed by all functions and sites in the project.\n *\n * @param {string} variableId - Variable 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.\n * @param {string} key - Variable key. Max length: 255 chars.\n * @param {string} value - Variable value. Max length: 8192 chars.\n * @param {boolean} secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Variable>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n createVariable(variableId: string, key: string, value: string, secret?: boolean): Promise<Models.Variable>;\n createVariable(\n paramsOrFirst: { variableId: string, key: string, value: string, secret?: boolean } | string,\n ...rest: [(string)?, (string)?, (boolean)?] \n ): Promise<Models.Variable> {\n let params: { variableId: string, key: string, value: string, secret?: boolean };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { variableId: string, key: string, value: string, secret?: boolean };\n } else {\n params = {\n variableId: paramsOrFirst as string,\n key: rest[0] as string,\n value: rest[1] as string,\n secret: rest[2] as boolean \n };\n }\n \n const variableId = params.variableId;\n const key = params.key;\n const value = params.value;\n const secret = params.secret;\n\n if (typeof variableId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"variableId\"');\n }\n if (typeof key === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"key\"');\n }\n if (typeof value === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"value\"');\n }\n\n const apiPath = '/project/variables';\n const payload: Payload = {};\n if (typeof variableId !== 'undefined') {\n payload['variableId'] = variableId;\n }\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n if (typeof value !== 'undefined') {\n payload['value'] = value;\n }\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'post',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Get a variable by its unique ID. \n *\n * @param {string} params.variableId - Variable ID.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Variable>}\n */\n getVariable(params: { variableId: string }): Promise<Models.Variable>;\n /**\n * Get a variable by its unique ID. \n *\n * @param {string} variableId - Variable ID.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Variable>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n getVariable(variableId: string): Promise<Models.Variable>;\n getVariable(\n paramsOrFirst: { variableId: string } | string \n ): Promise<Models.Variable> {\n let params: { variableId: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { variableId: string };\n } else {\n params = {\n variableId: paramsOrFirst as string \n };\n }\n \n const variableId = params.variableId;\n\n if (typeof variableId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"variableId\"');\n }\n\n const apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n }\n\n return this.client.call(\n 'get',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Update variable by its unique ID.\n *\n * @param {string} params.variableId - Variable ID.\n * @param {string} params.key - Variable key. Max length: 255 chars.\n * @param {string} params.value - Variable value. Max length: 8192 chars.\n * @param {boolean} params.secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Variable>}\n */\n updateVariable(params: { variableId: string, key?: string, value?: string, secret?: boolean }): Promise<Models.Variable>;\n /**\n * Update variable by its unique ID.\n *\n * @param {string} variableId - Variable ID.\n * @param {string} key - Variable key. Max length: 255 chars.\n * @param {string} value - Variable value. Max length: 8192 chars.\n * @param {boolean} secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime.\n * @throws {AppwriteException}\n * @returns {Promise<Models.Variable>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n updateVariable(variableId: string, key?: string, value?: string, secret?: boolean): Promise<Models.Variable>;\n updateVariable(\n paramsOrFirst: { variableId: string, key?: string, value?: string, secret?: boolean } | string,\n ...rest: [(string)?, (string)?, (boolean)?] \n ): Promise<Models.Variable> {\n let params: { variableId: string, key?: string, value?: string, secret?: boolean };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { variableId: string, key?: string, value?: string, secret?: boolean };\n } else {\n params = {\n variableId: paramsOrFirst as string,\n key: rest[0] as string,\n value: rest[1] as string,\n secret: rest[2] as boolean \n };\n }\n \n const variableId = params.variableId;\n const key = params.key;\n const value = params.value;\n const secret = params.secret;\n\n if (typeof variableId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"variableId\"');\n }\n\n const apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);\n const payload: Payload = {};\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n if (typeof value !== 'undefined') {\n payload['value'] = value;\n }\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'put',\n uri,\n apiHeaders,\n payload,\n );\n }\n\n /**\n * Delete a variable by its unique ID. \n *\n * @param {string} params.variableId - Variable ID.\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n */\n deleteVariable(params: { variableId: string }): Promise<{}>;\n /**\n * Delete a variable by its unique ID. \n *\n * @param {string} variableId - Variable ID.\n * @throws {AppwriteException}\n * @returns {Promise<{}>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n deleteVariable(variableId: string): Promise<{}>;\n deleteVariable(\n paramsOrFirst: { variableId: string } | string \n ): Promise<{}> {\n let params: { variableId: string };\n \n if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {\n params = (paramsOrFirst || {}) as { variableId: string };\n } else {\n params = {\n variableId: paramsOrFirst as string \n };\n }\n \n const variableId = params.variableId;\n\n if (typeof variableId === 'undefined') {\n throw new AppwriteException('Missing required parameter: \"variableId\"');\n }\n\n const apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);\n const payload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'content-type': 'application/json',\n }\n\n return this.client.call(\n 'delete',\n uri,\n apiHeaders,\n payload,\n );\n }\n}\n"]}
|
|
@@ -58,6 +58,7 @@ declare class Sites {
|
|
|
58
58
|
* @param {number} params.timeout - Maximum request time in seconds.
|
|
59
59
|
* @param {string} params.installCommand - Install Command.
|
|
60
60
|
* @param {string} params.buildCommand - Build Command.
|
|
61
|
+
* @param {string} params.startCommand - Custom start command. Leave empty to use default.
|
|
61
62
|
* @param {string} params.outputDirectory - Output Directory for site.
|
|
62
63
|
* @param {Adapter} params.adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr
|
|
63
64
|
* @param {string} params.installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
|
|
@@ -66,7 +67,9 @@ declare class Sites {
|
|
|
66
67
|
* @param {string} params.providerBranch - Production branch for the repo linked to the site.
|
|
67
68
|
* @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.
|
|
68
69
|
* @param {string} params.providerRootDirectory - Path to site code in the linked repo.
|
|
69
|
-
* @param {string} params.
|
|
70
|
+
* @param {string} params.buildSpecification - Build specification for the site deployments.
|
|
71
|
+
* @param {string} params.runtimeSpecification - Runtime specification for the SSR executions.
|
|
72
|
+
* @param {number} params.deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
|
|
70
73
|
* @throws {AppwriteException}
|
|
71
74
|
* @returns {Promise<Models.Site>}
|
|
72
75
|
*/
|
|
@@ -80,6 +83,7 @@ declare class Sites {
|
|
|
80
83
|
timeout?: number;
|
|
81
84
|
installCommand?: string;
|
|
82
85
|
buildCommand?: string;
|
|
86
|
+
startCommand?: string;
|
|
83
87
|
outputDirectory?: string;
|
|
84
88
|
adapter?: Adapter;
|
|
85
89
|
installationId?: string;
|
|
@@ -88,7 +92,9 @@ declare class Sites {
|
|
|
88
92
|
providerBranch?: string;
|
|
89
93
|
providerSilentMode?: boolean;
|
|
90
94
|
providerRootDirectory?: string;
|
|
91
|
-
|
|
95
|
+
buildSpecification?: string;
|
|
96
|
+
runtimeSpecification?: string;
|
|
97
|
+
deploymentRetention?: number;
|
|
92
98
|
}): Promise<Models.Site>;
|
|
93
99
|
/**
|
|
94
100
|
* Create a new site.
|
|
@@ -102,6 +108,7 @@ declare class Sites {
|
|
|
102
108
|
* @param {number} timeout - Maximum request time in seconds.
|
|
103
109
|
* @param {string} installCommand - Install Command.
|
|
104
110
|
* @param {string} buildCommand - Build Command.
|
|
111
|
+
* @param {string} startCommand - Custom start command. Leave empty to use default.
|
|
105
112
|
* @param {string} outputDirectory - Output Directory for site.
|
|
106
113
|
* @param {Adapter} adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr
|
|
107
114
|
* @param {string} installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
|
|
@@ -110,12 +117,14 @@ declare class Sites {
|
|
|
110
117
|
* @param {string} providerBranch - Production branch for the repo linked to the site.
|
|
111
118
|
* @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.
|
|
112
119
|
* @param {string} providerRootDirectory - Path to site code in the linked repo.
|
|
113
|
-
* @param {string}
|
|
120
|
+
* @param {string} buildSpecification - Build specification for the site deployments.
|
|
121
|
+
* @param {string} runtimeSpecification - Runtime specification for the SSR executions.
|
|
122
|
+
* @param {number} deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
|
|
114
123
|
* @throws {AppwriteException}
|
|
115
124
|
* @returns {Promise<Models.Site>}
|
|
116
125
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
117
126
|
*/
|
|
118
|
-
create(siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string,
|
|
127
|
+
create(siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number): Promise<Models.Site>;
|
|
119
128
|
/**
|
|
120
129
|
* Get a list of all frameworks that are currently available on the server instance.
|
|
121
130
|
*
|
|
@@ -160,6 +169,7 @@ declare class Sites {
|
|
|
160
169
|
* @param {number} params.timeout - Maximum request time in seconds.
|
|
161
170
|
* @param {string} params.installCommand - Install Command.
|
|
162
171
|
* @param {string} params.buildCommand - Build Command.
|
|
172
|
+
* @param {string} params.startCommand - Custom start command. Leave empty to use default.
|
|
163
173
|
* @param {string} params.outputDirectory - Output Directory for site.
|
|
164
174
|
* @param {BuildRuntime} params.buildRuntime - Runtime to use during build step.
|
|
165
175
|
* @param {Adapter} params.adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr
|
|
@@ -169,7 +179,9 @@ declare class Sites {
|
|
|
169
179
|
* @param {string} params.providerBranch - Production branch for the repo linked to the site.
|
|
170
180
|
* @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.
|
|
171
181
|
* @param {string} params.providerRootDirectory - Path to site code in the linked repo.
|
|
172
|
-
* @param {string} params.
|
|
182
|
+
* @param {string} params.buildSpecification - Build specification for the site deployments.
|
|
183
|
+
* @param {string} params.runtimeSpecification - Runtime specification for the SSR executions.
|
|
184
|
+
* @param {number} params.deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
|
|
173
185
|
* @throws {AppwriteException}
|
|
174
186
|
* @returns {Promise<Models.Site>}
|
|
175
187
|
*/
|
|
@@ -182,6 +194,7 @@ declare class Sites {
|
|
|
182
194
|
timeout?: number;
|
|
183
195
|
installCommand?: string;
|
|
184
196
|
buildCommand?: string;
|
|
197
|
+
startCommand?: string;
|
|
185
198
|
outputDirectory?: string;
|
|
186
199
|
buildRuntime?: BuildRuntime;
|
|
187
200
|
adapter?: Adapter;
|
|
@@ -191,7 +204,9 @@ declare class Sites {
|
|
|
191
204
|
providerBranch?: string;
|
|
192
205
|
providerSilentMode?: boolean;
|
|
193
206
|
providerRootDirectory?: string;
|
|
194
|
-
|
|
207
|
+
buildSpecification?: string;
|
|
208
|
+
runtimeSpecification?: string;
|
|
209
|
+
deploymentRetention?: number;
|
|
195
210
|
}): Promise<Models.Site>;
|
|
196
211
|
/**
|
|
197
212
|
* Update site by its unique ID.
|
|
@@ -204,6 +219,7 @@ declare class Sites {
|
|
|
204
219
|
* @param {number} timeout - Maximum request time in seconds.
|
|
205
220
|
* @param {string} installCommand - Install Command.
|
|
206
221
|
* @param {string} buildCommand - Build Command.
|
|
222
|
+
* @param {string} startCommand - Custom start command. Leave empty to use default.
|
|
207
223
|
* @param {string} outputDirectory - Output Directory for site.
|
|
208
224
|
* @param {BuildRuntime} buildRuntime - Runtime to use during build step.
|
|
209
225
|
* @param {Adapter} adapter - Framework adapter defining rendering strategy. Allowed values are: static, ssr
|
|
@@ -213,12 +229,14 @@ declare class Sites {
|
|
|
213
229
|
* @param {string} providerBranch - Production branch for the repo linked to the site.
|
|
214
230
|
* @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.
|
|
215
231
|
* @param {string} providerRootDirectory - Path to site code in the linked repo.
|
|
216
|
-
* @param {string}
|
|
232
|
+
* @param {string} buildSpecification - Build specification for the site deployments.
|
|
233
|
+
* @param {string} runtimeSpecification - Runtime specification for the SSR executions.
|
|
234
|
+
* @param {number} deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
|
|
217
235
|
* @throws {AppwriteException}
|
|
218
236
|
* @returns {Promise<Models.Site>}
|
|
219
237
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
220
238
|
*/
|
|
221
|
-
update(siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string,
|
|
239
|
+
update(siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number): Promise<Models.Site>;
|
|
222
240
|
/**
|
|
223
241
|
* Delete a site by its unique ID.
|
|
224
242
|
*
|