@appwrite.io/console 17.0.0 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/cjs/sdk.js +1239 -94
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +1236 -95
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +3241 -97
- package/package.json +5 -2
- package/types/client.d.ts +24 -0
- package/types/enums/build-runtime.d.ts +3 -0
- package/types/enums/conversation-type.d.ts +9 -0
- package/types/enums/o-auth-2-auth-0-prompt.d.ts +5 -0
- package/types/enums/o-auth-2-discord-prompt.d.ts +4 -0
- package/types/enums/o-auth-2-github-prompt.d.ts +3 -0
- package/types/enums/o-auth-2-kakao-prompt.d.ts +6 -0
- package/types/enums/o-auth-2-microsoft-prompt.d.ts +6 -0
- package/types/enums/o-auth-2-okta-prompt.d.ts +5 -0
- package/types/enums/o-auth-2-salesforce-prompt.d.ts +4 -0
- package/types/enums/o-auth-2-zoho-prompt.d.ts +3 -0
- package/types/enums/project-email-template-id.d.ts +2 -1
- package/types/enums/project-o-auth-2-auth-0-prompt.d.ts +5 -0
- package/types/enums/project-o-auth-2-discord-prompt.d.ts +4 -0
- package/types/enums/project-o-auth-2-git-hub-prompt.d.ts +3 -0
- package/types/enums/project-o-auth-2-kakao-prompt.d.ts +6 -0
- package/types/enums/project-o-auth-2-microsoft-prompt.d.ts +6 -0
- package/types/enums/project-o-auth-2-okta-prompt.d.ts +5 -0
- package/types/enums/project-o-auth-2-salesforce-prompt.d.ts +4 -0
- package/types/enums/project-o-auth-2-zoho-prompt.d.ts +3 -0
- package/types/enums/query-suggestion-resource.d.ts +1 -1
- package/types/enums/runtime.d.ts +3 -0
- package/types/index.d.ts +22 -1
- package/types/models.d.ts +68 -7
- package/types/services/account.d.ts +57 -2
- package/types/services/console.d.ts +2 -2
- package/types/services/databases.d.ts +4 -4
- package/types/services/growth.d.ts +100 -0
- package/types/services/manager.d.ts +25 -0
- package/types/services/messaging.d.ts +14 -2
- package/types/services/organizations.d.ts +0 -19
- package/types/services/project.d.ts +52 -20
- package/types/services/push.d.ts +153 -0
- package/types/services/tables-db.d.ts +37 -37
- package/types/services/users.d.ts +2 -2
- package/types/topic.d.ts +34 -0
package/dist/esm/sdk.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import JSONbigModule from 'json-bigint';
|
|
2
|
+
import { Buffer } from 'buffer';
|
|
3
|
+
import mqtt from 'mqtt';
|
|
2
4
|
|
|
3
5
|
/******************************************************************************
|
|
4
6
|
Copyright (c) Microsoft Corporation.
|
|
@@ -642,6 +644,8 @@ class Client {
|
|
|
642
644
|
this.config = {
|
|
643
645
|
endpoint: 'https://cloud.appwrite.io/v1',
|
|
644
646
|
endpointRealtime: '',
|
|
647
|
+
endpointPush: '',
|
|
648
|
+
pushClientId: '',
|
|
645
649
|
project: '',
|
|
646
650
|
key: '',
|
|
647
651
|
organization: '',
|
|
@@ -665,8 +669,8 @@ class Client {
|
|
|
665
669
|
'x-sdk-name': 'Console',
|
|
666
670
|
'x-sdk-platform': 'console',
|
|
667
671
|
'x-sdk-language': 'web',
|
|
668
|
-
'x-sdk-version': '
|
|
669
|
-
'X-Appwrite-Response-Format': '2.
|
|
672
|
+
'x-sdk-version': '18.0.0',
|
|
673
|
+
'X-Appwrite-Response-Format': '2.3.0',
|
|
670
674
|
};
|
|
671
675
|
this.realtime = {
|
|
672
676
|
socket: undefined,
|
|
@@ -907,6 +911,44 @@ class Client {
|
|
|
907
911
|
this.config.endpointRealtime = endpointRealtime;
|
|
908
912
|
return this;
|
|
909
913
|
}
|
|
914
|
+
/**
|
|
915
|
+
* Set Push Endpoint
|
|
916
|
+
*
|
|
917
|
+
* The MQTT-over-WebSocket URL the AppwritePush service connects to.
|
|
918
|
+
*
|
|
919
|
+
* @param {string} endpointPush
|
|
920
|
+
*
|
|
921
|
+
* @returns {this}
|
|
922
|
+
*/
|
|
923
|
+
setPushEndpoint(endpointPush) {
|
|
924
|
+
if (!endpointPush || typeof endpointPush !== 'string') {
|
|
925
|
+
throw new AppwriteException('Endpoint must be a valid string');
|
|
926
|
+
}
|
|
927
|
+
if (!endpointPush.startsWith('ws://') &&
|
|
928
|
+
!endpointPush.startsWith('wss://')) {
|
|
929
|
+
throw new AppwriteException('Invalid push endpoint URL: ' + endpointPush);
|
|
930
|
+
}
|
|
931
|
+
this.config.endpointPush = endpointPush;
|
|
932
|
+
return this;
|
|
933
|
+
}
|
|
934
|
+
/**
|
|
935
|
+
* Set Push Client Id
|
|
936
|
+
*
|
|
937
|
+
* A stable client id for the AppwritePush service. The broker keys its
|
|
938
|
+
* offline-replay cursor on this id, so pass a stable value to resume replay across
|
|
939
|
+
* reloads/restarts. Defaults to a per-connection id when unset.
|
|
940
|
+
*
|
|
941
|
+
* @param {string} pushClientId
|
|
942
|
+
*
|
|
943
|
+
* @returns {this}
|
|
944
|
+
*/
|
|
945
|
+
setPushClientId(pushClientId) {
|
|
946
|
+
if (!pushClientId || typeof pushClientId !== 'string') {
|
|
947
|
+
throw new AppwriteException('Client id must be a valid string');
|
|
948
|
+
}
|
|
949
|
+
this.config.pushClientId = pushClientId;
|
|
950
|
+
return this;
|
|
951
|
+
}
|
|
910
952
|
/**
|
|
911
953
|
* Set self-signed
|
|
912
954
|
*
|
|
@@ -1237,10 +1279,8 @@ class Client {
|
|
|
1237
1279
|
const options = {
|
|
1238
1280
|
method,
|
|
1239
1281
|
headers,
|
|
1282
|
+
credentials: this.config.credentials,
|
|
1240
1283
|
};
|
|
1241
|
-
if (headers['X-Appwrite-Dev-Key'] === undefined) {
|
|
1242
|
-
options.credentials = this.config.credentials;
|
|
1243
|
-
}
|
|
1244
1284
|
if (method === 'GET') {
|
|
1245
1285
|
for (const [key, value] of Object.entries(Client.flatten(params))) {
|
|
1246
1286
|
url.searchParams.append(key, value);
|
|
@@ -1279,7 +1319,7 @@ class Client {
|
|
|
1279
1319
|
var _a;
|
|
1280
1320
|
const [fileParam, file] = (_a = Object.entries(originalPayload).find(([_, value]) => value instanceof File)) !== null && _a !== void 0 ? _a : [];
|
|
1281
1321
|
if (!file || !fileParam) {
|
|
1282
|
-
|
|
1322
|
+
return yield this.call(method, url, headers, originalPayload);
|
|
1283
1323
|
}
|
|
1284
1324
|
if (file.size <= Client.CHUNK_SIZE) {
|
|
1285
1325
|
return yield this.call(method, url, headers, originalPayload);
|
|
@@ -3226,6 +3266,85 @@ class Account {
|
|
|
3226
3266
|
};
|
|
3227
3267
|
return this.client.call('put', uri, apiHeaders, payload);
|
|
3228
3268
|
}
|
|
3269
|
+
createRecoveryOTP(paramsOrFirst, ...rest) {
|
|
3270
|
+
let params;
|
|
3271
|
+
if (paramsOrFirst &&
|
|
3272
|
+
typeof paramsOrFirst === 'object' &&
|
|
3273
|
+
!Array.isArray(paramsOrFirst)) {
|
|
3274
|
+
params = (paramsOrFirst || {});
|
|
3275
|
+
}
|
|
3276
|
+
else {
|
|
3277
|
+
params = {
|
|
3278
|
+
email: paramsOrFirst,
|
|
3279
|
+
phrase: rest[0],
|
|
3280
|
+
};
|
|
3281
|
+
}
|
|
3282
|
+
const email = params.email;
|
|
3283
|
+
const phrase = params.phrase;
|
|
3284
|
+
if (typeof email === 'undefined') {
|
|
3285
|
+
throw new AppwriteException('Missing required parameter: "email"');
|
|
3286
|
+
}
|
|
3287
|
+
const apiPath = '/account/recovery/otp';
|
|
3288
|
+
const payload = {};
|
|
3289
|
+
if (typeof email !== 'undefined') {
|
|
3290
|
+
payload['email'] = email;
|
|
3291
|
+
}
|
|
3292
|
+
if (typeof phrase !== 'undefined') {
|
|
3293
|
+
payload['phrase'] = phrase;
|
|
3294
|
+
}
|
|
3295
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3296
|
+
const apiHeaders = {
|
|
3297
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
3298
|
+
'content-type': 'application/json',
|
|
3299
|
+
accept: 'application/json',
|
|
3300
|
+
};
|
|
3301
|
+
return this.client.call('post', uri, apiHeaders, payload);
|
|
3302
|
+
}
|
|
3303
|
+
updateRecoveryOTP(paramsOrFirst, ...rest) {
|
|
3304
|
+
let params;
|
|
3305
|
+
if (paramsOrFirst &&
|
|
3306
|
+
typeof paramsOrFirst === 'object' &&
|
|
3307
|
+
!Array.isArray(paramsOrFirst)) {
|
|
3308
|
+
params = (paramsOrFirst || {});
|
|
3309
|
+
}
|
|
3310
|
+
else {
|
|
3311
|
+
params = {
|
|
3312
|
+
userId: paramsOrFirst,
|
|
3313
|
+
secret: rest[0],
|
|
3314
|
+
password: rest[1],
|
|
3315
|
+
};
|
|
3316
|
+
}
|
|
3317
|
+
const userId = params.userId;
|
|
3318
|
+
const secret = params.secret;
|
|
3319
|
+
const password = params.password;
|
|
3320
|
+
if (typeof userId === 'undefined') {
|
|
3321
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
3322
|
+
}
|
|
3323
|
+
if (typeof secret === 'undefined') {
|
|
3324
|
+
throw new AppwriteException('Missing required parameter: "secret"');
|
|
3325
|
+
}
|
|
3326
|
+
if (typeof password === 'undefined') {
|
|
3327
|
+
throw new AppwriteException('Missing required parameter: "password"');
|
|
3328
|
+
}
|
|
3329
|
+
const apiPath = '/account/recovery/otp';
|
|
3330
|
+
const payload = {};
|
|
3331
|
+
if (typeof userId !== 'undefined') {
|
|
3332
|
+
payload['userId'] = userId;
|
|
3333
|
+
}
|
|
3334
|
+
if (typeof secret !== 'undefined') {
|
|
3335
|
+
payload['secret'] = secret;
|
|
3336
|
+
}
|
|
3337
|
+
if (typeof password !== 'undefined') {
|
|
3338
|
+
payload['password'] = password;
|
|
3339
|
+
}
|
|
3340
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3341
|
+
const apiHeaders = {
|
|
3342
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
3343
|
+
'content-type': 'application/json',
|
|
3344
|
+
accept: 'application/json',
|
|
3345
|
+
};
|
|
3346
|
+
return this.client.call('put', uri, apiHeaders, payload);
|
|
3347
|
+
}
|
|
3229
3348
|
/**
|
|
3230
3349
|
* Get the list of active sessions across different devices for the currently logged in user.
|
|
3231
3350
|
*
|
|
@@ -15739,6 +15858,171 @@ class Graphql {
|
|
|
15739
15858
|
}
|
|
15740
15859
|
}
|
|
15741
15860
|
|
|
15861
|
+
class Growth {
|
|
15862
|
+
constructor(client) {
|
|
15863
|
+
this.client = client;
|
|
15864
|
+
}
|
|
15865
|
+
createConversation(paramsOrFirst, ...rest) {
|
|
15866
|
+
let params;
|
|
15867
|
+
let onProgress;
|
|
15868
|
+
if (paramsOrFirst &&
|
|
15869
|
+
typeof paramsOrFirst === 'object' &&
|
|
15870
|
+
!Array.isArray(paramsOrFirst) &&
|
|
15871
|
+
('type' in paramsOrFirst ||
|
|
15872
|
+
'email' in paramsOrFirst ||
|
|
15873
|
+
'name' in paramsOrFirst ||
|
|
15874
|
+
'subject' in paramsOrFirst ||
|
|
15875
|
+
'message' in paramsOrFirst ||
|
|
15876
|
+
'organizationId' in paramsOrFirst ||
|
|
15877
|
+
'projectId' in paramsOrFirst ||
|
|
15878
|
+
'attributes' in paramsOrFirst ||
|
|
15879
|
+
'attachment' in paramsOrFirst ||
|
|
15880
|
+
'onProgress' in paramsOrFirst)) {
|
|
15881
|
+
params = (paramsOrFirst || {});
|
|
15882
|
+
onProgress = paramsOrFirst === null || paramsOrFirst === void 0 ? void 0 : paramsOrFirst.onProgress;
|
|
15883
|
+
}
|
|
15884
|
+
else {
|
|
15885
|
+
params = {
|
|
15886
|
+
type: paramsOrFirst,
|
|
15887
|
+
email: rest[0],
|
|
15888
|
+
name: rest[1],
|
|
15889
|
+
subject: rest[2],
|
|
15890
|
+
message: rest[3],
|
|
15891
|
+
organizationId: rest[4],
|
|
15892
|
+
projectId: rest[5],
|
|
15893
|
+
attributes: rest[6],
|
|
15894
|
+
attachment: rest[7],
|
|
15895
|
+
};
|
|
15896
|
+
onProgress = rest[8];
|
|
15897
|
+
}
|
|
15898
|
+
const type = params.type;
|
|
15899
|
+
const email = params.email;
|
|
15900
|
+
const name = params.name;
|
|
15901
|
+
const subject = params.subject;
|
|
15902
|
+
const message = params.message;
|
|
15903
|
+
const organizationId = params.organizationId;
|
|
15904
|
+
const projectId = params.projectId;
|
|
15905
|
+
const attributes = params.attributes;
|
|
15906
|
+
const attachment = params.attachment;
|
|
15907
|
+
if (typeof type === 'undefined') {
|
|
15908
|
+
throw new AppwriteException('Missing required parameter: "type"');
|
|
15909
|
+
}
|
|
15910
|
+
const apiPath = '/growth/conversations';
|
|
15911
|
+
const payload = {};
|
|
15912
|
+
if (typeof type !== 'undefined') {
|
|
15913
|
+
payload['type'] = type;
|
|
15914
|
+
}
|
|
15915
|
+
if (typeof email !== 'undefined') {
|
|
15916
|
+
payload['email'] = email;
|
|
15917
|
+
}
|
|
15918
|
+
if (typeof name !== 'undefined') {
|
|
15919
|
+
payload['name'] = name;
|
|
15920
|
+
}
|
|
15921
|
+
if (typeof subject !== 'undefined') {
|
|
15922
|
+
payload['subject'] = subject;
|
|
15923
|
+
}
|
|
15924
|
+
if (typeof message !== 'undefined') {
|
|
15925
|
+
payload['message'] = message;
|
|
15926
|
+
}
|
|
15927
|
+
if (typeof organizationId !== 'undefined') {
|
|
15928
|
+
payload['organizationId'] = organizationId;
|
|
15929
|
+
}
|
|
15930
|
+
if (typeof projectId !== 'undefined') {
|
|
15931
|
+
payload['projectId'] = projectId;
|
|
15932
|
+
}
|
|
15933
|
+
if (typeof attributes !== 'undefined') {
|
|
15934
|
+
payload['attributes'] = attributes;
|
|
15935
|
+
}
|
|
15936
|
+
if (typeof attachment !== 'undefined') {
|
|
15937
|
+
payload['attachment'] = attachment;
|
|
15938
|
+
}
|
|
15939
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
15940
|
+
const apiHeaders = {
|
|
15941
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
15942
|
+
'content-type': 'multipart/form-data',
|
|
15943
|
+
accept: 'application/json',
|
|
15944
|
+
};
|
|
15945
|
+
return this.client.chunkedUpload('post', uri, apiHeaders, payload, onProgress);
|
|
15946
|
+
}
|
|
15947
|
+
createInstallation(paramsOrFirst, ...rest) {
|
|
15948
|
+
let params;
|
|
15949
|
+
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
15950
|
+
(paramsOrFirst &&
|
|
15951
|
+
typeof paramsOrFirst === 'object' &&
|
|
15952
|
+
!Array.isArray(paramsOrFirst))) {
|
|
15953
|
+
params = (paramsOrFirst || {});
|
|
15954
|
+
}
|
|
15955
|
+
else {
|
|
15956
|
+
params = {
|
|
15957
|
+
email: paramsOrFirst,
|
|
15958
|
+
name: rest[0],
|
|
15959
|
+
version: rest[1],
|
|
15960
|
+
domain: rest[2],
|
|
15961
|
+
database: rest[3],
|
|
15962
|
+
hostIp: rest[4],
|
|
15963
|
+
userAgent: rest[5],
|
|
15964
|
+
os: rest[6],
|
|
15965
|
+
arch: rest[7],
|
|
15966
|
+
cpus: rest[8],
|
|
15967
|
+
ram: rest[9],
|
|
15968
|
+
};
|
|
15969
|
+
}
|
|
15970
|
+
const email = params.email;
|
|
15971
|
+
const name = params.name;
|
|
15972
|
+
const version = params.version;
|
|
15973
|
+
const domain = params.domain;
|
|
15974
|
+
const database = params.database;
|
|
15975
|
+
const hostIp = params.hostIp;
|
|
15976
|
+
const userAgent = params.userAgent;
|
|
15977
|
+
const os = params.os;
|
|
15978
|
+
const arch = params.arch;
|
|
15979
|
+
const cpus = params.cpus;
|
|
15980
|
+
const ram = params.ram;
|
|
15981
|
+
const apiPath = '/growth/installations';
|
|
15982
|
+
const payload = {};
|
|
15983
|
+
if (typeof email !== 'undefined') {
|
|
15984
|
+
payload['email'] = email;
|
|
15985
|
+
}
|
|
15986
|
+
if (typeof name !== 'undefined') {
|
|
15987
|
+
payload['name'] = name;
|
|
15988
|
+
}
|
|
15989
|
+
if (typeof version !== 'undefined') {
|
|
15990
|
+
payload['version'] = version;
|
|
15991
|
+
}
|
|
15992
|
+
if (typeof domain !== 'undefined') {
|
|
15993
|
+
payload['domain'] = domain;
|
|
15994
|
+
}
|
|
15995
|
+
if (typeof database !== 'undefined') {
|
|
15996
|
+
payload['database'] = database;
|
|
15997
|
+
}
|
|
15998
|
+
if (typeof hostIp !== 'undefined') {
|
|
15999
|
+
payload['hostIp'] = hostIp;
|
|
16000
|
+
}
|
|
16001
|
+
if (typeof userAgent !== 'undefined') {
|
|
16002
|
+
payload['userAgent'] = userAgent;
|
|
16003
|
+
}
|
|
16004
|
+
if (typeof os !== 'undefined') {
|
|
16005
|
+
payload['os'] = os;
|
|
16006
|
+
}
|
|
16007
|
+
if (typeof arch !== 'undefined') {
|
|
16008
|
+
payload['arch'] = arch;
|
|
16009
|
+
}
|
|
16010
|
+
if (typeof cpus !== 'undefined') {
|
|
16011
|
+
payload['cpus'] = cpus;
|
|
16012
|
+
}
|
|
16013
|
+
if (typeof ram !== 'undefined') {
|
|
16014
|
+
payload['ram'] = ram;
|
|
16015
|
+
}
|
|
16016
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
16017
|
+
const apiHeaders = {
|
|
16018
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
16019
|
+
'content-type': 'application/json',
|
|
16020
|
+
accept: 'application/json',
|
|
16021
|
+
};
|
|
16022
|
+
return this.client.call('post', uri, apiHeaders, payload);
|
|
16023
|
+
}
|
|
16024
|
+
}
|
|
16025
|
+
|
|
15742
16026
|
class Locale {
|
|
15743
16027
|
constructor(client) {
|
|
15744
16028
|
this.client = client;
|
|
@@ -16063,6 +16347,47 @@ class Manager {
|
|
|
16063
16347
|
};
|
|
16064
16348
|
return this.client.call('delete', uri, apiHeaders, payload);
|
|
16065
16349
|
}
|
|
16350
|
+
updateOrganizationStatus(paramsOrFirst, ...rest) {
|
|
16351
|
+
let params;
|
|
16352
|
+
if (paramsOrFirst &&
|
|
16353
|
+
typeof paramsOrFirst === 'object' &&
|
|
16354
|
+
!Array.isArray(paramsOrFirst)) {
|
|
16355
|
+
params = (paramsOrFirst || {});
|
|
16356
|
+
}
|
|
16357
|
+
else {
|
|
16358
|
+
params = {
|
|
16359
|
+
teamId: paramsOrFirst,
|
|
16360
|
+
status: rest[0],
|
|
16361
|
+
reason: rest[1],
|
|
16362
|
+
};
|
|
16363
|
+
}
|
|
16364
|
+
const teamId = params.teamId;
|
|
16365
|
+
const status = params.status;
|
|
16366
|
+
const reason = params.reason;
|
|
16367
|
+
if (typeof teamId === 'undefined') {
|
|
16368
|
+
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
16369
|
+
}
|
|
16370
|
+
if (typeof status === 'undefined') {
|
|
16371
|
+
throw new AppwriteException('Missing required parameter: "status"');
|
|
16372
|
+
}
|
|
16373
|
+
const apiPath = '/manager/organizations/status';
|
|
16374
|
+
const payload = {};
|
|
16375
|
+
if (typeof teamId !== 'undefined') {
|
|
16376
|
+
payload['teamId'] = teamId;
|
|
16377
|
+
}
|
|
16378
|
+
if (typeof status !== 'undefined') {
|
|
16379
|
+
payload['status'] = status;
|
|
16380
|
+
}
|
|
16381
|
+
if (typeof reason !== 'undefined') {
|
|
16382
|
+
payload['reason'] = reason;
|
|
16383
|
+
}
|
|
16384
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
16385
|
+
const apiHeaders = {
|
|
16386
|
+
'content-type': 'application/json',
|
|
16387
|
+
accept: 'application/json',
|
|
16388
|
+
};
|
|
16389
|
+
return this.client.call('patch', uri, apiHeaders, payload);
|
|
16390
|
+
}
|
|
16066
16391
|
updateUserStatus(paramsOrFirst, ...rest) {
|
|
16067
16392
|
let params;
|
|
16068
16393
|
if (paramsOrFirst &&
|
|
@@ -16166,9 +16491,11 @@ class Messaging {
|
|
|
16166
16491
|
cc: rest[5],
|
|
16167
16492
|
bcc: rest[6],
|
|
16168
16493
|
attachments: rest[7],
|
|
16169
|
-
|
|
16170
|
-
|
|
16171
|
-
|
|
16494
|
+
replyToEmail: rest[8],
|
|
16495
|
+
replyToName: rest[9],
|
|
16496
|
+
draft: rest[10],
|
|
16497
|
+
html: rest[11],
|
|
16498
|
+
scheduledAt: rest[12],
|
|
16172
16499
|
};
|
|
16173
16500
|
}
|
|
16174
16501
|
const messageId = params.messageId;
|
|
@@ -16180,6 +16507,8 @@ class Messaging {
|
|
|
16180
16507
|
const cc = params.cc;
|
|
16181
16508
|
const bcc = params.bcc;
|
|
16182
16509
|
const attachments = params.attachments;
|
|
16510
|
+
const replyToEmail = params.replyToEmail;
|
|
16511
|
+
const replyToName = params.replyToName;
|
|
16183
16512
|
const draft = params.draft;
|
|
16184
16513
|
const html = params.html;
|
|
16185
16514
|
const scheduledAt = params.scheduledAt;
|
|
@@ -16221,6 +16550,12 @@ class Messaging {
|
|
|
16221
16550
|
if (typeof attachments !== 'undefined') {
|
|
16222
16551
|
payload['attachments'] = attachments;
|
|
16223
16552
|
}
|
|
16553
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
16554
|
+
payload['replyToEmail'] = replyToEmail;
|
|
16555
|
+
}
|
|
16556
|
+
if (typeof replyToName !== 'undefined') {
|
|
16557
|
+
payload['replyToName'] = replyToName;
|
|
16558
|
+
}
|
|
16224
16559
|
if (typeof draft !== 'undefined') {
|
|
16225
16560
|
payload['draft'] = draft;
|
|
16226
16561
|
}
|
|
@@ -16257,8 +16592,10 @@ class Messaging {
|
|
|
16257
16592
|
html: rest[6],
|
|
16258
16593
|
cc: rest[7],
|
|
16259
16594
|
bcc: rest[8],
|
|
16260
|
-
|
|
16261
|
-
|
|
16595
|
+
replyToEmail: rest[9],
|
|
16596
|
+
replyToName: rest[10],
|
|
16597
|
+
scheduledAt: rest[11],
|
|
16598
|
+
attachments: rest[12],
|
|
16262
16599
|
};
|
|
16263
16600
|
}
|
|
16264
16601
|
const messageId = params.messageId;
|
|
@@ -16271,6 +16608,8 @@ class Messaging {
|
|
|
16271
16608
|
const html = params.html;
|
|
16272
16609
|
const cc = params.cc;
|
|
16273
16610
|
const bcc = params.bcc;
|
|
16611
|
+
const replyToEmail = params.replyToEmail;
|
|
16612
|
+
const replyToName = params.replyToName;
|
|
16274
16613
|
const scheduledAt = params.scheduledAt;
|
|
16275
16614
|
const attachments = params.attachments;
|
|
16276
16615
|
if (typeof messageId === 'undefined' || messageId === '') {
|
|
@@ -16305,6 +16644,12 @@ class Messaging {
|
|
|
16305
16644
|
if (typeof bcc !== 'undefined') {
|
|
16306
16645
|
payload['bcc'] = bcc;
|
|
16307
16646
|
}
|
|
16647
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
16648
|
+
payload['replyToEmail'] = replyToEmail;
|
|
16649
|
+
}
|
|
16650
|
+
if (typeof replyToName !== 'undefined') {
|
|
16651
|
+
payload['replyToName'] = replyToName;
|
|
16652
|
+
}
|
|
16308
16653
|
if (typeof scheduledAt !== 'undefined') {
|
|
16309
16654
|
payload['scheduledAt'] = scheduledAt;
|
|
16310
16655
|
}
|
|
@@ -25382,31 +25727,6 @@ class Organizations {
|
|
|
25382
25727
|
};
|
|
25383
25728
|
return this.client.call('get', uri, apiHeaders, payload);
|
|
25384
25729
|
}
|
|
25385
|
-
getEstimation(paramsOrFirst) {
|
|
25386
|
-
let params;
|
|
25387
|
-
if (paramsOrFirst &&
|
|
25388
|
-
typeof paramsOrFirst === 'object' &&
|
|
25389
|
-
!Array.isArray(paramsOrFirst)) {
|
|
25390
|
-
params = (paramsOrFirst || {});
|
|
25391
|
-
}
|
|
25392
|
-
else {
|
|
25393
|
-
params = {
|
|
25394
|
-
organizationId: paramsOrFirst,
|
|
25395
|
-
};
|
|
25396
|
-
}
|
|
25397
|
-
const organizationId = params.organizationId;
|
|
25398
|
-
if (typeof organizationId === 'undefined' || organizationId === '') {
|
|
25399
|
-
throw new AppwriteException('Missing required parameter: "organizationId"');
|
|
25400
|
-
}
|
|
25401
|
-
const apiPath = '/organizations/{organizationId}/estimations'.replace('{organizationId}', encodeURIComponent(String(organizationId)));
|
|
25402
|
-
const payload = {};
|
|
25403
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
25404
|
-
const apiHeaders = {
|
|
25405
|
-
'X-Appwrite-Project': this.client.config.project,
|
|
25406
|
-
accept: 'application/json',
|
|
25407
|
-
};
|
|
25408
|
-
return this.client.call('get', uri, apiHeaders, payload);
|
|
25409
|
-
}
|
|
25410
25730
|
estimationDeleteOrganization(paramsOrFirst) {
|
|
25411
25731
|
let params;
|
|
25412
25732
|
if (paramsOrFirst &&
|
|
@@ -28624,12 +28944,14 @@ class Project {
|
|
|
28624
28944
|
clientId: paramsOrFirst,
|
|
28625
28945
|
clientSecret: rest[0],
|
|
28626
28946
|
endpoint: rest[1],
|
|
28627
|
-
|
|
28947
|
+
prompt: rest[2],
|
|
28948
|
+
enabled: rest[3],
|
|
28628
28949
|
};
|
|
28629
28950
|
}
|
|
28630
28951
|
const clientId = params.clientId;
|
|
28631
28952
|
const clientSecret = params.clientSecret;
|
|
28632
28953
|
const endpoint = params.endpoint;
|
|
28954
|
+
const prompt = params.prompt;
|
|
28633
28955
|
const enabled = params.enabled;
|
|
28634
28956
|
const apiPath = '/project/oauth2/auth0';
|
|
28635
28957
|
const payload = {};
|
|
@@ -28642,6 +28964,9 @@ class Project {
|
|
|
28642
28964
|
if (typeof endpoint !== 'undefined') {
|
|
28643
28965
|
payload['endpoint'] = endpoint;
|
|
28644
28966
|
}
|
|
28967
|
+
if (typeof prompt !== 'undefined') {
|
|
28968
|
+
payload['prompt'] = prompt;
|
|
28969
|
+
}
|
|
28645
28970
|
if (typeof enabled !== 'undefined') {
|
|
28646
28971
|
payload['enabled'] = enabled;
|
|
28647
28972
|
}
|
|
@@ -28929,11 +29254,13 @@ class Project {
|
|
|
28929
29254
|
params = {
|
|
28930
29255
|
clientId: paramsOrFirst,
|
|
28931
29256
|
clientSecret: rest[0],
|
|
28932
|
-
|
|
29257
|
+
prompt: rest[1],
|
|
29258
|
+
enabled: rest[2],
|
|
28933
29259
|
};
|
|
28934
29260
|
}
|
|
28935
29261
|
const clientId = params.clientId;
|
|
28936
29262
|
const clientSecret = params.clientSecret;
|
|
29263
|
+
const prompt = params.prompt;
|
|
28937
29264
|
const enabled = params.enabled;
|
|
28938
29265
|
const apiPath = '/project/oauth2/discord';
|
|
28939
29266
|
const payload = {};
|
|
@@ -28943,6 +29270,9 @@ class Project {
|
|
|
28943
29270
|
if (typeof clientSecret !== 'undefined') {
|
|
28944
29271
|
payload['clientSecret'] = clientSecret;
|
|
28945
29272
|
}
|
|
29273
|
+
if (typeof prompt !== 'undefined') {
|
|
29274
|
+
payload['prompt'] = prompt;
|
|
29275
|
+
}
|
|
28946
29276
|
if (typeof enabled !== 'undefined') {
|
|
28947
29277
|
payload['enabled'] = enabled;
|
|
28948
29278
|
}
|
|
@@ -29193,11 +29523,13 @@ class Project {
|
|
|
29193
29523
|
params = {
|
|
29194
29524
|
clientId: paramsOrFirst,
|
|
29195
29525
|
clientSecret: rest[0],
|
|
29196
|
-
|
|
29526
|
+
prompt: rest[1],
|
|
29527
|
+
enabled: rest[2],
|
|
29197
29528
|
};
|
|
29198
29529
|
}
|
|
29199
29530
|
const clientId = params.clientId;
|
|
29200
29531
|
const clientSecret = params.clientSecret;
|
|
29532
|
+
const prompt = params.prompt;
|
|
29201
29533
|
const enabled = params.enabled;
|
|
29202
29534
|
const apiPath = '/project/oauth2/github';
|
|
29203
29535
|
const payload = {};
|
|
@@ -29207,6 +29539,9 @@ class Project {
|
|
|
29207
29539
|
if (typeof clientSecret !== 'undefined') {
|
|
29208
29540
|
payload['clientSecret'] = clientSecret;
|
|
29209
29541
|
}
|
|
29542
|
+
if (typeof prompt !== 'undefined') {
|
|
29543
|
+
payload['prompt'] = prompt;
|
|
29544
|
+
}
|
|
29210
29545
|
if (typeof enabled !== 'undefined') {
|
|
29211
29546
|
payload['enabled'] = enabled;
|
|
29212
29547
|
}
|
|
@@ -29361,11 +29696,13 @@ class Project {
|
|
|
29361
29696
|
params = {
|
|
29362
29697
|
clientId: paramsOrFirst,
|
|
29363
29698
|
clientSecret: rest[0],
|
|
29364
|
-
|
|
29699
|
+
prompt: rest[1],
|
|
29700
|
+
enabled: rest[2],
|
|
29365
29701
|
};
|
|
29366
29702
|
}
|
|
29367
29703
|
const clientId = params.clientId;
|
|
29368
29704
|
const clientSecret = params.clientSecret;
|
|
29705
|
+
const prompt = params.prompt;
|
|
29369
29706
|
const enabled = params.enabled;
|
|
29370
29707
|
const apiPath = '/project/oauth2/kakao';
|
|
29371
29708
|
const payload = {};
|
|
@@ -29375,6 +29712,9 @@ class Project {
|
|
|
29375
29712
|
if (typeof clientSecret !== 'undefined') {
|
|
29376
29713
|
payload['clientSecret'] = clientSecret;
|
|
29377
29714
|
}
|
|
29715
|
+
if (typeof prompt !== 'undefined') {
|
|
29716
|
+
payload['prompt'] = prompt;
|
|
29717
|
+
}
|
|
29378
29718
|
if (typeof enabled !== 'undefined') {
|
|
29379
29719
|
payload['enabled'] = enabled;
|
|
29380
29720
|
}
|
|
@@ -29520,12 +29860,14 @@ class Project {
|
|
|
29520
29860
|
applicationId: paramsOrFirst,
|
|
29521
29861
|
applicationSecret: rest[0],
|
|
29522
29862
|
tenant: rest[1],
|
|
29523
|
-
|
|
29863
|
+
prompt: rest[2],
|
|
29864
|
+
enabled: rest[3],
|
|
29524
29865
|
};
|
|
29525
29866
|
}
|
|
29526
29867
|
const applicationId = params.applicationId;
|
|
29527
29868
|
const applicationSecret = params.applicationSecret;
|
|
29528
29869
|
const tenant = params.tenant;
|
|
29870
|
+
const prompt = params.prompt;
|
|
29529
29871
|
const enabled = params.enabled;
|
|
29530
29872
|
const apiPath = '/project/oauth2/microsoft';
|
|
29531
29873
|
const payload = {};
|
|
@@ -29538,6 +29880,9 @@ class Project {
|
|
|
29538
29880
|
if (typeof tenant !== 'undefined') {
|
|
29539
29881
|
payload['tenant'] = tenant;
|
|
29540
29882
|
}
|
|
29883
|
+
if (typeof prompt !== 'undefined') {
|
|
29884
|
+
payload['prompt'] = prompt;
|
|
29885
|
+
}
|
|
29541
29886
|
if (typeof enabled !== 'undefined') {
|
|
29542
29887
|
payload['enabled'] = enabled;
|
|
29543
29888
|
}
|
|
@@ -29667,13 +30012,15 @@ class Project {
|
|
|
29667
30012
|
clientSecret: rest[0],
|
|
29668
30013
|
domain: rest[1],
|
|
29669
30014
|
authorizationServerId: rest[2],
|
|
29670
|
-
|
|
30015
|
+
prompt: rest[3],
|
|
30016
|
+
enabled: rest[4],
|
|
29671
30017
|
};
|
|
29672
30018
|
}
|
|
29673
30019
|
const clientId = params.clientId;
|
|
29674
30020
|
const clientSecret = params.clientSecret;
|
|
29675
30021
|
const domain = params.domain;
|
|
29676
30022
|
const authorizationServerId = params.authorizationServerId;
|
|
30023
|
+
const prompt = params.prompt;
|
|
29677
30024
|
const enabled = params.enabled;
|
|
29678
30025
|
const apiPath = '/project/oauth2/okta';
|
|
29679
30026
|
const payload = {};
|
|
@@ -29689,6 +30036,9 @@ class Project {
|
|
|
29689
30036
|
if (typeof authorizationServerId !== 'undefined') {
|
|
29690
30037
|
payload['authorizationServerId'] = authorizationServerId;
|
|
29691
30038
|
}
|
|
30039
|
+
if (typeof prompt !== 'undefined') {
|
|
30040
|
+
payload['prompt'] = prompt;
|
|
30041
|
+
}
|
|
29692
30042
|
if (typeof enabled !== 'undefined') {
|
|
29693
30043
|
payload['enabled'] = enabled;
|
|
29694
30044
|
}
|
|
@@ -29860,11 +30210,13 @@ class Project {
|
|
|
29860
30210
|
params = {
|
|
29861
30211
|
customerKey: paramsOrFirst,
|
|
29862
30212
|
customerSecret: rest[0],
|
|
29863
|
-
|
|
30213
|
+
prompt: rest[1],
|
|
30214
|
+
enabled: rest[2],
|
|
29864
30215
|
};
|
|
29865
30216
|
}
|
|
29866
30217
|
const customerKey = params.customerKey;
|
|
29867
30218
|
const customerSecret = params.customerSecret;
|
|
30219
|
+
const prompt = params.prompt;
|
|
29868
30220
|
const enabled = params.enabled;
|
|
29869
30221
|
const apiPath = '/project/oauth2/salesforce';
|
|
29870
30222
|
const payload = {};
|
|
@@ -29874,6 +30226,9 @@ class Project {
|
|
|
29874
30226
|
if (typeof customerSecret !== 'undefined') {
|
|
29875
30227
|
payload['customerSecret'] = customerSecret;
|
|
29876
30228
|
}
|
|
30229
|
+
if (typeof prompt !== 'undefined') {
|
|
30230
|
+
payload['prompt'] = prompt;
|
|
30231
|
+
}
|
|
29877
30232
|
if (typeof enabled !== 'undefined') {
|
|
29878
30233
|
payload['enabled'] = enabled;
|
|
29879
30234
|
}
|
|
@@ -30304,11 +30659,13 @@ class Project {
|
|
|
30304
30659
|
params = {
|
|
30305
30660
|
clientId: paramsOrFirst,
|
|
30306
30661
|
clientSecret: rest[0],
|
|
30307
|
-
|
|
30662
|
+
prompt: rest[1],
|
|
30663
|
+
enabled: rest[2],
|
|
30308
30664
|
};
|
|
30309
30665
|
}
|
|
30310
30666
|
const clientId = params.clientId;
|
|
30311
30667
|
const clientSecret = params.clientSecret;
|
|
30668
|
+
const prompt = params.prompt;
|
|
30312
30669
|
const enabled = params.enabled;
|
|
30313
30670
|
const apiPath = '/project/oauth2/zoho';
|
|
30314
30671
|
const payload = {};
|
|
@@ -30318,6 +30675,9 @@ class Project {
|
|
|
30318
30675
|
if (typeof clientSecret !== 'undefined') {
|
|
30319
30676
|
payload['clientSecret'] = clientSecret;
|
|
30320
30677
|
}
|
|
30678
|
+
if (typeof prompt !== 'undefined') {
|
|
30679
|
+
payload['prompt'] = prompt;
|
|
30680
|
+
}
|
|
30321
30681
|
if (typeof enabled !== 'undefined') {
|
|
30322
30682
|
payload['enabled'] = enabled;
|
|
30323
30683
|
}
|
|
@@ -37405,6 +37765,55 @@ class TablesDB {
|
|
|
37405
37765
|
};
|
|
37406
37766
|
return this.client.call('post', uri, apiHeaders, payload);
|
|
37407
37767
|
}
|
|
37768
|
+
updateRelationshipColumn(paramsOrFirst, ...rest) {
|
|
37769
|
+
let params;
|
|
37770
|
+
if (paramsOrFirst &&
|
|
37771
|
+
typeof paramsOrFirst === 'object' &&
|
|
37772
|
+
!Array.isArray(paramsOrFirst)) {
|
|
37773
|
+
params = (paramsOrFirst || {});
|
|
37774
|
+
}
|
|
37775
|
+
else {
|
|
37776
|
+
params = {
|
|
37777
|
+
databaseId: paramsOrFirst,
|
|
37778
|
+
tableId: rest[0],
|
|
37779
|
+
key: rest[1],
|
|
37780
|
+
onDelete: rest[2],
|
|
37781
|
+
newKey: rest[3],
|
|
37782
|
+
};
|
|
37783
|
+
}
|
|
37784
|
+
const databaseId = params.databaseId;
|
|
37785
|
+
const tableId = params.tableId;
|
|
37786
|
+
const key = params.key;
|
|
37787
|
+
const onDelete = params.onDelete;
|
|
37788
|
+
const newKey = params.newKey;
|
|
37789
|
+
if (typeof databaseId === 'undefined' || databaseId === '') {
|
|
37790
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
37791
|
+
}
|
|
37792
|
+
if (typeof tableId === 'undefined' || tableId === '') {
|
|
37793
|
+
throw new AppwriteException('Missing required parameter: "tableId"');
|
|
37794
|
+
}
|
|
37795
|
+
if (typeof key === 'undefined' || key === '') {
|
|
37796
|
+
throw new AppwriteException('Missing required parameter: "key"');
|
|
37797
|
+
}
|
|
37798
|
+
const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/relationship/{key}'
|
|
37799
|
+
.replace('{databaseId}', encodeURIComponent(String(databaseId)))
|
|
37800
|
+
.replace('{tableId}', encodeURIComponent(String(tableId)))
|
|
37801
|
+
.replace('{key}', encodeURIComponent(String(key)));
|
|
37802
|
+
const payload = {};
|
|
37803
|
+
if (typeof onDelete !== 'undefined') {
|
|
37804
|
+
payload['onDelete'] = onDelete;
|
|
37805
|
+
}
|
|
37806
|
+
if (typeof newKey !== 'undefined') {
|
|
37807
|
+
payload['newKey'] = newKey;
|
|
37808
|
+
}
|
|
37809
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
37810
|
+
const apiHeaders = {
|
|
37811
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
37812
|
+
'content-type': 'application/json',
|
|
37813
|
+
accept: 'application/json',
|
|
37814
|
+
};
|
|
37815
|
+
return this.client.call('patch', uri, apiHeaders, payload);
|
|
37816
|
+
}
|
|
37408
37817
|
createStringColumn(paramsOrFirst, ...rest) {
|
|
37409
37818
|
let params;
|
|
37410
37819
|
if (paramsOrFirst &&
|
|
@@ -37999,55 +38408,6 @@ class TablesDB {
|
|
|
37999
38408
|
};
|
|
38000
38409
|
return this.client.call('delete', uri, apiHeaders, payload);
|
|
38001
38410
|
}
|
|
38002
|
-
updateRelationshipColumn(paramsOrFirst, ...rest) {
|
|
38003
|
-
let params;
|
|
38004
|
-
if (paramsOrFirst &&
|
|
38005
|
-
typeof paramsOrFirst === 'object' &&
|
|
38006
|
-
!Array.isArray(paramsOrFirst)) {
|
|
38007
|
-
params = (paramsOrFirst || {});
|
|
38008
|
-
}
|
|
38009
|
-
else {
|
|
38010
|
-
params = {
|
|
38011
|
-
databaseId: paramsOrFirst,
|
|
38012
|
-
tableId: rest[0],
|
|
38013
|
-
key: rest[1],
|
|
38014
|
-
onDelete: rest[2],
|
|
38015
|
-
newKey: rest[3],
|
|
38016
|
-
};
|
|
38017
|
-
}
|
|
38018
|
-
const databaseId = params.databaseId;
|
|
38019
|
-
const tableId = params.tableId;
|
|
38020
|
-
const key = params.key;
|
|
38021
|
-
const onDelete = params.onDelete;
|
|
38022
|
-
const newKey = params.newKey;
|
|
38023
|
-
if (typeof databaseId === 'undefined' || databaseId === '') {
|
|
38024
|
-
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
38025
|
-
}
|
|
38026
|
-
if (typeof tableId === 'undefined' || tableId === '') {
|
|
38027
|
-
throw new AppwriteException('Missing required parameter: "tableId"');
|
|
38028
|
-
}
|
|
38029
|
-
if (typeof key === 'undefined' || key === '') {
|
|
38030
|
-
throw new AppwriteException('Missing required parameter: "key"');
|
|
38031
|
-
}
|
|
38032
|
-
const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}/relationship'
|
|
38033
|
-
.replace('{databaseId}', encodeURIComponent(String(databaseId)))
|
|
38034
|
-
.replace('{tableId}', encodeURIComponent(String(tableId)))
|
|
38035
|
-
.replace('{key}', encodeURIComponent(String(key)));
|
|
38036
|
-
const payload = {};
|
|
38037
|
-
if (typeof onDelete !== 'undefined') {
|
|
38038
|
-
payload['onDelete'] = onDelete;
|
|
38039
|
-
}
|
|
38040
|
-
if (typeof newKey !== 'undefined') {
|
|
38041
|
-
payload['newKey'] = newKey;
|
|
38042
|
-
}
|
|
38043
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
38044
|
-
const apiHeaders = {
|
|
38045
|
-
'X-Appwrite-Project': this.client.config.project,
|
|
38046
|
-
'content-type': 'application/json',
|
|
38047
|
-
accept: 'application/json',
|
|
38048
|
-
};
|
|
38049
|
-
return this.client.call('patch', uri, apiHeaders, payload);
|
|
38050
|
-
}
|
|
38051
38411
|
listIndexes(paramsOrFirst, ...rest) {
|
|
38052
38412
|
let params;
|
|
38053
38413
|
if (paramsOrFirst &&
|
|
@@ -45288,6 +45648,571 @@ class Realtime {
|
|
|
45288
45648
|
}
|
|
45289
45649
|
}
|
|
45290
45650
|
|
|
45651
|
+
// Fixed connection tuning — not exposed as options.
|
|
45652
|
+
const KEEP_ALIVE_SECONDS = 60;
|
|
45653
|
+
const RECONNECT_PERIOD_MS = 2000;
|
|
45654
|
+
/**
|
|
45655
|
+
* Appwrite native push service — the Realtime analog over an MQTT broker, without
|
|
45656
|
+
* FCM or APNS. In the browser the transport is MQTT 5 over WebSocket: while the page is
|
|
45657
|
+
* open the connection stays up and each message is handed to your callback, and a
|
|
45658
|
+
* subscription may also opt into a browser notification per message.
|
|
45659
|
+
*
|
|
45660
|
+
* The connection has no tunables — it always keeps its session (clean start off) so the
|
|
45661
|
+
* broker can redeliver missed messages, and reliability is chosen per subscription via
|
|
45662
|
+
* `retry`. `subscribe` opens the connection lazily and returns a
|
|
45663
|
+
* {@link PushSubscription} handle (unlike Realtime's bare unsubscribe callable — Push
|
|
45664
|
+
* carries per-subscription state). The credential is read off the client — set a JWT or
|
|
45665
|
+
* session on it (`Client.setJWT` / `Client.setSession`), the same way every other service
|
|
45666
|
+
* reads auth.
|
|
45667
|
+
*
|
|
45668
|
+
* const client = new Client().setEndpoint(...).setProject(...).setJWT(jwt);
|
|
45669
|
+
* const push = new Push(client);
|
|
45670
|
+
* const sub = await push.subscribe('user/123/#', (m) =>
|
|
45671
|
+
* console.log(m.topic, m.data),
|
|
45672
|
+
* );
|
|
45673
|
+
* // sub.update({ background: true }); sub.unsubscribe();
|
|
45674
|
+
*/
|
|
45675
|
+
class Push extends Service {
|
|
45676
|
+
constructor(client) {
|
|
45677
|
+
super(client);
|
|
45678
|
+
this.mqtt = null;
|
|
45679
|
+
this.connecting = null;
|
|
45680
|
+
/** Set once the first CONNACK lands, so 'connect' events after are reconnects. */
|
|
45681
|
+
this.everConnected = false;
|
|
45682
|
+
/** Errors already handed to onError, so one failure is reported once. */
|
|
45683
|
+
this.reported = new WeakSet();
|
|
45684
|
+
/** mqtt.js connect errors mapped to the error handed out for them (see connectError). */
|
|
45685
|
+
this.connectErrors = new WeakMap();
|
|
45686
|
+
/** True while the first connect is in flight: its errors go to the waiting caller. */
|
|
45687
|
+
this.opening = false;
|
|
45688
|
+
// Local id -> subscription state. The id is never sent to the broker; it only lets
|
|
45689
|
+
// the same topic carry more than one callback (each with its own options).
|
|
45690
|
+
/**
|
|
45691
|
+
* The client id when the credential names no user (and none was set): random, but kept for
|
|
45692
|
+
* this instance so reconnects resume the same broker session.
|
|
45693
|
+
*/
|
|
45694
|
+
this.fallbackClientId = randomId();
|
|
45695
|
+
this.subscriptions = new Map();
|
|
45696
|
+
}
|
|
45697
|
+
// The broker subscription for a filter uses the highest QoS any local subscription on
|
|
45698
|
+
// it wants, so a QoS-0 subscription never downgrades a QoS-1 one sharing the filter.
|
|
45699
|
+
effectiveQos(filter) {
|
|
45700
|
+
for (const sub of this.subscriptions.values()) {
|
|
45701
|
+
if (sub.topic === filter && sub.qos === 1) {
|
|
45702
|
+
return 1;
|
|
45703
|
+
}
|
|
45704
|
+
}
|
|
45705
|
+
return 0;
|
|
45706
|
+
}
|
|
45707
|
+
/** Register a callback invoked when the connection opens (CONNACK success). */
|
|
45708
|
+
onOpen(callback) {
|
|
45709
|
+
this.onOpenCb = callback;
|
|
45710
|
+
return this;
|
|
45711
|
+
}
|
|
45712
|
+
/** Register a callback invoked when the connection closes. */
|
|
45713
|
+
onClose(callback) {
|
|
45714
|
+
this.onCloseCb = callback;
|
|
45715
|
+
return this;
|
|
45716
|
+
}
|
|
45717
|
+
/** Register a callback invoked on a connection error. */
|
|
45718
|
+
onError(callback) {
|
|
45719
|
+
this.onErrorCb = callback;
|
|
45720
|
+
return this;
|
|
45721
|
+
}
|
|
45722
|
+
/**
|
|
45723
|
+
* The signed-in user's own topic, `users/<userId>`, for a topic-less subscribe. The id comes
|
|
45724
|
+
* from the credential the connection authenticates with: the JWT when one is set (never
|
|
45725
|
+
* the session, which could belong to a different user), else the session.
|
|
45726
|
+
*/
|
|
45727
|
+
userTopic() {
|
|
45728
|
+
const { jwt, session } = this.client.config;
|
|
45729
|
+
const userId = jwt ? userIdFromJwt(jwt) : userIdFromSession(session);
|
|
45730
|
+
if (!userId) {
|
|
45731
|
+
throw new Error('subscribe() without a topic needs a signed-in user: set a JWT or session on the client');
|
|
45732
|
+
}
|
|
45733
|
+
return `users/${userId}`;
|
|
45734
|
+
}
|
|
45735
|
+
/**
|
|
45736
|
+
* Hand an error to the onError callback, once per error. These errors happen outside any
|
|
45737
|
+
* call (reconnects, broker DISCONNECTs, background re-subscribes), so they are never
|
|
45738
|
+
* thrown, which would crash the app from inside mqtt.js: with no callback registered
|
|
45739
|
+
* they are logged, like Realtime does.
|
|
45740
|
+
*/
|
|
45741
|
+
report(error) {
|
|
45742
|
+
const err = toError(error);
|
|
45743
|
+
if (this.reported.has(err)) {
|
|
45744
|
+
return;
|
|
45745
|
+
}
|
|
45746
|
+
this.reported.add(err);
|
|
45747
|
+
if (!this.onErrorCb) {
|
|
45748
|
+
console.error('Appwrite Push error:', err);
|
|
45749
|
+
return;
|
|
45750
|
+
}
|
|
45751
|
+
try {
|
|
45752
|
+
this.onErrorCb(err);
|
|
45753
|
+
}
|
|
45754
|
+
catch (callbackError) {
|
|
45755
|
+
console.error('Appwrite Push onError threw:', callbackError);
|
|
45756
|
+
}
|
|
45757
|
+
}
|
|
45758
|
+
/**
|
|
45759
|
+
* For a call that fails to its caller: report the error to onError when a callback is
|
|
45760
|
+
* registered, then throw it to the caller, who can catch it.
|
|
45761
|
+
*/
|
|
45762
|
+
fail(error) {
|
|
45763
|
+
const err = toError(error);
|
|
45764
|
+
if (this.onErrorCb) {
|
|
45765
|
+
this.report(err);
|
|
45766
|
+
}
|
|
45767
|
+
throw err;
|
|
45768
|
+
}
|
|
45769
|
+
subscribe(topicsOrCallback_1, callbackOrOptions_1) {
|
|
45770
|
+
return __awaiter(this, arguments, void 0, function* (topicsOrCallback, callbackOrOptions, topicOptions = {}) {
|
|
45771
|
+
// Every failure reaches onError (when registered) and is thrown to the caller.
|
|
45772
|
+
try {
|
|
45773
|
+
return yield this.subscribeWith(topicsOrCallback, callbackOrOptions, topicOptions);
|
|
45774
|
+
}
|
|
45775
|
+
catch (err) {
|
|
45776
|
+
this.fail(err);
|
|
45777
|
+
}
|
|
45778
|
+
});
|
|
45779
|
+
}
|
|
45780
|
+
subscribeWith(topicsOrCallback, callbackOrOptions, topicOptions) {
|
|
45781
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45782
|
+
var _a, _b;
|
|
45783
|
+
// Topic-less form: subscribe(callback, options) targets the signed-in user's topic.
|
|
45784
|
+
const userForm = typeof topicsOrCallback === 'function';
|
|
45785
|
+
const topics = userForm ? this.userTopic() : topicsOrCallback;
|
|
45786
|
+
const callback = (userForm ? topicsOrCallback : callbackOrOptions);
|
|
45787
|
+
const options = (userForm ? (callbackOrOptions !== null && callbackOrOptions !== void 0 ? callbackOrOptions : {}) : topicOptions);
|
|
45788
|
+
const topicList = (Array.isArray(topics) ? topics : [topics]).map((topic) => topic.toString());
|
|
45789
|
+
// The user topic defaults to background delivery, like FCM/APNs; topics default off.
|
|
45790
|
+
const background = (_a = options.background) !== null && _a !== void 0 ? _a : userForm;
|
|
45791
|
+
const qos = ((_b = options.retry) !== null && _b !== void 0 ? _b : true) ? 1 : 0;
|
|
45792
|
+
if (background) {
|
|
45793
|
+
this.requestNotificationPermission();
|
|
45794
|
+
}
|
|
45795
|
+
const client = yield this.connect();
|
|
45796
|
+
const ids = [];
|
|
45797
|
+
const acks = [];
|
|
45798
|
+
for (const topic of topicList) {
|
|
45799
|
+
const id = randomId();
|
|
45800
|
+
ids.push(id);
|
|
45801
|
+
this.subscriptions.set(id, {
|
|
45802
|
+
topic,
|
|
45803
|
+
callback,
|
|
45804
|
+
background,
|
|
45805
|
+
title: options.title,
|
|
45806
|
+
qos,
|
|
45807
|
+
});
|
|
45808
|
+
acks.push(new Promise((resolve, reject) => {
|
|
45809
|
+
client.subscribe(topic, { qos: this.effectiveQos(topic) }, (err) => (err ? reject(err) : resolve()));
|
|
45810
|
+
}));
|
|
45811
|
+
}
|
|
45812
|
+
const unsubscribe = () => {
|
|
45813
|
+
var _a;
|
|
45814
|
+
// Filters whose removed sub was QoS 1: their effective QoS may now drop.
|
|
45815
|
+
const maybeDowngrade = new Set();
|
|
45816
|
+
for (const id of ids) {
|
|
45817
|
+
const entry = this.subscriptions.get(id);
|
|
45818
|
+
this.subscriptions.delete(id);
|
|
45819
|
+
if ((entry === null || entry === void 0 ? void 0 : entry.qos) === 1) {
|
|
45820
|
+
maybeDowngrade.add(entry.topic);
|
|
45821
|
+
}
|
|
45822
|
+
// Only unsubscribe the broker filter once its last local callback is gone.
|
|
45823
|
+
const stillUsed = [...this.subscriptions.values()].some((s) => s.topic === (entry === null || entry === void 0 ? void 0 : entry.topic));
|
|
45824
|
+
if (entry && this.mqtt && !stillUsed) {
|
|
45825
|
+
this.mqtt.unsubscribe(entry.topic, (err) => {
|
|
45826
|
+
if (err) {
|
|
45827
|
+
this.report(err);
|
|
45828
|
+
}
|
|
45829
|
+
});
|
|
45830
|
+
}
|
|
45831
|
+
}
|
|
45832
|
+
// A filter that lost its last QoS-1 sub but still has QoS-0 subs must be
|
|
45833
|
+
// re-SUBSCRIBEd at the lower QoS, or the broker keeps replaying to at-most-once subs.
|
|
45834
|
+
for (const filter of maybeDowngrade) {
|
|
45835
|
+
const stillUsed = [...this.subscriptions.values()].some((s) => s.topic === filter);
|
|
45836
|
+
if (stillUsed && this.effectiveQos(filter) === 0) {
|
|
45837
|
+
(_a = this.mqtt) === null || _a === void 0 ? void 0 : _a.subscribe(filter, { qos: 0 }, (err) => {
|
|
45838
|
+
if (err) {
|
|
45839
|
+
this.report(err);
|
|
45840
|
+
}
|
|
45841
|
+
});
|
|
45842
|
+
}
|
|
45843
|
+
}
|
|
45844
|
+
if (this.subscriptions.size === 0) {
|
|
45845
|
+
this.close();
|
|
45846
|
+
}
|
|
45847
|
+
};
|
|
45848
|
+
// If any topic's subscribe fails, roll this call's registrations back (and drop
|
|
45849
|
+
// any now-unused broker filter) so a failed subscribe leaks no callback, then rethrow.
|
|
45850
|
+
try {
|
|
45851
|
+
yield Promise.all(acks);
|
|
45852
|
+
}
|
|
45853
|
+
catch (err) {
|
|
45854
|
+
unsubscribe();
|
|
45855
|
+
throw err;
|
|
45856
|
+
}
|
|
45857
|
+
const update = (next) => {
|
|
45858
|
+
var _a;
|
|
45859
|
+
const enabling = next.background === true;
|
|
45860
|
+
const changedFilters = new Set();
|
|
45861
|
+
// Remember the pre-update QoS per id so a rejected re-SUBSCRIBE can be rolled back.
|
|
45862
|
+
const previous = new Map();
|
|
45863
|
+
for (const id of ids) {
|
|
45864
|
+
const entry = this.subscriptions.get(id);
|
|
45865
|
+
if (!entry) {
|
|
45866
|
+
continue;
|
|
45867
|
+
}
|
|
45868
|
+
if (next.background !== undefined) {
|
|
45869
|
+
entry.background = next.background;
|
|
45870
|
+
}
|
|
45871
|
+
if (next.title !== undefined) {
|
|
45872
|
+
entry.title = next.title;
|
|
45873
|
+
}
|
|
45874
|
+
if (next.retry !== undefined) {
|
|
45875
|
+
const q = next.retry ? 1 : 0;
|
|
45876
|
+
if (q !== entry.qos) {
|
|
45877
|
+
previous.set(id, entry.qos);
|
|
45878
|
+
entry.qos = q;
|
|
45879
|
+
changedFilters.add(entry.topic);
|
|
45880
|
+
}
|
|
45881
|
+
}
|
|
45882
|
+
}
|
|
45883
|
+
if (enabling) {
|
|
45884
|
+
this.requestNotificationPermission();
|
|
45885
|
+
}
|
|
45886
|
+
// Re-SUBSCRIBE the affected filters at their new effective QoS (a SUBSCRIBE to an
|
|
45887
|
+
// existing filter just updates its QoS — no unsubscribe gap). If the broker rejects
|
|
45888
|
+
// it, the old subscription still stands, so restore the local QoS to match and
|
|
45889
|
+
// surface the error rather than silently assuming the change took effect.
|
|
45890
|
+
for (const filter of changedFilters) {
|
|
45891
|
+
(_a = this.mqtt) === null || _a === void 0 ? void 0 : _a.subscribe(filter, { qos: this.effectiveQos(filter) }, (err) => {
|
|
45892
|
+
if (!err) {
|
|
45893
|
+
return;
|
|
45894
|
+
}
|
|
45895
|
+
for (const [id, q] of previous) {
|
|
45896
|
+
const entry = this.subscriptions.get(id);
|
|
45897
|
+
if (entry && entry.topic === filter) {
|
|
45898
|
+
entry.qos = q;
|
|
45899
|
+
}
|
|
45900
|
+
}
|
|
45901
|
+
this.report(err);
|
|
45902
|
+
});
|
|
45903
|
+
}
|
|
45904
|
+
};
|
|
45905
|
+
return { unsubscribe, update };
|
|
45906
|
+
});
|
|
45907
|
+
}
|
|
45908
|
+
/** Tear down the connection and drop all active subscriptions. */
|
|
45909
|
+
close() {
|
|
45910
|
+
if (this.mqtt) {
|
|
45911
|
+
this.mqtt.end(true);
|
|
45912
|
+
this.mqtt = null;
|
|
45913
|
+
}
|
|
45914
|
+
this.connecting = null;
|
|
45915
|
+
this.everConnected = false;
|
|
45916
|
+
this.subscriptions.clear();
|
|
45917
|
+
}
|
|
45918
|
+
/**
|
|
45919
|
+
* Re-register every active subscription. Called on each reconnect so a client that
|
|
45920
|
+
* reconnects with a fresh (or cleared) session does not silently stop receiving;
|
|
45921
|
+
* re-subscribing an existing filter is idempotent.
|
|
45922
|
+
*/
|
|
45923
|
+
resubscribeAll() {
|
|
45924
|
+
const client = this.mqtt;
|
|
45925
|
+
if (!client) {
|
|
45926
|
+
return;
|
|
45927
|
+
}
|
|
45928
|
+
const filters = new Set([...this.subscriptions.values()].map((s) => s.topic));
|
|
45929
|
+
for (const filter of filters) {
|
|
45930
|
+
client.subscribe(filter, { qos: this.effectiveQos(filter) }, (err) => {
|
|
45931
|
+
if (err) {
|
|
45932
|
+
this.report(err);
|
|
45933
|
+
}
|
|
45934
|
+
});
|
|
45935
|
+
}
|
|
45936
|
+
}
|
|
45937
|
+
// --- internals ---
|
|
45938
|
+
connect() {
|
|
45939
|
+
if (this.mqtt) {
|
|
45940
|
+
return Promise.resolve(this.mqtt);
|
|
45941
|
+
}
|
|
45942
|
+
if (!this.connecting) {
|
|
45943
|
+
this.connecting = this.open();
|
|
45944
|
+
// A failed open must not poison future attempts — clear the cached
|
|
45945
|
+
// in-flight promise so a later subscribe/publish can retry.
|
|
45946
|
+
this.connecting.catch(() => {
|
|
45947
|
+
this.connecting = null;
|
|
45948
|
+
});
|
|
45949
|
+
}
|
|
45950
|
+
return this.connecting.then(() => this.mqtt);
|
|
45951
|
+
}
|
|
45952
|
+
endpointUrl() {
|
|
45953
|
+
// The push endpoint set on the client (Client.setPushEndpoint) wins.
|
|
45954
|
+
if (this.client.config.endpointPush !== '') {
|
|
45955
|
+
return this.client.config.endpointPush;
|
|
45956
|
+
}
|
|
45957
|
+
// Otherwise default to a `push.` host on the regular API endpoint (not the
|
|
45958
|
+
// independently-configurable realtime endpoint), scheme switched to ws/wss.
|
|
45959
|
+
const wsEndpoint = this.client.config.endpoint
|
|
45960
|
+
.replace('https://', 'wss://')
|
|
45961
|
+
.replace('http://', 'ws://');
|
|
45962
|
+
// Prefix the host with `push.` (scheme://host/path -> scheme://push.host/path).
|
|
45963
|
+
const separator = '://';
|
|
45964
|
+
const at = wsEndpoint.indexOf(separator);
|
|
45965
|
+
return at === -1
|
|
45966
|
+
? wsEndpoint
|
|
45967
|
+
: `${wsEndpoint.slice(0, at + separator.length)}push.${wsEndpoint.slice(at + separator.length)}`;
|
|
45968
|
+
}
|
|
45969
|
+
open() {
|
|
45970
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45971
|
+
var _a;
|
|
45972
|
+
// Read the credential set on the client (via Client.setJWT / setSession).
|
|
45973
|
+
let authMethod;
|
|
45974
|
+
let credential;
|
|
45975
|
+
if (this.client.config.jwt) {
|
|
45976
|
+
authMethod = 'appwrite-jwt';
|
|
45977
|
+
credential = this.client.config.jwt;
|
|
45978
|
+
}
|
|
45979
|
+
else if (this.client.config.session) {
|
|
45980
|
+
authMethod = 'appwrite-session';
|
|
45981
|
+
credential = this.client.config.session;
|
|
45982
|
+
}
|
|
45983
|
+
else {
|
|
45984
|
+
throw new Error('No credential set on the client; call Client.setJWT() or Client.setSession() first.');
|
|
45985
|
+
}
|
|
45986
|
+
const project = (_a = this.client.config.project) !== null && _a !== void 0 ? _a : '';
|
|
45987
|
+
// Client id, when the app did not set one with Client.setPushClientId(). Unlike the
|
|
45988
|
+
// native SDKs (which send an empty id and let the broker derive a stable one), mqtt.js
|
|
45989
|
+
// rejects an empty id with clean start off, so derive a stable per-user id here from the
|
|
45990
|
+
// credential this connection authenticates with: the JWT's userId, or the session's user
|
|
45991
|
+
// id. A stable id keeps the broker's replay cursor resuming across reloads. The
|
|
45992
|
+
// credential itself is never used as the id.
|
|
45993
|
+
const clientId = this.client.config.pushClientId ||
|
|
45994
|
+
(authMethod === 'appwrite-jwt'
|
|
45995
|
+
? userIdFromJwt(credential)
|
|
45996
|
+
: userIdFromSession(credential)) ||
|
|
45997
|
+
this.fallbackClientId;
|
|
45998
|
+
const options = {
|
|
45999
|
+
clientId,
|
|
46000
|
+
protocolVersion: 5,
|
|
46001
|
+
clean: false, // always keep the session so the broker can replay QoS-1 topics
|
|
46002
|
+
keepalive: KEEP_ALIVE_SECONDS,
|
|
46003
|
+
reconnectPeriod: RECONNECT_PERIOD_MS,
|
|
46004
|
+
manualConnect: true,
|
|
46005
|
+
// Enhanced auth carried in CONNECT properties.
|
|
46006
|
+
properties: {
|
|
46007
|
+
authenticationMethod: authMethod,
|
|
46008
|
+
authenticationData: Buffer.from(credential),
|
|
46009
|
+
userProperties: { projectId: project },
|
|
46010
|
+
},
|
|
46011
|
+
};
|
|
46012
|
+
const client = mqtt.connect(this.endpointUrl(), options);
|
|
46013
|
+
this.mqtt = client;
|
|
46014
|
+
client.on('message', (_topic, _payload, packet) => {
|
|
46015
|
+
this.dispatch(packet).catch((err) => this.report(err));
|
|
46016
|
+
});
|
|
46017
|
+
// Persistent lifecycle listeners. Re-register every subscription on reconnect
|
|
46018
|
+
// (harmless if the broker resumed our session), and surface the lifecycle to the
|
|
46019
|
+
// caller's onOpen/onClose/onError hooks.
|
|
46020
|
+
client.on('connect', () => {
|
|
46021
|
+
var _a;
|
|
46022
|
+
if (this.everConnected) {
|
|
46023
|
+
this.resubscribeAll();
|
|
46024
|
+
}
|
|
46025
|
+
this.everConnected = true;
|
|
46026
|
+
(_a = this.onOpenCb) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
46027
|
+
});
|
|
46028
|
+
client.on('close', () => { var _a; return (_a = this.onCloseCb) === null || _a === void 0 ? void 0 : _a.call(this); });
|
|
46029
|
+
// The broker explains a refused CONNECT (CONNACK) or a server-initiated DISCONNECT
|
|
46030
|
+
// with an MQTT 5 Reason String. mqtt.js reports only the reason code, so capture the
|
|
46031
|
+
// string off the packet (packetreceive fires before mqtt.js handles it) and hand it
|
|
46032
|
+
// to onError as the error message.
|
|
46033
|
+
let refusedReason;
|
|
46034
|
+
client.on('packetreceive', (packet) => {
|
|
46035
|
+
var _a, _b;
|
|
46036
|
+
if (packet.cmd === 'connack') {
|
|
46037
|
+
refusedReason =
|
|
46038
|
+
((_a = packet.reasonCode) !== null && _a !== void 0 ? _a : 0) !== 0
|
|
46039
|
+
? (_b = packet.properties) === null || _b === void 0 ? void 0 : _b.reasonString
|
|
46040
|
+
: undefined;
|
|
46041
|
+
}
|
|
46042
|
+
});
|
|
46043
|
+
client.on('error', (err) => {
|
|
46044
|
+
const error = this.connectError(err, refusedReason);
|
|
46045
|
+
// While the first connect is pending its caller receives the error (and reports it
|
|
46046
|
+
// through fail()); afterwards, e.g. on reconnect, report it here.
|
|
46047
|
+
if (!this.opening) {
|
|
46048
|
+
this.report(error);
|
|
46049
|
+
}
|
|
46050
|
+
});
|
|
46051
|
+
client.on('disconnect', (packet) => {
|
|
46052
|
+
var _a, _b, _c;
|
|
46053
|
+
if (((_a = packet.reasonCode) !== null && _a !== void 0 ? _a : 0) !== 0) {
|
|
46054
|
+
this.report(new Error((_c = (_b = packet.properties) === null || _b === void 0 ? void 0 : _b.reasonString) !== null && _c !== void 0 ? _c : `Disconnected by the broker (reason ${packet.reasonCode})`));
|
|
46055
|
+
}
|
|
46056
|
+
});
|
|
46057
|
+
this.opening = true;
|
|
46058
|
+
yield new Promise((resolve, reject) => {
|
|
46059
|
+
const onConnect = (packet) => {
|
|
46060
|
+
var _a, _b;
|
|
46061
|
+
cleanup();
|
|
46062
|
+
const rc = (_b = (_a = packet.reasonCode) !== null && _a !== void 0 ? _a : packet.returnCode) !== null && _b !== void 0 ? _b : 0;
|
|
46063
|
+
if (rc !== 0) {
|
|
46064
|
+
this.close();
|
|
46065
|
+
reject(new Error(refusedReason !== null && refusedReason !== void 0 ? refusedReason : `MQTT authentication failed (CONNACK reason ${rc})`));
|
|
46066
|
+
}
|
|
46067
|
+
else {
|
|
46068
|
+
resolve();
|
|
46069
|
+
}
|
|
46070
|
+
};
|
|
46071
|
+
const onError = (err) => {
|
|
46072
|
+
cleanup();
|
|
46073
|
+
this.close();
|
|
46074
|
+
reject(this.connectError(err, refusedReason));
|
|
46075
|
+
};
|
|
46076
|
+
const cleanup = () => {
|
|
46077
|
+
this.opening = false;
|
|
46078
|
+
client.removeListener('connect', onConnect);
|
|
46079
|
+
client.removeListener('error', onError);
|
|
46080
|
+
};
|
|
46081
|
+
client.on('connect', onConnect);
|
|
46082
|
+
client.on('error', onError);
|
|
46083
|
+
client.connect();
|
|
46084
|
+
});
|
|
46085
|
+
});
|
|
46086
|
+
}
|
|
46087
|
+
/**
|
|
46088
|
+
* The error for a failed connect: the broker's Reason String when it sent one (a refused
|
|
46089
|
+
* CONNACK), else mqtt.js's error. Memoized so both error listeners hand out the same
|
|
46090
|
+
* object and it is reported once.
|
|
46091
|
+
*/
|
|
46092
|
+
connectError(err, reason) {
|
|
46093
|
+
const source = toError(err);
|
|
46094
|
+
let error = this.connectErrors.get(source);
|
|
46095
|
+
if (!error) {
|
|
46096
|
+
error = reason ? new Error(reason) : source;
|
|
46097
|
+
this.connectErrors.set(source, error);
|
|
46098
|
+
}
|
|
46099
|
+
return error;
|
|
46100
|
+
}
|
|
46101
|
+
/** Fan a delivered packet out to every subscription whose filter matches. */
|
|
46102
|
+
dispatch(packet) {
|
|
46103
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46104
|
+
const payload = Buffer.isBuffer(packet.payload)
|
|
46105
|
+
? packet.payload
|
|
46106
|
+
: Buffer.from(packet.payload);
|
|
46107
|
+
const message = {
|
|
46108
|
+
topic: packet.topic.toString(),
|
|
46109
|
+
data: new TextDecoder().decode(payload),
|
|
46110
|
+
payload,
|
|
46111
|
+
qos: packet.qos,
|
|
46112
|
+
};
|
|
46113
|
+
for (const sub of this.subscriptions.values()) {
|
|
46114
|
+
if (matches(sub.topic, message.topic)) {
|
|
46115
|
+
yield sub.callback(message);
|
|
46116
|
+
// Notification is per-subscription: only subs that opted in post one,
|
|
46117
|
+
// each with its own title.
|
|
46118
|
+
if (sub.background) {
|
|
46119
|
+
this.notify(message, sub.title);
|
|
46120
|
+
}
|
|
46121
|
+
}
|
|
46122
|
+
}
|
|
46123
|
+
});
|
|
46124
|
+
}
|
|
46125
|
+
requestNotificationPermission() {
|
|
46126
|
+
if (typeof Notification !== 'undefined' &&
|
|
46127
|
+
Notification.permission === 'default') {
|
|
46128
|
+
Promise.resolve(Notification.requestPermission()).catch((err) => this.report(err));
|
|
46129
|
+
}
|
|
46130
|
+
}
|
|
46131
|
+
/** Post a browser notification for a message a background subscription matched. */
|
|
46132
|
+
notify(message, title) {
|
|
46133
|
+
if (typeof Notification === 'undefined' ||
|
|
46134
|
+
Notification.permission !== 'granted') {
|
|
46135
|
+
return;
|
|
46136
|
+
}
|
|
46137
|
+
try {
|
|
46138
|
+
new Notification(title !== null && title !== void 0 ? title : message.topic, {
|
|
46139
|
+
body: message.data,
|
|
46140
|
+
});
|
|
46141
|
+
}
|
|
46142
|
+
catch (_a) {
|
|
46143
|
+
// Some browsers only allow notifications from a service worker; ignore.
|
|
46144
|
+
}
|
|
46145
|
+
}
|
|
46146
|
+
}
|
|
46147
|
+
/** Normalize anything thrown or passed to an error handler into an `Error`. */
|
|
46148
|
+
function toError(error) {
|
|
46149
|
+
return error instanceof Error ? error : new Error(String(error));
|
|
46150
|
+
}
|
|
46151
|
+
/**
|
|
46152
|
+
* The userId claim from an Appwrite JWT, used as the default MQTT client id so the
|
|
46153
|
+
* broker's replay cursor is stable per user. Returns '' when the token is not a decodable JWT
|
|
46154
|
+
* (e.g. a plain string), so the caller can fall back to the session or raw credential.
|
|
46155
|
+
*/
|
|
46156
|
+
function userIdFromJwt(jwt) {
|
|
46157
|
+
if (!jwt) {
|
|
46158
|
+
return '';
|
|
46159
|
+
}
|
|
46160
|
+
const parts = jwt.split('.');
|
|
46161
|
+
if (parts.length < 2) {
|
|
46162
|
+
return '';
|
|
46163
|
+
}
|
|
46164
|
+
try {
|
|
46165
|
+
const json = Buffer.from(parts[1].replace(/-/g, '+').replace(/_/g, '/'), 'base64').toString('utf-8');
|
|
46166
|
+
const payload = JSON.parse(json);
|
|
46167
|
+
return typeof payload.userId === 'string' ? payload.userId : '';
|
|
46168
|
+
}
|
|
46169
|
+
catch (_a) {
|
|
46170
|
+
return '';
|
|
46171
|
+
}
|
|
46172
|
+
}
|
|
46173
|
+
/**
|
|
46174
|
+
* The user id inside a session secret, which is base64 of JSON `{"id": <userId>, "secret": ...}`.
|
|
46175
|
+
* Returns '' when the value is not such a secret.
|
|
46176
|
+
*/
|
|
46177
|
+
function userIdFromSession(session) {
|
|
46178
|
+
if (!session) {
|
|
46179
|
+
return '';
|
|
46180
|
+
}
|
|
46181
|
+
try {
|
|
46182
|
+
const payload = JSON.parse(Buffer.from(session, 'base64').toString('utf-8'));
|
|
46183
|
+
return typeof payload.id === 'string' ? payload.id : '';
|
|
46184
|
+
}
|
|
46185
|
+
catch (_a) {
|
|
46186
|
+
return '';
|
|
46187
|
+
}
|
|
46188
|
+
}
|
|
46189
|
+
/** A hex id, uuid4-like enough for a client-generated client id suffix. */
|
|
46190
|
+
function randomId() {
|
|
46191
|
+
let out = '';
|
|
46192
|
+
for (let i = 0; i < 32; i++) {
|
|
46193
|
+
out += Math.floor(Math.random() * 16).toString(16);
|
|
46194
|
+
}
|
|
46195
|
+
return out;
|
|
46196
|
+
}
|
|
46197
|
+
/** MQTT topic-filter match with '+' (single level) and '#' (multi level). */
|
|
46198
|
+
function matches(filter, topic) {
|
|
46199
|
+
const filterParts = filter.split('/');
|
|
46200
|
+
const topicParts = topic.split('/');
|
|
46201
|
+
for (let i = 0; i < filterParts.length; i++) {
|
|
46202
|
+
const part = filterParts[i];
|
|
46203
|
+
if (part === '#') {
|
|
46204
|
+
return true;
|
|
46205
|
+
}
|
|
46206
|
+
if (i >= topicParts.length) {
|
|
46207
|
+
return false;
|
|
46208
|
+
}
|
|
46209
|
+
if (part !== '+' && part !== topicParts[i]) {
|
|
46210
|
+
return false;
|
|
46211
|
+
}
|
|
46212
|
+
}
|
|
46213
|
+
return filterParts.length === topicParts.length;
|
|
46214
|
+
}
|
|
46215
|
+
|
|
45291
46216
|
/**
|
|
45292
46217
|
* Helper class to generate permission strings for resources.
|
|
45293
46218
|
*/
|
|
@@ -45436,6 +46361,100 @@ class Role {
|
|
|
45436
46361
|
}
|
|
45437
46362
|
}
|
|
45438
46363
|
|
|
46364
|
+
/**
|
|
46365
|
+
* Validate the levels passed to `path()`: a non-empty array of non-empty strings, none holding
|
|
46366
|
+
* the level separator `/` or the wildcards `+` and `#` (use `any()` and `all()` for those).
|
|
46367
|
+
*/
|
|
46368
|
+
function levelsOf(levels) {
|
|
46369
|
+
if (!Array.isArray(levels)) {
|
|
46370
|
+
throw new Error("path() expects an array, e.g. path(['user'])");
|
|
46371
|
+
}
|
|
46372
|
+
if (levels.length === 0) {
|
|
46373
|
+
throw new Error('path() needs at least one level');
|
|
46374
|
+
}
|
|
46375
|
+
return levels.map((level, index) => {
|
|
46376
|
+
if (typeof level !== 'string') {
|
|
46377
|
+
const type = level === null ? 'null' : typeof level;
|
|
46378
|
+
throw new Error(`level at index ${index} must be a string, got ${type}`);
|
|
46379
|
+
}
|
|
46380
|
+
if (level === '') {
|
|
46381
|
+
throw new Error(`empty level at index ${index}`);
|
|
46382
|
+
}
|
|
46383
|
+
if (level.includes('/')) {
|
|
46384
|
+
const parts = level
|
|
46385
|
+
.split('/')
|
|
46386
|
+
.map((part) => `'${part}'`)
|
|
46387
|
+
.join(', ');
|
|
46388
|
+
throw new Error(`"${level}" contains "/", split it: path([${parts}])`);
|
|
46389
|
+
}
|
|
46390
|
+
if (level === '+') {
|
|
46391
|
+
throw new Error('"+" is reserved, use any()');
|
|
46392
|
+
}
|
|
46393
|
+
if (level.includes('+')) {
|
|
46394
|
+
throw new Error(`"${level}" contains "+", use any() for wildcards`);
|
|
46395
|
+
}
|
|
46396
|
+
if (level === '#') {
|
|
46397
|
+
throw new Error('"#" is reserved, use all()');
|
|
46398
|
+
}
|
|
46399
|
+
if (level.includes('#')) {
|
|
46400
|
+
throw new Error(`"${level}" contains "#", use all() for wildcards`);
|
|
46401
|
+
}
|
|
46402
|
+
return level;
|
|
46403
|
+
});
|
|
46404
|
+
}
|
|
46405
|
+
/**
|
|
46406
|
+
* Helper to build MQTT topics for `Push`, level by level.
|
|
46407
|
+
*
|
|
46408
|
+
* Topic.path(['user', userId, 'notification']); // "user/123/notification"
|
|
46409
|
+
* Topic.path(['user']).any().path(['notification']); // "user/+/notification"
|
|
46410
|
+
* Topic.path(['org']).any().path(['logs']).all(); // "org/+/logs/#"
|
|
46411
|
+
*
|
|
46412
|
+
* `any()` matches exactly one level and `all()` everything below, at any depth (including the
|
|
46413
|
+
* parent itself). `all()` ends the topic, so it returns a {@link ResolvedTopic}.
|
|
46414
|
+
*/
|
|
46415
|
+
class Topic {
|
|
46416
|
+
constructor(levels) {
|
|
46417
|
+
this.levels = levels;
|
|
46418
|
+
}
|
|
46419
|
+
/** Start a topic with the given levels, e.g. `Topic.path(['user', userId])`. */
|
|
46420
|
+
static path(levels) {
|
|
46421
|
+
return new Topic(levelsOf(levels));
|
|
46422
|
+
}
|
|
46423
|
+
/** Start a topic with a single-level wildcard (`+`). */
|
|
46424
|
+
static any() {
|
|
46425
|
+
return new Topic(['+']);
|
|
46426
|
+
}
|
|
46427
|
+
/** The multi-level wildcard alone (`#`): matches every topic. */
|
|
46428
|
+
static all() {
|
|
46429
|
+
return new ResolvedTopic(['#']);
|
|
46430
|
+
}
|
|
46431
|
+
/** Append the given levels. */
|
|
46432
|
+
path(levels) {
|
|
46433
|
+
return new Topic([...this.levels, ...levelsOf(levels)]);
|
|
46434
|
+
}
|
|
46435
|
+
/** Append a single-level wildcard (`+`): matches exactly one level. */
|
|
46436
|
+
any() {
|
|
46437
|
+
return new Topic([...this.levels, '+']);
|
|
46438
|
+
}
|
|
46439
|
+
/** Append the multi-level wildcard (`#`) and end the topic. */
|
|
46440
|
+
all() {
|
|
46441
|
+
return new ResolvedTopic([...this.levels, '#']);
|
|
46442
|
+
}
|
|
46443
|
+
toString() {
|
|
46444
|
+
return this.levels.join('/');
|
|
46445
|
+
}
|
|
46446
|
+
}
|
|
46447
|
+
/** A topic ended by `all()`: nothing can be appended after the `#` wildcard. */
|
|
46448
|
+
class ResolvedTopic {
|
|
46449
|
+
/** @internal Created by {@link Topic.all}. */
|
|
46450
|
+
constructor(levels) {
|
|
46451
|
+
this.levels = levels;
|
|
46452
|
+
}
|
|
46453
|
+
toString() {
|
|
46454
|
+
return this.levels.join('/');
|
|
46455
|
+
}
|
|
46456
|
+
}
|
|
46457
|
+
|
|
45439
46458
|
function normalize(id) {
|
|
45440
46459
|
if (id === undefined || id === null) {
|
|
45441
46460
|
throw new Error('Channel ID is required');
|
|
@@ -46666,7 +47685,7 @@ var QuerySuggestionResource;
|
|
|
46666
47685
|
QuerySuggestionResource["Buckets"] = "buckets";
|
|
46667
47686
|
QuerySuggestionResource["Providers"] = "providers";
|
|
46668
47687
|
QuerySuggestionResource["Messages"] = "messages";
|
|
46669
|
-
QuerySuggestionResource["
|
|
47688
|
+
QuerySuggestionResource["PushLedger"] = "pushledger";
|
|
46670
47689
|
QuerySuggestionResource["Topics"] = "topics";
|
|
46671
47690
|
QuerySuggestionResource["Subscribers"] = "subscribers";
|
|
46672
47691
|
QuerySuggestionResource["Targets"] = "targets";
|
|
@@ -46733,6 +47752,7 @@ var ProjectEmailTemplateId;
|
|
|
46733
47752
|
ProjectEmailTemplateId["SessionAlert"] = "sessionAlert";
|
|
46734
47753
|
ProjectEmailTemplateId["OtpSession"] = "otpSession";
|
|
46735
47754
|
ProjectEmailTemplateId["OtpVerification"] = "otpVerification";
|
|
47755
|
+
ProjectEmailTemplateId["OtpRecovery"] = "otpRecovery";
|
|
46736
47756
|
})(ProjectEmailTemplateId || (ProjectEmailTemplateId = {}));
|
|
46737
47757
|
|
|
46738
47758
|
var ProjectEmailTemplateLocale;
|
|
@@ -46960,6 +47980,9 @@ var Runtime;
|
|
|
46960
47980
|
Runtime["Pythonml311"] = "python-ml-3.11";
|
|
46961
47981
|
Runtime["Pythonml312"] = "python-ml-3.12";
|
|
46962
47982
|
Runtime["Pythonml313"] = "python-ml-3.13";
|
|
47983
|
+
Runtime["Deno121"] = "deno-1.21";
|
|
47984
|
+
Runtime["Deno124"] = "deno-1.24";
|
|
47985
|
+
Runtime["Deno135"] = "deno-1.35";
|
|
46963
47986
|
Runtime["Deno140"] = "deno-1.40";
|
|
46964
47987
|
Runtime["Deno146"] = "deno-1.46";
|
|
46965
47988
|
Runtime["Deno20"] = "deno-2.0";
|
|
@@ -47193,6 +48216,17 @@ var ExecutionMethod;
|
|
|
47193
48216
|
ExecutionMethod["HEAD"] = "HEAD";
|
|
47194
48217
|
})(ExecutionMethod || (ExecutionMethod = {}));
|
|
47195
48218
|
|
|
48219
|
+
var ConversationType;
|
|
48220
|
+
(function (ConversationType) {
|
|
48221
|
+
ConversationType["Support"] = "support";
|
|
48222
|
+
ConversationType["Feedback"] = "feedback";
|
|
48223
|
+
ConversationType["Docs"] = "docs";
|
|
48224
|
+
ConversationType["Enterprise"] = "enterprise";
|
|
48225
|
+
ConversationType["Startup"] = "startup";
|
|
48226
|
+
ConversationType["Partner"] = "partner";
|
|
48227
|
+
ConversationType["Sponsorship"] = "sponsorship";
|
|
48228
|
+
})(ConversationType || (ConversationType = {}));
|
|
48229
|
+
|
|
47196
48230
|
var BlockResourceType;
|
|
47197
48231
|
(function (BlockResourceType) {
|
|
47198
48232
|
BlockResourceType["Projects"] = "projects";
|
|
@@ -47389,6 +48423,24 @@ var ProjectAuthMethodId;
|
|
|
47389
48423
|
ProjectAuthMethodId["Phone"] = "phone";
|
|
47390
48424
|
})(ProjectAuthMethodId || (ProjectAuthMethodId = {}));
|
|
47391
48425
|
|
|
48426
|
+
var ProjectOAuth2Auth0Prompt;
|
|
48427
|
+
(function (ProjectOAuth2Auth0Prompt) {
|
|
48428
|
+
ProjectOAuth2Auth0Prompt["None"] = "none";
|
|
48429
|
+
ProjectOAuth2Auth0Prompt["Login"] = "login";
|
|
48430
|
+
ProjectOAuth2Auth0Prompt["Consent"] = "consent";
|
|
48431
|
+
})(ProjectOAuth2Auth0Prompt || (ProjectOAuth2Auth0Prompt = {}));
|
|
48432
|
+
|
|
48433
|
+
var ProjectOAuth2DiscordPrompt;
|
|
48434
|
+
(function (ProjectOAuth2DiscordPrompt) {
|
|
48435
|
+
ProjectOAuth2DiscordPrompt["None"] = "none";
|
|
48436
|
+
ProjectOAuth2DiscordPrompt["Consent"] = "consent";
|
|
48437
|
+
})(ProjectOAuth2DiscordPrompt || (ProjectOAuth2DiscordPrompt = {}));
|
|
48438
|
+
|
|
48439
|
+
var ProjectOAuth2GitHubPrompt;
|
|
48440
|
+
(function (ProjectOAuth2GitHubPrompt) {
|
|
48441
|
+
ProjectOAuth2GitHubPrompt["SelectAccount"] = "select_account";
|
|
48442
|
+
})(ProjectOAuth2GitHubPrompt || (ProjectOAuth2GitHubPrompt = {}));
|
|
48443
|
+
|
|
47392
48444
|
var ProjectOAuth2GooglePrompt;
|
|
47393
48445
|
(function (ProjectOAuth2GooglePrompt) {
|
|
47394
48446
|
ProjectOAuth2GooglePrompt["None"] = "none";
|
|
@@ -47396,6 +48448,22 @@ var ProjectOAuth2GooglePrompt;
|
|
|
47396
48448
|
ProjectOAuth2GooglePrompt["SelectAccount"] = "select_account";
|
|
47397
48449
|
})(ProjectOAuth2GooglePrompt || (ProjectOAuth2GooglePrompt = {}));
|
|
47398
48450
|
|
|
48451
|
+
var ProjectOAuth2KakaoPrompt;
|
|
48452
|
+
(function (ProjectOAuth2KakaoPrompt) {
|
|
48453
|
+
ProjectOAuth2KakaoPrompt["None"] = "none";
|
|
48454
|
+
ProjectOAuth2KakaoPrompt["Login"] = "login";
|
|
48455
|
+
ProjectOAuth2KakaoPrompt["Create"] = "create";
|
|
48456
|
+
ProjectOAuth2KakaoPrompt["SelectAccount"] = "select_account";
|
|
48457
|
+
})(ProjectOAuth2KakaoPrompt || (ProjectOAuth2KakaoPrompt = {}));
|
|
48458
|
+
|
|
48459
|
+
var ProjectOAuth2MicrosoftPrompt;
|
|
48460
|
+
(function (ProjectOAuth2MicrosoftPrompt) {
|
|
48461
|
+
ProjectOAuth2MicrosoftPrompt["None"] = "none";
|
|
48462
|
+
ProjectOAuth2MicrosoftPrompt["Login"] = "login";
|
|
48463
|
+
ProjectOAuth2MicrosoftPrompt["Consent"] = "consent";
|
|
48464
|
+
ProjectOAuth2MicrosoftPrompt["SelectAccount"] = "select_account";
|
|
48465
|
+
})(ProjectOAuth2MicrosoftPrompt || (ProjectOAuth2MicrosoftPrompt = {}));
|
|
48466
|
+
|
|
47399
48467
|
var ProjectOAuth2OidcPrompt;
|
|
47400
48468
|
(function (ProjectOAuth2OidcPrompt) {
|
|
47401
48469
|
ProjectOAuth2OidcPrompt["None"] = "none";
|
|
@@ -47404,6 +48472,24 @@ var ProjectOAuth2OidcPrompt;
|
|
|
47404
48472
|
ProjectOAuth2OidcPrompt["SelectAccount"] = "select_account";
|
|
47405
48473
|
})(ProjectOAuth2OidcPrompt || (ProjectOAuth2OidcPrompt = {}));
|
|
47406
48474
|
|
|
48475
|
+
var ProjectOAuth2OktaPrompt;
|
|
48476
|
+
(function (ProjectOAuth2OktaPrompt) {
|
|
48477
|
+
ProjectOAuth2OktaPrompt["None"] = "none";
|
|
48478
|
+
ProjectOAuth2OktaPrompt["Login"] = "login";
|
|
48479
|
+
ProjectOAuth2OktaPrompt["Consent"] = "consent";
|
|
48480
|
+
})(ProjectOAuth2OktaPrompt || (ProjectOAuth2OktaPrompt = {}));
|
|
48481
|
+
|
|
48482
|
+
var ProjectOAuth2SalesforcePrompt;
|
|
48483
|
+
(function (ProjectOAuth2SalesforcePrompt) {
|
|
48484
|
+
ProjectOAuth2SalesforcePrompt["Login"] = "login";
|
|
48485
|
+
ProjectOAuth2SalesforcePrompt["Consent"] = "consent";
|
|
48486
|
+
})(ProjectOAuth2SalesforcePrompt || (ProjectOAuth2SalesforcePrompt = {}));
|
|
48487
|
+
|
|
48488
|
+
var ProjectOAuth2ZohoPrompt;
|
|
48489
|
+
(function (ProjectOAuth2ZohoPrompt) {
|
|
48490
|
+
ProjectOAuth2ZohoPrompt["Consent"] = "consent";
|
|
48491
|
+
})(ProjectOAuth2ZohoPrompt || (ProjectOAuth2ZohoPrompt = {}));
|
|
48492
|
+
|
|
47407
48493
|
var ProjectOAuthProviderId;
|
|
47408
48494
|
(function (ProjectOAuthProviderId) {
|
|
47409
48495
|
ProjectOAuthProviderId["Amazon"] = "amazon";
|
|
@@ -47601,6 +48687,9 @@ var BuildRuntime;
|
|
|
47601
48687
|
BuildRuntime["Pythonml311"] = "python-ml-3.11";
|
|
47602
48688
|
BuildRuntime["Pythonml312"] = "python-ml-3.12";
|
|
47603
48689
|
BuildRuntime["Pythonml313"] = "python-ml-3.13";
|
|
48690
|
+
BuildRuntime["Deno121"] = "deno-1.21";
|
|
48691
|
+
BuildRuntime["Deno124"] = "deno-1.24";
|
|
48692
|
+
BuildRuntime["Deno135"] = "deno-1.35";
|
|
47604
48693
|
BuildRuntime["Deno140"] = "deno-1.40";
|
|
47605
48694
|
BuildRuntime["Deno146"] = "deno-1.46";
|
|
47606
48695
|
BuildRuntime["Deno20"] = "deno-2.0";
|
|
@@ -48018,6 +49107,17 @@ var ExecutionStatus;
|
|
|
48018
49107
|
ExecutionStatus["Scheduled"] = "scheduled";
|
|
48019
49108
|
})(ExecutionStatus || (ExecutionStatus = {}));
|
|
48020
49109
|
|
|
49110
|
+
var OAuth2GithubPrompt;
|
|
49111
|
+
(function (OAuth2GithubPrompt) {
|
|
49112
|
+
OAuth2GithubPrompt["SelectAccount"] = "select_account";
|
|
49113
|
+
})(OAuth2GithubPrompt || (OAuth2GithubPrompt = {}));
|
|
49114
|
+
|
|
49115
|
+
var OAuth2DiscordPrompt;
|
|
49116
|
+
(function (OAuth2DiscordPrompt) {
|
|
49117
|
+
OAuth2DiscordPrompt["None"] = "none";
|
|
49118
|
+
OAuth2DiscordPrompt["Consent"] = "consent";
|
|
49119
|
+
})(OAuth2DiscordPrompt || (OAuth2DiscordPrompt = {}));
|
|
49120
|
+
|
|
48021
49121
|
var OAuth2GooglePrompt;
|
|
48022
49122
|
(function (OAuth2GooglePrompt) {
|
|
48023
49123
|
OAuth2GooglePrompt["None"] = "none";
|
|
@@ -48025,6 +49125,24 @@ var OAuth2GooglePrompt;
|
|
|
48025
49125
|
OAuth2GooglePrompt["SelectAccount"] = "select_account";
|
|
48026
49126
|
})(OAuth2GooglePrompt || (OAuth2GooglePrompt = {}));
|
|
48027
49127
|
|
|
49128
|
+
var OAuth2ZohoPrompt;
|
|
49129
|
+
(function (OAuth2ZohoPrompt) {
|
|
49130
|
+
OAuth2ZohoPrompt["Consent"] = "consent";
|
|
49131
|
+
})(OAuth2ZohoPrompt || (OAuth2ZohoPrompt = {}));
|
|
49132
|
+
|
|
49133
|
+
var OAuth2SalesforcePrompt;
|
|
49134
|
+
(function (OAuth2SalesforcePrompt) {
|
|
49135
|
+
OAuth2SalesforcePrompt["Login"] = "login";
|
|
49136
|
+
OAuth2SalesforcePrompt["Consent"] = "consent";
|
|
49137
|
+
})(OAuth2SalesforcePrompt || (OAuth2SalesforcePrompt = {}));
|
|
49138
|
+
|
|
49139
|
+
var OAuth2Auth0Prompt;
|
|
49140
|
+
(function (OAuth2Auth0Prompt) {
|
|
49141
|
+
OAuth2Auth0Prompt["None"] = "none";
|
|
49142
|
+
OAuth2Auth0Prompt["Login"] = "login";
|
|
49143
|
+
OAuth2Auth0Prompt["Consent"] = "consent";
|
|
49144
|
+
})(OAuth2Auth0Prompt || (OAuth2Auth0Prompt = {}));
|
|
49145
|
+
|
|
48028
49146
|
var OAuth2OidcPrompt;
|
|
48029
49147
|
(function (OAuth2OidcPrompt) {
|
|
48030
49148
|
OAuth2OidcPrompt["None"] = "none";
|
|
@@ -48033,6 +49151,29 @@ var OAuth2OidcPrompt;
|
|
|
48033
49151
|
OAuth2OidcPrompt["SelectAccount"] = "select_account";
|
|
48034
49152
|
})(OAuth2OidcPrompt || (OAuth2OidcPrompt = {}));
|
|
48035
49153
|
|
|
49154
|
+
var OAuth2OktaPrompt;
|
|
49155
|
+
(function (OAuth2OktaPrompt) {
|
|
49156
|
+
OAuth2OktaPrompt["None"] = "none";
|
|
49157
|
+
OAuth2OktaPrompt["Login"] = "login";
|
|
49158
|
+
OAuth2OktaPrompt["Consent"] = "consent";
|
|
49159
|
+
})(OAuth2OktaPrompt || (OAuth2OktaPrompt = {}));
|
|
49160
|
+
|
|
49161
|
+
var OAuth2MicrosoftPrompt;
|
|
49162
|
+
(function (OAuth2MicrosoftPrompt) {
|
|
49163
|
+
OAuth2MicrosoftPrompt["None"] = "none";
|
|
49164
|
+
OAuth2MicrosoftPrompt["Login"] = "login";
|
|
49165
|
+
OAuth2MicrosoftPrompt["Consent"] = "consent";
|
|
49166
|
+
OAuth2MicrosoftPrompt["SelectAccount"] = "select_account";
|
|
49167
|
+
})(OAuth2MicrosoftPrompt || (OAuth2MicrosoftPrompt = {}));
|
|
49168
|
+
|
|
49169
|
+
var OAuth2KakaoPrompt;
|
|
49170
|
+
(function (OAuth2KakaoPrompt) {
|
|
49171
|
+
OAuth2KakaoPrompt["None"] = "none";
|
|
49172
|
+
OAuth2KakaoPrompt["Login"] = "login";
|
|
49173
|
+
OAuth2KakaoPrompt["Create"] = "create";
|
|
49174
|
+
OAuth2KakaoPrompt["SelectAccount"] = "select_account";
|
|
49175
|
+
})(OAuth2KakaoPrompt || (OAuth2KakaoPrompt = {}));
|
|
49176
|
+
|
|
48036
49177
|
var PlatformType;
|
|
48037
49178
|
(function (PlatformType) {
|
|
48038
49179
|
PlatformType["Windows"] = "windows";
|
|
@@ -48101,5 +49242,5 @@ var WafRuleAction;
|
|
|
48101
49242
|
WafRuleAction["Redirect"] = "redirect";
|
|
48102
49243
|
})(WafRuleAction || (WafRuleAction = {}));
|
|
48103
49244
|
|
|
48104
|
-
export { Account, AccountKeyScopes, Activities, Adapter, AddonKey, Advisor, Affiliates, Apps, AppwriteException, AppwriteMigrationResource, Assistant, AttributeStatus, AuthenticationFactor, AuthenticatorType, Avatars, BackupServices, Backups, BillingPlanGroup, BlockMode, BlockResourceType, Browser, BrowserPermission, BrowserTheme, BuildRuntime, CacheDatabase, CacheTarget, Channel, Client, ColumnStatus, Compression, Condition, Console, ConsoleResourceType, CreditCard, DatabaseStatus, DatabaseType, Databases, DatabasesIndexType, DeploymentDownloadType, DeploymentStatus, DetectionFrameworkType, DetectionRuntimeType, DocumentsDB, DocumentsDBIndexType, DomainPurchaseStatus, DomainRegistrationType, DomainSuggestionType, DomainTransferStatusEnum, Domains, EmbeddingModel, Embeddings, ExecutionMethod, ExecutionResourceType, ExecutionStatus, ExecutionTrigger, FirebaseMigrationResource, Flag, Framework, FunctionTemplateUseCase, Functions, Graphql, ID, IdTokenProvider, ImageFormat, ImageGravity, IndexStatus, InvalidationType, Locale, Manager, MessagePriority, MessageStatus, Messaging, MessagingProviderType, Migrations, Mongo, Mysql, NHostMigrationResource, Notifications, OAuth2GooglePrompt, OAuth2OidcPrompt, OAuthProvider, Oauth2, OnDuplicate, Operator, OrderBy, Organization, OrganizationKeyScopes, Organizations, PasswordHash, Permission, Platform, PlatformType, Postgresql, Presences, Project, ProjectAuthMethodId, ProjectEmailTemplateId, ProjectEmailTemplateLocale, ProjectKeyScopes, ProjectOAuth2GooglePrompt, ProjectOAuth2OidcPrompt, ProjectOAuthProviderId, ProjectPolicyId, ProjectProtocolId, ProjectSMTPSecure, ProjectServiceId, Projects, Proxy, ProxyResourceType, ProxyRuleDeploymentResourceType, ProxyRuleStatus, Query, QuerySuggestionResource, Realtime, Region, RelationMutate, RelationshipType, Role, Runtime, ScheduleResourceType, SiteTemplateUseCase, Sites, SmtpEncryption, Status, StatusCode, Storage, SupabaseMigrationResource, TablesDB, TablesDBIndexType, Teams, TemplateReferenceType, Timezone, Tokens, Usage, UsageEventDimension, UsageEventMetric, UsageGaugeDimension, UsageGaugeMetric, UsageInterval, UsageOrderBy, UsageOrderDirection, UsageRange, Users, VCSDetectionType, VCSReferenceType, Vcs, VectorsDB, VectorsDBIndexType, Waf, WafRuleAction, Webhooks };
|
|
49245
|
+
export { Account, AccountKeyScopes, Activities, Adapter, AddonKey, Advisor, Affiliates, Apps, AppwriteException, AppwriteMigrationResource, Assistant, AttributeStatus, AuthenticationFactor, AuthenticatorType, Avatars, BackupServices, Backups, BillingPlanGroup, BlockMode, BlockResourceType, Browser, BrowserPermission, BrowserTheme, BuildRuntime, CacheDatabase, CacheTarget, Channel, Client, ColumnStatus, Compression, Condition, Console, ConsoleResourceType, ConversationType, CreditCard, DatabaseStatus, DatabaseType, Databases, DatabasesIndexType, DeploymentDownloadType, DeploymentStatus, DetectionFrameworkType, DetectionRuntimeType, DocumentsDB, DocumentsDBIndexType, DomainPurchaseStatus, DomainRegistrationType, DomainSuggestionType, DomainTransferStatusEnum, Domains, EmbeddingModel, Embeddings, ExecutionMethod, ExecutionResourceType, ExecutionStatus, ExecutionTrigger, FirebaseMigrationResource, Flag, Framework, FunctionTemplateUseCase, Functions, Graphql, Growth, ID, IdTokenProvider, ImageFormat, ImageGravity, IndexStatus, InvalidationType, Locale, Manager, MessagePriority, MessageStatus, Messaging, MessagingProviderType, Migrations, Mongo, Mysql, NHostMigrationResource, Notifications, OAuth2Auth0Prompt, OAuth2DiscordPrompt, OAuth2GithubPrompt, OAuth2GooglePrompt, OAuth2KakaoPrompt, OAuth2MicrosoftPrompt, OAuth2OidcPrompt, OAuth2OktaPrompt, OAuth2SalesforcePrompt, OAuth2ZohoPrompt, OAuthProvider, Oauth2, OnDuplicate, Operator, OrderBy, Organization, OrganizationKeyScopes, Organizations, PasswordHash, Permission, Platform, PlatformType, Postgresql, Presences, Project, ProjectAuthMethodId, ProjectEmailTemplateId, ProjectEmailTemplateLocale, ProjectKeyScopes, ProjectOAuth2Auth0Prompt, ProjectOAuth2DiscordPrompt, ProjectOAuth2GitHubPrompt, ProjectOAuth2GooglePrompt, ProjectOAuth2KakaoPrompt, ProjectOAuth2MicrosoftPrompt, ProjectOAuth2OidcPrompt, ProjectOAuth2OktaPrompt, ProjectOAuth2SalesforcePrompt, ProjectOAuth2ZohoPrompt, ProjectOAuthProviderId, ProjectPolicyId, ProjectProtocolId, ProjectSMTPSecure, ProjectServiceId, Projects, Proxy, ProxyResourceType, ProxyRuleDeploymentResourceType, ProxyRuleStatus, Push, Query, QuerySuggestionResource, Realtime, Region, RelationMutate, RelationshipType, ResolvedTopic, Role, Runtime, ScheduleResourceType, SiteTemplateUseCase, Sites, SmtpEncryption, Status, StatusCode, Storage, SupabaseMigrationResource, TablesDB, TablesDBIndexType, Teams, TemplateReferenceType, Timezone, Tokens, Topic, Usage, UsageEventDimension, UsageEventMetric, UsageGaugeDimension, UsageGaugeMetric, UsageInterval, UsageOrderBy, UsageOrderDirection, UsageRange, Users, VCSDetectionType, VCSReferenceType, Vcs, VectorsDB, VectorsDBIndexType, Waf, WafRuleAction, Webhooks };
|
|
48105
49246
|
//# sourceMappingURL=sdk.js.map
|