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