@appwrite.io/console 7.0.0 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +1 -1
- package/CHANGELOG.md +30 -6
- package/README.md +2 -2
- package/dist/cjs/sdk.js +222 -303
- package/docs/examples/databases/create-index.md +2 -2
- package/docs/examples/domains/create-purchase.md +2 -1
- package/docs/examples/domains/create-transfer-in.md +2 -1
- package/docs/examples/domains/update-auto-renewal.md +16 -0
- package/docs/examples/project/create-variable.md +1 -0
- package/docs/examples/project/list-variables.md +4 -1
- package/docs/examples/project/update-variable.md +1 -1
- package/docs/examples/tablesdb/create-index.md +2 -2
- package/docs/examples/users/update-impersonator.md +16 -0
- package/package.json +7 -7
- package/rollup.config.js +2 -1
- package/src/client.ts +61 -1
- package/src/enums/appwrite-migration-resource.ts +2 -0
- package/src/enums/backup-services.ts +3 -0
- package/src/enums/build-runtime.ts +0 -86
- package/src/enums/database-type.ts +2 -0
- package/src/enums/databases-index-type.ts +6 -0
- package/src/enums/runtime.ts +0 -86
- package/src/enums/runtimes.ts +0 -86
- package/src/enums/scopes.ts +13 -2
- package/src/enums/{index-type.ts → tables-db-index-type.ts} +1 -1
- package/src/enums/template-reference-type.ts +1 -1
- package/src/enums/use-cases.ts +7 -2
- package/src/index.ts +2 -1
- package/src/models.ts +172 -4
- package/src/services/databases.ts +10 -10
- package/src/services/domains.ts +103 -26
- package/src/services/project.ts +76 -33
- package/src/services/tables-db.ts +10 -10
- package/src/services/users.ts +67 -2
- package/src/services/vcs.ts +10 -10
- package/dist/cjs/sdk.js.map +0 -1
- package/dist/esm/sdk.js +0 -29782
- package/dist/esm/sdk.js.map +0 -1
- package/dist/iife/sdk.js +0 -33583
- package/types/channel.d.ts +0 -74
- package/types/client.d.ts +0 -260
- package/types/enums/adapter.d.ts +0 -4
- package/types/enums/api-service.d.ts +0 -15
- package/types/enums/api.d.ts +0 -5
- package/types/enums/appwrite-migration-resource.d.ts +0 -25
- package/types/enums/attribute-status.d.ts +0 -7
- package/types/enums/auth-method.d.ts +0 -9
- package/types/enums/authentication-factor.d.ts +0 -6
- package/types/enums/authenticator-type.d.ts +0 -3
- package/types/enums/backup-services.d.ts +0 -5
- package/types/enums/billing-plan-group.d.ts +0 -5
- package/types/enums/browser-permission.d.ts +0 -22
- package/types/enums/browser.d.ts +0 -16
- package/types/enums/build-runtime.d.ts +0 -174
- package/types/enums/column-status.d.ts +0 -7
- package/types/enums/compression.d.ts +0 -5
- package/types/enums/console-resource-type.d.ts +0 -3
- package/types/enums/credit-card.d.ts +0 -19
- package/types/enums/database-type.d.ts +0 -4
- package/types/enums/deployment-download-type.d.ts +0 -4
- package/types/enums/deployment-status.d.ts +0 -8
- package/types/enums/domain-purchase-status.d.ts +0 -6
- package/types/enums/domain-transfer-status-enum.d.ts +0 -10
- package/types/enums/email-template-locale.d.ts +0 -133
- package/types/enums/email-template-type.d.ts +0 -9
- package/types/enums/execution-method.d.ts +0 -9
- package/types/enums/execution-status.d.ts +0 -7
- package/types/enums/execution-trigger.d.ts +0 -5
- package/types/enums/filter-type.d.ts +0 -4
- package/types/enums/firebase-migration-resource.d.ts +0 -12
- package/types/enums/flag.d.ts +0 -197
- package/types/enums/framework.d.ts +0 -17
- package/types/enums/frameworks.d.ts +0 -17
- package/types/enums/health-antivirus-status.d.ts +0 -5
- package/types/enums/health-check-status.d.ts +0 -4
- package/types/enums/image-format.d.ts +0 -9
- package/types/enums/image-gravity.d.ts +0 -11
- package/types/enums/index-status.d.ts +0 -7
- package/types/enums/index-type.d.ts +0 -6
- package/types/enums/message-priority.d.ts +0 -4
- package/types/enums/message-status.d.ts +0 -7
- package/types/enums/messaging-provider-type.d.ts +0 -5
- package/types/enums/n-host-migration-resource.d.ts +0 -13
- package/types/enums/name.d.ts +0 -15
- package/types/enums/o-auth-provider.d.ts +0 -41
- package/types/enums/order-by.d.ts +0 -4
- package/types/enums/password-hash.d.ts +0 -13
- package/types/enums/platform-type.d.ts +0 -17
- package/types/enums/platform.d.ts +0 -4
- package/types/enums/project-usage-range.d.ts +0 -4
- package/types/enums/proxy-resource-type.d.ts +0 -4
- package/types/enums/proxy-rule-deployment-resource-type.d.ts +0 -4
- package/types/enums/proxy-rule-status.d.ts +0 -6
- package/types/enums/region.d.ts +0 -8
- package/types/enums/registration-type.d.ts +0 -6
- package/types/enums/relation-mutate.d.ts +0 -5
- package/types/enums/relationship-type.d.ts +0 -6
- package/types/enums/resource-type.d.ts +0 -6
- package/types/enums/runtime.d.ts +0 -174
- package/types/enums/runtimes.d.ts +0 -174
- package/types/enums/scopes.d.ts +0 -70
- package/types/enums/sms-template-locale.d.ts +0 -133
- package/types/enums/sms-template-type.d.ts +0 -6
- package/types/enums/smtp-encryption.d.ts +0 -5
- package/types/enums/smtp-secure.d.ts +0 -4
- package/types/enums/status-code.d.ts +0 -6
- package/types/enums/status.d.ts +0 -3
- package/types/enums/supabase-migration-resource.d.ts +0 -13
- package/types/enums/template-reference-type.d.ts +0 -5
- package/types/enums/theme.d.ts +0 -4
- package/types/enums/timezone.d.ts +0 -421
- package/types/enums/usage-range.d.ts +0 -5
- package/types/enums/use-cases.d.ts +0 -11
- package/types/enums/vcs-detection-type.d.ts +0 -4
- package/types/enums/vcs-reference-type.d.ts +0 -5
- package/types/id.d.ts +0 -20
- package/types/index.d.ts +0 -117
- package/types/models.d.ts +0 -9071
- package/types/operator.d.ts +0 -180
- package/types/permission.d.ts +0 -43
- package/types/query.d.ts +0 -442
- package/types/role.d.ts +0 -70
- package/types/service.d.ts +0 -11
- package/types/services/account.d.ts +0 -1536
- package/types/services/activities.d.ts +0 -46
- package/types/services/assistant.d.ts +0 -24
- package/types/services/avatars.d.ts +0 -320
- package/types/services/backups.d.ts +0 -277
- package/types/services/console.d.ts +0 -248
- package/types/services/databases.d.ts +0 -2435
- package/types/services/domains.d.ts +0 -1499
- package/types/services/functions.d.ts +0 -842
- package/types/services/graphql.d.ts +0 -43
- package/types/services/health.d.ts +0 -475
- package/types/services/locale.d.ts +0 -64
- package/types/services/messaging.d.ts +0 -1989
- package/types/services/migrations.d.ts +0 -417
- package/types/services/organizations.d.ts +0 -1009
- package/types/services/project.d.ts +0 -130
- package/types/services/projects.d.ts +0 -1626
- package/types/services/proxy.d.ts +0 -190
- package/types/services/realtime.d.ts +0 -134
- package/types/services/sites.d.ts +0 -800
- package/types/services/storage.d.ts +0 -467
- package/types/services/tables-db.d.ts +0 -2352
- package/types/services/teams.d.ts +0 -366
- package/types/services/tokens.d.ts +0 -119
- package/types/services/users.d.ts +0 -1184
- package/types/services/vcs.d.ts +0 -252
- package/types/services/webhooks.d.ts +0 -165
package/src/services/project.ts
CHANGED
|
@@ -84,15 +84,51 @@ export class Project {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
|
-
* Get a list of all project
|
|
87
|
+
* Get a list of all project environment variables.
|
|
88
88
|
*
|
|
89
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret
|
|
90
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
89
91
|
* @throws {AppwriteException}
|
|
90
92
|
* @returns {Promise<Models.VariableList>}
|
|
91
93
|
*/
|
|
92
|
-
listVariables(): Promise<Models.VariableList
|
|
94
|
+
listVariables(params?: { queries?: string[], total?: boolean }): Promise<Models.VariableList>;
|
|
95
|
+
/**
|
|
96
|
+
* Get a list of all project environment variables.
|
|
97
|
+
*
|
|
98
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret
|
|
99
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
100
|
+
* @throws {AppwriteException}
|
|
101
|
+
* @returns {Promise<Models.VariableList>}
|
|
102
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
103
|
+
*/
|
|
104
|
+
listVariables(queries?: string[], total?: boolean): Promise<Models.VariableList>;
|
|
105
|
+
listVariables(
|
|
106
|
+
paramsOrFirst?: { queries?: string[], total?: boolean } | string[],
|
|
107
|
+
...rest: [(boolean)?]
|
|
108
|
+
): Promise<Models.VariableList> {
|
|
109
|
+
let params: { queries?: string[], total?: boolean };
|
|
110
|
+
|
|
111
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
112
|
+
params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean };
|
|
113
|
+
} else {
|
|
114
|
+
params = {
|
|
115
|
+
queries: paramsOrFirst as string[],
|
|
116
|
+
total: rest[0] as boolean
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const queries = params.queries;
|
|
121
|
+
const total = params.total;
|
|
122
|
+
|
|
93
123
|
|
|
94
124
|
const apiPath = '/project/variables';
|
|
95
125
|
const payload: Payload = {};
|
|
126
|
+
if (typeof queries !== 'undefined') {
|
|
127
|
+
payload['queries'] = queries;
|
|
128
|
+
}
|
|
129
|
+
if (typeof total !== 'undefined') {
|
|
130
|
+
payload['total'] = total;
|
|
131
|
+
}
|
|
96
132
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
97
133
|
|
|
98
134
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -107,18 +143,20 @@ export class Project {
|
|
|
107
143
|
}
|
|
108
144
|
|
|
109
145
|
/**
|
|
110
|
-
* Create a new project variable.
|
|
146
|
+
* Create a new project environment variable. These variables can be accessed by all functions and sites in the project.
|
|
111
147
|
*
|
|
148
|
+
* @param {string} params.variableId - Variable ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
112
149
|
* @param {string} params.key - Variable key. Max length: 255 chars.
|
|
113
150
|
* @param {string} params.value - Variable value. Max length: 8192 chars.
|
|
114
151
|
* @param {boolean} params.secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime.
|
|
115
152
|
* @throws {AppwriteException}
|
|
116
153
|
* @returns {Promise<Models.Variable>}
|
|
117
154
|
*/
|
|
118
|
-
createVariable(params: { key: string, value: string, secret?: boolean }): Promise<Models.Variable>;
|
|
155
|
+
createVariable(params: { variableId: string, key: string, value: string, secret?: boolean }): Promise<Models.Variable>;
|
|
119
156
|
/**
|
|
120
|
-
* Create a new project variable.
|
|
157
|
+
* Create a new project environment variable. These variables can be accessed by all functions and sites in the project.
|
|
121
158
|
*
|
|
159
|
+
* @param {string} variableId - Variable ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
122
160
|
* @param {string} key - Variable key. Max length: 255 chars.
|
|
123
161
|
* @param {string} value - Variable value. Max length: 8192 chars.
|
|
124
162
|
* @param {boolean} secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime.
|
|
@@ -126,27 +164,32 @@ export class Project {
|
|
|
126
164
|
* @returns {Promise<Models.Variable>}
|
|
127
165
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
128
166
|
*/
|
|
129
|
-
createVariable(key: string, value: string, secret?: boolean): Promise<Models.Variable>;
|
|
167
|
+
createVariable(variableId: string, key: string, value: string, secret?: boolean): Promise<Models.Variable>;
|
|
130
168
|
createVariable(
|
|
131
|
-
paramsOrFirst: { key: string, value: string, secret?: boolean } | string,
|
|
132
|
-
...rest: [(string)?, (boolean)?]
|
|
169
|
+
paramsOrFirst: { variableId: string, key: string, value: string, secret?: boolean } | string,
|
|
170
|
+
...rest: [(string)?, (string)?, (boolean)?]
|
|
133
171
|
): Promise<Models.Variable> {
|
|
134
|
-
let params: { key: string, value: string, secret?: boolean };
|
|
172
|
+
let params: { variableId: string, key: string, value: string, secret?: boolean };
|
|
135
173
|
|
|
136
174
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
137
|
-
params = (paramsOrFirst || {}) as { key: string, value: string, secret?: boolean };
|
|
175
|
+
params = (paramsOrFirst || {}) as { variableId: string, key: string, value: string, secret?: boolean };
|
|
138
176
|
} else {
|
|
139
177
|
params = {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
178
|
+
variableId: paramsOrFirst as string,
|
|
179
|
+
key: rest[0] as string,
|
|
180
|
+
value: rest[1] as string,
|
|
181
|
+
secret: rest[2] as boolean
|
|
143
182
|
};
|
|
144
183
|
}
|
|
145
184
|
|
|
185
|
+
const variableId = params.variableId;
|
|
146
186
|
const key = params.key;
|
|
147
187
|
const value = params.value;
|
|
148
188
|
const secret = params.secret;
|
|
149
189
|
|
|
190
|
+
if (typeof variableId === 'undefined') {
|
|
191
|
+
throw new AppwriteException('Missing required parameter: "variableId"');
|
|
192
|
+
}
|
|
150
193
|
if (typeof key === 'undefined') {
|
|
151
194
|
throw new AppwriteException('Missing required parameter: "key"');
|
|
152
195
|
}
|
|
@@ -156,6 +199,9 @@ export class Project {
|
|
|
156
199
|
|
|
157
200
|
const apiPath = '/project/variables';
|
|
158
201
|
const payload: Payload = {};
|
|
202
|
+
if (typeof variableId !== 'undefined') {
|
|
203
|
+
payload['variableId'] = variableId;
|
|
204
|
+
}
|
|
159
205
|
if (typeof key !== 'undefined') {
|
|
160
206
|
payload['key'] = key;
|
|
161
207
|
}
|
|
@@ -180,17 +226,17 @@ export class Project {
|
|
|
180
226
|
}
|
|
181
227
|
|
|
182
228
|
/**
|
|
183
|
-
* Get a
|
|
229
|
+
* Get a variable by its unique ID.
|
|
184
230
|
*
|
|
185
|
-
* @param {string} params.variableId - Variable
|
|
231
|
+
* @param {string} params.variableId - Variable ID.
|
|
186
232
|
* @throws {AppwriteException}
|
|
187
233
|
* @returns {Promise<Models.Variable>}
|
|
188
234
|
*/
|
|
189
235
|
getVariable(params: { variableId: string }): Promise<Models.Variable>;
|
|
190
236
|
/**
|
|
191
|
-
* Get a
|
|
237
|
+
* Get a variable by its unique ID.
|
|
192
238
|
*
|
|
193
|
-
* @param {string} variableId - Variable
|
|
239
|
+
* @param {string} variableId - Variable ID.
|
|
194
240
|
* @throws {AppwriteException}
|
|
195
241
|
* @returns {Promise<Models.Variable>}
|
|
196
242
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
@@ -231,20 +277,20 @@ export class Project {
|
|
|
231
277
|
}
|
|
232
278
|
|
|
233
279
|
/**
|
|
234
|
-
* Update
|
|
280
|
+
* Update variable by its unique ID.
|
|
235
281
|
*
|
|
236
|
-
* @param {string} params.variableId - Variable
|
|
282
|
+
* @param {string} params.variableId - Variable ID.
|
|
237
283
|
* @param {string} params.key - Variable key. Max length: 255 chars.
|
|
238
284
|
* @param {string} params.value - Variable value. Max length: 8192 chars.
|
|
239
285
|
* @param {boolean} params.secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime.
|
|
240
286
|
* @throws {AppwriteException}
|
|
241
287
|
* @returns {Promise<Models.Variable>}
|
|
242
288
|
*/
|
|
243
|
-
updateVariable(params: { variableId: string, key
|
|
289
|
+
updateVariable(params: { variableId: string, key?: string, value?: string, secret?: boolean }): Promise<Models.Variable>;
|
|
244
290
|
/**
|
|
245
|
-
* Update
|
|
291
|
+
* Update variable by its unique ID.
|
|
246
292
|
*
|
|
247
|
-
* @param {string} variableId - Variable
|
|
293
|
+
* @param {string} variableId - Variable ID.
|
|
248
294
|
* @param {string} key - Variable key. Max length: 255 chars.
|
|
249
295
|
* @param {string} value - Variable value. Max length: 8192 chars.
|
|
250
296
|
* @param {boolean} secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime.
|
|
@@ -252,15 +298,15 @@ export class Project {
|
|
|
252
298
|
* @returns {Promise<Models.Variable>}
|
|
253
299
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
254
300
|
*/
|
|
255
|
-
updateVariable(variableId: string, key
|
|
301
|
+
updateVariable(variableId: string, key?: string, value?: string, secret?: boolean): Promise<Models.Variable>;
|
|
256
302
|
updateVariable(
|
|
257
|
-
paramsOrFirst: { variableId: string, key
|
|
303
|
+
paramsOrFirst: { variableId: string, key?: string, value?: string, secret?: boolean } | string,
|
|
258
304
|
...rest: [(string)?, (string)?, (boolean)?]
|
|
259
305
|
): Promise<Models.Variable> {
|
|
260
|
-
let params: { variableId: string, key
|
|
306
|
+
let params: { variableId: string, key?: string, value?: string, secret?: boolean };
|
|
261
307
|
|
|
262
308
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
263
|
-
params = (paramsOrFirst || {}) as { variableId: string, key
|
|
309
|
+
params = (paramsOrFirst || {}) as { variableId: string, key?: string, value?: string, secret?: boolean };
|
|
264
310
|
} else {
|
|
265
311
|
params = {
|
|
266
312
|
variableId: paramsOrFirst as string,
|
|
@@ -278,9 +324,6 @@ export class Project {
|
|
|
278
324
|
if (typeof variableId === 'undefined') {
|
|
279
325
|
throw new AppwriteException('Missing required parameter: "variableId"');
|
|
280
326
|
}
|
|
281
|
-
if (typeof key === 'undefined') {
|
|
282
|
-
throw new AppwriteException('Missing required parameter: "key"');
|
|
283
|
-
}
|
|
284
327
|
|
|
285
328
|
const apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);
|
|
286
329
|
const payload: Payload = {};
|
|
@@ -308,17 +351,17 @@ export class Project {
|
|
|
308
351
|
}
|
|
309
352
|
|
|
310
353
|
/**
|
|
311
|
-
* Delete a
|
|
354
|
+
* Delete a variable by its unique ID.
|
|
312
355
|
*
|
|
313
|
-
* @param {string} params.variableId - Variable
|
|
356
|
+
* @param {string} params.variableId - Variable ID.
|
|
314
357
|
* @throws {AppwriteException}
|
|
315
358
|
* @returns {Promise<{}>}
|
|
316
359
|
*/
|
|
317
360
|
deleteVariable(params: { variableId: string }): Promise<{}>;
|
|
318
361
|
/**
|
|
319
|
-
* Delete a
|
|
362
|
+
* Delete a variable by its unique ID.
|
|
320
363
|
*
|
|
321
|
-
* @param {string} variableId - Variable
|
|
364
|
+
* @param {string} variableId - Variable ID.
|
|
322
365
|
* @throws {AppwriteException}
|
|
323
366
|
* @returns {Promise<{}>}
|
|
324
367
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
@@ -5,7 +5,7 @@ import type { Models } from '../models';
|
|
|
5
5
|
import { UsageRange } from '../enums/usage-range';
|
|
6
6
|
import { RelationshipType } from '../enums/relationship-type';
|
|
7
7
|
import { RelationMutate } from '../enums/relation-mutate';
|
|
8
|
-
import {
|
|
8
|
+
import { TablesDBIndexType } from '../enums/tables-db-index-type';
|
|
9
9
|
import { OrderBy } from '../enums/order-by';
|
|
10
10
|
|
|
11
11
|
export class TablesDB {
|
|
@@ -4746,14 +4746,14 @@ export class TablesDB {
|
|
|
4746
4746
|
* @param {string} params.databaseId - Database ID.
|
|
4747
4747
|
* @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
|
|
4748
4748
|
* @param {string} params.key - Index Key.
|
|
4749
|
-
* @param {
|
|
4749
|
+
* @param {TablesDBIndexType} params.type - Index type.
|
|
4750
4750
|
* @param {string[]} params.columns - Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.
|
|
4751
4751
|
* @param {OrderBy[]} params.orders - Array of index orders. Maximum of 100 orders are allowed.
|
|
4752
4752
|
* @param {number[]} params.lengths - Length of index. Maximum of 100
|
|
4753
4753
|
* @throws {AppwriteException}
|
|
4754
4754
|
* @returns {Promise<Models.ColumnIndex>}
|
|
4755
4755
|
*/
|
|
4756
|
-
createIndex(params: { databaseId: string, tableId: string, key: string, type:
|
|
4756
|
+
createIndex(params: { databaseId: string, tableId: string, key: string, type: TablesDBIndexType, columns: string[], orders?: OrderBy[], lengths?: number[] }): Promise<Models.ColumnIndex>;
|
|
4757
4757
|
/**
|
|
4758
4758
|
* Creates an index on the columns listed. Your index should include all the columns you will query in a single request.
|
|
4759
4759
|
* Type can be `key`, `fulltext`, or `unique`.
|
|
@@ -4761,7 +4761,7 @@ export class TablesDB {
|
|
|
4761
4761
|
* @param {string} databaseId - Database ID.
|
|
4762
4762
|
* @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
|
|
4763
4763
|
* @param {string} key - Index Key.
|
|
4764
|
-
* @param {
|
|
4764
|
+
* @param {TablesDBIndexType} type - Index type.
|
|
4765
4765
|
* @param {string[]} columns - Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.
|
|
4766
4766
|
* @param {OrderBy[]} orders - Array of index orders. Maximum of 100 orders are allowed.
|
|
4767
4767
|
* @param {number[]} lengths - Length of index. Maximum of 100
|
|
@@ -4769,21 +4769,21 @@ export class TablesDB {
|
|
|
4769
4769
|
* @returns {Promise<Models.ColumnIndex>}
|
|
4770
4770
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
4771
4771
|
*/
|
|
4772
|
-
createIndex(databaseId: string, tableId: string, key: string, type:
|
|
4772
|
+
createIndex(databaseId: string, tableId: string, key: string, type: TablesDBIndexType, columns: string[], orders?: OrderBy[], lengths?: number[]): Promise<Models.ColumnIndex>;
|
|
4773
4773
|
createIndex(
|
|
4774
|
-
paramsOrFirst: { databaseId: string, tableId: string, key: string, type:
|
|
4775
|
-
...rest: [(string)?, (string)?, (
|
|
4774
|
+
paramsOrFirst: { databaseId: string, tableId: string, key: string, type: TablesDBIndexType, columns: string[], orders?: OrderBy[], lengths?: number[] } | string,
|
|
4775
|
+
...rest: [(string)?, (string)?, (TablesDBIndexType)?, (string[])?, (OrderBy[])?, (number[])?]
|
|
4776
4776
|
): Promise<Models.ColumnIndex> {
|
|
4777
|
-
let params: { databaseId: string, tableId: string, key: string, type:
|
|
4777
|
+
let params: { databaseId: string, tableId: string, key: string, type: TablesDBIndexType, columns: string[], orders?: OrderBy[], lengths?: number[] };
|
|
4778
4778
|
|
|
4779
4779
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4780
|
-
params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, type:
|
|
4780
|
+
params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, type: TablesDBIndexType, columns: string[], orders?: OrderBy[], lengths?: number[] };
|
|
4781
4781
|
} else {
|
|
4782
4782
|
params = {
|
|
4783
4783
|
databaseId: paramsOrFirst as string,
|
|
4784
4784
|
tableId: rest[0] as string,
|
|
4785
4785
|
key: rest[1] as string,
|
|
4786
|
-
type: rest[2] as
|
|
4786
|
+
type: rest[2] as TablesDBIndexType,
|
|
4787
4787
|
columns: rest[3] as string[],
|
|
4788
4788
|
orders: rest[4] as OrderBy[],
|
|
4789
4789
|
lengths: rest[5] as number[]
|
package/src/services/users.ts
CHANGED
|
@@ -17,7 +17,7 @@ export class Users {
|
|
|
17
17
|
/**
|
|
18
18
|
* Get a list of all the project's users. You can use the query params to filter your results.
|
|
19
19
|
*
|
|
20
|
-
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels
|
|
20
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator
|
|
21
21
|
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
22
22
|
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
23
23
|
* @throws {AppwriteException}
|
|
@@ -27,7 +27,7 @@ export class Users {
|
|
|
27
27
|
/**
|
|
28
28
|
* Get a list of all the project's users. You can use the query params to filter your results.
|
|
29
29
|
*
|
|
30
|
-
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels
|
|
30
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator
|
|
31
31
|
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
32
32
|
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
33
33
|
* @throws {AppwriteException}
|
|
@@ -1169,6 +1169,71 @@ export class Users {
|
|
|
1169
1169
|
);
|
|
1170
1170
|
}
|
|
1171
1171
|
|
|
1172
|
+
/**
|
|
1173
|
+
* Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data.
|
|
1174
|
+
*
|
|
1175
|
+
*
|
|
1176
|
+
* @param {string} params.userId - User ID.
|
|
1177
|
+
* @param {boolean} params.impersonator - Whether the user can impersonate other users. When true, the user can browse project users to choose a target and can pass impersonation headers to act as that user. Internal audit logs still attribute impersonated actions to the original impersonator and store the target user details only in internal audit payload data.
|
|
1178
|
+
* @throws {AppwriteException}
|
|
1179
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
1180
|
+
*/
|
|
1181
|
+
updateImpersonator<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, impersonator: boolean }): Promise<Models.User<Preferences>>;
|
|
1182
|
+
/**
|
|
1183
|
+
* Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data.
|
|
1184
|
+
*
|
|
1185
|
+
*
|
|
1186
|
+
* @param {string} userId - User ID.
|
|
1187
|
+
* @param {boolean} impersonator - Whether the user can impersonate other users. When true, the user can browse project users to choose a target and can pass impersonation headers to act as that user. Internal audit logs still attribute impersonated actions to the original impersonator and store the target user details only in internal audit payload data.
|
|
1188
|
+
* @throws {AppwriteException}
|
|
1189
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
1190
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1191
|
+
*/
|
|
1192
|
+
updateImpersonator<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, impersonator: boolean): Promise<Models.User<Preferences>>;
|
|
1193
|
+
updateImpersonator<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
1194
|
+
paramsOrFirst: { userId: string, impersonator: boolean } | string,
|
|
1195
|
+
...rest: [(boolean)?]
|
|
1196
|
+
): Promise<Models.User<Preferences>> {
|
|
1197
|
+
let params: { userId: string, impersonator: boolean };
|
|
1198
|
+
|
|
1199
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1200
|
+
params = (paramsOrFirst || {}) as { userId: string, impersonator: boolean };
|
|
1201
|
+
} else {
|
|
1202
|
+
params = {
|
|
1203
|
+
userId: paramsOrFirst as string,
|
|
1204
|
+
impersonator: rest[0] as boolean
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
const userId = params.userId;
|
|
1209
|
+
const impersonator = params.impersonator;
|
|
1210
|
+
|
|
1211
|
+
if (typeof userId === 'undefined') {
|
|
1212
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1213
|
+
}
|
|
1214
|
+
if (typeof impersonator === 'undefined') {
|
|
1215
|
+
throw new AppwriteException('Missing required parameter: "impersonator"');
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
const apiPath = '/users/{userId}/impersonator'.replace('{userId}', userId);
|
|
1219
|
+
const payload: Payload = {};
|
|
1220
|
+
if (typeof impersonator !== 'undefined') {
|
|
1221
|
+
payload['impersonator'] = impersonator;
|
|
1222
|
+
}
|
|
1223
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1224
|
+
|
|
1225
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1226
|
+
'content-type': 'application/json',
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
return this.client.call(
|
|
1230
|
+
'patch',
|
|
1231
|
+
uri,
|
|
1232
|
+
apiHeaders,
|
|
1233
|
+
payload
|
|
1234
|
+
);
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1172
1237
|
/**
|
|
1173
1238
|
* Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.
|
|
1174
1239
|
*
|
package/src/services/vcs.ts
CHANGED
|
@@ -19,9 +19,9 @@ export class Vcs {
|
|
|
19
19
|
* @param {VCSDetectionType} params.type - Detector type. Must be one of the following: runtime, framework
|
|
20
20
|
* @param {string} params.providerRootDirectory - Path to Root Directory
|
|
21
21
|
* @throws {AppwriteException}
|
|
22
|
-
* @returns {Promise<Models.DetectionFramework>}
|
|
22
|
+
* @returns {Promise<Models.DetectionRuntime | Models.DetectionFramework>}
|
|
23
23
|
*/
|
|
24
|
-
createRepositoryDetection(params: { installationId: string, providerRepositoryId: string, type: VCSDetectionType, providerRootDirectory?: string }): Promise<Models.DetectionFramework>;
|
|
24
|
+
createRepositoryDetection(params: { installationId: string, providerRepositoryId: string, type: VCSDetectionType, providerRootDirectory?: string }): Promise<Models.DetectionRuntime | Models.DetectionFramework>;
|
|
25
25
|
/**
|
|
26
26
|
* Analyze a GitHub repository to automatically detect the programming language and runtime environment. This endpoint scans the repository's files and language statistics to determine the appropriate runtime settings for your function. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.
|
|
27
27
|
*
|
|
@@ -30,14 +30,14 @@ export class Vcs {
|
|
|
30
30
|
* @param {VCSDetectionType} type - Detector type. Must be one of the following: runtime, framework
|
|
31
31
|
* @param {string} providerRootDirectory - Path to Root Directory
|
|
32
32
|
* @throws {AppwriteException}
|
|
33
|
-
* @returns {Promise<Models.DetectionFramework>}
|
|
33
|
+
* @returns {Promise<Models.DetectionRuntime | Models.DetectionFramework>}
|
|
34
34
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
35
35
|
*/
|
|
36
|
-
createRepositoryDetection(installationId: string, providerRepositoryId: string, type: VCSDetectionType, providerRootDirectory?: string): Promise<Models.DetectionFramework>;
|
|
36
|
+
createRepositoryDetection(installationId: string, providerRepositoryId: string, type: VCSDetectionType, providerRootDirectory?: string): Promise<Models.DetectionRuntime | Models.DetectionFramework>;
|
|
37
37
|
createRepositoryDetection(
|
|
38
38
|
paramsOrFirst: { installationId: string, providerRepositoryId: string, type: VCSDetectionType, providerRootDirectory?: string } | string,
|
|
39
39
|
...rest: [(string)?, (VCSDetectionType)?, (string)?]
|
|
40
|
-
): Promise<Models.DetectionFramework> {
|
|
40
|
+
): Promise<Models.DetectionRuntime | Models.DetectionFramework> {
|
|
41
41
|
let params: { installationId: string, providerRepositoryId: string, type: VCSDetectionType, providerRootDirectory?: string };
|
|
42
42
|
|
|
43
43
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
@@ -99,9 +99,9 @@ export class Vcs {
|
|
|
99
99
|
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
100
100
|
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
|
|
101
101
|
* @throws {AppwriteException}
|
|
102
|
-
* @returns {Promise<Models.ProviderRepositoryFrameworkList>}
|
|
102
|
+
* @returns {Promise<Models.ProviderRepositoryRuntimeList | Models.ProviderRepositoryFrameworkList>}
|
|
103
103
|
*/
|
|
104
|
-
listRepositories(params: { installationId: string, type: VCSDetectionType, search?: string, queries?: string[] }): Promise<Models.ProviderRepositoryFrameworkList>;
|
|
104
|
+
listRepositories(params: { installationId: string, type: VCSDetectionType, search?: string, queries?: string[] }): Promise<Models.ProviderRepositoryRuntimeList | Models.ProviderRepositoryFrameworkList>;
|
|
105
105
|
/**
|
|
106
106
|
* Get a list of GitHub repositories available through your installation. This endpoint returns repositories with their basic information, detected runtime environments, and latest push dates. You can optionally filter repositories using a search term. Each repository's runtime is automatically detected based on its contents and language statistics. The GitHub installation must be properly configured for this endpoint to work.
|
|
107
107
|
*
|
|
@@ -110,14 +110,14 @@ export class Vcs {
|
|
|
110
110
|
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
111
111
|
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
|
|
112
112
|
* @throws {AppwriteException}
|
|
113
|
-
* @returns {Promise<Models.ProviderRepositoryFrameworkList>}
|
|
113
|
+
* @returns {Promise<Models.ProviderRepositoryRuntimeList | Models.ProviderRepositoryFrameworkList>}
|
|
114
114
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
115
115
|
*/
|
|
116
|
-
listRepositories(installationId: string, type: VCSDetectionType, search?: string, queries?: string[]): Promise<Models.ProviderRepositoryFrameworkList>;
|
|
116
|
+
listRepositories(installationId: string, type: VCSDetectionType, search?: string, queries?: string[]): Promise<Models.ProviderRepositoryRuntimeList | Models.ProviderRepositoryFrameworkList>;
|
|
117
117
|
listRepositories(
|
|
118
118
|
paramsOrFirst: { installationId: string, type: VCSDetectionType, search?: string, queries?: string[] } | string,
|
|
119
119
|
...rest: [(VCSDetectionType)?, (string)?, (string[])?]
|
|
120
|
-
): Promise<Models.ProviderRepositoryFrameworkList> {
|
|
120
|
+
): Promise<Models.ProviderRepositoryRuntimeList | Models.ProviderRepositoryFrameworkList> {
|
|
121
121
|
let params: { installationId: string, type: VCSDetectionType, search?: string, queries?: string[] };
|
|
122
122
|
|
|
123
123
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|