node-appwrite 17.2.0 → 19.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 +67 -2
- package/dist/client.js +3 -3
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +3 -3
- package/dist/client.mjs.map +1 -1
- package/dist/enums/credit-card.d.mts +1 -1
- package/dist/enums/credit-card.d.ts +1 -1
- package/dist/enums/credit-card.js +1 -1
- package/dist/enums/credit-card.js.map +1 -1
- package/dist/enums/credit-card.mjs +1 -1
- package/dist/enums/credit-card.mjs.map +1 -1
- package/dist/enums/execution-method.d.mts +2 -1
- package/dist/enums/execution-method.d.ts +2 -1
- package/dist/enums/execution-method.js +1 -0
- package/dist/enums/execution-method.js.map +1 -1
- package/dist/enums/execution-method.mjs +1 -0
- package/dist/enums/execution-method.mjs.map +1 -1
- package/dist/enums/index-type.d.mts +2 -1
- package/dist/enums/index-type.d.ts +2 -1
- package/dist/enums/index-type.js +1 -0
- package/dist/enums/index-type.js.map +1 -1
- package/dist/enums/index-type.mjs +1 -0
- package/dist/enums/index-type.mjs.map +1 -1
- package/dist/enums/{v-c-s-deployment-type.js → vcs-deployment-type.js} +1 -1
- package/dist/enums/vcs-deployment-type.js.map +1 -0
- package/dist/enums/{v-c-s-deployment-type.mjs → vcs-deployment-type.mjs} +2 -2
- package/dist/enums/vcs-deployment-type.mjs.map +1 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/dist/models.d.mts +1058 -153
- package/dist/models.d.ts +1058 -153
- package/dist/query.d.mts +196 -6
- package/dist/query.d.ts +196 -6
- package/dist/query.js +192 -2
- package/dist/query.js.map +1 -1
- package/dist/query.mjs +192 -2
- package/dist/query.mjs.map +1 -1
- package/dist/services/account.d.mts +625 -70
- package/dist/services/account.d.ts +625 -70
- package/dist/services/account.js +592 -292
- package/dist/services/account.js.map +1 -1
- package/dist/services/account.mjs +592 -292
- package/dist/services/account.mjs.map +1 -1
- package/dist/services/avatars.d.mts +157 -26
- package/dist/services/avatars.d.ts +157 -26
- package/dist/services/avatars.js +104 -93
- package/dist/services/avatars.js.map +1 -1
- package/dist/services/avatars.mjs +104 -93
- package/dist/services/avatars.mjs.map +1 -1
- package/dist/services/databases.d.mts +1425 -248
- package/dist/services/databases.d.ts +1425 -248
- package/dist/services/databases.js +1186 -611
- package/dist/services/databases.js.map +1 -1
- package/dist/services/databases.mjs +1186 -611
- package/dist/services/databases.mjs.map +1 -1
- package/dist/services/functions.d.mts +530 -107
- package/dist/services/functions.d.ts +530 -107
- package/dist/services/functions.js +393 -276
- package/dist/services/functions.js.map +1 -1
- package/dist/services/functions.mjs +393 -276
- package/dist/services/functions.mjs.map +1 -1
- package/dist/services/graphql.d.mts +24 -2
- package/dist/services/graphql.d.ts +24 -2
- package/dist/services/graphql.js +20 -16
- package/dist/services/graphql.js.map +1 -1
- package/dist/services/graphql.mjs +20 -16
- package/dist/services/graphql.mjs.map +1 -1
- package/dist/services/health.d.mts +175 -16
- package/dist/services/health.d.ts +175 -16
- package/dist/services/health.js +144 -115
- package/dist/services/health.js.map +1 -1
- package/dist/services/health.mjs +144 -115
- package/dist/services/health.mjs.map +1 -1
- package/dist/services/locale.js.map +1 -1
- package/dist/services/locale.mjs.map +1 -1
- package/dist/services/messaging.d.mts +1544 -262
- package/dist/services/messaging.d.ts +1544 -262
- package/dist/services/messaging.js +1417 -592
- package/dist/services/messaging.js.map +1 -1
- package/dist/services/messaging.mjs +1417 -592
- package/dist/services/messaging.mjs.map +1 -1
- package/dist/services/sites.d.mts +495 -99
- package/dist/services/sites.d.ts +495 -99
- package/dist/services/sites.js +371 -258
- package/dist/services/sites.js.map +1 -1
- package/dist/services/sites.mjs +371 -258
- package/dist/services/sites.mjs.map +1 -1
- package/dist/services/storage.d.mts +306 -63
- package/dist/services/storage.d.ts +306 -63
- package/dist/services/storage.js +225 -158
- package/dist/services/storage.js.map +1 -1
- package/dist/services/storage.mjs +225 -158
- package/dist/services/storage.mjs.map +1 -1
- package/dist/services/tables-db.d.mts +1744 -0
- package/dist/services/tables-db.d.ts +1744 -0
- package/dist/services/tables-db.js +2692 -0
- package/dist/services/tables-db.js.map +1 -0
- package/dist/services/tables-db.mjs +2691 -0
- package/dist/services/tables-db.mjs.map +1 -0
- package/dist/services/teams.d.mts +233 -39
- package/dist/services/teams.d.ts +233 -39
- package/dist/services/teams.js +170 -135
- package/dist/services/teams.js.map +1 -1
- package/dist/services/teams.mjs +170 -135
- package/dist/services/teams.mjs.map +1 -1
- package/dist/services/tokens.d.mts +76 -11
- package/dist/services/tokens.d.ts +76 -11
- package/dist/services/tokens.js +60 -45
- package/dist/services/tokens.js.map +1 -1
- package/dist/services/tokens.mjs +60 -45
- package/dist/services/tokens.mjs.map +1 -1
- package/dist/services/users.d.mts +842 -115
- package/dist/services/users.d.ts +842 -115
- package/dist/services/users.js +719 -408
- package/dist/services/users.js.map +1 -1
- package/dist/services/users.mjs +719 -408
- package/dist/services/users.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/enums/v-c-s-deployment-type.js.map +0 -1
- package/dist/enums/v-c-s-deployment-type.mjs.map +0 -1
- /package/dist/enums/{v-c-s-deployment-type.d.mts → vcs-deployment-type.d.mts} +0 -0
- /package/dist/enums/{v-c-s-deployment-type.d.ts → vcs-deployment-type.d.ts} +0 -0
|
@@ -0,0 +1,2692 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var client = require('../client');
|
|
4
|
+
|
|
5
|
+
class TablesDB {
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
list(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
|
+
search: rest[0]
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const queries = params.queries;
|
|
20
|
+
const search = params.search;
|
|
21
|
+
const apiPath = "/tablesdb";
|
|
22
|
+
const payload = {};
|
|
23
|
+
if (typeof queries !== "undefined") {
|
|
24
|
+
payload["queries"] = queries;
|
|
25
|
+
}
|
|
26
|
+
if (typeof search !== "undefined") {
|
|
27
|
+
payload["search"] = search;
|
|
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
|
+
create(paramsOrFirst, ...rest) {
|
|
39
|
+
let params;
|
|
40
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
41
|
+
params = paramsOrFirst || {};
|
|
42
|
+
} else {
|
|
43
|
+
params = {
|
|
44
|
+
databaseId: paramsOrFirst,
|
|
45
|
+
name: rest[0],
|
|
46
|
+
enabled: rest[1]
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
const databaseId = params.databaseId;
|
|
50
|
+
const name = params.name;
|
|
51
|
+
const enabled = params.enabled;
|
|
52
|
+
if (typeof databaseId === "undefined") {
|
|
53
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
54
|
+
}
|
|
55
|
+
if (typeof name === "undefined") {
|
|
56
|
+
throw new client.AppwriteException('Missing required parameter: "name"');
|
|
57
|
+
}
|
|
58
|
+
const apiPath = "/tablesdb";
|
|
59
|
+
const payload = {};
|
|
60
|
+
if (typeof databaseId !== "undefined") {
|
|
61
|
+
payload["databaseId"] = databaseId;
|
|
62
|
+
}
|
|
63
|
+
if (typeof name !== "undefined") {
|
|
64
|
+
payload["name"] = name;
|
|
65
|
+
}
|
|
66
|
+
if (typeof enabled !== "undefined") {
|
|
67
|
+
payload["enabled"] = enabled;
|
|
68
|
+
}
|
|
69
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
70
|
+
const apiHeaders = {
|
|
71
|
+
"content-type": "application/json"
|
|
72
|
+
};
|
|
73
|
+
return this.client.call(
|
|
74
|
+
"post",
|
|
75
|
+
uri,
|
|
76
|
+
apiHeaders,
|
|
77
|
+
payload
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
get(paramsOrFirst) {
|
|
81
|
+
let params;
|
|
82
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
83
|
+
params = paramsOrFirst || {};
|
|
84
|
+
} else {
|
|
85
|
+
params = {
|
|
86
|
+
databaseId: paramsOrFirst
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
const databaseId = params.databaseId;
|
|
90
|
+
if (typeof databaseId === "undefined") {
|
|
91
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
92
|
+
}
|
|
93
|
+
const apiPath = "/tablesdb/{databaseId}".replace("{databaseId}", databaseId);
|
|
94
|
+
const payload = {};
|
|
95
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
96
|
+
const apiHeaders = {};
|
|
97
|
+
return this.client.call(
|
|
98
|
+
"get",
|
|
99
|
+
uri,
|
|
100
|
+
apiHeaders,
|
|
101
|
+
payload
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
update(paramsOrFirst, ...rest) {
|
|
105
|
+
let params;
|
|
106
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
107
|
+
params = paramsOrFirst || {};
|
|
108
|
+
} else {
|
|
109
|
+
params = {
|
|
110
|
+
databaseId: paramsOrFirst,
|
|
111
|
+
name: rest[0],
|
|
112
|
+
enabled: rest[1]
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
const databaseId = params.databaseId;
|
|
116
|
+
const name = params.name;
|
|
117
|
+
const enabled = params.enabled;
|
|
118
|
+
if (typeof databaseId === "undefined") {
|
|
119
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
120
|
+
}
|
|
121
|
+
if (typeof name === "undefined") {
|
|
122
|
+
throw new client.AppwriteException('Missing required parameter: "name"');
|
|
123
|
+
}
|
|
124
|
+
const apiPath = "/tablesdb/{databaseId}".replace("{databaseId}", databaseId);
|
|
125
|
+
const payload = {};
|
|
126
|
+
if (typeof name !== "undefined") {
|
|
127
|
+
payload["name"] = name;
|
|
128
|
+
}
|
|
129
|
+
if (typeof enabled !== "undefined") {
|
|
130
|
+
payload["enabled"] = enabled;
|
|
131
|
+
}
|
|
132
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
133
|
+
const apiHeaders = {
|
|
134
|
+
"content-type": "application/json"
|
|
135
|
+
};
|
|
136
|
+
return this.client.call(
|
|
137
|
+
"put",
|
|
138
|
+
uri,
|
|
139
|
+
apiHeaders,
|
|
140
|
+
payload
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
delete(paramsOrFirst) {
|
|
144
|
+
let params;
|
|
145
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
146
|
+
params = paramsOrFirst || {};
|
|
147
|
+
} else {
|
|
148
|
+
params = {
|
|
149
|
+
databaseId: paramsOrFirst
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
const databaseId = params.databaseId;
|
|
153
|
+
if (typeof databaseId === "undefined") {
|
|
154
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
155
|
+
}
|
|
156
|
+
const apiPath = "/tablesdb/{databaseId}".replace("{databaseId}", databaseId);
|
|
157
|
+
const payload = {};
|
|
158
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
159
|
+
const apiHeaders = {
|
|
160
|
+
"content-type": "application/json"
|
|
161
|
+
};
|
|
162
|
+
return this.client.call(
|
|
163
|
+
"delete",
|
|
164
|
+
uri,
|
|
165
|
+
apiHeaders,
|
|
166
|
+
payload
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
listTables(paramsOrFirst, ...rest) {
|
|
170
|
+
let params;
|
|
171
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
172
|
+
params = paramsOrFirst || {};
|
|
173
|
+
} else {
|
|
174
|
+
params = {
|
|
175
|
+
databaseId: paramsOrFirst,
|
|
176
|
+
queries: rest[0],
|
|
177
|
+
search: rest[1]
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
const databaseId = params.databaseId;
|
|
181
|
+
const queries = params.queries;
|
|
182
|
+
const search = params.search;
|
|
183
|
+
if (typeof databaseId === "undefined") {
|
|
184
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
185
|
+
}
|
|
186
|
+
const apiPath = "/tablesdb/{databaseId}/tables".replace("{databaseId}", databaseId);
|
|
187
|
+
const payload = {};
|
|
188
|
+
if (typeof queries !== "undefined") {
|
|
189
|
+
payload["queries"] = queries;
|
|
190
|
+
}
|
|
191
|
+
if (typeof search !== "undefined") {
|
|
192
|
+
payload["search"] = search;
|
|
193
|
+
}
|
|
194
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
195
|
+
const apiHeaders = {};
|
|
196
|
+
return this.client.call(
|
|
197
|
+
"get",
|
|
198
|
+
uri,
|
|
199
|
+
apiHeaders,
|
|
200
|
+
payload
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
createTable(paramsOrFirst, ...rest) {
|
|
204
|
+
let params;
|
|
205
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
206
|
+
params = paramsOrFirst || {};
|
|
207
|
+
} else {
|
|
208
|
+
params = {
|
|
209
|
+
databaseId: paramsOrFirst,
|
|
210
|
+
tableId: rest[0],
|
|
211
|
+
name: rest[1],
|
|
212
|
+
permissions: rest[2],
|
|
213
|
+
rowSecurity: rest[3],
|
|
214
|
+
enabled: rest[4]
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
const databaseId = params.databaseId;
|
|
218
|
+
const tableId = params.tableId;
|
|
219
|
+
const name = params.name;
|
|
220
|
+
const permissions = params.permissions;
|
|
221
|
+
const rowSecurity = params.rowSecurity;
|
|
222
|
+
const enabled = params.enabled;
|
|
223
|
+
if (typeof databaseId === "undefined") {
|
|
224
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
225
|
+
}
|
|
226
|
+
if (typeof tableId === "undefined") {
|
|
227
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
228
|
+
}
|
|
229
|
+
if (typeof name === "undefined") {
|
|
230
|
+
throw new client.AppwriteException('Missing required parameter: "name"');
|
|
231
|
+
}
|
|
232
|
+
const apiPath = "/tablesdb/{databaseId}/tables".replace("{databaseId}", databaseId);
|
|
233
|
+
const payload = {};
|
|
234
|
+
if (typeof tableId !== "undefined") {
|
|
235
|
+
payload["tableId"] = tableId;
|
|
236
|
+
}
|
|
237
|
+
if (typeof name !== "undefined") {
|
|
238
|
+
payload["name"] = name;
|
|
239
|
+
}
|
|
240
|
+
if (typeof permissions !== "undefined") {
|
|
241
|
+
payload["permissions"] = permissions;
|
|
242
|
+
}
|
|
243
|
+
if (typeof rowSecurity !== "undefined") {
|
|
244
|
+
payload["rowSecurity"] = rowSecurity;
|
|
245
|
+
}
|
|
246
|
+
if (typeof enabled !== "undefined") {
|
|
247
|
+
payload["enabled"] = enabled;
|
|
248
|
+
}
|
|
249
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
250
|
+
const apiHeaders = {
|
|
251
|
+
"content-type": "application/json"
|
|
252
|
+
};
|
|
253
|
+
return this.client.call(
|
|
254
|
+
"post",
|
|
255
|
+
uri,
|
|
256
|
+
apiHeaders,
|
|
257
|
+
payload
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
getTable(paramsOrFirst, ...rest) {
|
|
261
|
+
let params;
|
|
262
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
263
|
+
params = paramsOrFirst || {};
|
|
264
|
+
} else {
|
|
265
|
+
params = {
|
|
266
|
+
databaseId: paramsOrFirst,
|
|
267
|
+
tableId: rest[0]
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
const databaseId = params.databaseId;
|
|
271
|
+
const tableId = params.tableId;
|
|
272
|
+
if (typeof databaseId === "undefined") {
|
|
273
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
274
|
+
}
|
|
275
|
+
if (typeof tableId === "undefined") {
|
|
276
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
277
|
+
}
|
|
278
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
279
|
+
const payload = {};
|
|
280
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
281
|
+
const apiHeaders = {};
|
|
282
|
+
return this.client.call(
|
|
283
|
+
"get",
|
|
284
|
+
uri,
|
|
285
|
+
apiHeaders,
|
|
286
|
+
payload
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
updateTable(paramsOrFirst, ...rest) {
|
|
290
|
+
let params;
|
|
291
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
292
|
+
params = paramsOrFirst || {};
|
|
293
|
+
} else {
|
|
294
|
+
params = {
|
|
295
|
+
databaseId: paramsOrFirst,
|
|
296
|
+
tableId: rest[0],
|
|
297
|
+
name: rest[1],
|
|
298
|
+
permissions: rest[2],
|
|
299
|
+
rowSecurity: rest[3],
|
|
300
|
+
enabled: rest[4]
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
const databaseId = params.databaseId;
|
|
304
|
+
const tableId = params.tableId;
|
|
305
|
+
const name = params.name;
|
|
306
|
+
const permissions = params.permissions;
|
|
307
|
+
const rowSecurity = params.rowSecurity;
|
|
308
|
+
const enabled = params.enabled;
|
|
309
|
+
if (typeof databaseId === "undefined") {
|
|
310
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
311
|
+
}
|
|
312
|
+
if (typeof tableId === "undefined") {
|
|
313
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
314
|
+
}
|
|
315
|
+
if (typeof name === "undefined") {
|
|
316
|
+
throw new client.AppwriteException('Missing required parameter: "name"');
|
|
317
|
+
}
|
|
318
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
319
|
+
const payload = {};
|
|
320
|
+
if (typeof name !== "undefined") {
|
|
321
|
+
payload["name"] = name;
|
|
322
|
+
}
|
|
323
|
+
if (typeof permissions !== "undefined") {
|
|
324
|
+
payload["permissions"] = permissions;
|
|
325
|
+
}
|
|
326
|
+
if (typeof rowSecurity !== "undefined") {
|
|
327
|
+
payload["rowSecurity"] = rowSecurity;
|
|
328
|
+
}
|
|
329
|
+
if (typeof enabled !== "undefined") {
|
|
330
|
+
payload["enabled"] = enabled;
|
|
331
|
+
}
|
|
332
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
333
|
+
const apiHeaders = {
|
|
334
|
+
"content-type": "application/json"
|
|
335
|
+
};
|
|
336
|
+
return this.client.call(
|
|
337
|
+
"put",
|
|
338
|
+
uri,
|
|
339
|
+
apiHeaders,
|
|
340
|
+
payload
|
|
341
|
+
);
|
|
342
|
+
}
|
|
343
|
+
deleteTable(paramsOrFirst, ...rest) {
|
|
344
|
+
let params;
|
|
345
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
346
|
+
params = paramsOrFirst || {};
|
|
347
|
+
} else {
|
|
348
|
+
params = {
|
|
349
|
+
databaseId: paramsOrFirst,
|
|
350
|
+
tableId: rest[0]
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
const databaseId = params.databaseId;
|
|
354
|
+
const tableId = params.tableId;
|
|
355
|
+
if (typeof databaseId === "undefined") {
|
|
356
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
357
|
+
}
|
|
358
|
+
if (typeof tableId === "undefined") {
|
|
359
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
360
|
+
}
|
|
361
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
362
|
+
const payload = {};
|
|
363
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
364
|
+
const apiHeaders = {
|
|
365
|
+
"content-type": "application/json"
|
|
366
|
+
};
|
|
367
|
+
return this.client.call(
|
|
368
|
+
"delete",
|
|
369
|
+
uri,
|
|
370
|
+
apiHeaders,
|
|
371
|
+
payload
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
listColumns(paramsOrFirst, ...rest) {
|
|
375
|
+
let params;
|
|
376
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
377
|
+
params = paramsOrFirst || {};
|
|
378
|
+
} else {
|
|
379
|
+
params = {
|
|
380
|
+
databaseId: paramsOrFirst,
|
|
381
|
+
tableId: rest[0],
|
|
382
|
+
queries: rest[1]
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
const databaseId = params.databaseId;
|
|
386
|
+
const tableId = params.tableId;
|
|
387
|
+
const queries = params.queries;
|
|
388
|
+
if (typeof databaseId === "undefined") {
|
|
389
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
390
|
+
}
|
|
391
|
+
if (typeof tableId === "undefined") {
|
|
392
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
393
|
+
}
|
|
394
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
395
|
+
const payload = {};
|
|
396
|
+
if (typeof queries !== "undefined") {
|
|
397
|
+
payload["queries"] = queries;
|
|
398
|
+
}
|
|
399
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
400
|
+
const apiHeaders = {};
|
|
401
|
+
return this.client.call(
|
|
402
|
+
"get",
|
|
403
|
+
uri,
|
|
404
|
+
apiHeaders,
|
|
405
|
+
payload
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
createBooleanColumn(paramsOrFirst, ...rest) {
|
|
409
|
+
let params;
|
|
410
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
411
|
+
params = paramsOrFirst || {};
|
|
412
|
+
} else {
|
|
413
|
+
params = {
|
|
414
|
+
databaseId: paramsOrFirst,
|
|
415
|
+
tableId: rest[0],
|
|
416
|
+
key: rest[1],
|
|
417
|
+
required: rest[2],
|
|
418
|
+
xdefault: rest[3],
|
|
419
|
+
array: rest[4]
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
const databaseId = params.databaseId;
|
|
423
|
+
const tableId = params.tableId;
|
|
424
|
+
const key = params.key;
|
|
425
|
+
const required = params.required;
|
|
426
|
+
const xdefault = params.xdefault;
|
|
427
|
+
const array = params.array;
|
|
428
|
+
if (typeof databaseId === "undefined") {
|
|
429
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
430
|
+
}
|
|
431
|
+
if (typeof tableId === "undefined") {
|
|
432
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
433
|
+
}
|
|
434
|
+
if (typeof key === "undefined") {
|
|
435
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
436
|
+
}
|
|
437
|
+
if (typeof required === "undefined") {
|
|
438
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
439
|
+
}
|
|
440
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/boolean".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
441
|
+
const payload = {};
|
|
442
|
+
if (typeof key !== "undefined") {
|
|
443
|
+
payload["key"] = key;
|
|
444
|
+
}
|
|
445
|
+
if (typeof required !== "undefined") {
|
|
446
|
+
payload["required"] = required;
|
|
447
|
+
}
|
|
448
|
+
if (typeof xdefault !== "undefined") {
|
|
449
|
+
payload["default"] = xdefault;
|
|
450
|
+
}
|
|
451
|
+
if (typeof array !== "undefined") {
|
|
452
|
+
payload["array"] = array;
|
|
453
|
+
}
|
|
454
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
455
|
+
const apiHeaders = {
|
|
456
|
+
"content-type": "application/json"
|
|
457
|
+
};
|
|
458
|
+
return this.client.call(
|
|
459
|
+
"post",
|
|
460
|
+
uri,
|
|
461
|
+
apiHeaders,
|
|
462
|
+
payload
|
|
463
|
+
);
|
|
464
|
+
}
|
|
465
|
+
updateBooleanColumn(paramsOrFirst, ...rest) {
|
|
466
|
+
let params;
|
|
467
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
468
|
+
params = paramsOrFirst || {};
|
|
469
|
+
} else {
|
|
470
|
+
params = {
|
|
471
|
+
databaseId: paramsOrFirst,
|
|
472
|
+
tableId: rest[0],
|
|
473
|
+
key: rest[1],
|
|
474
|
+
required: rest[2],
|
|
475
|
+
xdefault: rest[3],
|
|
476
|
+
newKey: rest[4]
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
const databaseId = params.databaseId;
|
|
480
|
+
const tableId = params.tableId;
|
|
481
|
+
const key = params.key;
|
|
482
|
+
const required = params.required;
|
|
483
|
+
const xdefault = params.xdefault;
|
|
484
|
+
const newKey = params.newKey;
|
|
485
|
+
if (typeof databaseId === "undefined") {
|
|
486
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
487
|
+
}
|
|
488
|
+
if (typeof tableId === "undefined") {
|
|
489
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
490
|
+
}
|
|
491
|
+
if (typeof key === "undefined") {
|
|
492
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
493
|
+
}
|
|
494
|
+
if (typeof required === "undefined") {
|
|
495
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
496
|
+
}
|
|
497
|
+
if (typeof xdefault === "undefined") {
|
|
498
|
+
throw new client.AppwriteException('Missing required parameter: "xdefault"');
|
|
499
|
+
}
|
|
500
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/boolean/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
501
|
+
const payload = {};
|
|
502
|
+
if (typeof required !== "undefined") {
|
|
503
|
+
payload["required"] = required;
|
|
504
|
+
}
|
|
505
|
+
if (typeof xdefault !== "undefined") {
|
|
506
|
+
payload["default"] = xdefault;
|
|
507
|
+
}
|
|
508
|
+
if (typeof newKey !== "undefined") {
|
|
509
|
+
payload["newKey"] = newKey;
|
|
510
|
+
}
|
|
511
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
512
|
+
const apiHeaders = {
|
|
513
|
+
"content-type": "application/json"
|
|
514
|
+
};
|
|
515
|
+
return this.client.call(
|
|
516
|
+
"patch",
|
|
517
|
+
uri,
|
|
518
|
+
apiHeaders,
|
|
519
|
+
payload
|
|
520
|
+
);
|
|
521
|
+
}
|
|
522
|
+
createDatetimeColumn(paramsOrFirst, ...rest) {
|
|
523
|
+
let params;
|
|
524
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
525
|
+
params = paramsOrFirst || {};
|
|
526
|
+
} else {
|
|
527
|
+
params = {
|
|
528
|
+
databaseId: paramsOrFirst,
|
|
529
|
+
tableId: rest[0],
|
|
530
|
+
key: rest[1],
|
|
531
|
+
required: rest[2],
|
|
532
|
+
xdefault: rest[3],
|
|
533
|
+
array: rest[4]
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
const databaseId = params.databaseId;
|
|
537
|
+
const tableId = params.tableId;
|
|
538
|
+
const key = params.key;
|
|
539
|
+
const required = params.required;
|
|
540
|
+
const xdefault = params.xdefault;
|
|
541
|
+
const array = params.array;
|
|
542
|
+
if (typeof databaseId === "undefined") {
|
|
543
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
544
|
+
}
|
|
545
|
+
if (typeof tableId === "undefined") {
|
|
546
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
547
|
+
}
|
|
548
|
+
if (typeof key === "undefined") {
|
|
549
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
550
|
+
}
|
|
551
|
+
if (typeof required === "undefined") {
|
|
552
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
553
|
+
}
|
|
554
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/datetime".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
555
|
+
const payload = {};
|
|
556
|
+
if (typeof key !== "undefined") {
|
|
557
|
+
payload["key"] = key;
|
|
558
|
+
}
|
|
559
|
+
if (typeof required !== "undefined") {
|
|
560
|
+
payload["required"] = required;
|
|
561
|
+
}
|
|
562
|
+
if (typeof xdefault !== "undefined") {
|
|
563
|
+
payload["default"] = xdefault;
|
|
564
|
+
}
|
|
565
|
+
if (typeof array !== "undefined") {
|
|
566
|
+
payload["array"] = array;
|
|
567
|
+
}
|
|
568
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
569
|
+
const apiHeaders = {
|
|
570
|
+
"content-type": "application/json"
|
|
571
|
+
};
|
|
572
|
+
return this.client.call(
|
|
573
|
+
"post",
|
|
574
|
+
uri,
|
|
575
|
+
apiHeaders,
|
|
576
|
+
payload
|
|
577
|
+
);
|
|
578
|
+
}
|
|
579
|
+
updateDatetimeColumn(paramsOrFirst, ...rest) {
|
|
580
|
+
let params;
|
|
581
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
582
|
+
params = paramsOrFirst || {};
|
|
583
|
+
} else {
|
|
584
|
+
params = {
|
|
585
|
+
databaseId: paramsOrFirst,
|
|
586
|
+
tableId: rest[0],
|
|
587
|
+
key: rest[1],
|
|
588
|
+
required: rest[2],
|
|
589
|
+
xdefault: rest[3],
|
|
590
|
+
newKey: rest[4]
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
const databaseId = params.databaseId;
|
|
594
|
+
const tableId = params.tableId;
|
|
595
|
+
const key = params.key;
|
|
596
|
+
const required = params.required;
|
|
597
|
+
const xdefault = params.xdefault;
|
|
598
|
+
const newKey = params.newKey;
|
|
599
|
+
if (typeof databaseId === "undefined") {
|
|
600
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
601
|
+
}
|
|
602
|
+
if (typeof tableId === "undefined") {
|
|
603
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
604
|
+
}
|
|
605
|
+
if (typeof key === "undefined") {
|
|
606
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
607
|
+
}
|
|
608
|
+
if (typeof required === "undefined") {
|
|
609
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
610
|
+
}
|
|
611
|
+
if (typeof xdefault === "undefined") {
|
|
612
|
+
throw new client.AppwriteException('Missing required parameter: "xdefault"');
|
|
613
|
+
}
|
|
614
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/datetime/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
615
|
+
const payload = {};
|
|
616
|
+
if (typeof required !== "undefined") {
|
|
617
|
+
payload["required"] = required;
|
|
618
|
+
}
|
|
619
|
+
if (typeof xdefault !== "undefined") {
|
|
620
|
+
payload["default"] = xdefault;
|
|
621
|
+
}
|
|
622
|
+
if (typeof newKey !== "undefined") {
|
|
623
|
+
payload["newKey"] = newKey;
|
|
624
|
+
}
|
|
625
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
626
|
+
const apiHeaders = {
|
|
627
|
+
"content-type": "application/json"
|
|
628
|
+
};
|
|
629
|
+
return this.client.call(
|
|
630
|
+
"patch",
|
|
631
|
+
uri,
|
|
632
|
+
apiHeaders,
|
|
633
|
+
payload
|
|
634
|
+
);
|
|
635
|
+
}
|
|
636
|
+
createEmailColumn(paramsOrFirst, ...rest) {
|
|
637
|
+
let params;
|
|
638
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
639
|
+
params = paramsOrFirst || {};
|
|
640
|
+
} else {
|
|
641
|
+
params = {
|
|
642
|
+
databaseId: paramsOrFirst,
|
|
643
|
+
tableId: rest[0],
|
|
644
|
+
key: rest[1],
|
|
645
|
+
required: rest[2],
|
|
646
|
+
xdefault: rest[3],
|
|
647
|
+
array: rest[4]
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
const databaseId = params.databaseId;
|
|
651
|
+
const tableId = params.tableId;
|
|
652
|
+
const key = params.key;
|
|
653
|
+
const required = params.required;
|
|
654
|
+
const xdefault = params.xdefault;
|
|
655
|
+
const array = params.array;
|
|
656
|
+
if (typeof databaseId === "undefined") {
|
|
657
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
658
|
+
}
|
|
659
|
+
if (typeof tableId === "undefined") {
|
|
660
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
661
|
+
}
|
|
662
|
+
if (typeof key === "undefined") {
|
|
663
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
664
|
+
}
|
|
665
|
+
if (typeof required === "undefined") {
|
|
666
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
667
|
+
}
|
|
668
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/email".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
669
|
+
const payload = {};
|
|
670
|
+
if (typeof key !== "undefined") {
|
|
671
|
+
payload["key"] = key;
|
|
672
|
+
}
|
|
673
|
+
if (typeof required !== "undefined") {
|
|
674
|
+
payload["required"] = required;
|
|
675
|
+
}
|
|
676
|
+
if (typeof xdefault !== "undefined") {
|
|
677
|
+
payload["default"] = xdefault;
|
|
678
|
+
}
|
|
679
|
+
if (typeof array !== "undefined") {
|
|
680
|
+
payload["array"] = array;
|
|
681
|
+
}
|
|
682
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
683
|
+
const apiHeaders = {
|
|
684
|
+
"content-type": "application/json"
|
|
685
|
+
};
|
|
686
|
+
return this.client.call(
|
|
687
|
+
"post",
|
|
688
|
+
uri,
|
|
689
|
+
apiHeaders,
|
|
690
|
+
payload
|
|
691
|
+
);
|
|
692
|
+
}
|
|
693
|
+
updateEmailColumn(paramsOrFirst, ...rest) {
|
|
694
|
+
let params;
|
|
695
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
696
|
+
params = paramsOrFirst || {};
|
|
697
|
+
} else {
|
|
698
|
+
params = {
|
|
699
|
+
databaseId: paramsOrFirst,
|
|
700
|
+
tableId: rest[0],
|
|
701
|
+
key: rest[1],
|
|
702
|
+
required: rest[2],
|
|
703
|
+
xdefault: rest[3],
|
|
704
|
+
newKey: rest[4]
|
|
705
|
+
};
|
|
706
|
+
}
|
|
707
|
+
const databaseId = params.databaseId;
|
|
708
|
+
const tableId = params.tableId;
|
|
709
|
+
const key = params.key;
|
|
710
|
+
const required = params.required;
|
|
711
|
+
const xdefault = params.xdefault;
|
|
712
|
+
const newKey = params.newKey;
|
|
713
|
+
if (typeof databaseId === "undefined") {
|
|
714
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
715
|
+
}
|
|
716
|
+
if (typeof tableId === "undefined") {
|
|
717
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
718
|
+
}
|
|
719
|
+
if (typeof key === "undefined") {
|
|
720
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
721
|
+
}
|
|
722
|
+
if (typeof required === "undefined") {
|
|
723
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
724
|
+
}
|
|
725
|
+
if (typeof xdefault === "undefined") {
|
|
726
|
+
throw new client.AppwriteException('Missing required parameter: "xdefault"');
|
|
727
|
+
}
|
|
728
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/email/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
729
|
+
const payload = {};
|
|
730
|
+
if (typeof required !== "undefined") {
|
|
731
|
+
payload["required"] = required;
|
|
732
|
+
}
|
|
733
|
+
if (typeof xdefault !== "undefined") {
|
|
734
|
+
payload["default"] = xdefault;
|
|
735
|
+
}
|
|
736
|
+
if (typeof newKey !== "undefined") {
|
|
737
|
+
payload["newKey"] = newKey;
|
|
738
|
+
}
|
|
739
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
740
|
+
const apiHeaders = {
|
|
741
|
+
"content-type": "application/json"
|
|
742
|
+
};
|
|
743
|
+
return this.client.call(
|
|
744
|
+
"patch",
|
|
745
|
+
uri,
|
|
746
|
+
apiHeaders,
|
|
747
|
+
payload
|
|
748
|
+
);
|
|
749
|
+
}
|
|
750
|
+
createEnumColumn(paramsOrFirst, ...rest) {
|
|
751
|
+
let params;
|
|
752
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
753
|
+
params = paramsOrFirst || {};
|
|
754
|
+
} else {
|
|
755
|
+
params = {
|
|
756
|
+
databaseId: paramsOrFirst,
|
|
757
|
+
tableId: rest[0],
|
|
758
|
+
key: rest[1],
|
|
759
|
+
elements: rest[2],
|
|
760
|
+
required: rest[3],
|
|
761
|
+
xdefault: rest[4],
|
|
762
|
+
array: rest[5]
|
|
763
|
+
};
|
|
764
|
+
}
|
|
765
|
+
const databaseId = params.databaseId;
|
|
766
|
+
const tableId = params.tableId;
|
|
767
|
+
const key = params.key;
|
|
768
|
+
const elements = params.elements;
|
|
769
|
+
const required = params.required;
|
|
770
|
+
const xdefault = params.xdefault;
|
|
771
|
+
const array = params.array;
|
|
772
|
+
if (typeof databaseId === "undefined") {
|
|
773
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
774
|
+
}
|
|
775
|
+
if (typeof tableId === "undefined") {
|
|
776
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
777
|
+
}
|
|
778
|
+
if (typeof key === "undefined") {
|
|
779
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
780
|
+
}
|
|
781
|
+
if (typeof elements === "undefined") {
|
|
782
|
+
throw new client.AppwriteException('Missing required parameter: "elements"');
|
|
783
|
+
}
|
|
784
|
+
if (typeof required === "undefined") {
|
|
785
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
786
|
+
}
|
|
787
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/enum".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
788
|
+
const payload = {};
|
|
789
|
+
if (typeof key !== "undefined") {
|
|
790
|
+
payload["key"] = key;
|
|
791
|
+
}
|
|
792
|
+
if (typeof elements !== "undefined") {
|
|
793
|
+
payload["elements"] = elements;
|
|
794
|
+
}
|
|
795
|
+
if (typeof required !== "undefined") {
|
|
796
|
+
payload["required"] = required;
|
|
797
|
+
}
|
|
798
|
+
if (typeof xdefault !== "undefined") {
|
|
799
|
+
payload["default"] = xdefault;
|
|
800
|
+
}
|
|
801
|
+
if (typeof array !== "undefined") {
|
|
802
|
+
payload["array"] = array;
|
|
803
|
+
}
|
|
804
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
805
|
+
const apiHeaders = {
|
|
806
|
+
"content-type": "application/json"
|
|
807
|
+
};
|
|
808
|
+
return this.client.call(
|
|
809
|
+
"post",
|
|
810
|
+
uri,
|
|
811
|
+
apiHeaders,
|
|
812
|
+
payload
|
|
813
|
+
);
|
|
814
|
+
}
|
|
815
|
+
updateEnumColumn(paramsOrFirst, ...rest) {
|
|
816
|
+
let params;
|
|
817
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
818
|
+
params = paramsOrFirst || {};
|
|
819
|
+
} else {
|
|
820
|
+
params = {
|
|
821
|
+
databaseId: paramsOrFirst,
|
|
822
|
+
tableId: rest[0],
|
|
823
|
+
key: rest[1],
|
|
824
|
+
elements: rest[2],
|
|
825
|
+
required: rest[3],
|
|
826
|
+
xdefault: rest[4],
|
|
827
|
+
newKey: rest[5]
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
const databaseId = params.databaseId;
|
|
831
|
+
const tableId = params.tableId;
|
|
832
|
+
const key = params.key;
|
|
833
|
+
const elements = params.elements;
|
|
834
|
+
const required = params.required;
|
|
835
|
+
const xdefault = params.xdefault;
|
|
836
|
+
const newKey = params.newKey;
|
|
837
|
+
if (typeof databaseId === "undefined") {
|
|
838
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
839
|
+
}
|
|
840
|
+
if (typeof tableId === "undefined") {
|
|
841
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
842
|
+
}
|
|
843
|
+
if (typeof key === "undefined") {
|
|
844
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
845
|
+
}
|
|
846
|
+
if (typeof elements === "undefined") {
|
|
847
|
+
throw new client.AppwriteException('Missing required parameter: "elements"');
|
|
848
|
+
}
|
|
849
|
+
if (typeof required === "undefined") {
|
|
850
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
851
|
+
}
|
|
852
|
+
if (typeof xdefault === "undefined") {
|
|
853
|
+
throw new client.AppwriteException('Missing required parameter: "xdefault"');
|
|
854
|
+
}
|
|
855
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/enum/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
856
|
+
const payload = {};
|
|
857
|
+
if (typeof elements !== "undefined") {
|
|
858
|
+
payload["elements"] = elements;
|
|
859
|
+
}
|
|
860
|
+
if (typeof required !== "undefined") {
|
|
861
|
+
payload["required"] = required;
|
|
862
|
+
}
|
|
863
|
+
if (typeof xdefault !== "undefined") {
|
|
864
|
+
payload["default"] = xdefault;
|
|
865
|
+
}
|
|
866
|
+
if (typeof newKey !== "undefined") {
|
|
867
|
+
payload["newKey"] = newKey;
|
|
868
|
+
}
|
|
869
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
870
|
+
const apiHeaders = {
|
|
871
|
+
"content-type": "application/json"
|
|
872
|
+
};
|
|
873
|
+
return this.client.call(
|
|
874
|
+
"patch",
|
|
875
|
+
uri,
|
|
876
|
+
apiHeaders,
|
|
877
|
+
payload
|
|
878
|
+
);
|
|
879
|
+
}
|
|
880
|
+
createFloatColumn(paramsOrFirst, ...rest) {
|
|
881
|
+
let params;
|
|
882
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
883
|
+
params = paramsOrFirst || {};
|
|
884
|
+
} else {
|
|
885
|
+
params = {
|
|
886
|
+
databaseId: paramsOrFirst,
|
|
887
|
+
tableId: rest[0],
|
|
888
|
+
key: rest[1],
|
|
889
|
+
required: rest[2],
|
|
890
|
+
min: rest[3],
|
|
891
|
+
max: rest[4],
|
|
892
|
+
xdefault: rest[5],
|
|
893
|
+
array: rest[6]
|
|
894
|
+
};
|
|
895
|
+
}
|
|
896
|
+
const databaseId = params.databaseId;
|
|
897
|
+
const tableId = params.tableId;
|
|
898
|
+
const key = params.key;
|
|
899
|
+
const required = params.required;
|
|
900
|
+
const min = params.min;
|
|
901
|
+
const max = params.max;
|
|
902
|
+
const xdefault = params.xdefault;
|
|
903
|
+
const array = params.array;
|
|
904
|
+
if (typeof databaseId === "undefined") {
|
|
905
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
906
|
+
}
|
|
907
|
+
if (typeof tableId === "undefined") {
|
|
908
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
909
|
+
}
|
|
910
|
+
if (typeof key === "undefined") {
|
|
911
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
912
|
+
}
|
|
913
|
+
if (typeof required === "undefined") {
|
|
914
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
915
|
+
}
|
|
916
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/float".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
917
|
+
const payload = {};
|
|
918
|
+
if (typeof key !== "undefined") {
|
|
919
|
+
payload["key"] = key;
|
|
920
|
+
}
|
|
921
|
+
if (typeof required !== "undefined") {
|
|
922
|
+
payload["required"] = required;
|
|
923
|
+
}
|
|
924
|
+
if (typeof min !== "undefined") {
|
|
925
|
+
payload["min"] = min;
|
|
926
|
+
}
|
|
927
|
+
if (typeof max !== "undefined") {
|
|
928
|
+
payload["max"] = max;
|
|
929
|
+
}
|
|
930
|
+
if (typeof xdefault !== "undefined") {
|
|
931
|
+
payload["default"] = xdefault;
|
|
932
|
+
}
|
|
933
|
+
if (typeof array !== "undefined") {
|
|
934
|
+
payload["array"] = array;
|
|
935
|
+
}
|
|
936
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
937
|
+
const apiHeaders = {
|
|
938
|
+
"content-type": "application/json"
|
|
939
|
+
};
|
|
940
|
+
return this.client.call(
|
|
941
|
+
"post",
|
|
942
|
+
uri,
|
|
943
|
+
apiHeaders,
|
|
944
|
+
payload
|
|
945
|
+
);
|
|
946
|
+
}
|
|
947
|
+
updateFloatColumn(paramsOrFirst, ...rest) {
|
|
948
|
+
let params;
|
|
949
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
950
|
+
params = paramsOrFirst || {};
|
|
951
|
+
} else {
|
|
952
|
+
params = {
|
|
953
|
+
databaseId: paramsOrFirst,
|
|
954
|
+
tableId: rest[0],
|
|
955
|
+
key: rest[1],
|
|
956
|
+
required: rest[2],
|
|
957
|
+
xdefault: rest[3],
|
|
958
|
+
min: rest[4],
|
|
959
|
+
max: rest[5],
|
|
960
|
+
newKey: rest[6]
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
const databaseId = params.databaseId;
|
|
964
|
+
const tableId = params.tableId;
|
|
965
|
+
const key = params.key;
|
|
966
|
+
const required = params.required;
|
|
967
|
+
const xdefault = params.xdefault;
|
|
968
|
+
const min = params.min;
|
|
969
|
+
const max = params.max;
|
|
970
|
+
const newKey = params.newKey;
|
|
971
|
+
if (typeof databaseId === "undefined") {
|
|
972
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
973
|
+
}
|
|
974
|
+
if (typeof tableId === "undefined") {
|
|
975
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
976
|
+
}
|
|
977
|
+
if (typeof key === "undefined") {
|
|
978
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
979
|
+
}
|
|
980
|
+
if (typeof required === "undefined") {
|
|
981
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
982
|
+
}
|
|
983
|
+
if (typeof xdefault === "undefined") {
|
|
984
|
+
throw new client.AppwriteException('Missing required parameter: "xdefault"');
|
|
985
|
+
}
|
|
986
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/float/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
987
|
+
const payload = {};
|
|
988
|
+
if (typeof required !== "undefined") {
|
|
989
|
+
payload["required"] = required;
|
|
990
|
+
}
|
|
991
|
+
if (typeof min !== "undefined") {
|
|
992
|
+
payload["min"] = min;
|
|
993
|
+
}
|
|
994
|
+
if (typeof max !== "undefined") {
|
|
995
|
+
payload["max"] = max;
|
|
996
|
+
}
|
|
997
|
+
if (typeof xdefault !== "undefined") {
|
|
998
|
+
payload["default"] = xdefault;
|
|
999
|
+
}
|
|
1000
|
+
if (typeof newKey !== "undefined") {
|
|
1001
|
+
payload["newKey"] = newKey;
|
|
1002
|
+
}
|
|
1003
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1004
|
+
const apiHeaders = {
|
|
1005
|
+
"content-type": "application/json"
|
|
1006
|
+
};
|
|
1007
|
+
return this.client.call(
|
|
1008
|
+
"patch",
|
|
1009
|
+
uri,
|
|
1010
|
+
apiHeaders,
|
|
1011
|
+
payload
|
|
1012
|
+
);
|
|
1013
|
+
}
|
|
1014
|
+
createIntegerColumn(paramsOrFirst, ...rest) {
|
|
1015
|
+
let params;
|
|
1016
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
1017
|
+
params = paramsOrFirst || {};
|
|
1018
|
+
} else {
|
|
1019
|
+
params = {
|
|
1020
|
+
databaseId: paramsOrFirst,
|
|
1021
|
+
tableId: rest[0],
|
|
1022
|
+
key: rest[1],
|
|
1023
|
+
required: rest[2],
|
|
1024
|
+
min: rest[3],
|
|
1025
|
+
max: rest[4],
|
|
1026
|
+
xdefault: rest[5],
|
|
1027
|
+
array: rest[6]
|
|
1028
|
+
};
|
|
1029
|
+
}
|
|
1030
|
+
const databaseId = params.databaseId;
|
|
1031
|
+
const tableId = params.tableId;
|
|
1032
|
+
const key = params.key;
|
|
1033
|
+
const required = params.required;
|
|
1034
|
+
const min = params.min;
|
|
1035
|
+
const max = params.max;
|
|
1036
|
+
const xdefault = params.xdefault;
|
|
1037
|
+
const array = params.array;
|
|
1038
|
+
if (typeof databaseId === "undefined") {
|
|
1039
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1040
|
+
}
|
|
1041
|
+
if (typeof tableId === "undefined") {
|
|
1042
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
1043
|
+
}
|
|
1044
|
+
if (typeof key === "undefined") {
|
|
1045
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
1046
|
+
}
|
|
1047
|
+
if (typeof required === "undefined") {
|
|
1048
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
1049
|
+
}
|
|
1050
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/integer".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
1051
|
+
const payload = {};
|
|
1052
|
+
if (typeof key !== "undefined") {
|
|
1053
|
+
payload["key"] = key;
|
|
1054
|
+
}
|
|
1055
|
+
if (typeof required !== "undefined") {
|
|
1056
|
+
payload["required"] = required;
|
|
1057
|
+
}
|
|
1058
|
+
if (typeof min !== "undefined") {
|
|
1059
|
+
payload["min"] = min;
|
|
1060
|
+
}
|
|
1061
|
+
if (typeof max !== "undefined") {
|
|
1062
|
+
payload["max"] = max;
|
|
1063
|
+
}
|
|
1064
|
+
if (typeof xdefault !== "undefined") {
|
|
1065
|
+
payload["default"] = xdefault;
|
|
1066
|
+
}
|
|
1067
|
+
if (typeof array !== "undefined") {
|
|
1068
|
+
payload["array"] = array;
|
|
1069
|
+
}
|
|
1070
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1071
|
+
const apiHeaders = {
|
|
1072
|
+
"content-type": "application/json"
|
|
1073
|
+
};
|
|
1074
|
+
return this.client.call(
|
|
1075
|
+
"post",
|
|
1076
|
+
uri,
|
|
1077
|
+
apiHeaders,
|
|
1078
|
+
payload
|
|
1079
|
+
);
|
|
1080
|
+
}
|
|
1081
|
+
updateIntegerColumn(paramsOrFirst, ...rest) {
|
|
1082
|
+
let params;
|
|
1083
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
1084
|
+
params = paramsOrFirst || {};
|
|
1085
|
+
} else {
|
|
1086
|
+
params = {
|
|
1087
|
+
databaseId: paramsOrFirst,
|
|
1088
|
+
tableId: rest[0],
|
|
1089
|
+
key: rest[1],
|
|
1090
|
+
required: rest[2],
|
|
1091
|
+
xdefault: rest[3],
|
|
1092
|
+
min: rest[4],
|
|
1093
|
+
max: rest[5],
|
|
1094
|
+
newKey: rest[6]
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
1097
|
+
const databaseId = params.databaseId;
|
|
1098
|
+
const tableId = params.tableId;
|
|
1099
|
+
const key = params.key;
|
|
1100
|
+
const required = params.required;
|
|
1101
|
+
const xdefault = params.xdefault;
|
|
1102
|
+
const min = params.min;
|
|
1103
|
+
const max = params.max;
|
|
1104
|
+
const newKey = params.newKey;
|
|
1105
|
+
if (typeof databaseId === "undefined") {
|
|
1106
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1107
|
+
}
|
|
1108
|
+
if (typeof tableId === "undefined") {
|
|
1109
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
1110
|
+
}
|
|
1111
|
+
if (typeof key === "undefined") {
|
|
1112
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
1113
|
+
}
|
|
1114
|
+
if (typeof required === "undefined") {
|
|
1115
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
1116
|
+
}
|
|
1117
|
+
if (typeof xdefault === "undefined") {
|
|
1118
|
+
throw new client.AppwriteException('Missing required parameter: "xdefault"');
|
|
1119
|
+
}
|
|
1120
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/integer/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
1121
|
+
const payload = {};
|
|
1122
|
+
if (typeof required !== "undefined") {
|
|
1123
|
+
payload["required"] = required;
|
|
1124
|
+
}
|
|
1125
|
+
if (typeof min !== "undefined") {
|
|
1126
|
+
payload["min"] = min;
|
|
1127
|
+
}
|
|
1128
|
+
if (typeof max !== "undefined") {
|
|
1129
|
+
payload["max"] = max;
|
|
1130
|
+
}
|
|
1131
|
+
if (typeof xdefault !== "undefined") {
|
|
1132
|
+
payload["default"] = xdefault;
|
|
1133
|
+
}
|
|
1134
|
+
if (typeof newKey !== "undefined") {
|
|
1135
|
+
payload["newKey"] = newKey;
|
|
1136
|
+
}
|
|
1137
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1138
|
+
const apiHeaders = {
|
|
1139
|
+
"content-type": "application/json"
|
|
1140
|
+
};
|
|
1141
|
+
return this.client.call(
|
|
1142
|
+
"patch",
|
|
1143
|
+
uri,
|
|
1144
|
+
apiHeaders,
|
|
1145
|
+
payload
|
|
1146
|
+
);
|
|
1147
|
+
}
|
|
1148
|
+
createIpColumn(paramsOrFirst, ...rest) {
|
|
1149
|
+
let params;
|
|
1150
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
1151
|
+
params = paramsOrFirst || {};
|
|
1152
|
+
} else {
|
|
1153
|
+
params = {
|
|
1154
|
+
databaseId: paramsOrFirst,
|
|
1155
|
+
tableId: rest[0],
|
|
1156
|
+
key: rest[1],
|
|
1157
|
+
required: rest[2],
|
|
1158
|
+
xdefault: rest[3],
|
|
1159
|
+
array: rest[4]
|
|
1160
|
+
};
|
|
1161
|
+
}
|
|
1162
|
+
const databaseId = params.databaseId;
|
|
1163
|
+
const tableId = params.tableId;
|
|
1164
|
+
const key = params.key;
|
|
1165
|
+
const required = params.required;
|
|
1166
|
+
const xdefault = params.xdefault;
|
|
1167
|
+
const array = params.array;
|
|
1168
|
+
if (typeof databaseId === "undefined") {
|
|
1169
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1170
|
+
}
|
|
1171
|
+
if (typeof tableId === "undefined") {
|
|
1172
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
1173
|
+
}
|
|
1174
|
+
if (typeof key === "undefined") {
|
|
1175
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
1176
|
+
}
|
|
1177
|
+
if (typeof required === "undefined") {
|
|
1178
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
1179
|
+
}
|
|
1180
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/ip".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
1181
|
+
const payload = {};
|
|
1182
|
+
if (typeof key !== "undefined") {
|
|
1183
|
+
payload["key"] = key;
|
|
1184
|
+
}
|
|
1185
|
+
if (typeof required !== "undefined") {
|
|
1186
|
+
payload["required"] = required;
|
|
1187
|
+
}
|
|
1188
|
+
if (typeof xdefault !== "undefined") {
|
|
1189
|
+
payload["default"] = xdefault;
|
|
1190
|
+
}
|
|
1191
|
+
if (typeof array !== "undefined") {
|
|
1192
|
+
payload["array"] = array;
|
|
1193
|
+
}
|
|
1194
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1195
|
+
const apiHeaders = {
|
|
1196
|
+
"content-type": "application/json"
|
|
1197
|
+
};
|
|
1198
|
+
return this.client.call(
|
|
1199
|
+
"post",
|
|
1200
|
+
uri,
|
|
1201
|
+
apiHeaders,
|
|
1202
|
+
payload
|
|
1203
|
+
);
|
|
1204
|
+
}
|
|
1205
|
+
updateIpColumn(paramsOrFirst, ...rest) {
|
|
1206
|
+
let params;
|
|
1207
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
1208
|
+
params = paramsOrFirst || {};
|
|
1209
|
+
} else {
|
|
1210
|
+
params = {
|
|
1211
|
+
databaseId: paramsOrFirst,
|
|
1212
|
+
tableId: rest[0],
|
|
1213
|
+
key: rest[1],
|
|
1214
|
+
required: rest[2],
|
|
1215
|
+
xdefault: rest[3],
|
|
1216
|
+
newKey: rest[4]
|
|
1217
|
+
};
|
|
1218
|
+
}
|
|
1219
|
+
const databaseId = params.databaseId;
|
|
1220
|
+
const tableId = params.tableId;
|
|
1221
|
+
const key = params.key;
|
|
1222
|
+
const required = params.required;
|
|
1223
|
+
const xdefault = params.xdefault;
|
|
1224
|
+
const newKey = params.newKey;
|
|
1225
|
+
if (typeof databaseId === "undefined") {
|
|
1226
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1227
|
+
}
|
|
1228
|
+
if (typeof tableId === "undefined") {
|
|
1229
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
1230
|
+
}
|
|
1231
|
+
if (typeof key === "undefined") {
|
|
1232
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
1233
|
+
}
|
|
1234
|
+
if (typeof required === "undefined") {
|
|
1235
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
1236
|
+
}
|
|
1237
|
+
if (typeof xdefault === "undefined") {
|
|
1238
|
+
throw new client.AppwriteException('Missing required parameter: "xdefault"');
|
|
1239
|
+
}
|
|
1240
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/ip/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
1241
|
+
const payload = {};
|
|
1242
|
+
if (typeof required !== "undefined") {
|
|
1243
|
+
payload["required"] = required;
|
|
1244
|
+
}
|
|
1245
|
+
if (typeof xdefault !== "undefined") {
|
|
1246
|
+
payload["default"] = xdefault;
|
|
1247
|
+
}
|
|
1248
|
+
if (typeof newKey !== "undefined") {
|
|
1249
|
+
payload["newKey"] = newKey;
|
|
1250
|
+
}
|
|
1251
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1252
|
+
const apiHeaders = {
|
|
1253
|
+
"content-type": "application/json"
|
|
1254
|
+
};
|
|
1255
|
+
return this.client.call(
|
|
1256
|
+
"patch",
|
|
1257
|
+
uri,
|
|
1258
|
+
apiHeaders,
|
|
1259
|
+
payload
|
|
1260
|
+
);
|
|
1261
|
+
}
|
|
1262
|
+
createLineColumn(paramsOrFirst, ...rest) {
|
|
1263
|
+
let params;
|
|
1264
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
1265
|
+
params = paramsOrFirst || {};
|
|
1266
|
+
} else {
|
|
1267
|
+
params = {
|
|
1268
|
+
databaseId: paramsOrFirst,
|
|
1269
|
+
tableId: rest[0],
|
|
1270
|
+
key: rest[1],
|
|
1271
|
+
required: rest[2],
|
|
1272
|
+
xdefault: rest[3]
|
|
1273
|
+
};
|
|
1274
|
+
}
|
|
1275
|
+
const databaseId = params.databaseId;
|
|
1276
|
+
const tableId = params.tableId;
|
|
1277
|
+
const key = params.key;
|
|
1278
|
+
const required = params.required;
|
|
1279
|
+
const xdefault = params.xdefault;
|
|
1280
|
+
if (typeof databaseId === "undefined") {
|
|
1281
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1282
|
+
}
|
|
1283
|
+
if (typeof tableId === "undefined") {
|
|
1284
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
1285
|
+
}
|
|
1286
|
+
if (typeof key === "undefined") {
|
|
1287
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
1288
|
+
}
|
|
1289
|
+
if (typeof required === "undefined") {
|
|
1290
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
1291
|
+
}
|
|
1292
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/line".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
1293
|
+
const payload = {};
|
|
1294
|
+
if (typeof key !== "undefined") {
|
|
1295
|
+
payload["key"] = key;
|
|
1296
|
+
}
|
|
1297
|
+
if (typeof required !== "undefined") {
|
|
1298
|
+
payload["required"] = required;
|
|
1299
|
+
}
|
|
1300
|
+
if (typeof xdefault !== "undefined") {
|
|
1301
|
+
payload["default"] = xdefault;
|
|
1302
|
+
}
|
|
1303
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1304
|
+
const apiHeaders = {
|
|
1305
|
+
"content-type": "application/json"
|
|
1306
|
+
};
|
|
1307
|
+
return this.client.call(
|
|
1308
|
+
"post",
|
|
1309
|
+
uri,
|
|
1310
|
+
apiHeaders,
|
|
1311
|
+
payload
|
|
1312
|
+
);
|
|
1313
|
+
}
|
|
1314
|
+
updateLineColumn(paramsOrFirst, ...rest) {
|
|
1315
|
+
let params;
|
|
1316
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
1317
|
+
params = paramsOrFirst || {};
|
|
1318
|
+
} else {
|
|
1319
|
+
params = {
|
|
1320
|
+
databaseId: paramsOrFirst,
|
|
1321
|
+
tableId: rest[0],
|
|
1322
|
+
key: rest[1],
|
|
1323
|
+
required: rest[2],
|
|
1324
|
+
xdefault: rest[3],
|
|
1325
|
+
newKey: rest[4]
|
|
1326
|
+
};
|
|
1327
|
+
}
|
|
1328
|
+
const databaseId = params.databaseId;
|
|
1329
|
+
const tableId = params.tableId;
|
|
1330
|
+
const key = params.key;
|
|
1331
|
+
const required = params.required;
|
|
1332
|
+
const xdefault = params.xdefault;
|
|
1333
|
+
const newKey = params.newKey;
|
|
1334
|
+
if (typeof databaseId === "undefined") {
|
|
1335
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1336
|
+
}
|
|
1337
|
+
if (typeof tableId === "undefined") {
|
|
1338
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
1339
|
+
}
|
|
1340
|
+
if (typeof key === "undefined") {
|
|
1341
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
1342
|
+
}
|
|
1343
|
+
if (typeof required === "undefined") {
|
|
1344
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
1345
|
+
}
|
|
1346
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/line/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
1347
|
+
const payload = {};
|
|
1348
|
+
if (typeof required !== "undefined") {
|
|
1349
|
+
payload["required"] = required;
|
|
1350
|
+
}
|
|
1351
|
+
if (typeof xdefault !== "undefined") {
|
|
1352
|
+
payload["default"] = xdefault;
|
|
1353
|
+
}
|
|
1354
|
+
if (typeof newKey !== "undefined") {
|
|
1355
|
+
payload["newKey"] = newKey;
|
|
1356
|
+
}
|
|
1357
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1358
|
+
const apiHeaders = {
|
|
1359
|
+
"content-type": "application/json"
|
|
1360
|
+
};
|
|
1361
|
+
return this.client.call(
|
|
1362
|
+
"patch",
|
|
1363
|
+
uri,
|
|
1364
|
+
apiHeaders,
|
|
1365
|
+
payload
|
|
1366
|
+
);
|
|
1367
|
+
}
|
|
1368
|
+
createPointColumn(paramsOrFirst, ...rest) {
|
|
1369
|
+
let params;
|
|
1370
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
1371
|
+
params = paramsOrFirst || {};
|
|
1372
|
+
} else {
|
|
1373
|
+
params = {
|
|
1374
|
+
databaseId: paramsOrFirst,
|
|
1375
|
+
tableId: rest[0],
|
|
1376
|
+
key: rest[1],
|
|
1377
|
+
required: rest[2],
|
|
1378
|
+
xdefault: rest[3]
|
|
1379
|
+
};
|
|
1380
|
+
}
|
|
1381
|
+
const databaseId = params.databaseId;
|
|
1382
|
+
const tableId = params.tableId;
|
|
1383
|
+
const key = params.key;
|
|
1384
|
+
const required = params.required;
|
|
1385
|
+
const xdefault = params.xdefault;
|
|
1386
|
+
if (typeof databaseId === "undefined") {
|
|
1387
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1388
|
+
}
|
|
1389
|
+
if (typeof tableId === "undefined") {
|
|
1390
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
1391
|
+
}
|
|
1392
|
+
if (typeof key === "undefined") {
|
|
1393
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
1394
|
+
}
|
|
1395
|
+
if (typeof required === "undefined") {
|
|
1396
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
1397
|
+
}
|
|
1398
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/point".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
1399
|
+
const payload = {};
|
|
1400
|
+
if (typeof key !== "undefined") {
|
|
1401
|
+
payload["key"] = key;
|
|
1402
|
+
}
|
|
1403
|
+
if (typeof required !== "undefined") {
|
|
1404
|
+
payload["required"] = required;
|
|
1405
|
+
}
|
|
1406
|
+
if (typeof xdefault !== "undefined") {
|
|
1407
|
+
payload["default"] = xdefault;
|
|
1408
|
+
}
|
|
1409
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1410
|
+
const apiHeaders = {
|
|
1411
|
+
"content-type": "application/json"
|
|
1412
|
+
};
|
|
1413
|
+
return this.client.call(
|
|
1414
|
+
"post",
|
|
1415
|
+
uri,
|
|
1416
|
+
apiHeaders,
|
|
1417
|
+
payload
|
|
1418
|
+
);
|
|
1419
|
+
}
|
|
1420
|
+
updatePointColumn(paramsOrFirst, ...rest) {
|
|
1421
|
+
let params;
|
|
1422
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
1423
|
+
params = paramsOrFirst || {};
|
|
1424
|
+
} else {
|
|
1425
|
+
params = {
|
|
1426
|
+
databaseId: paramsOrFirst,
|
|
1427
|
+
tableId: rest[0],
|
|
1428
|
+
key: rest[1],
|
|
1429
|
+
required: rest[2],
|
|
1430
|
+
xdefault: rest[3],
|
|
1431
|
+
newKey: rest[4]
|
|
1432
|
+
};
|
|
1433
|
+
}
|
|
1434
|
+
const databaseId = params.databaseId;
|
|
1435
|
+
const tableId = params.tableId;
|
|
1436
|
+
const key = params.key;
|
|
1437
|
+
const required = params.required;
|
|
1438
|
+
const xdefault = params.xdefault;
|
|
1439
|
+
const newKey = params.newKey;
|
|
1440
|
+
if (typeof databaseId === "undefined") {
|
|
1441
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1442
|
+
}
|
|
1443
|
+
if (typeof tableId === "undefined") {
|
|
1444
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
1445
|
+
}
|
|
1446
|
+
if (typeof key === "undefined") {
|
|
1447
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
1448
|
+
}
|
|
1449
|
+
if (typeof required === "undefined") {
|
|
1450
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
1451
|
+
}
|
|
1452
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/point/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
1453
|
+
const payload = {};
|
|
1454
|
+
if (typeof required !== "undefined") {
|
|
1455
|
+
payload["required"] = required;
|
|
1456
|
+
}
|
|
1457
|
+
if (typeof xdefault !== "undefined") {
|
|
1458
|
+
payload["default"] = xdefault;
|
|
1459
|
+
}
|
|
1460
|
+
if (typeof newKey !== "undefined") {
|
|
1461
|
+
payload["newKey"] = newKey;
|
|
1462
|
+
}
|
|
1463
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1464
|
+
const apiHeaders = {
|
|
1465
|
+
"content-type": "application/json"
|
|
1466
|
+
};
|
|
1467
|
+
return this.client.call(
|
|
1468
|
+
"patch",
|
|
1469
|
+
uri,
|
|
1470
|
+
apiHeaders,
|
|
1471
|
+
payload
|
|
1472
|
+
);
|
|
1473
|
+
}
|
|
1474
|
+
createPolygonColumn(paramsOrFirst, ...rest) {
|
|
1475
|
+
let params;
|
|
1476
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
1477
|
+
params = paramsOrFirst || {};
|
|
1478
|
+
} else {
|
|
1479
|
+
params = {
|
|
1480
|
+
databaseId: paramsOrFirst,
|
|
1481
|
+
tableId: rest[0],
|
|
1482
|
+
key: rest[1],
|
|
1483
|
+
required: rest[2],
|
|
1484
|
+
xdefault: rest[3]
|
|
1485
|
+
};
|
|
1486
|
+
}
|
|
1487
|
+
const databaseId = params.databaseId;
|
|
1488
|
+
const tableId = params.tableId;
|
|
1489
|
+
const key = params.key;
|
|
1490
|
+
const required = params.required;
|
|
1491
|
+
const xdefault = params.xdefault;
|
|
1492
|
+
if (typeof databaseId === "undefined") {
|
|
1493
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1494
|
+
}
|
|
1495
|
+
if (typeof tableId === "undefined") {
|
|
1496
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
1497
|
+
}
|
|
1498
|
+
if (typeof key === "undefined") {
|
|
1499
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
1500
|
+
}
|
|
1501
|
+
if (typeof required === "undefined") {
|
|
1502
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
1503
|
+
}
|
|
1504
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/polygon".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
1505
|
+
const payload = {};
|
|
1506
|
+
if (typeof key !== "undefined") {
|
|
1507
|
+
payload["key"] = key;
|
|
1508
|
+
}
|
|
1509
|
+
if (typeof required !== "undefined") {
|
|
1510
|
+
payload["required"] = required;
|
|
1511
|
+
}
|
|
1512
|
+
if (typeof xdefault !== "undefined") {
|
|
1513
|
+
payload["default"] = xdefault;
|
|
1514
|
+
}
|
|
1515
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1516
|
+
const apiHeaders = {
|
|
1517
|
+
"content-type": "application/json"
|
|
1518
|
+
};
|
|
1519
|
+
return this.client.call(
|
|
1520
|
+
"post",
|
|
1521
|
+
uri,
|
|
1522
|
+
apiHeaders,
|
|
1523
|
+
payload
|
|
1524
|
+
);
|
|
1525
|
+
}
|
|
1526
|
+
updatePolygonColumn(paramsOrFirst, ...rest) {
|
|
1527
|
+
let params;
|
|
1528
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
1529
|
+
params = paramsOrFirst || {};
|
|
1530
|
+
} else {
|
|
1531
|
+
params = {
|
|
1532
|
+
databaseId: paramsOrFirst,
|
|
1533
|
+
tableId: rest[0],
|
|
1534
|
+
key: rest[1],
|
|
1535
|
+
required: rest[2],
|
|
1536
|
+
xdefault: rest[3],
|
|
1537
|
+
newKey: rest[4]
|
|
1538
|
+
};
|
|
1539
|
+
}
|
|
1540
|
+
const databaseId = params.databaseId;
|
|
1541
|
+
const tableId = params.tableId;
|
|
1542
|
+
const key = params.key;
|
|
1543
|
+
const required = params.required;
|
|
1544
|
+
const xdefault = params.xdefault;
|
|
1545
|
+
const newKey = params.newKey;
|
|
1546
|
+
if (typeof databaseId === "undefined") {
|
|
1547
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1548
|
+
}
|
|
1549
|
+
if (typeof tableId === "undefined") {
|
|
1550
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
1551
|
+
}
|
|
1552
|
+
if (typeof key === "undefined") {
|
|
1553
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
1554
|
+
}
|
|
1555
|
+
if (typeof required === "undefined") {
|
|
1556
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
1557
|
+
}
|
|
1558
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/polygon/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
1559
|
+
const payload = {};
|
|
1560
|
+
if (typeof required !== "undefined") {
|
|
1561
|
+
payload["required"] = required;
|
|
1562
|
+
}
|
|
1563
|
+
if (typeof xdefault !== "undefined") {
|
|
1564
|
+
payload["default"] = xdefault;
|
|
1565
|
+
}
|
|
1566
|
+
if (typeof newKey !== "undefined") {
|
|
1567
|
+
payload["newKey"] = newKey;
|
|
1568
|
+
}
|
|
1569
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1570
|
+
const apiHeaders = {
|
|
1571
|
+
"content-type": "application/json"
|
|
1572
|
+
};
|
|
1573
|
+
return this.client.call(
|
|
1574
|
+
"patch",
|
|
1575
|
+
uri,
|
|
1576
|
+
apiHeaders,
|
|
1577
|
+
payload
|
|
1578
|
+
);
|
|
1579
|
+
}
|
|
1580
|
+
createRelationshipColumn(paramsOrFirst, ...rest) {
|
|
1581
|
+
let params;
|
|
1582
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
1583
|
+
params = paramsOrFirst || {};
|
|
1584
|
+
} else {
|
|
1585
|
+
params = {
|
|
1586
|
+
databaseId: paramsOrFirst,
|
|
1587
|
+
tableId: rest[0],
|
|
1588
|
+
relatedTableId: rest[1],
|
|
1589
|
+
type: rest[2],
|
|
1590
|
+
twoWay: rest[3],
|
|
1591
|
+
key: rest[4],
|
|
1592
|
+
twoWayKey: rest[5],
|
|
1593
|
+
onDelete: rest[6]
|
|
1594
|
+
};
|
|
1595
|
+
}
|
|
1596
|
+
const databaseId = params.databaseId;
|
|
1597
|
+
const tableId = params.tableId;
|
|
1598
|
+
const relatedTableId = params.relatedTableId;
|
|
1599
|
+
const type = params.type;
|
|
1600
|
+
const twoWay = params.twoWay;
|
|
1601
|
+
const key = params.key;
|
|
1602
|
+
const twoWayKey = params.twoWayKey;
|
|
1603
|
+
const onDelete = params.onDelete;
|
|
1604
|
+
if (typeof databaseId === "undefined") {
|
|
1605
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1606
|
+
}
|
|
1607
|
+
if (typeof tableId === "undefined") {
|
|
1608
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
1609
|
+
}
|
|
1610
|
+
if (typeof relatedTableId === "undefined") {
|
|
1611
|
+
throw new client.AppwriteException('Missing required parameter: "relatedTableId"');
|
|
1612
|
+
}
|
|
1613
|
+
if (typeof type === "undefined") {
|
|
1614
|
+
throw new client.AppwriteException('Missing required parameter: "type"');
|
|
1615
|
+
}
|
|
1616
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/relationship".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
1617
|
+
const payload = {};
|
|
1618
|
+
if (typeof relatedTableId !== "undefined") {
|
|
1619
|
+
payload["relatedTableId"] = relatedTableId;
|
|
1620
|
+
}
|
|
1621
|
+
if (typeof type !== "undefined") {
|
|
1622
|
+
payload["type"] = type;
|
|
1623
|
+
}
|
|
1624
|
+
if (typeof twoWay !== "undefined") {
|
|
1625
|
+
payload["twoWay"] = twoWay;
|
|
1626
|
+
}
|
|
1627
|
+
if (typeof key !== "undefined") {
|
|
1628
|
+
payload["key"] = key;
|
|
1629
|
+
}
|
|
1630
|
+
if (typeof twoWayKey !== "undefined") {
|
|
1631
|
+
payload["twoWayKey"] = twoWayKey;
|
|
1632
|
+
}
|
|
1633
|
+
if (typeof onDelete !== "undefined") {
|
|
1634
|
+
payload["onDelete"] = onDelete;
|
|
1635
|
+
}
|
|
1636
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1637
|
+
const apiHeaders = {
|
|
1638
|
+
"content-type": "application/json"
|
|
1639
|
+
};
|
|
1640
|
+
return this.client.call(
|
|
1641
|
+
"post",
|
|
1642
|
+
uri,
|
|
1643
|
+
apiHeaders,
|
|
1644
|
+
payload
|
|
1645
|
+
);
|
|
1646
|
+
}
|
|
1647
|
+
createStringColumn(paramsOrFirst, ...rest) {
|
|
1648
|
+
let params;
|
|
1649
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
1650
|
+
params = paramsOrFirst || {};
|
|
1651
|
+
} else {
|
|
1652
|
+
params = {
|
|
1653
|
+
databaseId: paramsOrFirst,
|
|
1654
|
+
tableId: rest[0],
|
|
1655
|
+
key: rest[1],
|
|
1656
|
+
size: rest[2],
|
|
1657
|
+
required: rest[3],
|
|
1658
|
+
xdefault: rest[4],
|
|
1659
|
+
array: rest[5],
|
|
1660
|
+
encrypt: rest[6]
|
|
1661
|
+
};
|
|
1662
|
+
}
|
|
1663
|
+
const databaseId = params.databaseId;
|
|
1664
|
+
const tableId = params.tableId;
|
|
1665
|
+
const key = params.key;
|
|
1666
|
+
const size = params.size;
|
|
1667
|
+
const required = params.required;
|
|
1668
|
+
const xdefault = params.xdefault;
|
|
1669
|
+
const array = params.array;
|
|
1670
|
+
const encrypt = params.encrypt;
|
|
1671
|
+
if (typeof databaseId === "undefined") {
|
|
1672
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1673
|
+
}
|
|
1674
|
+
if (typeof tableId === "undefined") {
|
|
1675
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
1676
|
+
}
|
|
1677
|
+
if (typeof key === "undefined") {
|
|
1678
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
1679
|
+
}
|
|
1680
|
+
if (typeof size === "undefined") {
|
|
1681
|
+
throw new client.AppwriteException('Missing required parameter: "size"');
|
|
1682
|
+
}
|
|
1683
|
+
if (typeof required === "undefined") {
|
|
1684
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
1685
|
+
}
|
|
1686
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/string".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
1687
|
+
const payload = {};
|
|
1688
|
+
if (typeof key !== "undefined") {
|
|
1689
|
+
payload["key"] = key;
|
|
1690
|
+
}
|
|
1691
|
+
if (typeof size !== "undefined") {
|
|
1692
|
+
payload["size"] = size;
|
|
1693
|
+
}
|
|
1694
|
+
if (typeof required !== "undefined") {
|
|
1695
|
+
payload["required"] = required;
|
|
1696
|
+
}
|
|
1697
|
+
if (typeof xdefault !== "undefined") {
|
|
1698
|
+
payload["default"] = xdefault;
|
|
1699
|
+
}
|
|
1700
|
+
if (typeof array !== "undefined") {
|
|
1701
|
+
payload["array"] = array;
|
|
1702
|
+
}
|
|
1703
|
+
if (typeof encrypt !== "undefined") {
|
|
1704
|
+
payload["encrypt"] = encrypt;
|
|
1705
|
+
}
|
|
1706
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1707
|
+
const apiHeaders = {
|
|
1708
|
+
"content-type": "application/json"
|
|
1709
|
+
};
|
|
1710
|
+
return this.client.call(
|
|
1711
|
+
"post",
|
|
1712
|
+
uri,
|
|
1713
|
+
apiHeaders,
|
|
1714
|
+
payload
|
|
1715
|
+
);
|
|
1716
|
+
}
|
|
1717
|
+
updateStringColumn(paramsOrFirst, ...rest) {
|
|
1718
|
+
let params;
|
|
1719
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
1720
|
+
params = paramsOrFirst || {};
|
|
1721
|
+
} else {
|
|
1722
|
+
params = {
|
|
1723
|
+
databaseId: paramsOrFirst,
|
|
1724
|
+
tableId: rest[0],
|
|
1725
|
+
key: rest[1],
|
|
1726
|
+
required: rest[2],
|
|
1727
|
+
xdefault: rest[3],
|
|
1728
|
+
size: rest[4],
|
|
1729
|
+
newKey: rest[5]
|
|
1730
|
+
};
|
|
1731
|
+
}
|
|
1732
|
+
const databaseId = params.databaseId;
|
|
1733
|
+
const tableId = params.tableId;
|
|
1734
|
+
const key = params.key;
|
|
1735
|
+
const required = params.required;
|
|
1736
|
+
const xdefault = params.xdefault;
|
|
1737
|
+
const size = params.size;
|
|
1738
|
+
const newKey = params.newKey;
|
|
1739
|
+
if (typeof databaseId === "undefined") {
|
|
1740
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1741
|
+
}
|
|
1742
|
+
if (typeof tableId === "undefined") {
|
|
1743
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
1744
|
+
}
|
|
1745
|
+
if (typeof key === "undefined") {
|
|
1746
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
1747
|
+
}
|
|
1748
|
+
if (typeof required === "undefined") {
|
|
1749
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
1750
|
+
}
|
|
1751
|
+
if (typeof xdefault === "undefined") {
|
|
1752
|
+
throw new client.AppwriteException('Missing required parameter: "xdefault"');
|
|
1753
|
+
}
|
|
1754
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/string/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
1755
|
+
const payload = {};
|
|
1756
|
+
if (typeof required !== "undefined") {
|
|
1757
|
+
payload["required"] = required;
|
|
1758
|
+
}
|
|
1759
|
+
if (typeof xdefault !== "undefined") {
|
|
1760
|
+
payload["default"] = xdefault;
|
|
1761
|
+
}
|
|
1762
|
+
if (typeof size !== "undefined") {
|
|
1763
|
+
payload["size"] = size;
|
|
1764
|
+
}
|
|
1765
|
+
if (typeof newKey !== "undefined") {
|
|
1766
|
+
payload["newKey"] = newKey;
|
|
1767
|
+
}
|
|
1768
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1769
|
+
const apiHeaders = {
|
|
1770
|
+
"content-type": "application/json"
|
|
1771
|
+
};
|
|
1772
|
+
return this.client.call(
|
|
1773
|
+
"patch",
|
|
1774
|
+
uri,
|
|
1775
|
+
apiHeaders,
|
|
1776
|
+
payload
|
|
1777
|
+
);
|
|
1778
|
+
}
|
|
1779
|
+
createUrlColumn(paramsOrFirst, ...rest) {
|
|
1780
|
+
let params;
|
|
1781
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
1782
|
+
params = paramsOrFirst || {};
|
|
1783
|
+
} else {
|
|
1784
|
+
params = {
|
|
1785
|
+
databaseId: paramsOrFirst,
|
|
1786
|
+
tableId: rest[0],
|
|
1787
|
+
key: rest[1],
|
|
1788
|
+
required: rest[2],
|
|
1789
|
+
xdefault: rest[3],
|
|
1790
|
+
array: rest[4]
|
|
1791
|
+
};
|
|
1792
|
+
}
|
|
1793
|
+
const databaseId = params.databaseId;
|
|
1794
|
+
const tableId = params.tableId;
|
|
1795
|
+
const key = params.key;
|
|
1796
|
+
const required = params.required;
|
|
1797
|
+
const xdefault = params.xdefault;
|
|
1798
|
+
const array = params.array;
|
|
1799
|
+
if (typeof databaseId === "undefined") {
|
|
1800
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1801
|
+
}
|
|
1802
|
+
if (typeof tableId === "undefined") {
|
|
1803
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
1804
|
+
}
|
|
1805
|
+
if (typeof key === "undefined") {
|
|
1806
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
1807
|
+
}
|
|
1808
|
+
if (typeof required === "undefined") {
|
|
1809
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
1810
|
+
}
|
|
1811
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/url".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
1812
|
+
const payload = {};
|
|
1813
|
+
if (typeof key !== "undefined") {
|
|
1814
|
+
payload["key"] = key;
|
|
1815
|
+
}
|
|
1816
|
+
if (typeof required !== "undefined") {
|
|
1817
|
+
payload["required"] = required;
|
|
1818
|
+
}
|
|
1819
|
+
if (typeof xdefault !== "undefined") {
|
|
1820
|
+
payload["default"] = xdefault;
|
|
1821
|
+
}
|
|
1822
|
+
if (typeof array !== "undefined") {
|
|
1823
|
+
payload["array"] = array;
|
|
1824
|
+
}
|
|
1825
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1826
|
+
const apiHeaders = {
|
|
1827
|
+
"content-type": "application/json"
|
|
1828
|
+
};
|
|
1829
|
+
return this.client.call(
|
|
1830
|
+
"post",
|
|
1831
|
+
uri,
|
|
1832
|
+
apiHeaders,
|
|
1833
|
+
payload
|
|
1834
|
+
);
|
|
1835
|
+
}
|
|
1836
|
+
updateUrlColumn(paramsOrFirst, ...rest) {
|
|
1837
|
+
let params;
|
|
1838
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
1839
|
+
params = paramsOrFirst || {};
|
|
1840
|
+
} else {
|
|
1841
|
+
params = {
|
|
1842
|
+
databaseId: paramsOrFirst,
|
|
1843
|
+
tableId: rest[0],
|
|
1844
|
+
key: rest[1],
|
|
1845
|
+
required: rest[2],
|
|
1846
|
+
xdefault: rest[3],
|
|
1847
|
+
newKey: rest[4]
|
|
1848
|
+
};
|
|
1849
|
+
}
|
|
1850
|
+
const databaseId = params.databaseId;
|
|
1851
|
+
const tableId = params.tableId;
|
|
1852
|
+
const key = params.key;
|
|
1853
|
+
const required = params.required;
|
|
1854
|
+
const xdefault = params.xdefault;
|
|
1855
|
+
const newKey = params.newKey;
|
|
1856
|
+
if (typeof databaseId === "undefined") {
|
|
1857
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1858
|
+
}
|
|
1859
|
+
if (typeof tableId === "undefined") {
|
|
1860
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
1861
|
+
}
|
|
1862
|
+
if (typeof key === "undefined") {
|
|
1863
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
1864
|
+
}
|
|
1865
|
+
if (typeof required === "undefined") {
|
|
1866
|
+
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
1867
|
+
}
|
|
1868
|
+
if (typeof xdefault === "undefined") {
|
|
1869
|
+
throw new client.AppwriteException('Missing required parameter: "xdefault"');
|
|
1870
|
+
}
|
|
1871
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/url/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
1872
|
+
const payload = {};
|
|
1873
|
+
if (typeof required !== "undefined") {
|
|
1874
|
+
payload["required"] = required;
|
|
1875
|
+
}
|
|
1876
|
+
if (typeof xdefault !== "undefined") {
|
|
1877
|
+
payload["default"] = xdefault;
|
|
1878
|
+
}
|
|
1879
|
+
if (typeof newKey !== "undefined") {
|
|
1880
|
+
payload["newKey"] = newKey;
|
|
1881
|
+
}
|
|
1882
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1883
|
+
const apiHeaders = {
|
|
1884
|
+
"content-type": "application/json"
|
|
1885
|
+
};
|
|
1886
|
+
return this.client.call(
|
|
1887
|
+
"patch",
|
|
1888
|
+
uri,
|
|
1889
|
+
apiHeaders,
|
|
1890
|
+
payload
|
|
1891
|
+
);
|
|
1892
|
+
}
|
|
1893
|
+
getColumn(paramsOrFirst, ...rest) {
|
|
1894
|
+
let params;
|
|
1895
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
1896
|
+
params = paramsOrFirst || {};
|
|
1897
|
+
} else {
|
|
1898
|
+
params = {
|
|
1899
|
+
databaseId: paramsOrFirst,
|
|
1900
|
+
tableId: rest[0],
|
|
1901
|
+
key: rest[1]
|
|
1902
|
+
};
|
|
1903
|
+
}
|
|
1904
|
+
const databaseId = params.databaseId;
|
|
1905
|
+
const tableId = params.tableId;
|
|
1906
|
+
const key = params.key;
|
|
1907
|
+
if (typeof databaseId === "undefined") {
|
|
1908
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1909
|
+
}
|
|
1910
|
+
if (typeof tableId === "undefined") {
|
|
1911
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
1912
|
+
}
|
|
1913
|
+
if (typeof key === "undefined") {
|
|
1914
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
1915
|
+
}
|
|
1916
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
1917
|
+
const payload = {};
|
|
1918
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1919
|
+
const apiHeaders = {};
|
|
1920
|
+
return this.client.call(
|
|
1921
|
+
"get",
|
|
1922
|
+
uri,
|
|
1923
|
+
apiHeaders,
|
|
1924
|
+
payload
|
|
1925
|
+
);
|
|
1926
|
+
}
|
|
1927
|
+
deleteColumn(paramsOrFirst, ...rest) {
|
|
1928
|
+
let params;
|
|
1929
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
1930
|
+
params = paramsOrFirst || {};
|
|
1931
|
+
} else {
|
|
1932
|
+
params = {
|
|
1933
|
+
databaseId: paramsOrFirst,
|
|
1934
|
+
tableId: rest[0],
|
|
1935
|
+
key: rest[1]
|
|
1936
|
+
};
|
|
1937
|
+
}
|
|
1938
|
+
const databaseId = params.databaseId;
|
|
1939
|
+
const tableId = params.tableId;
|
|
1940
|
+
const key = params.key;
|
|
1941
|
+
if (typeof databaseId === "undefined") {
|
|
1942
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1943
|
+
}
|
|
1944
|
+
if (typeof tableId === "undefined") {
|
|
1945
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
1946
|
+
}
|
|
1947
|
+
if (typeof key === "undefined") {
|
|
1948
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
1949
|
+
}
|
|
1950
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
1951
|
+
const payload = {};
|
|
1952
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1953
|
+
const apiHeaders = {
|
|
1954
|
+
"content-type": "application/json"
|
|
1955
|
+
};
|
|
1956
|
+
return this.client.call(
|
|
1957
|
+
"delete",
|
|
1958
|
+
uri,
|
|
1959
|
+
apiHeaders,
|
|
1960
|
+
payload
|
|
1961
|
+
);
|
|
1962
|
+
}
|
|
1963
|
+
updateRelationshipColumn(paramsOrFirst, ...rest) {
|
|
1964
|
+
let params;
|
|
1965
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
1966
|
+
params = paramsOrFirst || {};
|
|
1967
|
+
} else {
|
|
1968
|
+
params = {
|
|
1969
|
+
databaseId: paramsOrFirst,
|
|
1970
|
+
tableId: rest[0],
|
|
1971
|
+
key: rest[1],
|
|
1972
|
+
onDelete: rest[2],
|
|
1973
|
+
newKey: rest[3]
|
|
1974
|
+
};
|
|
1975
|
+
}
|
|
1976
|
+
const databaseId = params.databaseId;
|
|
1977
|
+
const tableId = params.tableId;
|
|
1978
|
+
const key = params.key;
|
|
1979
|
+
const onDelete = params.onDelete;
|
|
1980
|
+
const newKey = params.newKey;
|
|
1981
|
+
if (typeof databaseId === "undefined") {
|
|
1982
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1983
|
+
}
|
|
1984
|
+
if (typeof tableId === "undefined") {
|
|
1985
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
1986
|
+
}
|
|
1987
|
+
if (typeof key === "undefined") {
|
|
1988
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
1989
|
+
}
|
|
1990
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/{key}/relationship".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
1991
|
+
const payload = {};
|
|
1992
|
+
if (typeof onDelete !== "undefined") {
|
|
1993
|
+
payload["onDelete"] = onDelete;
|
|
1994
|
+
}
|
|
1995
|
+
if (typeof newKey !== "undefined") {
|
|
1996
|
+
payload["newKey"] = newKey;
|
|
1997
|
+
}
|
|
1998
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1999
|
+
const apiHeaders = {
|
|
2000
|
+
"content-type": "application/json"
|
|
2001
|
+
};
|
|
2002
|
+
return this.client.call(
|
|
2003
|
+
"patch",
|
|
2004
|
+
uri,
|
|
2005
|
+
apiHeaders,
|
|
2006
|
+
payload
|
|
2007
|
+
);
|
|
2008
|
+
}
|
|
2009
|
+
listIndexes(paramsOrFirst, ...rest) {
|
|
2010
|
+
let params;
|
|
2011
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
2012
|
+
params = paramsOrFirst || {};
|
|
2013
|
+
} else {
|
|
2014
|
+
params = {
|
|
2015
|
+
databaseId: paramsOrFirst,
|
|
2016
|
+
tableId: rest[0],
|
|
2017
|
+
queries: rest[1]
|
|
2018
|
+
};
|
|
2019
|
+
}
|
|
2020
|
+
const databaseId = params.databaseId;
|
|
2021
|
+
const tableId = params.tableId;
|
|
2022
|
+
const queries = params.queries;
|
|
2023
|
+
if (typeof databaseId === "undefined") {
|
|
2024
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
2025
|
+
}
|
|
2026
|
+
if (typeof tableId === "undefined") {
|
|
2027
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
2028
|
+
}
|
|
2029
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
2030
|
+
const payload = {};
|
|
2031
|
+
if (typeof queries !== "undefined") {
|
|
2032
|
+
payload["queries"] = queries;
|
|
2033
|
+
}
|
|
2034
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2035
|
+
const apiHeaders = {};
|
|
2036
|
+
return this.client.call(
|
|
2037
|
+
"get",
|
|
2038
|
+
uri,
|
|
2039
|
+
apiHeaders,
|
|
2040
|
+
payload
|
|
2041
|
+
);
|
|
2042
|
+
}
|
|
2043
|
+
createIndex(paramsOrFirst, ...rest) {
|
|
2044
|
+
let params;
|
|
2045
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
2046
|
+
params = paramsOrFirst || {};
|
|
2047
|
+
} else {
|
|
2048
|
+
params = {
|
|
2049
|
+
databaseId: paramsOrFirst,
|
|
2050
|
+
tableId: rest[0],
|
|
2051
|
+
key: rest[1],
|
|
2052
|
+
type: rest[2],
|
|
2053
|
+
columns: rest[3],
|
|
2054
|
+
orders: rest[4],
|
|
2055
|
+
lengths: rest[5]
|
|
2056
|
+
};
|
|
2057
|
+
}
|
|
2058
|
+
const databaseId = params.databaseId;
|
|
2059
|
+
const tableId = params.tableId;
|
|
2060
|
+
const key = params.key;
|
|
2061
|
+
const type = params.type;
|
|
2062
|
+
const columns = params.columns;
|
|
2063
|
+
const orders = params.orders;
|
|
2064
|
+
const lengths = params.lengths;
|
|
2065
|
+
if (typeof databaseId === "undefined") {
|
|
2066
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
2067
|
+
}
|
|
2068
|
+
if (typeof tableId === "undefined") {
|
|
2069
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
2070
|
+
}
|
|
2071
|
+
if (typeof key === "undefined") {
|
|
2072
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
2073
|
+
}
|
|
2074
|
+
if (typeof type === "undefined") {
|
|
2075
|
+
throw new client.AppwriteException('Missing required parameter: "type"');
|
|
2076
|
+
}
|
|
2077
|
+
if (typeof columns === "undefined") {
|
|
2078
|
+
throw new client.AppwriteException('Missing required parameter: "columns"');
|
|
2079
|
+
}
|
|
2080
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
2081
|
+
const payload = {};
|
|
2082
|
+
if (typeof key !== "undefined") {
|
|
2083
|
+
payload["key"] = key;
|
|
2084
|
+
}
|
|
2085
|
+
if (typeof type !== "undefined") {
|
|
2086
|
+
payload["type"] = type;
|
|
2087
|
+
}
|
|
2088
|
+
if (typeof columns !== "undefined") {
|
|
2089
|
+
payload["columns"] = columns;
|
|
2090
|
+
}
|
|
2091
|
+
if (typeof orders !== "undefined") {
|
|
2092
|
+
payload["orders"] = orders;
|
|
2093
|
+
}
|
|
2094
|
+
if (typeof lengths !== "undefined") {
|
|
2095
|
+
payload["lengths"] = lengths;
|
|
2096
|
+
}
|
|
2097
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2098
|
+
const apiHeaders = {
|
|
2099
|
+
"content-type": "application/json"
|
|
2100
|
+
};
|
|
2101
|
+
return this.client.call(
|
|
2102
|
+
"post",
|
|
2103
|
+
uri,
|
|
2104
|
+
apiHeaders,
|
|
2105
|
+
payload
|
|
2106
|
+
);
|
|
2107
|
+
}
|
|
2108
|
+
getIndex(paramsOrFirst, ...rest) {
|
|
2109
|
+
let params;
|
|
2110
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
2111
|
+
params = paramsOrFirst || {};
|
|
2112
|
+
} else {
|
|
2113
|
+
params = {
|
|
2114
|
+
databaseId: paramsOrFirst,
|
|
2115
|
+
tableId: rest[0],
|
|
2116
|
+
key: rest[1]
|
|
2117
|
+
};
|
|
2118
|
+
}
|
|
2119
|
+
const databaseId = params.databaseId;
|
|
2120
|
+
const tableId = params.tableId;
|
|
2121
|
+
const key = params.key;
|
|
2122
|
+
if (typeof databaseId === "undefined") {
|
|
2123
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
2124
|
+
}
|
|
2125
|
+
if (typeof tableId === "undefined") {
|
|
2126
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
2127
|
+
}
|
|
2128
|
+
if (typeof key === "undefined") {
|
|
2129
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
2130
|
+
}
|
|
2131
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
2132
|
+
const payload = {};
|
|
2133
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2134
|
+
const apiHeaders = {};
|
|
2135
|
+
return this.client.call(
|
|
2136
|
+
"get",
|
|
2137
|
+
uri,
|
|
2138
|
+
apiHeaders,
|
|
2139
|
+
payload
|
|
2140
|
+
);
|
|
2141
|
+
}
|
|
2142
|
+
deleteIndex(paramsOrFirst, ...rest) {
|
|
2143
|
+
let params;
|
|
2144
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
2145
|
+
params = paramsOrFirst || {};
|
|
2146
|
+
} else {
|
|
2147
|
+
params = {
|
|
2148
|
+
databaseId: paramsOrFirst,
|
|
2149
|
+
tableId: rest[0],
|
|
2150
|
+
key: rest[1]
|
|
2151
|
+
};
|
|
2152
|
+
}
|
|
2153
|
+
const databaseId = params.databaseId;
|
|
2154
|
+
const tableId = params.tableId;
|
|
2155
|
+
const key = params.key;
|
|
2156
|
+
if (typeof databaseId === "undefined") {
|
|
2157
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
2158
|
+
}
|
|
2159
|
+
if (typeof tableId === "undefined") {
|
|
2160
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
2161
|
+
}
|
|
2162
|
+
if (typeof key === "undefined") {
|
|
2163
|
+
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
2164
|
+
}
|
|
2165
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
2166
|
+
const payload = {};
|
|
2167
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2168
|
+
const apiHeaders = {
|
|
2169
|
+
"content-type": "application/json"
|
|
2170
|
+
};
|
|
2171
|
+
return this.client.call(
|
|
2172
|
+
"delete",
|
|
2173
|
+
uri,
|
|
2174
|
+
apiHeaders,
|
|
2175
|
+
payload
|
|
2176
|
+
);
|
|
2177
|
+
}
|
|
2178
|
+
listRows(paramsOrFirst, ...rest) {
|
|
2179
|
+
let params;
|
|
2180
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
2181
|
+
params = paramsOrFirst || {};
|
|
2182
|
+
} else {
|
|
2183
|
+
params = {
|
|
2184
|
+
databaseId: paramsOrFirst,
|
|
2185
|
+
tableId: rest[0],
|
|
2186
|
+
queries: rest[1]
|
|
2187
|
+
};
|
|
2188
|
+
}
|
|
2189
|
+
const databaseId = params.databaseId;
|
|
2190
|
+
const tableId = params.tableId;
|
|
2191
|
+
const queries = params.queries;
|
|
2192
|
+
if (typeof databaseId === "undefined") {
|
|
2193
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
2194
|
+
}
|
|
2195
|
+
if (typeof tableId === "undefined") {
|
|
2196
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
2197
|
+
}
|
|
2198
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
2199
|
+
const payload = {};
|
|
2200
|
+
if (typeof queries !== "undefined") {
|
|
2201
|
+
payload["queries"] = queries;
|
|
2202
|
+
}
|
|
2203
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2204
|
+
const apiHeaders = {};
|
|
2205
|
+
return this.client.call(
|
|
2206
|
+
"get",
|
|
2207
|
+
uri,
|
|
2208
|
+
apiHeaders,
|
|
2209
|
+
payload
|
|
2210
|
+
);
|
|
2211
|
+
}
|
|
2212
|
+
createRow(paramsOrFirst, ...rest) {
|
|
2213
|
+
let params;
|
|
2214
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
2215
|
+
params = paramsOrFirst || {};
|
|
2216
|
+
} else {
|
|
2217
|
+
params = {
|
|
2218
|
+
databaseId: paramsOrFirst,
|
|
2219
|
+
tableId: rest[0],
|
|
2220
|
+
rowId: rest[1],
|
|
2221
|
+
data: rest[2],
|
|
2222
|
+
permissions: rest[3]
|
|
2223
|
+
};
|
|
2224
|
+
}
|
|
2225
|
+
const databaseId = params.databaseId;
|
|
2226
|
+
const tableId = params.tableId;
|
|
2227
|
+
const rowId = params.rowId;
|
|
2228
|
+
const data = params.data;
|
|
2229
|
+
const permissions = params.permissions;
|
|
2230
|
+
if (typeof databaseId === "undefined") {
|
|
2231
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
2232
|
+
}
|
|
2233
|
+
if (typeof tableId === "undefined") {
|
|
2234
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
2235
|
+
}
|
|
2236
|
+
if (typeof rowId === "undefined") {
|
|
2237
|
+
throw new client.AppwriteException('Missing required parameter: "rowId"');
|
|
2238
|
+
}
|
|
2239
|
+
if (typeof data === "undefined") {
|
|
2240
|
+
throw new client.AppwriteException('Missing required parameter: "data"');
|
|
2241
|
+
}
|
|
2242
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
2243
|
+
const payload = {};
|
|
2244
|
+
if (typeof rowId !== "undefined") {
|
|
2245
|
+
payload["rowId"] = rowId;
|
|
2246
|
+
}
|
|
2247
|
+
if (typeof data !== "undefined") {
|
|
2248
|
+
payload["data"] = data;
|
|
2249
|
+
}
|
|
2250
|
+
if (typeof permissions !== "undefined") {
|
|
2251
|
+
payload["permissions"] = permissions;
|
|
2252
|
+
}
|
|
2253
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2254
|
+
const apiHeaders = {
|
|
2255
|
+
"content-type": "application/json"
|
|
2256
|
+
};
|
|
2257
|
+
return this.client.call(
|
|
2258
|
+
"post",
|
|
2259
|
+
uri,
|
|
2260
|
+
apiHeaders,
|
|
2261
|
+
payload
|
|
2262
|
+
);
|
|
2263
|
+
}
|
|
2264
|
+
createRows(paramsOrFirst, ...rest) {
|
|
2265
|
+
let params;
|
|
2266
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
2267
|
+
params = paramsOrFirst || {};
|
|
2268
|
+
} else {
|
|
2269
|
+
params = {
|
|
2270
|
+
databaseId: paramsOrFirst,
|
|
2271
|
+
tableId: rest[0],
|
|
2272
|
+
rows: rest[1]
|
|
2273
|
+
};
|
|
2274
|
+
}
|
|
2275
|
+
const databaseId = params.databaseId;
|
|
2276
|
+
const tableId = params.tableId;
|
|
2277
|
+
const rows = params.rows;
|
|
2278
|
+
if (typeof databaseId === "undefined") {
|
|
2279
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
2280
|
+
}
|
|
2281
|
+
if (typeof tableId === "undefined") {
|
|
2282
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
2283
|
+
}
|
|
2284
|
+
if (typeof rows === "undefined") {
|
|
2285
|
+
throw new client.AppwriteException('Missing required parameter: "rows"');
|
|
2286
|
+
}
|
|
2287
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
2288
|
+
const payload = {};
|
|
2289
|
+
if (typeof rows !== "undefined") {
|
|
2290
|
+
payload["rows"] = rows;
|
|
2291
|
+
}
|
|
2292
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2293
|
+
const apiHeaders = {
|
|
2294
|
+
"content-type": "application/json"
|
|
2295
|
+
};
|
|
2296
|
+
return this.client.call(
|
|
2297
|
+
"post",
|
|
2298
|
+
uri,
|
|
2299
|
+
apiHeaders,
|
|
2300
|
+
payload
|
|
2301
|
+
);
|
|
2302
|
+
}
|
|
2303
|
+
upsertRows(paramsOrFirst, ...rest) {
|
|
2304
|
+
let params;
|
|
2305
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
2306
|
+
params = paramsOrFirst || {};
|
|
2307
|
+
} else {
|
|
2308
|
+
params = {
|
|
2309
|
+
databaseId: paramsOrFirst,
|
|
2310
|
+
tableId: rest[0],
|
|
2311
|
+
rows: rest[1]
|
|
2312
|
+
};
|
|
2313
|
+
}
|
|
2314
|
+
const databaseId = params.databaseId;
|
|
2315
|
+
const tableId = params.tableId;
|
|
2316
|
+
const rows = params.rows;
|
|
2317
|
+
if (typeof databaseId === "undefined") {
|
|
2318
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
2319
|
+
}
|
|
2320
|
+
if (typeof tableId === "undefined") {
|
|
2321
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
2322
|
+
}
|
|
2323
|
+
if (typeof rows === "undefined") {
|
|
2324
|
+
throw new client.AppwriteException('Missing required parameter: "rows"');
|
|
2325
|
+
}
|
|
2326
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
2327
|
+
const payload = {};
|
|
2328
|
+
if (typeof rows !== "undefined") {
|
|
2329
|
+
payload["rows"] = rows;
|
|
2330
|
+
}
|
|
2331
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2332
|
+
const apiHeaders = {
|
|
2333
|
+
"content-type": "application/json"
|
|
2334
|
+
};
|
|
2335
|
+
return this.client.call(
|
|
2336
|
+
"put",
|
|
2337
|
+
uri,
|
|
2338
|
+
apiHeaders,
|
|
2339
|
+
payload
|
|
2340
|
+
);
|
|
2341
|
+
}
|
|
2342
|
+
updateRows(paramsOrFirst, ...rest) {
|
|
2343
|
+
let params;
|
|
2344
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
2345
|
+
params = paramsOrFirst || {};
|
|
2346
|
+
} else {
|
|
2347
|
+
params = {
|
|
2348
|
+
databaseId: paramsOrFirst,
|
|
2349
|
+
tableId: rest[0],
|
|
2350
|
+
data: rest[1],
|
|
2351
|
+
queries: rest[2]
|
|
2352
|
+
};
|
|
2353
|
+
}
|
|
2354
|
+
const databaseId = params.databaseId;
|
|
2355
|
+
const tableId = params.tableId;
|
|
2356
|
+
const data = params.data;
|
|
2357
|
+
const queries = params.queries;
|
|
2358
|
+
if (typeof databaseId === "undefined") {
|
|
2359
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
2360
|
+
}
|
|
2361
|
+
if (typeof tableId === "undefined") {
|
|
2362
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
2363
|
+
}
|
|
2364
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
2365
|
+
const payload = {};
|
|
2366
|
+
if (typeof data !== "undefined") {
|
|
2367
|
+
payload["data"] = data;
|
|
2368
|
+
}
|
|
2369
|
+
if (typeof queries !== "undefined") {
|
|
2370
|
+
payload["queries"] = queries;
|
|
2371
|
+
}
|
|
2372
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2373
|
+
const apiHeaders = {
|
|
2374
|
+
"content-type": "application/json"
|
|
2375
|
+
};
|
|
2376
|
+
return this.client.call(
|
|
2377
|
+
"patch",
|
|
2378
|
+
uri,
|
|
2379
|
+
apiHeaders,
|
|
2380
|
+
payload
|
|
2381
|
+
);
|
|
2382
|
+
}
|
|
2383
|
+
deleteRows(paramsOrFirst, ...rest) {
|
|
2384
|
+
let params;
|
|
2385
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
2386
|
+
params = paramsOrFirst || {};
|
|
2387
|
+
} else {
|
|
2388
|
+
params = {
|
|
2389
|
+
databaseId: paramsOrFirst,
|
|
2390
|
+
tableId: rest[0],
|
|
2391
|
+
queries: rest[1]
|
|
2392
|
+
};
|
|
2393
|
+
}
|
|
2394
|
+
const databaseId = params.databaseId;
|
|
2395
|
+
const tableId = params.tableId;
|
|
2396
|
+
const queries = params.queries;
|
|
2397
|
+
if (typeof databaseId === "undefined") {
|
|
2398
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
2399
|
+
}
|
|
2400
|
+
if (typeof tableId === "undefined") {
|
|
2401
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
2402
|
+
}
|
|
2403
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
2404
|
+
const payload = {};
|
|
2405
|
+
if (typeof queries !== "undefined") {
|
|
2406
|
+
payload["queries"] = queries;
|
|
2407
|
+
}
|
|
2408
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2409
|
+
const apiHeaders = {
|
|
2410
|
+
"content-type": "application/json"
|
|
2411
|
+
};
|
|
2412
|
+
return this.client.call(
|
|
2413
|
+
"delete",
|
|
2414
|
+
uri,
|
|
2415
|
+
apiHeaders,
|
|
2416
|
+
payload
|
|
2417
|
+
);
|
|
2418
|
+
}
|
|
2419
|
+
getRow(paramsOrFirst, ...rest) {
|
|
2420
|
+
let params;
|
|
2421
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
2422
|
+
params = paramsOrFirst || {};
|
|
2423
|
+
} else {
|
|
2424
|
+
params = {
|
|
2425
|
+
databaseId: paramsOrFirst,
|
|
2426
|
+
tableId: rest[0],
|
|
2427
|
+
rowId: rest[1],
|
|
2428
|
+
queries: rest[2]
|
|
2429
|
+
};
|
|
2430
|
+
}
|
|
2431
|
+
const databaseId = params.databaseId;
|
|
2432
|
+
const tableId = params.tableId;
|
|
2433
|
+
const rowId = params.rowId;
|
|
2434
|
+
const queries = params.queries;
|
|
2435
|
+
if (typeof databaseId === "undefined") {
|
|
2436
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
2437
|
+
}
|
|
2438
|
+
if (typeof tableId === "undefined") {
|
|
2439
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
2440
|
+
}
|
|
2441
|
+
if (typeof rowId === "undefined") {
|
|
2442
|
+
throw new client.AppwriteException('Missing required parameter: "rowId"');
|
|
2443
|
+
}
|
|
2444
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{rowId}", rowId);
|
|
2445
|
+
const payload = {};
|
|
2446
|
+
if (typeof queries !== "undefined") {
|
|
2447
|
+
payload["queries"] = queries;
|
|
2448
|
+
}
|
|
2449
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2450
|
+
const apiHeaders = {};
|
|
2451
|
+
return this.client.call(
|
|
2452
|
+
"get",
|
|
2453
|
+
uri,
|
|
2454
|
+
apiHeaders,
|
|
2455
|
+
payload
|
|
2456
|
+
);
|
|
2457
|
+
}
|
|
2458
|
+
upsertRow(paramsOrFirst, ...rest) {
|
|
2459
|
+
let params;
|
|
2460
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
2461
|
+
params = paramsOrFirst || {};
|
|
2462
|
+
} else {
|
|
2463
|
+
params = {
|
|
2464
|
+
databaseId: paramsOrFirst,
|
|
2465
|
+
tableId: rest[0],
|
|
2466
|
+
rowId: rest[1],
|
|
2467
|
+
data: rest[2],
|
|
2468
|
+
permissions: rest[3]
|
|
2469
|
+
};
|
|
2470
|
+
}
|
|
2471
|
+
const databaseId = params.databaseId;
|
|
2472
|
+
const tableId = params.tableId;
|
|
2473
|
+
const rowId = params.rowId;
|
|
2474
|
+
const data = params.data;
|
|
2475
|
+
const permissions = params.permissions;
|
|
2476
|
+
if (typeof databaseId === "undefined") {
|
|
2477
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
2478
|
+
}
|
|
2479
|
+
if (typeof tableId === "undefined") {
|
|
2480
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
2481
|
+
}
|
|
2482
|
+
if (typeof rowId === "undefined") {
|
|
2483
|
+
throw new client.AppwriteException('Missing required parameter: "rowId"');
|
|
2484
|
+
}
|
|
2485
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{rowId}", rowId);
|
|
2486
|
+
const payload = {};
|
|
2487
|
+
if (typeof data !== "undefined") {
|
|
2488
|
+
payload["data"] = data;
|
|
2489
|
+
}
|
|
2490
|
+
if (typeof permissions !== "undefined") {
|
|
2491
|
+
payload["permissions"] = permissions;
|
|
2492
|
+
}
|
|
2493
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2494
|
+
const apiHeaders = {
|
|
2495
|
+
"content-type": "application/json"
|
|
2496
|
+
};
|
|
2497
|
+
return this.client.call(
|
|
2498
|
+
"put",
|
|
2499
|
+
uri,
|
|
2500
|
+
apiHeaders,
|
|
2501
|
+
payload
|
|
2502
|
+
);
|
|
2503
|
+
}
|
|
2504
|
+
updateRow(paramsOrFirst, ...rest) {
|
|
2505
|
+
let params;
|
|
2506
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
2507
|
+
params = paramsOrFirst || {};
|
|
2508
|
+
} else {
|
|
2509
|
+
params = {
|
|
2510
|
+
databaseId: paramsOrFirst,
|
|
2511
|
+
tableId: rest[0],
|
|
2512
|
+
rowId: rest[1],
|
|
2513
|
+
data: rest[2],
|
|
2514
|
+
permissions: rest[3]
|
|
2515
|
+
};
|
|
2516
|
+
}
|
|
2517
|
+
const databaseId = params.databaseId;
|
|
2518
|
+
const tableId = params.tableId;
|
|
2519
|
+
const rowId = params.rowId;
|
|
2520
|
+
const data = params.data;
|
|
2521
|
+
const permissions = params.permissions;
|
|
2522
|
+
if (typeof databaseId === "undefined") {
|
|
2523
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
2524
|
+
}
|
|
2525
|
+
if (typeof tableId === "undefined") {
|
|
2526
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
2527
|
+
}
|
|
2528
|
+
if (typeof rowId === "undefined") {
|
|
2529
|
+
throw new client.AppwriteException('Missing required parameter: "rowId"');
|
|
2530
|
+
}
|
|
2531
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{rowId}", rowId);
|
|
2532
|
+
const payload = {};
|
|
2533
|
+
if (typeof data !== "undefined") {
|
|
2534
|
+
payload["data"] = data;
|
|
2535
|
+
}
|
|
2536
|
+
if (typeof permissions !== "undefined") {
|
|
2537
|
+
payload["permissions"] = permissions;
|
|
2538
|
+
}
|
|
2539
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2540
|
+
const apiHeaders = {
|
|
2541
|
+
"content-type": "application/json"
|
|
2542
|
+
};
|
|
2543
|
+
return this.client.call(
|
|
2544
|
+
"patch",
|
|
2545
|
+
uri,
|
|
2546
|
+
apiHeaders,
|
|
2547
|
+
payload
|
|
2548
|
+
);
|
|
2549
|
+
}
|
|
2550
|
+
deleteRow(paramsOrFirst, ...rest) {
|
|
2551
|
+
let params;
|
|
2552
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
2553
|
+
params = paramsOrFirst || {};
|
|
2554
|
+
} else {
|
|
2555
|
+
params = {
|
|
2556
|
+
databaseId: paramsOrFirst,
|
|
2557
|
+
tableId: rest[0],
|
|
2558
|
+
rowId: rest[1]
|
|
2559
|
+
};
|
|
2560
|
+
}
|
|
2561
|
+
const databaseId = params.databaseId;
|
|
2562
|
+
const tableId = params.tableId;
|
|
2563
|
+
const rowId = params.rowId;
|
|
2564
|
+
if (typeof databaseId === "undefined") {
|
|
2565
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
2566
|
+
}
|
|
2567
|
+
if (typeof tableId === "undefined") {
|
|
2568
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
2569
|
+
}
|
|
2570
|
+
if (typeof rowId === "undefined") {
|
|
2571
|
+
throw new client.AppwriteException('Missing required parameter: "rowId"');
|
|
2572
|
+
}
|
|
2573
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{rowId}", rowId);
|
|
2574
|
+
const payload = {};
|
|
2575
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2576
|
+
const apiHeaders = {
|
|
2577
|
+
"content-type": "application/json"
|
|
2578
|
+
};
|
|
2579
|
+
return this.client.call(
|
|
2580
|
+
"delete",
|
|
2581
|
+
uri,
|
|
2582
|
+
apiHeaders,
|
|
2583
|
+
payload
|
|
2584
|
+
);
|
|
2585
|
+
}
|
|
2586
|
+
decrementRowColumn(paramsOrFirst, ...rest) {
|
|
2587
|
+
let params;
|
|
2588
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
2589
|
+
params = paramsOrFirst || {};
|
|
2590
|
+
} else {
|
|
2591
|
+
params = {
|
|
2592
|
+
databaseId: paramsOrFirst,
|
|
2593
|
+
tableId: rest[0],
|
|
2594
|
+
rowId: rest[1],
|
|
2595
|
+
column: rest[2],
|
|
2596
|
+
value: rest[3],
|
|
2597
|
+
min: rest[4]
|
|
2598
|
+
};
|
|
2599
|
+
}
|
|
2600
|
+
const databaseId = params.databaseId;
|
|
2601
|
+
const tableId = params.tableId;
|
|
2602
|
+
const rowId = params.rowId;
|
|
2603
|
+
const column = params.column;
|
|
2604
|
+
const value = params.value;
|
|
2605
|
+
const min = params.min;
|
|
2606
|
+
if (typeof databaseId === "undefined") {
|
|
2607
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
2608
|
+
}
|
|
2609
|
+
if (typeof tableId === "undefined") {
|
|
2610
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
2611
|
+
}
|
|
2612
|
+
if (typeof rowId === "undefined") {
|
|
2613
|
+
throw new client.AppwriteException('Missing required parameter: "rowId"');
|
|
2614
|
+
}
|
|
2615
|
+
if (typeof column === "undefined") {
|
|
2616
|
+
throw new client.AppwriteException('Missing required parameter: "column"');
|
|
2617
|
+
}
|
|
2618
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{rowId}", rowId).replace("{column}", column);
|
|
2619
|
+
const payload = {};
|
|
2620
|
+
if (typeof value !== "undefined") {
|
|
2621
|
+
payload["value"] = value;
|
|
2622
|
+
}
|
|
2623
|
+
if (typeof min !== "undefined") {
|
|
2624
|
+
payload["min"] = min;
|
|
2625
|
+
}
|
|
2626
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2627
|
+
const apiHeaders = {
|
|
2628
|
+
"content-type": "application/json"
|
|
2629
|
+
};
|
|
2630
|
+
return this.client.call(
|
|
2631
|
+
"patch",
|
|
2632
|
+
uri,
|
|
2633
|
+
apiHeaders,
|
|
2634
|
+
payload
|
|
2635
|
+
);
|
|
2636
|
+
}
|
|
2637
|
+
incrementRowColumn(paramsOrFirst, ...rest) {
|
|
2638
|
+
let params;
|
|
2639
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
2640
|
+
params = paramsOrFirst || {};
|
|
2641
|
+
} else {
|
|
2642
|
+
params = {
|
|
2643
|
+
databaseId: paramsOrFirst,
|
|
2644
|
+
tableId: rest[0],
|
|
2645
|
+
rowId: rest[1],
|
|
2646
|
+
column: rest[2],
|
|
2647
|
+
value: rest[3],
|
|
2648
|
+
max: rest[4]
|
|
2649
|
+
};
|
|
2650
|
+
}
|
|
2651
|
+
const databaseId = params.databaseId;
|
|
2652
|
+
const tableId = params.tableId;
|
|
2653
|
+
const rowId = params.rowId;
|
|
2654
|
+
const column = params.column;
|
|
2655
|
+
const value = params.value;
|
|
2656
|
+
const max = params.max;
|
|
2657
|
+
if (typeof databaseId === "undefined") {
|
|
2658
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
2659
|
+
}
|
|
2660
|
+
if (typeof tableId === "undefined") {
|
|
2661
|
+
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
2662
|
+
}
|
|
2663
|
+
if (typeof rowId === "undefined") {
|
|
2664
|
+
throw new client.AppwriteException('Missing required parameter: "rowId"');
|
|
2665
|
+
}
|
|
2666
|
+
if (typeof column === "undefined") {
|
|
2667
|
+
throw new client.AppwriteException('Missing required parameter: "column"');
|
|
2668
|
+
}
|
|
2669
|
+
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{rowId}", rowId).replace("{column}", column);
|
|
2670
|
+
const payload = {};
|
|
2671
|
+
if (typeof value !== "undefined") {
|
|
2672
|
+
payload["value"] = value;
|
|
2673
|
+
}
|
|
2674
|
+
if (typeof max !== "undefined") {
|
|
2675
|
+
payload["max"] = max;
|
|
2676
|
+
}
|
|
2677
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2678
|
+
const apiHeaders = {
|
|
2679
|
+
"content-type": "application/json"
|
|
2680
|
+
};
|
|
2681
|
+
return this.client.call(
|
|
2682
|
+
"patch",
|
|
2683
|
+
uri,
|
|
2684
|
+
apiHeaders,
|
|
2685
|
+
payload
|
|
2686
|
+
);
|
|
2687
|
+
}
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2690
|
+
exports.TablesDB = TablesDB;
|
|
2691
|
+
//# sourceMappingURL=out.js.map
|
|
2692
|
+
//# sourceMappingURL=tables-db.js.map
|