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