@appwrite.io/console 18.2.0 → 18.3.0-rc.2
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 +2 -2
- package/dist/cjs/sdk.js +3115 -373
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +3112 -374
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +3115 -373
- package/package.json +1 -1
- package/types/enums/analytics-dimension.d.ts +24 -0
- package/types/enums/analytics-interval.d.ts +6 -0
- package/types/enums/platform-resource-type.d.ts +11 -0
- package/types/enums/project-auth-method-id.d.ts +2 -1
- package/types/enums/project-key-scopes.d.ts +5 -1
- package/types/enums/project-policy-id.d.ts +2 -1
- package/types/enums/project-resource-type.d.ts +13 -0
- package/types/enums/proxy-rule-deployment-resource-type.d.ts +2 -1
- package/types/enums/query-suggestion-resource.d.ts +8 -0
- package/types/enums/usage-event-metric.d.ts +3 -0
- package/types/enums/usage-gauge-metric.d.ts +1 -0
- package/types/enums/video-output.d.ts +5 -0
- package/types/enums/video-rendition-status.d.ts +9 -0
- package/types/index.d.ts +11 -0
- package/types/models.d.ts +591 -55
- package/types/services/account.d.ts +158 -0
- package/types/services/admin.d.ts +80 -0
- package/types/services/analytics-tracking.d.ts +211 -0
- package/types/services/analytics.d.ts +254 -0
- package/types/services/project.d.ts +30 -8
- package/types/services/push.d.ts +2 -2
- package/types/services/users.d.ts +69 -0
- package/types/services/videos.d.ts +860 -0
- package/types/service.d.ts +0 -11
package/dist/iife/sdk.js
CHANGED
|
@@ -4467,7 +4467,7 @@
|
|
|
4467
4467
|
'x-sdk-name': 'Console',
|
|
4468
4468
|
'x-sdk-platform': 'console',
|
|
4469
4469
|
'x-sdk-language': 'web',
|
|
4470
|
-
'x-sdk-version': '18.
|
|
4470
|
+
'x-sdk-version': '18.3.0-rc.2',
|
|
4471
4471
|
'X-Appwrite-Response-Format': '2.3.0',
|
|
4472
4472
|
};
|
|
4473
4473
|
this.realtime = {
|
|
@@ -5320,29 +5320,6 @@
|
|
|
5320
5320
|
}
|
|
5321
5321
|
Client.CHUNK_SIZE = 1024 * 1024 * 5;
|
|
5322
5322
|
|
|
5323
|
-
class Service {
|
|
5324
|
-
constructor(client) {
|
|
5325
|
-
this.client = client;
|
|
5326
|
-
}
|
|
5327
|
-
static flatten(data, prefix = '') {
|
|
5328
|
-
let output = {};
|
|
5329
|
-
for (const [key, value] of Object.entries(data)) {
|
|
5330
|
-
const finalKey = prefix ? prefix + '[' + key + ']' : key;
|
|
5331
|
-
if (Array.isArray(value)) {
|
|
5332
|
-
output = Object.assign(Object.assign({}, output), Service.flatten(value, finalKey));
|
|
5333
|
-
}
|
|
5334
|
-
else {
|
|
5335
|
-
output[finalKey] = value;
|
|
5336
|
-
}
|
|
5337
|
-
}
|
|
5338
|
-
return output;
|
|
5339
|
-
}
|
|
5340
|
-
}
|
|
5341
|
-
/**
|
|
5342
|
-
* The size for chunked uploads in bytes.
|
|
5343
|
-
*/
|
|
5344
|
-
Service.CHUNK_SIZE = 5 * 1024 * 1024; // 5MB
|
|
5345
|
-
|
|
5346
5323
|
class Account {
|
|
5347
5324
|
constructor(client) {
|
|
5348
5325
|
this.client = client;
|
|
@@ -6661,6 +6638,196 @@
|
|
|
6661
6638
|
};
|
|
6662
6639
|
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
6663
6640
|
}
|
|
6641
|
+
listPasskeys(paramsOrFirst, ...rest) {
|
|
6642
|
+
let params;
|
|
6643
|
+
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
6644
|
+
(paramsOrFirst &&
|
|
6645
|
+
typeof paramsOrFirst === 'object' &&
|
|
6646
|
+
!Array.isArray(paramsOrFirst))) {
|
|
6647
|
+
params = (paramsOrFirst || {});
|
|
6648
|
+
}
|
|
6649
|
+
else {
|
|
6650
|
+
params = {
|
|
6651
|
+
queries: paramsOrFirst,
|
|
6652
|
+
total: rest[0],
|
|
6653
|
+
};
|
|
6654
|
+
}
|
|
6655
|
+
const queries = params.queries;
|
|
6656
|
+
const total = params.total;
|
|
6657
|
+
const apiPath = '/account/passkeys';
|
|
6658
|
+
const apiPayload = {};
|
|
6659
|
+
if (typeof queries !== 'undefined') {
|
|
6660
|
+
apiPayload['queries'] = queries;
|
|
6661
|
+
}
|
|
6662
|
+
if (typeof total !== 'undefined') {
|
|
6663
|
+
apiPayload['total'] = total;
|
|
6664
|
+
}
|
|
6665
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
6666
|
+
const apiHeaders = {
|
|
6667
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
6668
|
+
accept: 'application/json',
|
|
6669
|
+
};
|
|
6670
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
6671
|
+
}
|
|
6672
|
+
createPasskey(paramsOrFirst, ...rest) {
|
|
6673
|
+
let params;
|
|
6674
|
+
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
6675
|
+
(paramsOrFirst &&
|
|
6676
|
+
typeof paramsOrFirst === 'object' &&
|
|
6677
|
+
!Array.isArray(paramsOrFirst))) {
|
|
6678
|
+
params = (paramsOrFirst || {});
|
|
6679
|
+
}
|
|
6680
|
+
else {
|
|
6681
|
+
params = {
|
|
6682
|
+
passkeyId: paramsOrFirst,
|
|
6683
|
+
name: rest[0],
|
|
6684
|
+
};
|
|
6685
|
+
}
|
|
6686
|
+
const passkeyId = params.passkeyId;
|
|
6687
|
+
const name = params.name;
|
|
6688
|
+
const apiPath = '/account/passkeys';
|
|
6689
|
+
const apiPayload = {};
|
|
6690
|
+
if (typeof passkeyId !== 'undefined') {
|
|
6691
|
+
apiPayload['passkeyId'] = passkeyId;
|
|
6692
|
+
}
|
|
6693
|
+
if (typeof name !== 'undefined') {
|
|
6694
|
+
apiPayload['name'] = name;
|
|
6695
|
+
}
|
|
6696
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
6697
|
+
const apiHeaders = {
|
|
6698
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
6699
|
+
'content-type': 'application/json',
|
|
6700
|
+
accept: 'application/json',
|
|
6701
|
+
};
|
|
6702
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
6703
|
+
}
|
|
6704
|
+
getPasskey(paramsOrFirst) {
|
|
6705
|
+
let params;
|
|
6706
|
+
if (paramsOrFirst &&
|
|
6707
|
+
typeof paramsOrFirst === 'object' &&
|
|
6708
|
+
!Array.isArray(paramsOrFirst)) {
|
|
6709
|
+
params = (paramsOrFirst || {});
|
|
6710
|
+
}
|
|
6711
|
+
else {
|
|
6712
|
+
params = {
|
|
6713
|
+
passkeyId: paramsOrFirst,
|
|
6714
|
+
};
|
|
6715
|
+
}
|
|
6716
|
+
const passkeyId = params.passkeyId;
|
|
6717
|
+
if (typeof passkeyId === 'undefined' || passkeyId === '') {
|
|
6718
|
+
throw new AppwriteException('Missing required parameter: "passkeyId"');
|
|
6719
|
+
}
|
|
6720
|
+
const apiPath = '/account/passkeys/{passkeyId}'.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
|
|
6721
|
+
const apiPayload = {};
|
|
6722
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
6723
|
+
const apiHeaders = {
|
|
6724
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
6725
|
+
accept: 'application/json',
|
|
6726
|
+
};
|
|
6727
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
6728
|
+
}
|
|
6729
|
+
updatePasskey(paramsOrFirst, ...rest) {
|
|
6730
|
+
let params;
|
|
6731
|
+
if (paramsOrFirst &&
|
|
6732
|
+
typeof paramsOrFirst === 'object' &&
|
|
6733
|
+
!Array.isArray(paramsOrFirst)) {
|
|
6734
|
+
params = (paramsOrFirst || {});
|
|
6735
|
+
}
|
|
6736
|
+
else {
|
|
6737
|
+
params = {
|
|
6738
|
+
passkeyId: paramsOrFirst,
|
|
6739
|
+
name: rest[0],
|
|
6740
|
+
};
|
|
6741
|
+
}
|
|
6742
|
+
const passkeyId = params.passkeyId;
|
|
6743
|
+
const name = params.name;
|
|
6744
|
+
if (typeof passkeyId === 'undefined' || passkeyId === '') {
|
|
6745
|
+
throw new AppwriteException('Missing required parameter: "passkeyId"');
|
|
6746
|
+
}
|
|
6747
|
+
if (typeof name === 'undefined') {
|
|
6748
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
6749
|
+
}
|
|
6750
|
+
const apiPath = '/account/passkeys/{passkeyId}'.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
|
|
6751
|
+
const apiPayload = {};
|
|
6752
|
+
if (typeof name !== 'undefined') {
|
|
6753
|
+
apiPayload['name'] = name;
|
|
6754
|
+
}
|
|
6755
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
6756
|
+
const apiHeaders = {
|
|
6757
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
6758
|
+
'content-type': 'application/json',
|
|
6759
|
+
accept: 'application/json',
|
|
6760
|
+
};
|
|
6761
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
6762
|
+
}
|
|
6763
|
+
deletePasskey(paramsOrFirst) {
|
|
6764
|
+
let params;
|
|
6765
|
+
if (paramsOrFirst &&
|
|
6766
|
+
typeof paramsOrFirst === 'object' &&
|
|
6767
|
+
!Array.isArray(paramsOrFirst)) {
|
|
6768
|
+
params = (paramsOrFirst || {});
|
|
6769
|
+
}
|
|
6770
|
+
else {
|
|
6771
|
+
params = {
|
|
6772
|
+
passkeyId: paramsOrFirst,
|
|
6773
|
+
};
|
|
6774
|
+
}
|
|
6775
|
+
const passkeyId = params.passkeyId;
|
|
6776
|
+
if (typeof passkeyId === 'undefined' || passkeyId === '') {
|
|
6777
|
+
throw new AppwriteException('Missing required parameter: "passkeyId"');
|
|
6778
|
+
}
|
|
6779
|
+
const apiPath = '/account/passkeys/{passkeyId}'.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
|
|
6780
|
+
const apiPayload = {};
|
|
6781
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
6782
|
+
const apiHeaders = {
|
|
6783
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
6784
|
+
'content-type': 'application/json',
|
|
6785
|
+
accept: 'application/json',
|
|
6786
|
+
};
|
|
6787
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
6788
|
+
}
|
|
6789
|
+
updatePasskeyVerification(paramsOrFirst, ...rest) {
|
|
6790
|
+
let params;
|
|
6791
|
+
if (paramsOrFirst &&
|
|
6792
|
+
typeof paramsOrFirst === 'object' &&
|
|
6793
|
+
!Array.isArray(paramsOrFirst)) {
|
|
6794
|
+
params = (paramsOrFirst || {});
|
|
6795
|
+
}
|
|
6796
|
+
else {
|
|
6797
|
+
params = {
|
|
6798
|
+
passkeyId: paramsOrFirst,
|
|
6799
|
+
challengeId: rest[0],
|
|
6800
|
+
credential: rest[1],
|
|
6801
|
+
};
|
|
6802
|
+
}
|
|
6803
|
+
const passkeyId = params.passkeyId;
|
|
6804
|
+
const challengeId = params.challengeId;
|
|
6805
|
+
const credential = params.credential;
|
|
6806
|
+
if (typeof passkeyId === 'undefined' || passkeyId === '') {
|
|
6807
|
+
throw new AppwriteException('Missing required parameter: "passkeyId"');
|
|
6808
|
+
}
|
|
6809
|
+
if (typeof challengeId === 'undefined') {
|
|
6810
|
+
throw new AppwriteException('Missing required parameter: "challengeId"');
|
|
6811
|
+
}
|
|
6812
|
+
if (typeof credential === 'undefined') {
|
|
6813
|
+
throw new AppwriteException('Missing required parameter: "credential"');
|
|
6814
|
+
}
|
|
6815
|
+
const apiPath = '/account/passkeys/{passkeyId}/verification'.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
|
|
6816
|
+
const apiPayload = {};
|
|
6817
|
+
if (typeof challengeId !== 'undefined') {
|
|
6818
|
+
apiPayload['challengeId'] = challengeId;
|
|
6819
|
+
}
|
|
6820
|
+
if (typeof credential !== 'undefined') {
|
|
6821
|
+
apiPayload['credential'] = credential;
|
|
6822
|
+
}
|
|
6823
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
6824
|
+
const apiHeaders = {
|
|
6825
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
6826
|
+
'content-type': 'application/json',
|
|
6827
|
+
accept: 'application/json',
|
|
6828
|
+
};
|
|
6829
|
+
return this.client.call('put', uri, apiHeaders, apiPayload);
|
|
6830
|
+
}
|
|
6664
6831
|
updatePassword(paramsOrFirst, ...rest) {
|
|
6665
6832
|
let params;
|
|
6666
6833
|
if (paramsOrFirst &&
|
|
@@ -7404,7 +7571,7 @@
|
|
|
7404
7571
|
}
|
|
7405
7572
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
7406
7573
|
apiPayload['project'] = this.client.config.project;
|
|
7407
|
-
for (const [key, value] of Object.entries(
|
|
7574
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
7408
7575
|
uri.searchParams.append(key, value);
|
|
7409
7576
|
}
|
|
7410
7577
|
if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.location)) {
|
|
@@ -7813,7 +7980,7 @@
|
|
|
7813
7980
|
}
|
|
7814
7981
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
7815
7982
|
apiPayload['project'] = this.client.config.project;
|
|
7816
|
-
for (const [key, value] of Object.entries(
|
|
7983
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
7817
7984
|
uri.searchParams.append(key, value);
|
|
7818
7985
|
}
|
|
7819
7986
|
if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.location)) {
|
|
@@ -7824,6 +7991,60 @@
|
|
|
7824
7991
|
return uri.toString();
|
|
7825
7992
|
}
|
|
7826
7993
|
}
|
|
7994
|
+
/**
|
|
7995
|
+
* Start signing in with a passkey. No email or user ID is needed: pass the returned `publicKey` options to `navigator.credentials.get()` and the user picks one of their passkeys. Then call [Update passkey token](/docs/references/cloud/client-web/account#updatePasskeyToken) with the credential to receive a token, and exchange it with [Create session](/docs/references/cloud/client-web/account#createSession). The challenge expires after 5 minutes.
|
|
7996
|
+
*
|
|
7997
|
+
* @throws {AppwriteException}
|
|
7998
|
+
* @returns {Promise<Models.PasskeyChallenge>}
|
|
7999
|
+
*/
|
|
8000
|
+
createPasskeyToken() {
|
|
8001
|
+
const apiPath = '/account/tokens/passkey';
|
|
8002
|
+
const apiPayload = {};
|
|
8003
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
8004
|
+
const apiHeaders = {
|
|
8005
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
8006
|
+
'content-type': 'application/json',
|
|
8007
|
+
accept: 'application/json',
|
|
8008
|
+
};
|
|
8009
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
8010
|
+
}
|
|
8011
|
+
updatePasskeyToken(paramsOrFirst, ...rest) {
|
|
8012
|
+
let params;
|
|
8013
|
+
if (paramsOrFirst &&
|
|
8014
|
+
typeof paramsOrFirst === 'object' &&
|
|
8015
|
+
!Array.isArray(paramsOrFirst)) {
|
|
8016
|
+
params = (paramsOrFirst || {});
|
|
8017
|
+
}
|
|
8018
|
+
else {
|
|
8019
|
+
params = {
|
|
8020
|
+
challengeId: paramsOrFirst,
|
|
8021
|
+
credential: rest[0],
|
|
8022
|
+
};
|
|
8023
|
+
}
|
|
8024
|
+
const challengeId = params.challengeId;
|
|
8025
|
+
const credential = params.credential;
|
|
8026
|
+
if (typeof challengeId === 'undefined') {
|
|
8027
|
+
throw new AppwriteException('Missing required parameter: "challengeId"');
|
|
8028
|
+
}
|
|
8029
|
+
if (typeof credential === 'undefined') {
|
|
8030
|
+
throw new AppwriteException('Missing required parameter: "credential"');
|
|
8031
|
+
}
|
|
8032
|
+
const apiPath = '/account/tokens/passkey';
|
|
8033
|
+
const apiPayload = {};
|
|
8034
|
+
if (typeof challengeId !== 'undefined') {
|
|
8035
|
+
apiPayload['challengeId'] = challengeId;
|
|
8036
|
+
}
|
|
8037
|
+
if (typeof credential !== 'undefined') {
|
|
8038
|
+
apiPayload['credential'] = credential;
|
|
8039
|
+
}
|
|
8040
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
8041
|
+
const apiHeaders = {
|
|
8042
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
8043
|
+
'content-type': 'application/json',
|
|
8044
|
+
accept: 'application/json',
|
|
8045
|
+
};
|
|
8046
|
+
return this.client.call('put', uri, apiHeaders, apiPayload);
|
|
8047
|
+
}
|
|
7827
8048
|
createPhoneToken(paramsOrFirst, ...rest) {
|
|
7828
8049
|
let params;
|
|
7829
8050
|
if (paramsOrFirst &&
|
|
@@ -8170,6 +8391,135 @@
|
|
|
8170
8391
|
}
|
|
8171
8392
|
}
|
|
8172
8393
|
|
|
8394
|
+
class Admin {
|
|
8395
|
+
constructor(client) {
|
|
8396
|
+
this.client = client;
|
|
8397
|
+
}
|
|
8398
|
+
/**
|
|
8399
|
+
* Delete everything cached from the platform database in the region serving the request.
|
|
8400
|
+
*
|
|
8401
|
+
* @throws {AppwriteException}
|
|
8402
|
+
* @returns {Promise<{}>}
|
|
8403
|
+
*/
|
|
8404
|
+
deletePlatformCache() {
|
|
8405
|
+
const apiPath = '/admin/cache/platform';
|
|
8406
|
+
const apiPayload = {};
|
|
8407
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
8408
|
+
const apiHeaders = {
|
|
8409
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
8410
|
+
'content-type': 'application/json',
|
|
8411
|
+
accept: 'application/json',
|
|
8412
|
+
};
|
|
8413
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
8414
|
+
}
|
|
8415
|
+
deletePlatformResourceCache(paramsOrFirst, ...rest) {
|
|
8416
|
+
let params;
|
|
8417
|
+
if (paramsOrFirst &&
|
|
8418
|
+
typeof paramsOrFirst === 'object' &&
|
|
8419
|
+
!Array.isArray(paramsOrFirst) &&
|
|
8420
|
+
('resourceType' in paramsOrFirst || 'resourceId' in paramsOrFirst)) {
|
|
8421
|
+
params = (paramsOrFirst || {});
|
|
8422
|
+
}
|
|
8423
|
+
else {
|
|
8424
|
+
params = {
|
|
8425
|
+
resourceType: paramsOrFirst,
|
|
8426
|
+
resourceId: rest[0],
|
|
8427
|
+
};
|
|
8428
|
+
}
|
|
8429
|
+
const resourceType = params.resourceType;
|
|
8430
|
+
const resourceId = params.resourceId;
|
|
8431
|
+
if (typeof resourceType === 'undefined') {
|
|
8432
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
8433
|
+
}
|
|
8434
|
+
const apiPath = '/admin/cache/platform/resources';
|
|
8435
|
+
const apiPayload = {};
|
|
8436
|
+
if (typeof resourceType !== 'undefined') {
|
|
8437
|
+
apiPayload['resourceType'] = resourceType;
|
|
8438
|
+
}
|
|
8439
|
+
if (typeof resourceId !== 'undefined') {
|
|
8440
|
+
apiPayload['resourceId'] = resourceId;
|
|
8441
|
+
}
|
|
8442
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
8443
|
+
const apiHeaders = {
|
|
8444
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
8445
|
+
'content-type': 'application/json',
|
|
8446
|
+
accept: 'application/json',
|
|
8447
|
+
};
|
|
8448
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
8449
|
+
}
|
|
8450
|
+
deleteProjectCache(paramsOrFirst) {
|
|
8451
|
+
let params;
|
|
8452
|
+
if (paramsOrFirst &&
|
|
8453
|
+
typeof paramsOrFirst === 'object' &&
|
|
8454
|
+
!Array.isArray(paramsOrFirst)) {
|
|
8455
|
+
params = (paramsOrFirst || {});
|
|
8456
|
+
}
|
|
8457
|
+
else {
|
|
8458
|
+
params = {
|
|
8459
|
+
projectId: paramsOrFirst,
|
|
8460
|
+
};
|
|
8461
|
+
}
|
|
8462
|
+
const projectId = params.projectId;
|
|
8463
|
+
if (typeof projectId === 'undefined') {
|
|
8464
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
8465
|
+
}
|
|
8466
|
+
const apiPath = '/admin/cache/project';
|
|
8467
|
+
const apiPayload = {};
|
|
8468
|
+
if (typeof projectId !== 'undefined') {
|
|
8469
|
+
apiPayload['projectId'] = projectId;
|
|
8470
|
+
}
|
|
8471
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
8472
|
+
const apiHeaders = {
|
|
8473
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
8474
|
+
'content-type': 'application/json',
|
|
8475
|
+
accept: 'application/json',
|
|
8476
|
+
};
|
|
8477
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
8478
|
+
}
|
|
8479
|
+
deleteProjectResourceCache(paramsOrFirst, ...rest) {
|
|
8480
|
+
let params;
|
|
8481
|
+
if (paramsOrFirst &&
|
|
8482
|
+
typeof paramsOrFirst === 'object' &&
|
|
8483
|
+
!Array.isArray(paramsOrFirst)) {
|
|
8484
|
+
params = (paramsOrFirst || {});
|
|
8485
|
+
}
|
|
8486
|
+
else {
|
|
8487
|
+
params = {
|
|
8488
|
+
projectId: paramsOrFirst,
|
|
8489
|
+
resourceType: rest[0],
|
|
8490
|
+
resourceId: rest[1],
|
|
8491
|
+
};
|
|
8492
|
+
}
|
|
8493
|
+
const projectId = params.projectId;
|
|
8494
|
+
const resourceType = params.resourceType;
|
|
8495
|
+
const resourceId = params.resourceId;
|
|
8496
|
+
if (typeof projectId === 'undefined') {
|
|
8497
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
8498
|
+
}
|
|
8499
|
+
if (typeof resourceType === 'undefined') {
|
|
8500
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
8501
|
+
}
|
|
8502
|
+
const apiPath = '/admin/cache/project/resources';
|
|
8503
|
+
const apiPayload = {};
|
|
8504
|
+
if (typeof projectId !== 'undefined') {
|
|
8505
|
+
apiPayload['projectId'] = projectId;
|
|
8506
|
+
}
|
|
8507
|
+
if (typeof resourceType !== 'undefined') {
|
|
8508
|
+
apiPayload['resourceType'] = resourceType;
|
|
8509
|
+
}
|
|
8510
|
+
if (typeof resourceId !== 'undefined') {
|
|
8511
|
+
apiPayload['resourceId'] = resourceId;
|
|
8512
|
+
}
|
|
8513
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
8514
|
+
const apiHeaders = {
|
|
8515
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
8516
|
+
'content-type': 'application/json',
|
|
8517
|
+
accept: 'application/json',
|
|
8518
|
+
};
|
|
8519
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
8520
|
+
}
|
|
8521
|
+
}
|
|
8522
|
+
|
|
8173
8523
|
class Affiliates {
|
|
8174
8524
|
constructor(client) {
|
|
8175
8525
|
this.client = client;
|
|
@@ -8381,6 +8731,369 @@
|
|
|
8381
8731
|
}
|
|
8382
8732
|
}
|
|
8383
8733
|
|
|
8734
|
+
class Analytics {
|
|
8735
|
+
constructor(client) {
|
|
8736
|
+
this.client = client;
|
|
8737
|
+
}
|
|
8738
|
+
listProperties(paramsOrFirst, ...rest) {
|
|
8739
|
+
let params;
|
|
8740
|
+
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
8741
|
+
(paramsOrFirst &&
|
|
8742
|
+
typeof paramsOrFirst === 'object' &&
|
|
8743
|
+
!Array.isArray(paramsOrFirst))) {
|
|
8744
|
+
params = (paramsOrFirst || {});
|
|
8745
|
+
}
|
|
8746
|
+
else {
|
|
8747
|
+
params = {
|
|
8748
|
+
queries: paramsOrFirst,
|
|
8749
|
+
search: rest[0],
|
|
8750
|
+
total: rest[1],
|
|
8751
|
+
};
|
|
8752
|
+
}
|
|
8753
|
+
const queries = params.queries;
|
|
8754
|
+
const search = params.search;
|
|
8755
|
+
const total = params.total;
|
|
8756
|
+
const apiPath = '/analytics/properties';
|
|
8757
|
+
const apiPayload = {};
|
|
8758
|
+
if (typeof queries !== 'undefined') {
|
|
8759
|
+
apiPayload['queries'] = queries;
|
|
8760
|
+
}
|
|
8761
|
+
if (typeof search !== 'undefined') {
|
|
8762
|
+
apiPayload['search'] = search;
|
|
8763
|
+
}
|
|
8764
|
+
if (typeof total !== 'undefined') {
|
|
8765
|
+
apiPayload['total'] = total;
|
|
8766
|
+
}
|
|
8767
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
8768
|
+
const apiHeaders = {
|
|
8769
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
8770
|
+
accept: 'application/json',
|
|
8771
|
+
};
|
|
8772
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
8773
|
+
}
|
|
8774
|
+
createProperty(paramsOrFirst, ...rest) {
|
|
8775
|
+
let params;
|
|
8776
|
+
if (paramsOrFirst &&
|
|
8777
|
+
typeof paramsOrFirst === 'object' &&
|
|
8778
|
+
!Array.isArray(paramsOrFirst)) {
|
|
8779
|
+
params = (paramsOrFirst || {});
|
|
8780
|
+
}
|
|
8781
|
+
else {
|
|
8782
|
+
params = {
|
|
8783
|
+
propertyId: paramsOrFirst,
|
|
8784
|
+
name: rest[0],
|
|
8785
|
+
domain: rest[1],
|
|
8786
|
+
timezone: rest[2],
|
|
8787
|
+
enabled: rest[3],
|
|
8788
|
+
xpublic: rest[4],
|
|
8789
|
+
allowedOrigins: rest[5],
|
|
8790
|
+
};
|
|
8791
|
+
}
|
|
8792
|
+
const propertyId = params.propertyId;
|
|
8793
|
+
const name = params.name;
|
|
8794
|
+
const domain = params.domain;
|
|
8795
|
+
const timezone = params.timezone;
|
|
8796
|
+
const enabled = params.enabled;
|
|
8797
|
+
const xpublic = params.xpublic;
|
|
8798
|
+
const allowedOrigins = params.allowedOrigins;
|
|
8799
|
+
if (typeof propertyId === 'undefined') {
|
|
8800
|
+
throw new AppwriteException('Missing required parameter: "propertyId"');
|
|
8801
|
+
}
|
|
8802
|
+
if (typeof name === 'undefined') {
|
|
8803
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
8804
|
+
}
|
|
8805
|
+
const apiPath = '/analytics/properties';
|
|
8806
|
+
const apiPayload = {};
|
|
8807
|
+
if (typeof propertyId !== 'undefined') {
|
|
8808
|
+
apiPayload['propertyId'] = propertyId;
|
|
8809
|
+
}
|
|
8810
|
+
if (typeof name !== 'undefined') {
|
|
8811
|
+
apiPayload['name'] = name;
|
|
8812
|
+
}
|
|
8813
|
+
if (typeof domain !== 'undefined') {
|
|
8814
|
+
apiPayload['domain'] = domain;
|
|
8815
|
+
}
|
|
8816
|
+
if (typeof timezone !== 'undefined') {
|
|
8817
|
+
apiPayload['timezone'] = timezone;
|
|
8818
|
+
}
|
|
8819
|
+
if (typeof enabled !== 'undefined') {
|
|
8820
|
+
apiPayload['enabled'] = enabled;
|
|
8821
|
+
}
|
|
8822
|
+
if (typeof xpublic !== 'undefined') {
|
|
8823
|
+
apiPayload['public'] = xpublic;
|
|
8824
|
+
}
|
|
8825
|
+
if (typeof allowedOrigins !== 'undefined') {
|
|
8826
|
+
apiPayload['allowedOrigins'] = allowedOrigins;
|
|
8827
|
+
}
|
|
8828
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
8829
|
+
const apiHeaders = {
|
|
8830
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
8831
|
+
'content-type': 'application/json',
|
|
8832
|
+
accept: 'application/json',
|
|
8833
|
+
};
|
|
8834
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
8835
|
+
}
|
|
8836
|
+
getProperty(paramsOrFirst) {
|
|
8837
|
+
let params;
|
|
8838
|
+
if (paramsOrFirst &&
|
|
8839
|
+
typeof paramsOrFirst === 'object' &&
|
|
8840
|
+
!Array.isArray(paramsOrFirst)) {
|
|
8841
|
+
params = (paramsOrFirst || {});
|
|
8842
|
+
}
|
|
8843
|
+
else {
|
|
8844
|
+
params = {
|
|
8845
|
+
propertyId: paramsOrFirst,
|
|
8846
|
+
};
|
|
8847
|
+
}
|
|
8848
|
+
const propertyId = params.propertyId;
|
|
8849
|
+
if (typeof propertyId === 'undefined' || propertyId === '') {
|
|
8850
|
+
throw new AppwriteException('Missing required parameter: "propertyId"');
|
|
8851
|
+
}
|
|
8852
|
+
const apiPath = '/analytics/properties/{propertyId}'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
|
|
8853
|
+
const apiPayload = {};
|
|
8854
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
8855
|
+
const apiHeaders = {
|
|
8856
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
8857
|
+
accept: 'application/json',
|
|
8858
|
+
};
|
|
8859
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
8860
|
+
}
|
|
8861
|
+
updateProperty(paramsOrFirst, ...rest) {
|
|
8862
|
+
let params;
|
|
8863
|
+
if (paramsOrFirst &&
|
|
8864
|
+
typeof paramsOrFirst === 'object' &&
|
|
8865
|
+
!Array.isArray(paramsOrFirst)) {
|
|
8866
|
+
params = (paramsOrFirst || {});
|
|
8867
|
+
}
|
|
8868
|
+
else {
|
|
8869
|
+
params = {
|
|
8870
|
+
propertyId: paramsOrFirst,
|
|
8871
|
+
name: rest[0],
|
|
8872
|
+
domain: rest[1],
|
|
8873
|
+
timezone: rest[2],
|
|
8874
|
+
enabled: rest[3],
|
|
8875
|
+
xpublic: rest[4],
|
|
8876
|
+
allowedOrigins: rest[5],
|
|
8877
|
+
};
|
|
8878
|
+
}
|
|
8879
|
+
const propertyId = params.propertyId;
|
|
8880
|
+
const name = params.name;
|
|
8881
|
+
const domain = params.domain;
|
|
8882
|
+
const timezone = params.timezone;
|
|
8883
|
+
const enabled = params.enabled;
|
|
8884
|
+
const xpublic = params.xpublic;
|
|
8885
|
+
const allowedOrigins = params.allowedOrigins;
|
|
8886
|
+
if (typeof propertyId === 'undefined' || propertyId === '') {
|
|
8887
|
+
throw new AppwriteException('Missing required parameter: "propertyId"');
|
|
8888
|
+
}
|
|
8889
|
+
const apiPath = '/analytics/properties/{propertyId}'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
|
|
8890
|
+
const apiPayload = {};
|
|
8891
|
+
if (typeof name !== 'undefined') {
|
|
8892
|
+
apiPayload['name'] = name;
|
|
8893
|
+
}
|
|
8894
|
+
if (typeof domain !== 'undefined') {
|
|
8895
|
+
apiPayload['domain'] = domain;
|
|
8896
|
+
}
|
|
8897
|
+
if (typeof timezone !== 'undefined') {
|
|
8898
|
+
apiPayload['timezone'] = timezone;
|
|
8899
|
+
}
|
|
8900
|
+
if (typeof enabled !== 'undefined') {
|
|
8901
|
+
apiPayload['enabled'] = enabled;
|
|
8902
|
+
}
|
|
8903
|
+
if (typeof xpublic !== 'undefined') {
|
|
8904
|
+
apiPayload['public'] = xpublic;
|
|
8905
|
+
}
|
|
8906
|
+
if (typeof allowedOrigins !== 'undefined') {
|
|
8907
|
+
apiPayload['allowedOrigins'] = allowedOrigins;
|
|
8908
|
+
}
|
|
8909
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
8910
|
+
const apiHeaders = {
|
|
8911
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
8912
|
+
'content-type': 'application/json',
|
|
8913
|
+
accept: 'application/json',
|
|
8914
|
+
};
|
|
8915
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
8916
|
+
}
|
|
8917
|
+
deleteProperty(paramsOrFirst) {
|
|
8918
|
+
let params;
|
|
8919
|
+
if (paramsOrFirst &&
|
|
8920
|
+
typeof paramsOrFirst === 'object' &&
|
|
8921
|
+
!Array.isArray(paramsOrFirst)) {
|
|
8922
|
+
params = (paramsOrFirst || {});
|
|
8923
|
+
}
|
|
8924
|
+
else {
|
|
8925
|
+
params = {
|
|
8926
|
+
propertyId: paramsOrFirst,
|
|
8927
|
+
};
|
|
8928
|
+
}
|
|
8929
|
+
const propertyId = params.propertyId;
|
|
8930
|
+
if (typeof propertyId === 'undefined' || propertyId === '') {
|
|
8931
|
+
throw new AppwriteException('Missing required parameter: "propertyId"');
|
|
8932
|
+
}
|
|
8933
|
+
const apiPath = '/analytics/properties/{propertyId}'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
|
|
8934
|
+
const apiPayload = {};
|
|
8935
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
8936
|
+
const apiHeaders = {
|
|
8937
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
8938
|
+
'content-type': 'application/json',
|
|
8939
|
+
accept: 'application/json',
|
|
8940
|
+
};
|
|
8941
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
8942
|
+
}
|
|
8943
|
+
createEvent(paramsOrFirst, ...rest) {
|
|
8944
|
+
let params;
|
|
8945
|
+
if (paramsOrFirst &&
|
|
8946
|
+
typeof paramsOrFirst === 'object' &&
|
|
8947
|
+
!Array.isArray(paramsOrFirst)) {
|
|
8948
|
+
params = (paramsOrFirst || {});
|
|
8949
|
+
}
|
|
8950
|
+
else {
|
|
8951
|
+
params = {
|
|
8952
|
+
propertyId: paramsOrFirst,
|
|
8953
|
+
name: rest[0],
|
|
8954
|
+
url: rest[1],
|
|
8955
|
+
domain: rest[2],
|
|
8956
|
+
referrer: rest[3],
|
|
8957
|
+
screenWidth: rest[4],
|
|
8958
|
+
sessionHash: rest[5],
|
|
8959
|
+
scrollDepth: rest[6],
|
|
8960
|
+
engagementTime: rest[7],
|
|
8961
|
+
props: rest[8],
|
|
8962
|
+
userId: rest[9],
|
|
8963
|
+
ip: rest[10],
|
|
8964
|
+
userAgent: rest[11],
|
|
8965
|
+
};
|
|
8966
|
+
}
|
|
8967
|
+
const propertyId = params.propertyId;
|
|
8968
|
+
const name = params.name;
|
|
8969
|
+
const url = params.url;
|
|
8970
|
+
const domain = params.domain;
|
|
8971
|
+
const referrer = params.referrer;
|
|
8972
|
+
const screenWidth = params.screenWidth;
|
|
8973
|
+
const sessionHash = params.sessionHash;
|
|
8974
|
+
const scrollDepth = params.scrollDepth;
|
|
8975
|
+
const engagementTime = params.engagementTime;
|
|
8976
|
+
const props = params.props;
|
|
8977
|
+
const userId = params.userId;
|
|
8978
|
+
const ip = params.ip;
|
|
8979
|
+
const userAgent = params.userAgent;
|
|
8980
|
+
if (typeof propertyId === 'undefined' || propertyId === '') {
|
|
8981
|
+
throw new AppwriteException('Missing required parameter: "propertyId"');
|
|
8982
|
+
}
|
|
8983
|
+
if (typeof name === 'undefined') {
|
|
8984
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
8985
|
+
}
|
|
8986
|
+
if (typeof url === 'undefined') {
|
|
8987
|
+
throw new AppwriteException('Missing required parameter: "url"');
|
|
8988
|
+
}
|
|
8989
|
+
const apiPath = '/analytics/properties/{propertyId}/events'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
|
|
8990
|
+
const apiPayload = {};
|
|
8991
|
+
if (typeof name !== 'undefined') {
|
|
8992
|
+
apiPayload['name'] = name;
|
|
8993
|
+
}
|
|
8994
|
+
if (typeof url !== 'undefined') {
|
|
8995
|
+
apiPayload['url'] = url;
|
|
8996
|
+
}
|
|
8997
|
+
if (typeof domain !== 'undefined') {
|
|
8998
|
+
apiPayload['domain'] = domain;
|
|
8999
|
+
}
|
|
9000
|
+
if (typeof referrer !== 'undefined') {
|
|
9001
|
+
apiPayload['referrer'] = referrer;
|
|
9002
|
+
}
|
|
9003
|
+
if (typeof screenWidth !== 'undefined') {
|
|
9004
|
+
apiPayload['screenWidth'] = screenWidth;
|
|
9005
|
+
}
|
|
9006
|
+
if (typeof sessionHash !== 'undefined') {
|
|
9007
|
+
apiPayload['sessionHash'] = sessionHash;
|
|
9008
|
+
}
|
|
9009
|
+
if (typeof scrollDepth !== 'undefined') {
|
|
9010
|
+
apiPayload['scrollDepth'] = scrollDepth;
|
|
9011
|
+
}
|
|
9012
|
+
if (typeof engagementTime !== 'undefined') {
|
|
9013
|
+
apiPayload['engagementTime'] = engagementTime;
|
|
9014
|
+
}
|
|
9015
|
+
if (typeof props !== 'undefined') {
|
|
9016
|
+
apiPayload['props'] = props;
|
|
9017
|
+
}
|
|
9018
|
+
if (typeof userId !== 'undefined') {
|
|
9019
|
+
apiPayload['userId'] = userId;
|
|
9020
|
+
}
|
|
9021
|
+
if (typeof ip !== 'undefined') {
|
|
9022
|
+
apiPayload['ip'] = ip;
|
|
9023
|
+
}
|
|
9024
|
+
if (typeof userAgent !== 'undefined') {
|
|
9025
|
+
apiPayload['userAgent'] = userAgent;
|
|
9026
|
+
}
|
|
9027
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
9028
|
+
const apiHeaders = {
|
|
9029
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
9030
|
+
'content-type': 'application/json',
|
|
9031
|
+
accept: 'application/json',
|
|
9032
|
+
};
|
|
9033
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
9034
|
+
}
|
|
9035
|
+
listMetrics(paramsOrFirst, ...rest) {
|
|
9036
|
+
let params;
|
|
9037
|
+
if (paramsOrFirst &&
|
|
9038
|
+
typeof paramsOrFirst === 'object' &&
|
|
9039
|
+
!Array.isArray(paramsOrFirst)) {
|
|
9040
|
+
params = (paramsOrFirst || {});
|
|
9041
|
+
}
|
|
9042
|
+
else {
|
|
9043
|
+
params = {
|
|
9044
|
+
propertyId: paramsOrFirst,
|
|
9045
|
+
queries: rest[0],
|
|
9046
|
+
interval: rest[1],
|
|
9047
|
+
dimensions: rest[2],
|
|
9048
|
+
dateRange: rest[3],
|
|
9049
|
+
startAt: rest[4],
|
|
9050
|
+
endAt: rest[5],
|
|
9051
|
+
limit: rest[6],
|
|
9052
|
+
};
|
|
9053
|
+
}
|
|
9054
|
+
const propertyId = params.propertyId;
|
|
9055
|
+
const queries = params.queries;
|
|
9056
|
+
const interval = params.interval;
|
|
9057
|
+
const dimensions = params.dimensions;
|
|
9058
|
+
const dateRange = params.dateRange;
|
|
9059
|
+
const startAt = params.startAt;
|
|
9060
|
+
const endAt = params.endAt;
|
|
9061
|
+
const limit = params.limit;
|
|
9062
|
+
if (typeof propertyId === 'undefined' || propertyId === '') {
|
|
9063
|
+
throw new AppwriteException('Missing required parameter: "propertyId"');
|
|
9064
|
+
}
|
|
9065
|
+
const apiPath = '/analytics/properties/{propertyId}/metrics'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
|
|
9066
|
+
const apiPayload = {};
|
|
9067
|
+
if (typeof queries !== 'undefined') {
|
|
9068
|
+
apiPayload['queries'] = queries;
|
|
9069
|
+
}
|
|
9070
|
+
if (typeof interval !== 'undefined') {
|
|
9071
|
+
apiPayload['interval'] = interval;
|
|
9072
|
+
}
|
|
9073
|
+
if (typeof dimensions !== 'undefined') {
|
|
9074
|
+
apiPayload['dimensions'] = dimensions;
|
|
9075
|
+
}
|
|
9076
|
+
if (typeof dateRange !== 'undefined') {
|
|
9077
|
+
apiPayload['dateRange'] = dateRange;
|
|
9078
|
+
}
|
|
9079
|
+
if (typeof startAt !== 'undefined') {
|
|
9080
|
+
apiPayload['startAt'] = startAt;
|
|
9081
|
+
}
|
|
9082
|
+
if (typeof endAt !== 'undefined') {
|
|
9083
|
+
apiPayload['endAt'] = endAt;
|
|
9084
|
+
}
|
|
9085
|
+
if (typeof limit !== 'undefined') {
|
|
9086
|
+
apiPayload['limit'] = limit;
|
|
9087
|
+
}
|
|
9088
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
9089
|
+
const apiHeaders = {
|
|
9090
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
9091
|
+
accept: 'application/json',
|
|
9092
|
+
};
|
|
9093
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
9094
|
+
}
|
|
9095
|
+
}
|
|
9096
|
+
|
|
8384
9097
|
class Apps {
|
|
8385
9098
|
constructor(client) {
|
|
8386
9099
|
this.client = client;
|
|
@@ -9273,7 +9986,7 @@
|
|
|
9273
9986
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
9274
9987
|
apiPayload['project'] = this.client.config.project;
|
|
9275
9988
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
9276
|
-
for (const [key, value] of Object.entries(
|
|
9989
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
9277
9990
|
uri.searchParams.append(key, value);
|
|
9278
9991
|
}
|
|
9279
9992
|
return uri.toString();
|
|
@@ -9318,7 +10031,7 @@
|
|
|
9318
10031
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
9319
10032
|
apiPayload['project'] = this.client.config.project;
|
|
9320
10033
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
9321
|
-
for (const [key, value] of Object.entries(
|
|
10034
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
9322
10035
|
uri.searchParams.append(key, value);
|
|
9323
10036
|
}
|
|
9324
10037
|
return uri.toString();
|
|
@@ -9347,7 +10060,7 @@
|
|
|
9347
10060
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
9348
10061
|
apiPayload['project'] = this.client.config.project;
|
|
9349
10062
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
9350
|
-
for (const [key, value] of Object.entries(
|
|
10063
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
9351
10064
|
uri.searchParams.append(key, value);
|
|
9352
10065
|
}
|
|
9353
10066
|
return uri.toString();
|
|
@@ -9392,7 +10105,7 @@
|
|
|
9392
10105
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
9393
10106
|
apiPayload['project'] = this.client.config.project;
|
|
9394
10107
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
9395
|
-
for (const [key, value] of Object.entries(
|
|
10108
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
9396
10109
|
uri.searchParams.append(key, value);
|
|
9397
10110
|
}
|
|
9398
10111
|
return uri.toString();
|
|
@@ -9431,7 +10144,7 @@
|
|
|
9431
10144
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
9432
10145
|
apiPayload['project'] = this.client.config.project;
|
|
9433
10146
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
9434
|
-
for (const [key, value] of Object.entries(
|
|
10147
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
9435
10148
|
uri.searchParams.append(key, value);
|
|
9436
10149
|
}
|
|
9437
10150
|
return uri.toString();
|
|
@@ -9473,7 +10186,7 @@
|
|
|
9473
10186
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
9474
10187
|
apiPayload['project'] = this.client.config.project;
|
|
9475
10188
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
9476
|
-
for (const [key, value] of Object.entries(
|
|
10189
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
9477
10190
|
uri.searchParams.append(key, value);
|
|
9478
10191
|
}
|
|
9479
10192
|
return uri.toString();
|
|
@@ -9535,7 +10248,7 @@
|
|
|
9535
10248
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
9536
10249
|
apiPayload['project'] = this.client.config.project;
|
|
9537
10250
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
9538
|
-
for (const [key, value] of Object.entries(
|
|
10251
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
9539
10252
|
uri.searchParams.append(key, value);
|
|
9540
10253
|
}
|
|
9541
10254
|
return uri.toString();
|
|
@@ -9629,7 +10342,7 @@
|
|
|
9629
10342
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
9630
10343
|
apiPayload['project'] = this.client.config.project;
|
|
9631
10344
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
9632
|
-
for (const [key, value] of Object.entries(
|
|
10345
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
9633
10346
|
uri.searchParams.append(key, value);
|
|
9634
10347
|
}
|
|
9635
10348
|
return uri.toString();
|
|
@@ -9753,7 +10466,7 @@
|
|
|
9753
10466
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
9754
10467
|
apiPayload['project'] = this.client.config.project;
|
|
9755
10468
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
9756
|
-
for (const [key, value] of Object.entries(
|
|
10469
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
9757
10470
|
uri.searchParams.append(key, value);
|
|
9758
10471
|
}
|
|
9759
10472
|
return uri.toString();
|
|
@@ -19329,7 +20042,7 @@
|
|
|
19329
20042
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
19330
20043
|
apiPayload['project'] = this.client.config.project;
|
|
19331
20044
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
19332
|
-
for (const [key, value] of Object.entries(
|
|
20045
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
19333
20046
|
uri.searchParams.append(key, value);
|
|
19334
20047
|
}
|
|
19335
20048
|
return uri.toString();
|
|
@@ -29968,7 +30681,7 @@
|
|
|
29968
30681
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
29969
30682
|
apiPayload['project'] = this.client.config.project;
|
|
29970
30683
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
29971
|
-
for (const [key, value] of Object.entries(
|
|
30684
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
29972
30685
|
uri.searchParams.append(key, value);
|
|
29973
30686
|
}
|
|
29974
30687
|
return uri.toString();
|
|
@@ -30075,7 +30788,7 @@
|
|
|
30075
30788
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
30076
30789
|
apiPayload['project'] = this.client.config.project;
|
|
30077
30790
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
30078
|
-
for (const [key, value] of Object.entries(
|
|
30791
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
30079
30792
|
uri.searchParams.append(key, value);
|
|
30080
30793
|
}
|
|
30081
30794
|
return uri.toString();
|
|
@@ -35571,6 +36284,38 @@
|
|
|
35571
36284
|
};
|
|
35572
36285
|
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
35573
36286
|
}
|
|
36287
|
+
updatePasskeyPolicy(paramsOrFirst, ...rest) {
|
|
36288
|
+
let params;
|
|
36289
|
+
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
36290
|
+
(paramsOrFirst &&
|
|
36291
|
+
typeof paramsOrFirst === 'object' &&
|
|
36292
|
+
!Array.isArray(paramsOrFirst))) {
|
|
36293
|
+
params = (paramsOrFirst || {});
|
|
36294
|
+
}
|
|
36295
|
+
else {
|
|
36296
|
+
params = {
|
|
36297
|
+
rpId: paramsOrFirst,
|
|
36298
|
+
origins: rest[0],
|
|
36299
|
+
};
|
|
36300
|
+
}
|
|
36301
|
+
const rpId = params.rpId;
|
|
36302
|
+
const origins = params.origins;
|
|
36303
|
+
const apiPath = '/project/policies/passkey';
|
|
36304
|
+
const apiPayload = {};
|
|
36305
|
+
if (typeof rpId !== 'undefined') {
|
|
36306
|
+
apiPayload['rpId'] = rpId;
|
|
36307
|
+
}
|
|
36308
|
+
if (typeof origins !== 'undefined') {
|
|
36309
|
+
apiPayload['origins'] = origins;
|
|
36310
|
+
}
|
|
36311
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
36312
|
+
const apiHeaders = {
|
|
36313
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
36314
|
+
'content-type': 'application/json',
|
|
36315
|
+
accept: 'application/json',
|
|
36316
|
+
};
|
|
36317
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
36318
|
+
}
|
|
35574
36319
|
updatePasswordDictionaryPolicy(paramsOrFirst) {
|
|
35575
36320
|
let params;
|
|
35576
36321
|
if (paramsOrFirst &&
|
|
@@ -38259,7 +39004,7 @@
|
|
|
38259
39004
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
38260
39005
|
apiPayload['project'] = this.client.config.project;
|
|
38261
39006
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
38262
|
-
for (const [key, value] of Object.entries(
|
|
39007
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
38263
39008
|
uri.searchParams.append(key, value);
|
|
38264
39009
|
}
|
|
38265
39010
|
return uri.toString();
|
|
@@ -39090,7 +39835,7 @@
|
|
|
39090
39835
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
39091
39836
|
apiPayload['project'] = this.client.config.project;
|
|
39092
39837
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
39093
|
-
for (const [key, value] of Object.entries(
|
|
39838
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
39094
39839
|
uri.searchParams.append(key, value);
|
|
39095
39840
|
}
|
|
39096
39841
|
return uri.toString();
|
|
@@ -39183,7 +39928,7 @@
|
|
|
39183
39928
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
39184
39929
|
apiPayload['project'] = this.client.config.project;
|
|
39185
39930
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
39186
|
-
for (const [key, value] of Object.entries(
|
|
39931
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
39187
39932
|
uri.searchParams.append(key, value);
|
|
39188
39933
|
}
|
|
39189
39934
|
return uri.toString();
|
|
@@ -39221,7 +39966,7 @@
|
|
|
39221
39966
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
39222
39967
|
apiPayload['project'] = this.client.config.project;
|
|
39223
39968
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
39224
|
-
for (const [key, value] of Object.entries(
|
|
39969
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
39225
39970
|
uri.searchParams.append(key, value);
|
|
39226
39971
|
}
|
|
39227
39972
|
return uri.toString();
|
|
@@ -45532,6 +46277,106 @@
|
|
|
45532
46277
|
};
|
|
45533
46278
|
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
45534
46279
|
}
|
|
46280
|
+
listPasskeys(paramsOrFirst, ...rest) {
|
|
46281
|
+
let params;
|
|
46282
|
+
if (paramsOrFirst &&
|
|
46283
|
+
typeof paramsOrFirst === 'object' &&
|
|
46284
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46285
|
+
params = (paramsOrFirst || {});
|
|
46286
|
+
}
|
|
46287
|
+
else {
|
|
46288
|
+
params = {
|
|
46289
|
+
userId: paramsOrFirst,
|
|
46290
|
+
queries: rest[0],
|
|
46291
|
+
total: rest[1],
|
|
46292
|
+
};
|
|
46293
|
+
}
|
|
46294
|
+
const userId = params.userId;
|
|
46295
|
+
const queries = params.queries;
|
|
46296
|
+
const total = params.total;
|
|
46297
|
+
if (typeof userId === 'undefined' || userId === '') {
|
|
46298
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
46299
|
+
}
|
|
46300
|
+
const apiPath = '/users/{userId}/passkeys'.replace('{userId}', encodeURIComponent(String(userId)));
|
|
46301
|
+
const apiPayload = {};
|
|
46302
|
+
if (typeof queries !== 'undefined') {
|
|
46303
|
+
apiPayload['queries'] = queries;
|
|
46304
|
+
}
|
|
46305
|
+
if (typeof total !== 'undefined') {
|
|
46306
|
+
apiPayload['total'] = total;
|
|
46307
|
+
}
|
|
46308
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46309
|
+
const apiHeaders = {
|
|
46310
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46311
|
+
accept: 'application/json',
|
|
46312
|
+
};
|
|
46313
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
46314
|
+
}
|
|
46315
|
+
getPasskey(paramsOrFirst, ...rest) {
|
|
46316
|
+
let params;
|
|
46317
|
+
if (paramsOrFirst &&
|
|
46318
|
+
typeof paramsOrFirst === 'object' &&
|
|
46319
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46320
|
+
params = (paramsOrFirst || {});
|
|
46321
|
+
}
|
|
46322
|
+
else {
|
|
46323
|
+
params = {
|
|
46324
|
+
userId: paramsOrFirst,
|
|
46325
|
+
passkeyId: rest[0],
|
|
46326
|
+
};
|
|
46327
|
+
}
|
|
46328
|
+
const userId = params.userId;
|
|
46329
|
+
const passkeyId = params.passkeyId;
|
|
46330
|
+
if (typeof userId === 'undefined' || userId === '') {
|
|
46331
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
46332
|
+
}
|
|
46333
|
+
if (typeof passkeyId === 'undefined' || passkeyId === '') {
|
|
46334
|
+
throw new AppwriteException('Missing required parameter: "passkeyId"');
|
|
46335
|
+
}
|
|
46336
|
+
const apiPath = '/users/{userId}/passkeys/{passkeyId}'
|
|
46337
|
+
.replace('{userId}', encodeURIComponent(String(userId)))
|
|
46338
|
+
.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
|
|
46339
|
+
const apiPayload = {};
|
|
46340
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46341
|
+
const apiHeaders = {
|
|
46342
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46343
|
+
accept: 'application/json',
|
|
46344
|
+
};
|
|
46345
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
46346
|
+
}
|
|
46347
|
+
deletePasskey(paramsOrFirst, ...rest) {
|
|
46348
|
+
let params;
|
|
46349
|
+
if (paramsOrFirst &&
|
|
46350
|
+
typeof paramsOrFirst === 'object' &&
|
|
46351
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46352
|
+
params = (paramsOrFirst || {});
|
|
46353
|
+
}
|
|
46354
|
+
else {
|
|
46355
|
+
params = {
|
|
46356
|
+
userId: paramsOrFirst,
|
|
46357
|
+
passkeyId: rest[0],
|
|
46358
|
+
};
|
|
46359
|
+
}
|
|
46360
|
+
const userId = params.userId;
|
|
46361
|
+
const passkeyId = params.passkeyId;
|
|
46362
|
+
if (typeof userId === 'undefined' || userId === '') {
|
|
46363
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
46364
|
+
}
|
|
46365
|
+
if (typeof passkeyId === 'undefined' || passkeyId === '') {
|
|
46366
|
+
throw new AppwriteException('Missing required parameter: "passkeyId"');
|
|
46367
|
+
}
|
|
46368
|
+
const apiPath = '/users/{userId}/passkeys/{passkeyId}'
|
|
46369
|
+
.replace('{userId}', encodeURIComponent(String(userId)))
|
|
46370
|
+
.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
|
|
46371
|
+
const apiPayload = {};
|
|
46372
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46373
|
+
const apiHeaders = {
|
|
46374
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46375
|
+
'content-type': 'application/json',
|
|
46376
|
+
accept: 'application/json',
|
|
46377
|
+
};
|
|
46378
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
46379
|
+
}
|
|
45535
46380
|
updatePassword(paramsOrFirst, ...rest) {
|
|
45536
46381
|
let params;
|
|
45537
46382
|
if (paramsOrFirst &&
|
|
@@ -48038,11 +48883,11 @@
|
|
|
48038
48883
|
}
|
|
48039
48884
|
}
|
|
48040
48885
|
|
|
48041
|
-
class
|
|
48886
|
+
class Videos {
|
|
48042
48887
|
constructor(client) {
|
|
48043
48888
|
this.client = client;
|
|
48044
48889
|
}
|
|
48045
|
-
|
|
48890
|
+
list(paramsOrFirst, ...rest) {
|
|
48046
48891
|
let params;
|
|
48047
48892
|
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
48048
48893
|
(paramsOrFirst &&
|
|
@@ -48060,7 +48905,7 @@
|
|
|
48060
48905
|
const queries = params.queries;
|
|
48061
48906
|
const search = params.search;
|
|
48062
48907
|
const total = params.total;
|
|
48063
|
-
const apiPath = '/
|
|
48908
|
+
const apiPath = '/videos';
|
|
48064
48909
|
const apiPayload = {};
|
|
48065
48910
|
if (typeof queries !== 'undefined') {
|
|
48066
48911
|
apiPayload['queries'] = queries;
|
|
@@ -48078,7 +48923,7 @@
|
|
|
48078
48923
|
};
|
|
48079
48924
|
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
48080
48925
|
}
|
|
48081
|
-
|
|
48926
|
+
create(paramsOrFirst, ...rest) {
|
|
48082
48927
|
let params;
|
|
48083
48928
|
if (paramsOrFirst &&
|
|
48084
48929
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -48087,59 +48932,31 @@
|
|
|
48087
48932
|
}
|
|
48088
48933
|
else {
|
|
48089
48934
|
params = {
|
|
48090
|
-
|
|
48091
|
-
|
|
48935
|
+
bucketId: paramsOrFirst,
|
|
48936
|
+
fileId: rest[0],
|
|
48092
48937
|
name: rest[1],
|
|
48093
|
-
resourceId: rest[2],
|
|
48094
|
-
description: rest[3],
|
|
48095
|
-
priority: rest[4],
|
|
48096
|
-
enabled: rest[5],
|
|
48097
|
-
conditions: rest[6],
|
|
48098
48938
|
};
|
|
48099
48939
|
}
|
|
48100
|
-
const
|
|
48101
|
-
const
|
|
48940
|
+
const bucketId = params.bucketId;
|
|
48941
|
+
const fileId = params.fileId;
|
|
48102
48942
|
const name = params.name;
|
|
48103
|
-
|
|
48104
|
-
|
|
48105
|
-
const priority = params.priority;
|
|
48106
|
-
const enabled = params.enabled;
|
|
48107
|
-
const conditions = params.conditions;
|
|
48108
|
-
if (typeof ruleId === 'undefined') {
|
|
48109
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
48110
|
-
}
|
|
48111
|
-
if (typeof resourceType === 'undefined') {
|
|
48112
|
-
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
48943
|
+
if (typeof bucketId === 'undefined') {
|
|
48944
|
+
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
48113
48945
|
}
|
|
48114
|
-
if (typeof
|
|
48115
|
-
throw new AppwriteException('Missing required parameter: "
|
|
48946
|
+
if (typeof fileId === 'undefined') {
|
|
48947
|
+
throw new AppwriteException('Missing required parameter: "fileId"');
|
|
48116
48948
|
}
|
|
48117
|
-
const apiPath = '/
|
|
48949
|
+
const apiPath = '/videos';
|
|
48118
48950
|
const apiPayload = {};
|
|
48119
|
-
if (typeof
|
|
48120
|
-
apiPayload['
|
|
48121
|
-
}
|
|
48122
|
-
if (typeof resourceType !== 'undefined') {
|
|
48123
|
-
apiPayload['resourceType'] = resourceType;
|
|
48951
|
+
if (typeof bucketId !== 'undefined') {
|
|
48952
|
+
apiPayload['bucketId'] = bucketId;
|
|
48124
48953
|
}
|
|
48125
|
-
if (typeof
|
|
48126
|
-
apiPayload['
|
|
48954
|
+
if (typeof fileId !== 'undefined') {
|
|
48955
|
+
apiPayload['fileId'] = fileId;
|
|
48127
48956
|
}
|
|
48128
48957
|
if (typeof name !== 'undefined') {
|
|
48129
48958
|
apiPayload['name'] = name;
|
|
48130
48959
|
}
|
|
48131
|
-
if (typeof description !== 'undefined') {
|
|
48132
|
-
apiPayload['description'] = description;
|
|
48133
|
-
}
|
|
48134
|
-
if (typeof priority !== 'undefined') {
|
|
48135
|
-
apiPayload['priority'] = priority;
|
|
48136
|
-
}
|
|
48137
|
-
if (typeof enabled !== 'undefined') {
|
|
48138
|
-
apiPayload['enabled'] = enabled;
|
|
48139
|
-
}
|
|
48140
|
-
if (typeof conditions !== 'undefined') {
|
|
48141
|
-
apiPayload['conditions'] = conditions;
|
|
48142
|
-
}
|
|
48143
48960
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
48144
48961
|
const apiHeaders = {
|
|
48145
48962
|
'X-Appwrite-Project': this.client.config.project,
|
|
@@ -48148,68 +48965,33 @@
|
|
|
48148
48965
|
};
|
|
48149
48966
|
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
48150
48967
|
}
|
|
48151
|
-
|
|
48968
|
+
listProfiles(paramsOrFirst) {
|
|
48152
48969
|
let params;
|
|
48153
|
-
if (paramsOrFirst
|
|
48154
|
-
|
|
48155
|
-
|
|
48970
|
+
if (typeof paramsOrFirst === 'undefined' ||
|
|
48971
|
+
(paramsOrFirst &&
|
|
48972
|
+
typeof paramsOrFirst === 'object' &&
|
|
48973
|
+
!Array.isArray(paramsOrFirst))) {
|
|
48156
48974
|
params = (paramsOrFirst || {});
|
|
48157
48975
|
}
|
|
48158
48976
|
else {
|
|
48159
48977
|
params = {
|
|
48160
|
-
|
|
48161
|
-
resourceType: rest[0],
|
|
48162
|
-
resourceId: rest[1],
|
|
48163
|
-
name: rest[2],
|
|
48164
|
-
description: rest[3],
|
|
48165
|
-
priority: rest[4],
|
|
48166
|
-
enabled: rest[5],
|
|
48167
|
-
conditions: rest[6],
|
|
48978
|
+
search: paramsOrFirst,
|
|
48168
48979
|
};
|
|
48169
48980
|
}
|
|
48170
|
-
const
|
|
48171
|
-
const
|
|
48172
|
-
const resourceId = params.resourceId;
|
|
48173
|
-
const name = params.name;
|
|
48174
|
-
const description = params.description;
|
|
48175
|
-
const priority = params.priority;
|
|
48176
|
-
const enabled = params.enabled;
|
|
48177
|
-
const conditions = params.conditions;
|
|
48178
|
-
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
48179
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
48180
|
-
}
|
|
48181
|
-
const apiPath = '/waf/rules/bypass/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
|
|
48981
|
+
const search = params.search;
|
|
48982
|
+
const apiPath = '/videos/profiles';
|
|
48182
48983
|
const apiPayload = {};
|
|
48183
|
-
if (typeof
|
|
48184
|
-
apiPayload['
|
|
48185
|
-
}
|
|
48186
|
-
if (typeof resourceId !== 'undefined') {
|
|
48187
|
-
apiPayload['resourceId'] = resourceId;
|
|
48188
|
-
}
|
|
48189
|
-
if (typeof name !== 'undefined') {
|
|
48190
|
-
apiPayload['name'] = name;
|
|
48191
|
-
}
|
|
48192
|
-
if (typeof description !== 'undefined') {
|
|
48193
|
-
apiPayload['description'] = description;
|
|
48194
|
-
}
|
|
48195
|
-
if (typeof priority !== 'undefined') {
|
|
48196
|
-
apiPayload['priority'] = priority;
|
|
48197
|
-
}
|
|
48198
|
-
if (typeof enabled !== 'undefined') {
|
|
48199
|
-
apiPayload['enabled'] = enabled;
|
|
48200
|
-
}
|
|
48201
|
-
if (typeof conditions !== 'undefined') {
|
|
48202
|
-
apiPayload['conditions'] = conditions;
|
|
48984
|
+
if (typeof search !== 'undefined') {
|
|
48985
|
+
apiPayload['search'] = search;
|
|
48203
48986
|
}
|
|
48204
48987
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
48205
48988
|
const apiHeaders = {
|
|
48206
48989
|
'X-Appwrite-Project': this.client.config.project,
|
|
48207
|
-
'content-type': 'application/json',
|
|
48208
48990
|
accept: 'application/json',
|
|
48209
48991
|
};
|
|
48210
|
-
return this.client.call('
|
|
48992
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
48211
48993
|
}
|
|
48212
|
-
|
|
48994
|
+
createProfile(paramsOrFirst, ...rest) {
|
|
48213
48995
|
let params;
|
|
48214
48996
|
if (paramsOrFirst &&
|
|
48215
48997
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -48218,73 +49000,49 @@
|
|
|
48218
49000
|
}
|
|
48219
49001
|
else {
|
|
48220
49002
|
params = {
|
|
48221
|
-
|
|
48222
|
-
|
|
48223
|
-
|
|
48224
|
-
|
|
48225
|
-
|
|
48226
|
-
challengeType: rest[4],
|
|
48227
|
-
priority: rest[5],
|
|
48228
|
-
enabled: rest[6],
|
|
48229
|
-
conditions: rest[7],
|
|
48230
|
-
difficulty: rest[8],
|
|
48231
|
-
ttl: rest[9],
|
|
49003
|
+
name: paramsOrFirst,
|
|
49004
|
+
videoBitRate: rest[0],
|
|
49005
|
+
audioBitRate: rest[1],
|
|
49006
|
+
width: rest[2],
|
|
49007
|
+
height: rest[3],
|
|
48232
49008
|
};
|
|
48233
49009
|
}
|
|
48234
|
-
const ruleId = params.ruleId;
|
|
48235
|
-
const resourceType = params.resourceType;
|
|
48236
49010
|
const name = params.name;
|
|
48237
|
-
const
|
|
48238
|
-
const
|
|
48239
|
-
const
|
|
48240
|
-
const
|
|
48241
|
-
const enabled = params.enabled;
|
|
48242
|
-
const conditions = params.conditions;
|
|
48243
|
-
const difficulty = params.difficulty;
|
|
48244
|
-
const ttl = params.ttl;
|
|
48245
|
-
if (typeof ruleId === 'undefined') {
|
|
48246
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
48247
|
-
}
|
|
48248
|
-
if (typeof resourceType === 'undefined') {
|
|
48249
|
-
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
48250
|
-
}
|
|
49011
|
+
const videoBitRate = params.videoBitRate;
|
|
49012
|
+
const audioBitRate = params.audioBitRate;
|
|
49013
|
+
const width = params.width;
|
|
49014
|
+
const height = params.height;
|
|
48251
49015
|
if (typeof name === 'undefined') {
|
|
48252
49016
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
48253
49017
|
}
|
|
48254
|
-
|
|
48255
|
-
|
|
48256
|
-
if (typeof ruleId !== 'undefined') {
|
|
48257
|
-
apiPayload['ruleId'] = ruleId;
|
|
49018
|
+
if (typeof videoBitRate === 'undefined') {
|
|
49019
|
+
throw new AppwriteException('Missing required parameter: "videoBitRate"');
|
|
48258
49020
|
}
|
|
48259
|
-
if (typeof
|
|
48260
|
-
|
|
49021
|
+
if (typeof audioBitRate === 'undefined') {
|
|
49022
|
+
throw new AppwriteException('Missing required parameter: "audioBitRate"');
|
|
48261
49023
|
}
|
|
48262
|
-
if (typeof
|
|
48263
|
-
|
|
49024
|
+
if (typeof width === 'undefined') {
|
|
49025
|
+
throw new AppwriteException('Missing required parameter: "width"');
|
|
48264
49026
|
}
|
|
49027
|
+
if (typeof height === 'undefined') {
|
|
49028
|
+
throw new AppwriteException('Missing required parameter: "height"');
|
|
49029
|
+
}
|
|
49030
|
+
const apiPath = '/videos/profiles';
|
|
49031
|
+
const apiPayload = {};
|
|
48265
49032
|
if (typeof name !== 'undefined') {
|
|
48266
49033
|
apiPayload['name'] = name;
|
|
48267
49034
|
}
|
|
48268
|
-
if (typeof
|
|
48269
|
-
apiPayload['
|
|
48270
|
-
}
|
|
48271
|
-
if (typeof challengeType !== 'undefined') {
|
|
48272
|
-
apiPayload['challengeType'] = challengeType;
|
|
48273
|
-
}
|
|
48274
|
-
if (typeof priority !== 'undefined') {
|
|
48275
|
-
apiPayload['priority'] = priority;
|
|
48276
|
-
}
|
|
48277
|
-
if (typeof enabled !== 'undefined') {
|
|
48278
|
-
apiPayload['enabled'] = enabled;
|
|
49035
|
+
if (typeof videoBitRate !== 'undefined') {
|
|
49036
|
+
apiPayload['videoBitRate'] = videoBitRate;
|
|
48279
49037
|
}
|
|
48280
|
-
if (typeof
|
|
48281
|
-
apiPayload['
|
|
49038
|
+
if (typeof audioBitRate !== 'undefined') {
|
|
49039
|
+
apiPayload['audioBitRate'] = audioBitRate;
|
|
48282
49040
|
}
|
|
48283
|
-
if (typeof
|
|
48284
|
-
apiPayload['
|
|
49041
|
+
if (typeof width !== 'undefined') {
|
|
49042
|
+
apiPayload['width'] = width;
|
|
48285
49043
|
}
|
|
48286
|
-
if (typeof
|
|
48287
|
-
apiPayload['
|
|
49044
|
+
if (typeof height !== 'undefined') {
|
|
49045
|
+
apiPayload['height'] = height;
|
|
48288
49046
|
}
|
|
48289
49047
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
48290
49048
|
const apiHeaders = {
|
|
@@ -48294,7 +49052,7 @@
|
|
|
48294
49052
|
};
|
|
48295
49053
|
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
48296
49054
|
}
|
|
48297
|
-
|
|
49055
|
+
getProfile(paramsOrFirst) {
|
|
48298
49056
|
let params;
|
|
48299
49057
|
if (paramsOrFirst &&
|
|
48300
49058
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -48303,74 +49061,23 @@
|
|
|
48303
49061
|
}
|
|
48304
49062
|
else {
|
|
48305
49063
|
params = {
|
|
48306
|
-
|
|
48307
|
-
resourceType: rest[0],
|
|
48308
|
-
resourceId: rest[1],
|
|
48309
|
-
name: rest[2],
|
|
48310
|
-
description: rest[3],
|
|
48311
|
-
challengeType: rest[4],
|
|
48312
|
-
priority: rest[5],
|
|
48313
|
-
enabled: rest[6],
|
|
48314
|
-
conditions: rest[7],
|
|
48315
|
-
difficulty: rest[8],
|
|
48316
|
-
ttl: rest[9],
|
|
49064
|
+
profileId: paramsOrFirst,
|
|
48317
49065
|
};
|
|
48318
49066
|
}
|
|
48319
|
-
const
|
|
48320
|
-
|
|
48321
|
-
|
|
48322
|
-
const name = params.name;
|
|
48323
|
-
const description = params.description;
|
|
48324
|
-
const challengeType = params.challengeType;
|
|
48325
|
-
const priority = params.priority;
|
|
48326
|
-
const enabled = params.enabled;
|
|
48327
|
-
const conditions = params.conditions;
|
|
48328
|
-
const difficulty = params.difficulty;
|
|
48329
|
-
const ttl = params.ttl;
|
|
48330
|
-
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
48331
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
49067
|
+
const profileId = params.profileId;
|
|
49068
|
+
if (typeof profileId === 'undefined' || profileId === '') {
|
|
49069
|
+
throw new AppwriteException('Missing required parameter: "profileId"');
|
|
48332
49070
|
}
|
|
48333
|
-
const apiPath = '/
|
|
49071
|
+
const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
|
|
48334
49072
|
const apiPayload = {};
|
|
48335
|
-
if (typeof resourceType !== 'undefined') {
|
|
48336
|
-
apiPayload['resourceType'] = resourceType;
|
|
48337
|
-
}
|
|
48338
|
-
if (typeof resourceId !== 'undefined') {
|
|
48339
|
-
apiPayload['resourceId'] = resourceId;
|
|
48340
|
-
}
|
|
48341
|
-
if (typeof name !== 'undefined') {
|
|
48342
|
-
apiPayload['name'] = name;
|
|
48343
|
-
}
|
|
48344
|
-
if (typeof description !== 'undefined') {
|
|
48345
|
-
apiPayload['description'] = description;
|
|
48346
|
-
}
|
|
48347
|
-
if (typeof challengeType !== 'undefined') {
|
|
48348
|
-
apiPayload['challengeType'] = challengeType;
|
|
48349
|
-
}
|
|
48350
|
-
if (typeof priority !== 'undefined') {
|
|
48351
|
-
apiPayload['priority'] = priority;
|
|
48352
|
-
}
|
|
48353
|
-
if (typeof enabled !== 'undefined') {
|
|
48354
|
-
apiPayload['enabled'] = enabled;
|
|
48355
|
-
}
|
|
48356
|
-
if (typeof conditions !== 'undefined') {
|
|
48357
|
-
apiPayload['conditions'] = conditions;
|
|
48358
|
-
}
|
|
48359
|
-
if (typeof difficulty !== 'undefined') {
|
|
48360
|
-
apiPayload['difficulty'] = difficulty;
|
|
48361
|
-
}
|
|
48362
|
-
if (typeof ttl !== 'undefined') {
|
|
48363
|
-
apiPayload['ttl'] = ttl;
|
|
48364
|
-
}
|
|
48365
49073
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
48366
49074
|
const apiHeaders = {
|
|
48367
49075
|
'X-Appwrite-Project': this.client.config.project,
|
|
48368
|
-
'content-type': 'application/json',
|
|
48369
49076
|
accept: 'application/json',
|
|
48370
49077
|
};
|
|
48371
|
-
return this.client.call('
|
|
49078
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
48372
49079
|
}
|
|
48373
|
-
|
|
49080
|
+
updateProfile(paramsOrFirst, ...rest) {
|
|
48374
49081
|
let params;
|
|
48375
49082
|
if (paramsOrFirst &&
|
|
48376
49083
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -48379,58 +49086,54 @@
|
|
|
48379
49086
|
}
|
|
48380
49087
|
else {
|
|
48381
49088
|
params = {
|
|
48382
|
-
|
|
48383
|
-
|
|
48384
|
-
|
|
48385
|
-
|
|
48386
|
-
|
|
48387
|
-
|
|
48388
|
-
enabled: rest[5],
|
|
48389
|
-
conditions: rest[6],
|
|
49089
|
+
profileId: paramsOrFirst,
|
|
49090
|
+
name: rest[0],
|
|
49091
|
+
videoBitRate: rest[1],
|
|
49092
|
+
audioBitRate: rest[2],
|
|
49093
|
+
width: rest[3],
|
|
49094
|
+
height: rest[4],
|
|
48390
49095
|
};
|
|
48391
49096
|
}
|
|
48392
|
-
const
|
|
48393
|
-
const resourceType = params.resourceType;
|
|
49097
|
+
const profileId = params.profileId;
|
|
48394
49098
|
const name = params.name;
|
|
48395
|
-
const
|
|
48396
|
-
const
|
|
48397
|
-
const
|
|
48398
|
-
const
|
|
48399
|
-
|
|
48400
|
-
|
|
48401
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
48402
|
-
}
|
|
48403
|
-
if (typeof resourceType === 'undefined') {
|
|
48404
|
-
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
49099
|
+
const videoBitRate = params.videoBitRate;
|
|
49100
|
+
const audioBitRate = params.audioBitRate;
|
|
49101
|
+
const width = params.width;
|
|
49102
|
+
const height = params.height;
|
|
49103
|
+
if (typeof profileId === 'undefined' || profileId === '') {
|
|
49104
|
+
throw new AppwriteException('Missing required parameter: "profileId"');
|
|
48405
49105
|
}
|
|
48406
49106
|
if (typeof name === 'undefined') {
|
|
48407
49107
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
48408
49108
|
}
|
|
48409
|
-
|
|
48410
|
-
|
|
48411
|
-
if (typeof ruleId !== 'undefined') {
|
|
48412
|
-
apiPayload['ruleId'] = ruleId;
|
|
49109
|
+
if (typeof videoBitRate === 'undefined') {
|
|
49110
|
+
throw new AppwriteException('Missing required parameter: "videoBitRate"');
|
|
48413
49111
|
}
|
|
48414
|
-
if (typeof
|
|
48415
|
-
|
|
49112
|
+
if (typeof audioBitRate === 'undefined') {
|
|
49113
|
+
throw new AppwriteException('Missing required parameter: "audioBitRate"');
|
|
48416
49114
|
}
|
|
48417
|
-
if (typeof
|
|
48418
|
-
|
|
49115
|
+
if (typeof width === 'undefined') {
|
|
49116
|
+
throw new AppwriteException('Missing required parameter: "width"');
|
|
48419
49117
|
}
|
|
49118
|
+
if (typeof height === 'undefined') {
|
|
49119
|
+
throw new AppwriteException('Missing required parameter: "height"');
|
|
49120
|
+
}
|
|
49121
|
+
const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
|
|
49122
|
+
const apiPayload = {};
|
|
48420
49123
|
if (typeof name !== 'undefined') {
|
|
48421
49124
|
apiPayload['name'] = name;
|
|
48422
49125
|
}
|
|
48423
|
-
if (typeof
|
|
48424
|
-
apiPayload['
|
|
49126
|
+
if (typeof videoBitRate !== 'undefined') {
|
|
49127
|
+
apiPayload['videoBitRate'] = videoBitRate;
|
|
48425
49128
|
}
|
|
48426
|
-
if (typeof
|
|
48427
|
-
apiPayload['
|
|
49129
|
+
if (typeof audioBitRate !== 'undefined') {
|
|
49130
|
+
apiPayload['audioBitRate'] = audioBitRate;
|
|
48428
49131
|
}
|
|
48429
|
-
if (typeof
|
|
48430
|
-
apiPayload['
|
|
49132
|
+
if (typeof width !== 'undefined') {
|
|
49133
|
+
apiPayload['width'] = width;
|
|
48431
49134
|
}
|
|
48432
|
-
if (typeof
|
|
48433
|
-
apiPayload['
|
|
49135
|
+
if (typeof height !== 'undefined') {
|
|
49136
|
+
apiPayload['height'] = height;
|
|
48434
49137
|
}
|
|
48435
49138
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
48436
49139
|
const apiHeaders = {
|
|
@@ -48438,9 +49141,9 @@
|
|
|
48438
49141
|
'content-type': 'application/json',
|
|
48439
49142
|
accept: 'application/json',
|
|
48440
49143
|
};
|
|
48441
|
-
return this.client.call('
|
|
49144
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
48442
49145
|
}
|
|
48443
|
-
|
|
49146
|
+
deleteProfile(paramsOrFirst) {
|
|
48444
49147
|
let params;
|
|
48445
49148
|
if (paramsOrFirst &&
|
|
48446
49149
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -48449,59 +49152,49 @@
|
|
|
48449
49152
|
}
|
|
48450
49153
|
else {
|
|
48451
49154
|
params = {
|
|
48452
|
-
|
|
48453
|
-
resourceType: rest[0],
|
|
48454
|
-
resourceId: rest[1],
|
|
48455
|
-
name: rest[2],
|
|
48456
|
-
description: rest[3],
|
|
48457
|
-
priority: rest[4],
|
|
48458
|
-
enabled: rest[5],
|
|
48459
|
-
conditions: rest[6],
|
|
49155
|
+
profileId: paramsOrFirst,
|
|
48460
49156
|
};
|
|
48461
49157
|
}
|
|
48462
|
-
const
|
|
48463
|
-
|
|
48464
|
-
|
|
48465
|
-
const name = params.name;
|
|
48466
|
-
const description = params.description;
|
|
48467
|
-
const priority = params.priority;
|
|
48468
|
-
const enabled = params.enabled;
|
|
48469
|
-
const conditions = params.conditions;
|
|
48470
|
-
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
48471
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
49158
|
+
const profileId = params.profileId;
|
|
49159
|
+
if (typeof profileId === 'undefined' || profileId === '') {
|
|
49160
|
+
throw new AppwriteException('Missing required parameter: "profileId"');
|
|
48472
49161
|
}
|
|
48473
|
-
const apiPath = '/
|
|
49162
|
+
const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
|
|
48474
49163
|
const apiPayload = {};
|
|
48475
|
-
|
|
48476
|
-
|
|
48477
|
-
|
|
48478
|
-
|
|
48479
|
-
|
|
48480
|
-
}
|
|
48481
|
-
|
|
48482
|
-
|
|
48483
|
-
|
|
48484
|
-
|
|
48485
|
-
|
|
48486
|
-
|
|
48487
|
-
|
|
48488
|
-
|
|
49164
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49165
|
+
const apiHeaders = {
|
|
49166
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49167
|
+
'content-type': 'application/json',
|
|
49168
|
+
accept: 'application/json',
|
|
49169
|
+
};
|
|
49170
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
49171
|
+
}
|
|
49172
|
+
get(paramsOrFirst) {
|
|
49173
|
+
let params;
|
|
49174
|
+
if (paramsOrFirst &&
|
|
49175
|
+
typeof paramsOrFirst === 'object' &&
|
|
49176
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49177
|
+
params = (paramsOrFirst || {});
|
|
48489
49178
|
}
|
|
48490
|
-
|
|
48491
|
-
|
|
49179
|
+
else {
|
|
49180
|
+
params = {
|
|
49181
|
+
videoId: paramsOrFirst,
|
|
49182
|
+
};
|
|
48492
49183
|
}
|
|
48493
|
-
|
|
48494
|
-
|
|
49184
|
+
const videoId = params.videoId;
|
|
49185
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49186
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
48495
49187
|
}
|
|
49188
|
+
const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49189
|
+
const apiPayload = {};
|
|
48496
49190
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
48497
49191
|
const apiHeaders = {
|
|
48498
49192
|
'X-Appwrite-Project': this.client.config.project,
|
|
48499
|
-
'content-type': 'application/json',
|
|
48500
49193
|
accept: 'application/json',
|
|
48501
49194
|
};
|
|
48502
|
-
return this.client.call('
|
|
49195
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
48503
49196
|
}
|
|
48504
|
-
|
|
49197
|
+
update(paramsOrFirst, ...rest) {
|
|
48505
49198
|
let params;
|
|
48506
49199
|
if (paramsOrFirst &&
|
|
48507
49200
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -48510,65 +49203,1347 @@
|
|
|
48510
49203
|
}
|
|
48511
49204
|
else {
|
|
48512
49205
|
params = {
|
|
48513
|
-
|
|
48514
|
-
|
|
48515
|
-
name: rest[1],
|
|
48516
|
-
limit: rest[2],
|
|
48517
|
-
interval: rest[3],
|
|
48518
|
-
resourceId: rest[4],
|
|
48519
|
-
description: rest[5],
|
|
48520
|
-
key: rest[6],
|
|
48521
|
-
strategy: rest[7],
|
|
48522
|
-
maxBucketSize: rest[8],
|
|
48523
|
-
priority: rest[9],
|
|
48524
|
-
enabled: rest[10],
|
|
48525
|
-
conditions: rest[11],
|
|
49206
|
+
videoId: paramsOrFirst,
|
|
49207
|
+
name: rest[0],
|
|
48526
49208
|
};
|
|
48527
49209
|
}
|
|
48528
|
-
const
|
|
48529
|
-
const resourceType = params.resourceType;
|
|
49210
|
+
const videoId = params.videoId;
|
|
48530
49211
|
const name = params.name;
|
|
48531
|
-
|
|
48532
|
-
|
|
48533
|
-
const resourceId = params.resourceId;
|
|
48534
|
-
const description = params.description;
|
|
48535
|
-
const key = params.key;
|
|
48536
|
-
const strategy = params.strategy;
|
|
48537
|
-
const maxBucketSize = params.maxBucketSize;
|
|
48538
|
-
const priority = params.priority;
|
|
48539
|
-
const enabled = params.enabled;
|
|
48540
|
-
const conditions = params.conditions;
|
|
48541
|
-
if (typeof ruleId === 'undefined') {
|
|
48542
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
48543
|
-
}
|
|
48544
|
-
if (typeof resourceType === 'undefined') {
|
|
48545
|
-
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
49212
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49213
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
48546
49214
|
}
|
|
48547
49215
|
if (typeof name === 'undefined') {
|
|
48548
49216
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
48549
49217
|
}
|
|
48550
|
-
|
|
48551
|
-
throw new AppwriteException('Missing required parameter: "limit"');
|
|
48552
|
-
}
|
|
48553
|
-
if (typeof interval === 'undefined') {
|
|
48554
|
-
throw new AppwriteException('Missing required parameter: "interval"');
|
|
48555
|
-
}
|
|
48556
|
-
const apiPath = '/waf/rules/rate-limit';
|
|
49218
|
+
const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
48557
49219
|
const apiPayload = {};
|
|
48558
|
-
if (typeof ruleId !== 'undefined') {
|
|
48559
|
-
apiPayload['ruleId'] = ruleId;
|
|
48560
|
-
}
|
|
48561
|
-
if (typeof resourceType !== 'undefined') {
|
|
48562
|
-
apiPayload['resourceType'] = resourceType;
|
|
48563
|
-
}
|
|
48564
|
-
if (typeof resourceId !== 'undefined') {
|
|
48565
|
-
apiPayload['resourceId'] = resourceId;
|
|
48566
|
-
}
|
|
48567
49220
|
if (typeof name !== 'undefined') {
|
|
48568
49221
|
apiPayload['name'] = name;
|
|
48569
49222
|
}
|
|
48570
|
-
|
|
48571
|
-
|
|
49223
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49224
|
+
const apiHeaders = {
|
|
49225
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49226
|
+
'content-type': 'application/json',
|
|
49227
|
+
accept: 'application/json',
|
|
49228
|
+
};
|
|
49229
|
+
return this.client.call('put', uri, apiHeaders, apiPayload);
|
|
49230
|
+
}
|
|
49231
|
+
delete(paramsOrFirst) {
|
|
49232
|
+
let params;
|
|
49233
|
+
if (paramsOrFirst &&
|
|
49234
|
+
typeof paramsOrFirst === 'object' &&
|
|
49235
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49236
|
+
params = (paramsOrFirst || {});
|
|
49237
|
+
}
|
|
49238
|
+
else {
|
|
49239
|
+
params = {
|
|
49240
|
+
videoId: paramsOrFirst,
|
|
49241
|
+
};
|
|
49242
|
+
}
|
|
49243
|
+
const videoId = params.videoId;
|
|
49244
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49245
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49246
|
+
}
|
|
49247
|
+
const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49248
|
+
const apiPayload = {};
|
|
49249
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49250
|
+
const apiHeaders = {
|
|
49251
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49252
|
+
'content-type': 'application/json',
|
|
49253
|
+
accept: 'application/json',
|
|
49254
|
+
};
|
|
49255
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
49256
|
+
}
|
|
49257
|
+
getCmafHlsManifest(paramsOrFirst) {
|
|
49258
|
+
let params;
|
|
49259
|
+
if (paramsOrFirst &&
|
|
49260
|
+
typeof paramsOrFirst === 'object' &&
|
|
49261
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49262
|
+
params = (paramsOrFirst || {});
|
|
49263
|
+
}
|
|
49264
|
+
else {
|
|
49265
|
+
params = {
|
|
49266
|
+
videoId: paramsOrFirst,
|
|
49267
|
+
};
|
|
49268
|
+
}
|
|
49269
|
+
const videoId = params.videoId;
|
|
49270
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49271
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49272
|
+
}
|
|
49273
|
+
const apiPath = '/videos/{videoId}/outputs/cmaf/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49274
|
+
const apiPayload = {};
|
|
49275
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49276
|
+
apiPayload['project'] = this.client.config.project;
|
|
49277
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
49278
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
49279
|
+
uri.searchParams.append(key, value);
|
|
49280
|
+
}
|
|
49281
|
+
return uri.toString();
|
|
49282
|
+
}
|
|
49283
|
+
getCmafDashManifest(paramsOrFirst) {
|
|
49284
|
+
let params;
|
|
49285
|
+
if (paramsOrFirst &&
|
|
49286
|
+
typeof paramsOrFirst === 'object' &&
|
|
49287
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49288
|
+
params = (paramsOrFirst || {});
|
|
49289
|
+
}
|
|
49290
|
+
else {
|
|
49291
|
+
params = {
|
|
49292
|
+
videoId: paramsOrFirst,
|
|
49293
|
+
};
|
|
49294
|
+
}
|
|
49295
|
+
const videoId = params.videoId;
|
|
49296
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49297
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49298
|
+
}
|
|
49299
|
+
const apiPath = '/videos/{videoId}/outputs/cmaf/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49300
|
+
const apiPayload = {};
|
|
49301
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49302
|
+
apiPayload['project'] = this.client.config.project;
|
|
49303
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
49304
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
49305
|
+
uri.searchParams.append(key, value);
|
|
49306
|
+
}
|
|
49307
|
+
return uri.toString();
|
|
49308
|
+
}
|
|
49309
|
+
getCmafStreamManifest(paramsOrFirst, ...rest) {
|
|
49310
|
+
let params;
|
|
49311
|
+
if (paramsOrFirst &&
|
|
49312
|
+
typeof paramsOrFirst === 'object' &&
|
|
49313
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49314
|
+
params = (paramsOrFirst || {});
|
|
49315
|
+
}
|
|
49316
|
+
else {
|
|
49317
|
+
params = {
|
|
49318
|
+
videoId: paramsOrFirst,
|
|
49319
|
+
renditionId: rest[0],
|
|
49320
|
+
streamId: rest[1],
|
|
49321
|
+
};
|
|
49322
|
+
}
|
|
49323
|
+
const videoId = params.videoId;
|
|
49324
|
+
const renditionId = params.renditionId;
|
|
49325
|
+
const streamId = params.streamId;
|
|
49326
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49327
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49328
|
+
}
|
|
49329
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
49330
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
49331
|
+
}
|
|
49332
|
+
if (typeof streamId === 'undefined') {
|
|
49333
|
+
throw new AppwriteException('Missing required parameter: "streamId"');
|
|
49334
|
+
}
|
|
49335
|
+
const apiPath = '/videos/{videoId}/outputs/cmaf/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
|
|
49336
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
49337
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)))
|
|
49338
|
+
.replace('{streamId}', encodeURIComponent(String(streamId)));
|
|
49339
|
+
const apiPayload = {};
|
|
49340
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49341
|
+
apiPayload['project'] = this.client.config.project;
|
|
49342
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
49343
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
49344
|
+
uri.searchParams.append(key, value);
|
|
49345
|
+
}
|
|
49346
|
+
return uri.toString();
|
|
49347
|
+
}
|
|
49348
|
+
getDashManifest(paramsOrFirst) {
|
|
49349
|
+
let params;
|
|
49350
|
+
if (paramsOrFirst &&
|
|
49351
|
+
typeof paramsOrFirst === 'object' &&
|
|
49352
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49353
|
+
params = (paramsOrFirst || {});
|
|
49354
|
+
}
|
|
49355
|
+
else {
|
|
49356
|
+
params = {
|
|
49357
|
+
videoId: paramsOrFirst,
|
|
49358
|
+
};
|
|
49359
|
+
}
|
|
49360
|
+
const videoId = params.videoId;
|
|
49361
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49362
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49363
|
+
}
|
|
49364
|
+
const apiPath = '/videos/{videoId}/outputs/dash/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49365
|
+
const apiPayload = {};
|
|
49366
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49367
|
+
apiPayload['project'] = this.client.config.project;
|
|
49368
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
49369
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
49370
|
+
uri.searchParams.append(key, value);
|
|
49371
|
+
}
|
|
49372
|
+
return uri.toString();
|
|
49373
|
+
}
|
|
49374
|
+
getHlsManifest(paramsOrFirst) {
|
|
49375
|
+
let params;
|
|
49376
|
+
if (paramsOrFirst &&
|
|
49377
|
+
typeof paramsOrFirst === 'object' &&
|
|
49378
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49379
|
+
params = (paramsOrFirst || {});
|
|
49380
|
+
}
|
|
49381
|
+
else {
|
|
49382
|
+
params = {
|
|
49383
|
+
videoId: paramsOrFirst,
|
|
49384
|
+
};
|
|
49385
|
+
}
|
|
49386
|
+
const videoId = params.videoId;
|
|
49387
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49388
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49389
|
+
}
|
|
49390
|
+
const apiPath = '/videos/{videoId}/outputs/hls/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49391
|
+
const apiPayload = {};
|
|
49392
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49393
|
+
apiPayload['project'] = this.client.config.project;
|
|
49394
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
49395
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
49396
|
+
uri.searchParams.append(key, value);
|
|
49397
|
+
}
|
|
49398
|
+
return uri.toString();
|
|
49399
|
+
}
|
|
49400
|
+
getStreamManifest(paramsOrFirst, ...rest) {
|
|
49401
|
+
let params;
|
|
49402
|
+
if (paramsOrFirst &&
|
|
49403
|
+
typeof paramsOrFirst === 'object' &&
|
|
49404
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49405
|
+
params = (paramsOrFirst || {});
|
|
49406
|
+
}
|
|
49407
|
+
else {
|
|
49408
|
+
params = {
|
|
49409
|
+
videoId: paramsOrFirst,
|
|
49410
|
+
renditionId: rest[0],
|
|
49411
|
+
streamId: rest[1],
|
|
49412
|
+
};
|
|
49413
|
+
}
|
|
49414
|
+
const videoId = params.videoId;
|
|
49415
|
+
const renditionId = params.renditionId;
|
|
49416
|
+
const streamId = params.streamId;
|
|
49417
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49418
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49419
|
+
}
|
|
49420
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
49421
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
49422
|
+
}
|
|
49423
|
+
if (typeof streamId === 'undefined') {
|
|
49424
|
+
throw new AppwriteException('Missing required parameter: "streamId"');
|
|
49425
|
+
}
|
|
49426
|
+
const apiPath = '/videos/{videoId}/outputs/hls/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
|
|
49427
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
49428
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)))
|
|
49429
|
+
.replace('{streamId}', encodeURIComponent(String(streamId)));
|
|
49430
|
+
const apiPayload = {};
|
|
49431
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49432
|
+
apiPayload['project'] = this.client.config.project;
|
|
49433
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
49434
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
49435
|
+
uri.searchParams.append(key, value);
|
|
49436
|
+
}
|
|
49437
|
+
return uri.toString();
|
|
49438
|
+
}
|
|
49439
|
+
getSegment(paramsOrFirst, ...rest) {
|
|
49440
|
+
let params;
|
|
49441
|
+
if (paramsOrFirst &&
|
|
49442
|
+
typeof paramsOrFirst === 'object' &&
|
|
49443
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49444
|
+
params = (paramsOrFirst || {});
|
|
49445
|
+
}
|
|
49446
|
+
else {
|
|
49447
|
+
params = {
|
|
49448
|
+
videoId: paramsOrFirst,
|
|
49449
|
+
output: rest[0],
|
|
49450
|
+
renditionId: rest[1],
|
|
49451
|
+
segmentId: rest[2],
|
|
49452
|
+
};
|
|
49453
|
+
}
|
|
49454
|
+
const videoId = params.videoId;
|
|
49455
|
+
const output = params.output;
|
|
49456
|
+
const renditionId = params.renditionId;
|
|
49457
|
+
const segmentId = params.segmentId;
|
|
49458
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49459
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49460
|
+
}
|
|
49461
|
+
if (typeof output === 'undefined') {
|
|
49462
|
+
throw new AppwriteException('Missing required parameter: "output"');
|
|
49463
|
+
}
|
|
49464
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
49465
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
49466
|
+
}
|
|
49467
|
+
if (typeof segmentId === 'undefined' || segmentId === '') {
|
|
49468
|
+
throw new AppwriteException('Missing required parameter: "segmentId"');
|
|
49469
|
+
}
|
|
49470
|
+
const apiPath = '/videos/{videoId}/outputs/{output}/renditions/{renditionId}/segments/{segmentId}'
|
|
49471
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
49472
|
+
.replace('{output}', encodeURIComponent(String(output)))
|
|
49473
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)))
|
|
49474
|
+
.replace('{segmentId}', encodeURIComponent(String(segmentId)));
|
|
49475
|
+
const apiPayload = {};
|
|
49476
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49477
|
+
apiPayload['project'] = this.client.config.project;
|
|
49478
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
49479
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
49480
|
+
uri.searchParams.append(key, value);
|
|
49481
|
+
}
|
|
49482
|
+
return uri.toString();
|
|
49483
|
+
}
|
|
49484
|
+
getSubtitleManifest(paramsOrFirst, ...rest) {
|
|
49485
|
+
let params;
|
|
49486
|
+
if (paramsOrFirst &&
|
|
49487
|
+
typeof paramsOrFirst === 'object' &&
|
|
49488
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49489
|
+
params = (paramsOrFirst || {});
|
|
49490
|
+
}
|
|
49491
|
+
else {
|
|
49492
|
+
params = {
|
|
49493
|
+
videoId: paramsOrFirst,
|
|
49494
|
+
output: rest[0],
|
|
49495
|
+
subtitleId: rest[1],
|
|
49496
|
+
};
|
|
49497
|
+
}
|
|
49498
|
+
const videoId = params.videoId;
|
|
49499
|
+
const output = params.output;
|
|
49500
|
+
const subtitleId = params.subtitleId;
|
|
49501
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49502
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49503
|
+
}
|
|
49504
|
+
if (typeof output === 'undefined') {
|
|
49505
|
+
throw new AppwriteException('Missing required parameter: "output"');
|
|
49506
|
+
}
|
|
49507
|
+
if (typeof subtitleId === 'undefined' || subtitleId === '') {
|
|
49508
|
+
throw new AppwriteException('Missing required parameter: "subtitleId"');
|
|
49509
|
+
}
|
|
49510
|
+
const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/manifest'
|
|
49511
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
49512
|
+
.replace('{output}', encodeURIComponent(String(output)))
|
|
49513
|
+
.replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
|
|
49514
|
+
const apiPayload = {};
|
|
49515
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49516
|
+
apiPayload['project'] = this.client.config.project;
|
|
49517
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
49518
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
49519
|
+
uri.searchParams.append(key, value);
|
|
49520
|
+
}
|
|
49521
|
+
return uri.toString();
|
|
49522
|
+
}
|
|
49523
|
+
getSubtitleSegment(paramsOrFirst, ...rest) {
|
|
49524
|
+
let params;
|
|
49525
|
+
if (paramsOrFirst &&
|
|
49526
|
+
typeof paramsOrFirst === 'object' &&
|
|
49527
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49528
|
+
params = (paramsOrFirst || {});
|
|
49529
|
+
}
|
|
49530
|
+
else {
|
|
49531
|
+
params = {
|
|
49532
|
+
videoId: paramsOrFirst,
|
|
49533
|
+
output: rest[0],
|
|
49534
|
+
subtitleId: rest[1],
|
|
49535
|
+
segmentId: rest[2],
|
|
49536
|
+
};
|
|
49537
|
+
}
|
|
49538
|
+
const videoId = params.videoId;
|
|
49539
|
+
const output = params.output;
|
|
49540
|
+
const subtitleId = params.subtitleId;
|
|
49541
|
+
const segmentId = params.segmentId;
|
|
49542
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49543
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49544
|
+
}
|
|
49545
|
+
if (typeof output === 'undefined') {
|
|
49546
|
+
throw new AppwriteException('Missing required parameter: "output"');
|
|
49547
|
+
}
|
|
49548
|
+
if (typeof subtitleId === 'undefined' || subtitleId === '') {
|
|
49549
|
+
throw new AppwriteException('Missing required parameter: "subtitleId"');
|
|
49550
|
+
}
|
|
49551
|
+
if (typeof segmentId === 'undefined' || segmentId === '') {
|
|
49552
|
+
throw new AppwriteException('Missing required parameter: "segmentId"');
|
|
49553
|
+
}
|
|
49554
|
+
const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/segments/{segmentId}'
|
|
49555
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
49556
|
+
.replace('{output}', encodeURIComponent(String(output)))
|
|
49557
|
+
.replace('{subtitleId}', encodeURIComponent(String(subtitleId)))
|
|
49558
|
+
.replace('{segmentId}', encodeURIComponent(String(segmentId)));
|
|
49559
|
+
const apiPayload = {};
|
|
49560
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49561
|
+
apiPayload['project'] = this.client.config.project;
|
|
49562
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
49563
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
49564
|
+
uri.searchParams.append(key, value);
|
|
49565
|
+
}
|
|
49566
|
+
return uri.toString();
|
|
49567
|
+
}
|
|
49568
|
+
getPreview(paramsOrFirst, ...rest) {
|
|
49569
|
+
let params;
|
|
49570
|
+
if (paramsOrFirst &&
|
|
49571
|
+
typeof paramsOrFirst === 'object' &&
|
|
49572
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49573
|
+
params = (paramsOrFirst || {});
|
|
49574
|
+
}
|
|
49575
|
+
else {
|
|
49576
|
+
params = {
|
|
49577
|
+
videoId: paramsOrFirst,
|
|
49578
|
+
previewId: rest[0],
|
|
49579
|
+
width: rest[1],
|
|
49580
|
+
height: rest[2],
|
|
49581
|
+
output: rest[3],
|
|
49582
|
+
};
|
|
49583
|
+
}
|
|
49584
|
+
const videoId = params.videoId;
|
|
49585
|
+
const previewId = params.previewId;
|
|
49586
|
+
const width = params.width;
|
|
49587
|
+
const height = params.height;
|
|
49588
|
+
const output = params.output;
|
|
49589
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49590
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49591
|
+
}
|
|
49592
|
+
if (typeof previewId === 'undefined' || previewId === '') {
|
|
49593
|
+
throw new AppwriteException('Missing required parameter: "previewId"');
|
|
49594
|
+
}
|
|
49595
|
+
const apiPath = '/videos/{videoId}/previews/{previewId}'
|
|
49596
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
49597
|
+
.replace('{previewId}', encodeURIComponent(String(previewId)));
|
|
49598
|
+
const apiPayload = {};
|
|
49599
|
+
if (typeof width !== 'undefined') {
|
|
49600
|
+
apiPayload['width'] = width;
|
|
49601
|
+
}
|
|
49602
|
+
if (typeof height !== 'undefined') {
|
|
49603
|
+
apiPayload['height'] = height;
|
|
49604
|
+
}
|
|
49605
|
+
if (typeof output !== 'undefined') {
|
|
49606
|
+
apiPayload['output'] = output;
|
|
49607
|
+
}
|
|
49608
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49609
|
+
apiPayload['project'] = this.client.config.project;
|
|
49610
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
49611
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
49612
|
+
uri.searchParams.append(key, value);
|
|
49613
|
+
}
|
|
49614
|
+
return uri.toString();
|
|
49615
|
+
}
|
|
49616
|
+
listRenditions(paramsOrFirst, ...rest) {
|
|
49617
|
+
let params;
|
|
49618
|
+
if (paramsOrFirst &&
|
|
49619
|
+
typeof paramsOrFirst === 'object' &&
|
|
49620
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49621
|
+
params = (paramsOrFirst || {});
|
|
49622
|
+
}
|
|
49623
|
+
else {
|
|
49624
|
+
params = {
|
|
49625
|
+
videoId: paramsOrFirst,
|
|
49626
|
+
output: rest[0],
|
|
49627
|
+
status: rest[1],
|
|
49628
|
+
};
|
|
49629
|
+
}
|
|
49630
|
+
const videoId = params.videoId;
|
|
49631
|
+
const output = params.output;
|
|
49632
|
+
const status = params.status;
|
|
49633
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49634
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49635
|
+
}
|
|
49636
|
+
const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49637
|
+
const apiPayload = {};
|
|
49638
|
+
if (typeof output !== 'undefined') {
|
|
49639
|
+
apiPayload['output'] = output;
|
|
49640
|
+
}
|
|
49641
|
+
if (typeof status !== 'undefined') {
|
|
49642
|
+
apiPayload['status'] = status;
|
|
49643
|
+
}
|
|
49644
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49645
|
+
const apiHeaders = {
|
|
49646
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49647
|
+
accept: 'application/json',
|
|
49648
|
+
};
|
|
49649
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
49650
|
+
}
|
|
49651
|
+
createRendition(paramsOrFirst, ...rest) {
|
|
49652
|
+
let params;
|
|
49653
|
+
if (paramsOrFirst &&
|
|
49654
|
+
typeof paramsOrFirst === 'object' &&
|
|
49655
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49656
|
+
params = (paramsOrFirst || {});
|
|
49657
|
+
}
|
|
49658
|
+
else {
|
|
49659
|
+
params = {
|
|
49660
|
+
videoId: paramsOrFirst,
|
|
49661
|
+
profileId: rest[0],
|
|
49662
|
+
output: rest[1],
|
|
49663
|
+
};
|
|
49664
|
+
}
|
|
49665
|
+
const videoId = params.videoId;
|
|
49666
|
+
const profileId = params.profileId;
|
|
49667
|
+
const output = params.output;
|
|
49668
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49669
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49670
|
+
}
|
|
49671
|
+
if (typeof profileId === 'undefined') {
|
|
49672
|
+
throw new AppwriteException('Missing required parameter: "profileId"');
|
|
49673
|
+
}
|
|
49674
|
+
if (typeof output === 'undefined') {
|
|
49675
|
+
throw new AppwriteException('Missing required parameter: "output"');
|
|
49676
|
+
}
|
|
49677
|
+
const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49678
|
+
const apiPayload = {};
|
|
49679
|
+
if (typeof profileId !== 'undefined') {
|
|
49680
|
+
apiPayload['profileId'] = profileId;
|
|
49681
|
+
}
|
|
49682
|
+
if (typeof output !== 'undefined') {
|
|
49683
|
+
apiPayload['output'] = output;
|
|
49684
|
+
}
|
|
49685
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49686
|
+
const apiHeaders = {
|
|
49687
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49688
|
+
'content-type': 'application/json',
|
|
49689
|
+
accept: 'application/json',
|
|
49690
|
+
};
|
|
49691
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
49692
|
+
}
|
|
49693
|
+
getRendition(paramsOrFirst, ...rest) {
|
|
49694
|
+
let params;
|
|
49695
|
+
if (paramsOrFirst &&
|
|
49696
|
+
typeof paramsOrFirst === 'object' &&
|
|
49697
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49698
|
+
params = (paramsOrFirst || {});
|
|
49699
|
+
}
|
|
49700
|
+
else {
|
|
49701
|
+
params = {
|
|
49702
|
+
videoId: paramsOrFirst,
|
|
49703
|
+
renditionId: rest[0],
|
|
49704
|
+
};
|
|
49705
|
+
}
|
|
49706
|
+
const videoId = params.videoId;
|
|
49707
|
+
const renditionId = params.renditionId;
|
|
49708
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49709
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49710
|
+
}
|
|
49711
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
49712
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
49713
|
+
}
|
|
49714
|
+
const apiPath = '/videos/{videoId}/renditions/{renditionId}'
|
|
49715
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
49716
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)));
|
|
49717
|
+
const apiPayload = {};
|
|
49718
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49719
|
+
const apiHeaders = {
|
|
49720
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49721
|
+
accept: 'application/json',
|
|
49722
|
+
};
|
|
49723
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
49724
|
+
}
|
|
49725
|
+
deleteRendition(paramsOrFirst, ...rest) {
|
|
49726
|
+
let params;
|
|
49727
|
+
if (paramsOrFirst &&
|
|
49728
|
+
typeof paramsOrFirst === 'object' &&
|
|
49729
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49730
|
+
params = (paramsOrFirst || {});
|
|
49731
|
+
}
|
|
49732
|
+
else {
|
|
49733
|
+
params = {
|
|
49734
|
+
videoId: paramsOrFirst,
|
|
49735
|
+
renditionId: rest[0],
|
|
49736
|
+
};
|
|
49737
|
+
}
|
|
49738
|
+
const videoId = params.videoId;
|
|
49739
|
+
const renditionId = params.renditionId;
|
|
49740
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49741
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49742
|
+
}
|
|
49743
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
49744
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
49745
|
+
}
|
|
49746
|
+
const apiPath = '/videos/{videoId}/renditions/{renditionId}'
|
|
49747
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
49748
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)));
|
|
49749
|
+
const apiPayload = {};
|
|
49750
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49751
|
+
const apiHeaders = {
|
|
49752
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49753
|
+
'content-type': 'application/json',
|
|
49754
|
+
accept: 'application/json',
|
|
49755
|
+
};
|
|
49756
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
49757
|
+
}
|
|
49758
|
+
createSource(paramsOrFirst) {
|
|
49759
|
+
let params;
|
|
49760
|
+
if (paramsOrFirst &&
|
|
49761
|
+
typeof paramsOrFirst === 'object' &&
|
|
49762
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49763
|
+
params = (paramsOrFirst || {});
|
|
49764
|
+
}
|
|
49765
|
+
else {
|
|
49766
|
+
params = {
|
|
49767
|
+
videoId: paramsOrFirst,
|
|
49768
|
+
};
|
|
49769
|
+
}
|
|
49770
|
+
const videoId = params.videoId;
|
|
49771
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49772
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49773
|
+
}
|
|
49774
|
+
const apiPath = '/videos/{videoId}/source'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49775
|
+
const apiPayload = {};
|
|
49776
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49777
|
+
const apiHeaders = {
|
|
49778
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49779
|
+
'content-type': 'application/json',
|
|
49780
|
+
accept: 'application/json',
|
|
49781
|
+
};
|
|
49782
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
49783
|
+
}
|
|
49784
|
+
listSubtitles(paramsOrFirst) {
|
|
49785
|
+
let params;
|
|
49786
|
+
if (paramsOrFirst &&
|
|
49787
|
+
typeof paramsOrFirst === 'object' &&
|
|
49788
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49789
|
+
params = (paramsOrFirst || {});
|
|
49790
|
+
}
|
|
49791
|
+
else {
|
|
49792
|
+
params = {
|
|
49793
|
+
videoId: paramsOrFirst,
|
|
49794
|
+
};
|
|
49795
|
+
}
|
|
49796
|
+
const videoId = params.videoId;
|
|
49797
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49798
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49799
|
+
}
|
|
49800
|
+
const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49801
|
+
const apiPayload = {};
|
|
49802
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49803
|
+
const apiHeaders = {
|
|
49804
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49805
|
+
accept: 'application/json',
|
|
49806
|
+
};
|
|
49807
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
49808
|
+
}
|
|
49809
|
+
createSubtitle(paramsOrFirst, ...rest) {
|
|
49810
|
+
let params;
|
|
49811
|
+
if (paramsOrFirst &&
|
|
49812
|
+
typeof paramsOrFirst === 'object' &&
|
|
49813
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49814
|
+
params = (paramsOrFirst || {});
|
|
49815
|
+
}
|
|
49816
|
+
else {
|
|
49817
|
+
params = {
|
|
49818
|
+
videoId: paramsOrFirst,
|
|
49819
|
+
bucketId: rest[0],
|
|
49820
|
+
fileId: rest[1],
|
|
49821
|
+
name: rest[2],
|
|
49822
|
+
code: rest[3],
|
|
49823
|
+
xdefault: rest[4],
|
|
49824
|
+
};
|
|
49825
|
+
}
|
|
49826
|
+
const videoId = params.videoId;
|
|
49827
|
+
const bucketId = params.bucketId;
|
|
49828
|
+
const fileId = params.fileId;
|
|
49829
|
+
const name = params.name;
|
|
49830
|
+
const code = params.code;
|
|
49831
|
+
const xdefault = params.xdefault;
|
|
49832
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49833
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49834
|
+
}
|
|
49835
|
+
if (typeof bucketId === 'undefined') {
|
|
49836
|
+
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
49837
|
+
}
|
|
49838
|
+
if (typeof fileId === 'undefined') {
|
|
49839
|
+
throw new AppwriteException('Missing required parameter: "fileId"');
|
|
49840
|
+
}
|
|
49841
|
+
if (typeof name === 'undefined') {
|
|
49842
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
49843
|
+
}
|
|
49844
|
+
if (typeof code === 'undefined') {
|
|
49845
|
+
throw new AppwriteException('Missing required parameter: "code"');
|
|
49846
|
+
}
|
|
49847
|
+
const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49848
|
+
const apiPayload = {};
|
|
49849
|
+
if (typeof bucketId !== 'undefined') {
|
|
49850
|
+
apiPayload['bucketId'] = bucketId;
|
|
49851
|
+
}
|
|
49852
|
+
if (typeof fileId !== 'undefined') {
|
|
49853
|
+
apiPayload['fileId'] = fileId;
|
|
49854
|
+
}
|
|
49855
|
+
if (typeof name !== 'undefined') {
|
|
49856
|
+
apiPayload['name'] = name;
|
|
49857
|
+
}
|
|
49858
|
+
if (typeof code !== 'undefined') {
|
|
49859
|
+
apiPayload['code'] = code;
|
|
49860
|
+
}
|
|
49861
|
+
if (typeof xdefault !== 'undefined') {
|
|
49862
|
+
apiPayload['default'] = xdefault;
|
|
49863
|
+
}
|
|
49864
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49865
|
+
const apiHeaders = {
|
|
49866
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49867
|
+
'content-type': 'application/json',
|
|
49868
|
+
accept: 'application/json',
|
|
49869
|
+
};
|
|
49870
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
49871
|
+
}
|
|
49872
|
+
updateSubtitle(paramsOrFirst, ...rest) {
|
|
49873
|
+
let params;
|
|
49874
|
+
if (paramsOrFirst &&
|
|
49875
|
+
typeof paramsOrFirst === 'object' &&
|
|
49876
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49877
|
+
params = (paramsOrFirst || {});
|
|
49878
|
+
}
|
|
49879
|
+
else {
|
|
49880
|
+
params = {
|
|
49881
|
+
videoId: paramsOrFirst,
|
|
49882
|
+
subtitleId: rest[0],
|
|
49883
|
+
bucketId: rest[1],
|
|
49884
|
+
fileId: rest[2],
|
|
49885
|
+
name: rest[3],
|
|
49886
|
+
code: rest[4],
|
|
49887
|
+
xdefault: rest[5],
|
|
49888
|
+
};
|
|
49889
|
+
}
|
|
49890
|
+
const videoId = params.videoId;
|
|
49891
|
+
const subtitleId = params.subtitleId;
|
|
49892
|
+
const bucketId = params.bucketId;
|
|
49893
|
+
const fileId = params.fileId;
|
|
49894
|
+
const name = params.name;
|
|
49895
|
+
const code = params.code;
|
|
49896
|
+
const xdefault = params.xdefault;
|
|
49897
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49898
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49899
|
+
}
|
|
49900
|
+
if (typeof subtitleId === 'undefined' || subtitleId === '') {
|
|
49901
|
+
throw new AppwriteException('Missing required parameter: "subtitleId"');
|
|
49902
|
+
}
|
|
49903
|
+
const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
|
|
49904
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
49905
|
+
.replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
|
|
49906
|
+
const apiPayload = {};
|
|
49907
|
+
if (typeof bucketId !== 'undefined') {
|
|
49908
|
+
apiPayload['bucketId'] = bucketId;
|
|
49909
|
+
}
|
|
49910
|
+
if (typeof fileId !== 'undefined') {
|
|
49911
|
+
apiPayload['fileId'] = fileId;
|
|
49912
|
+
}
|
|
49913
|
+
if (typeof name !== 'undefined') {
|
|
49914
|
+
apiPayload['name'] = name;
|
|
49915
|
+
}
|
|
49916
|
+
if (typeof code !== 'undefined') {
|
|
49917
|
+
apiPayload['code'] = code;
|
|
49918
|
+
}
|
|
49919
|
+
if (typeof xdefault !== 'undefined') {
|
|
49920
|
+
apiPayload['default'] = xdefault;
|
|
49921
|
+
}
|
|
49922
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49923
|
+
const apiHeaders = {
|
|
49924
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49925
|
+
'content-type': 'application/json',
|
|
49926
|
+
accept: 'application/json',
|
|
49927
|
+
};
|
|
49928
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
49929
|
+
}
|
|
49930
|
+
deleteSubtitle(paramsOrFirst, ...rest) {
|
|
49931
|
+
let params;
|
|
49932
|
+
if (paramsOrFirst &&
|
|
49933
|
+
typeof paramsOrFirst === 'object' &&
|
|
49934
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49935
|
+
params = (paramsOrFirst || {});
|
|
49936
|
+
}
|
|
49937
|
+
else {
|
|
49938
|
+
params = {
|
|
49939
|
+
videoId: paramsOrFirst,
|
|
49940
|
+
subtitleId: rest[0],
|
|
49941
|
+
};
|
|
49942
|
+
}
|
|
49943
|
+
const videoId = params.videoId;
|
|
49944
|
+
const subtitleId = params.subtitleId;
|
|
49945
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49946
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49947
|
+
}
|
|
49948
|
+
if (typeof subtitleId === 'undefined' || subtitleId === '') {
|
|
49949
|
+
throw new AppwriteException('Missing required parameter: "subtitleId"');
|
|
49950
|
+
}
|
|
49951
|
+
const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
|
|
49952
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
49953
|
+
.replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
|
|
49954
|
+
const apiPayload = {};
|
|
49955
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49956
|
+
const apiHeaders = {
|
|
49957
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49958
|
+
'content-type': 'application/json',
|
|
49959
|
+
accept: 'application/json',
|
|
49960
|
+
};
|
|
49961
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
49962
|
+
}
|
|
49963
|
+
getTimeline(paramsOrFirst) {
|
|
49964
|
+
let params;
|
|
49965
|
+
if (paramsOrFirst &&
|
|
49966
|
+
typeof paramsOrFirst === 'object' &&
|
|
49967
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49968
|
+
params = (paramsOrFirst || {});
|
|
49969
|
+
}
|
|
49970
|
+
else {
|
|
49971
|
+
params = {
|
|
49972
|
+
videoId: paramsOrFirst,
|
|
49973
|
+
};
|
|
49974
|
+
}
|
|
49975
|
+
const videoId = params.videoId;
|
|
49976
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49977
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49978
|
+
}
|
|
49979
|
+
const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49980
|
+
const apiPayload = {};
|
|
49981
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49982
|
+
const apiHeaders = {
|
|
49983
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49984
|
+
accept: 'text/plain',
|
|
49985
|
+
};
|
|
49986
|
+
return this.client.call('get', uri, apiHeaders, apiPayload, 'text');
|
|
49987
|
+
}
|
|
49988
|
+
createTimeline(paramsOrFirst) {
|
|
49989
|
+
let params;
|
|
49990
|
+
if (paramsOrFirst &&
|
|
49991
|
+
typeof paramsOrFirst === 'object' &&
|
|
49992
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49993
|
+
params = (paramsOrFirst || {});
|
|
49994
|
+
}
|
|
49995
|
+
else {
|
|
49996
|
+
params = {
|
|
49997
|
+
videoId: paramsOrFirst,
|
|
49998
|
+
};
|
|
49999
|
+
}
|
|
50000
|
+
const videoId = params.videoId;
|
|
50001
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
50002
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
50003
|
+
}
|
|
50004
|
+
const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
50005
|
+
const apiPayload = {};
|
|
50006
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
50007
|
+
const apiHeaders = {
|
|
50008
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
50009
|
+
'content-type': 'application/json',
|
|
50010
|
+
accept: 'application/json',
|
|
50011
|
+
};
|
|
50012
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
50013
|
+
}
|
|
50014
|
+
}
|
|
50015
|
+
|
|
50016
|
+
class Waf {
|
|
50017
|
+
constructor(client) {
|
|
50018
|
+
this.client = client;
|
|
50019
|
+
}
|
|
50020
|
+
listRules(paramsOrFirst, ...rest) {
|
|
50021
|
+
let params;
|
|
50022
|
+
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
50023
|
+
(paramsOrFirst &&
|
|
50024
|
+
typeof paramsOrFirst === 'object' &&
|
|
50025
|
+
!Array.isArray(paramsOrFirst))) {
|
|
50026
|
+
params = (paramsOrFirst || {});
|
|
50027
|
+
}
|
|
50028
|
+
else {
|
|
50029
|
+
params = {
|
|
50030
|
+
queries: paramsOrFirst,
|
|
50031
|
+
search: rest[0],
|
|
50032
|
+
total: rest[1],
|
|
50033
|
+
};
|
|
50034
|
+
}
|
|
50035
|
+
const queries = params.queries;
|
|
50036
|
+
const search = params.search;
|
|
50037
|
+
const total = params.total;
|
|
50038
|
+
const apiPath = '/waf/rules';
|
|
50039
|
+
const apiPayload = {};
|
|
50040
|
+
if (typeof queries !== 'undefined') {
|
|
50041
|
+
apiPayload['queries'] = queries;
|
|
50042
|
+
}
|
|
50043
|
+
if (typeof search !== 'undefined') {
|
|
50044
|
+
apiPayload['search'] = search;
|
|
50045
|
+
}
|
|
50046
|
+
if (typeof total !== 'undefined') {
|
|
50047
|
+
apiPayload['total'] = total;
|
|
50048
|
+
}
|
|
50049
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
50050
|
+
const apiHeaders = {
|
|
50051
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
50052
|
+
accept: 'application/json',
|
|
50053
|
+
};
|
|
50054
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
50055
|
+
}
|
|
50056
|
+
createBypassRule(paramsOrFirst, ...rest) {
|
|
50057
|
+
let params;
|
|
50058
|
+
if (paramsOrFirst &&
|
|
50059
|
+
typeof paramsOrFirst === 'object' &&
|
|
50060
|
+
!Array.isArray(paramsOrFirst)) {
|
|
50061
|
+
params = (paramsOrFirst || {});
|
|
50062
|
+
}
|
|
50063
|
+
else {
|
|
50064
|
+
params = {
|
|
50065
|
+
ruleId: paramsOrFirst,
|
|
50066
|
+
resourceType: rest[0],
|
|
50067
|
+
name: rest[1],
|
|
50068
|
+
resourceId: rest[2],
|
|
50069
|
+
description: rest[3],
|
|
50070
|
+
priority: rest[4],
|
|
50071
|
+
enabled: rest[5],
|
|
50072
|
+
conditions: rest[6],
|
|
50073
|
+
};
|
|
50074
|
+
}
|
|
50075
|
+
const ruleId = params.ruleId;
|
|
50076
|
+
const resourceType = params.resourceType;
|
|
50077
|
+
const name = params.name;
|
|
50078
|
+
const resourceId = params.resourceId;
|
|
50079
|
+
const description = params.description;
|
|
50080
|
+
const priority = params.priority;
|
|
50081
|
+
const enabled = params.enabled;
|
|
50082
|
+
const conditions = params.conditions;
|
|
50083
|
+
if (typeof ruleId === 'undefined') {
|
|
50084
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
50085
|
+
}
|
|
50086
|
+
if (typeof resourceType === 'undefined') {
|
|
50087
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
50088
|
+
}
|
|
50089
|
+
if (typeof name === 'undefined') {
|
|
50090
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
50091
|
+
}
|
|
50092
|
+
const apiPath = '/waf/rules/bypass';
|
|
50093
|
+
const apiPayload = {};
|
|
50094
|
+
if (typeof ruleId !== 'undefined') {
|
|
50095
|
+
apiPayload['ruleId'] = ruleId;
|
|
50096
|
+
}
|
|
50097
|
+
if (typeof resourceType !== 'undefined') {
|
|
50098
|
+
apiPayload['resourceType'] = resourceType;
|
|
50099
|
+
}
|
|
50100
|
+
if (typeof resourceId !== 'undefined') {
|
|
50101
|
+
apiPayload['resourceId'] = resourceId;
|
|
50102
|
+
}
|
|
50103
|
+
if (typeof name !== 'undefined') {
|
|
50104
|
+
apiPayload['name'] = name;
|
|
50105
|
+
}
|
|
50106
|
+
if (typeof description !== 'undefined') {
|
|
50107
|
+
apiPayload['description'] = description;
|
|
50108
|
+
}
|
|
50109
|
+
if (typeof priority !== 'undefined') {
|
|
50110
|
+
apiPayload['priority'] = priority;
|
|
50111
|
+
}
|
|
50112
|
+
if (typeof enabled !== 'undefined') {
|
|
50113
|
+
apiPayload['enabled'] = enabled;
|
|
50114
|
+
}
|
|
50115
|
+
if (typeof conditions !== 'undefined') {
|
|
50116
|
+
apiPayload['conditions'] = conditions;
|
|
50117
|
+
}
|
|
50118
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
50119
|
+
const apiHeaders = {
|
|
50120
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
50121
|
+
'content-type': 'application/json',
|
|
50122
|
+
accept: 'application/json',
|
|
50123
|
+
};
|
|
50124
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
50125
|
+
}
|
|
50126
|
+
updateBypassRule(paramsOrFirst, ...rest) {
|
|
50127
|
+
let params;
|
|
50128
|
+
if (paramsOrFirst &&
|
|
50129
|
+
typeof paramsOrFirst === 'object' &&
|
|
50130
|
+
!Array.isArray(paramsOrFirst)) {
|
|
50131
|
+
params = (paramsOrFirst || {});
|
|
50132
|
+
}
|
|
50133
|
+
else {
|
|
50134
|
+
params = {
|
|
50135
|
+
ruleId: paramsOrFirst,
|
|
50136
|
+
resourceType: rest[0],
|
|
50137
|
+
resourceId: rest[1],
|
|
50138
|
+
name: rest[2],
|
|
50139
|
+
description: rest[3],
|
|
50140
|
+
priority: rest[4],
|
|
50141
|
+
enabled: rest[5],
|
|
50142
|
+
conditions: rest[6],
|
|
50143
|
+
};
|
|
50144
|
+
}
|
|
50145
|
+
const ruleId = params.ruleId;
|
|
50146
|
+
const resourceType = params.resourceType;
|
|
50147
|
+
const resourceId = params.resourceId;
|
|
50148
|
+
const name = params.name;
|
|
50149
|
+
const description = params.description;
|
|
50150
|
+
const priority = params.priority;
|
|
50151
|
+
const enabled = params.enabled;
|
|
50152
|
+
const conditions = params.conditions;
|
|
50153
|
+
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
50154
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
50155
|
+
}
|
|
50156
|
+
const apiPath = '/waf/rules/bypass/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
|
|
50157
|
+
const apiPayload = {};
|
|
50158
|
+
if (typeof resourceType !== 'undefined') {
|
|
50159
|
+
apiPayload['resourceType'] = resourceType;
|
|
50160
|
+
}
|
|
50161
|
+
if (typeof resourceId !== 'undefined') {
|
|
50162
|
+
apiPayload['resourceId'] = resourceId;
|
|
50163
|
+
}
|
|
50164
|
+
if (typeof name !== 'undefined') {
|
|
50165
|
+
apiPayload['name'] = name;
|
|
50166
|
+
}
|
|
50167
|
+
if (typeof description !== 'undefined') {
|
|
50168
|
+
apiPayload['description'] = description;
|
|
50169
|
+
}
|
|
50170
|
+
if (typeof priority !== 'undefined') {
|
|
50171
|
+
apiPayload['priority'] = priority;
|
|
50172
|
+
}
|
|
50173
|
+
if (typeof enabled !== 'undefined') {
|
|
50174
|
+
apiPayload['enabled'] = enabled;
|
|
50175
|
+
}
|
|
50176
|
+
if (typeof conditions !== 'undefined') {
|
|
50177
|
+
apiPayload['conditions'] = conditions;
|
|
50178
|
+
}
|
|
50179
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
50180
|
+
const apiHeaders = {
|
|
50181
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
50182
|
+
'content-type': 'application/json',
|
|
50183
|
+
accept: 'application/json',
|
|
50184
|
+
};
|
|
50185
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
50186
|
+
}
|
|
50187
|
+
createChallengeRule(paramsOrFirst, ...rest) {
|
|
50188
|
+
let params;
|
|
50189
|
+
if (paramsOrFirst &&
|
|
50190
|
+
typeof paramsOrFirst === 'object' &&
|
|
50191
|
+
!Array.isArray(paramsOrFirst)) {
|
|
50192
|
+
params = (paramsOrFirst || {});
|
|
50193
|
+
}
|
|
50194
|
+
else {
|
|
50195
|
+
params = {
|
|
50196
|
+
ruleId: paramsOrFirst,
|
|
50197
|
+
resourceType: rest[0],
|
|
50198
|
+
name: rest[1],
|
|
50199
|
+
resourceId: rest[2],
|
|
50200
|
+
description: rest[3],
|
|
50201
|
+
challengeType: rest[4],
|
|
50202
|
+
priority: rest[5],
|
|
50203
|
+
enabled: rest[6],
|
|
50204
|
+
conditions: rest[7],
|
|
50205
|
+
difficulty: rest[8],
|
|
50206
|
+
ttl: rest[9],
|
|
50207
|
+
};
|
|
50208
|
+
}
|
|
50209
|
+
const ruleId = params.ruleId;
|
|
50210
|
+
const resourceType = params.resourceType;
|
|
50211
|
+
const name = params.name;
|
|
50212
|
+
const resourceId = params.resourceId;
|
|
50213
|
+
const description = params.description;
|
|
50214
|
+
const challengeType = params.challengeType;
|
|
50215
|
+
const priority = params.priority;
|
|
50216
|
+
const enabled = params.enabled;
|
|
50217
|
+
const conditions = params.conditions;
|
|
50218
|
+
const difficulty = params.difficulty;
|
|
50219
|
+
const ttl = params.ttl;
|
|
50220
|
+
if (typeof ruleId === 'undefined') {
|
|
50221
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
50222
|
+
}
|
|
50223
|
+
if (typeof resourceType === 'undefined') {
|
|
50224
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
50225
|
+
}
|
|
50226
|
+
if (typeof name === 'undefined') {
|
|
50227
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
50228
|
+
}
|
|
50229
|
+
const apiPath = '/waf/rules/challenge';
|
|
50230
|
+
const apiPayload = {};
|
|
50231
|
+
if (typeof ruleId !== 'undefined') {
|
|
50232
|
+
apiPayload['ruleId'] = ruleId;
|
|
50233
|
+
}
|
|
50234
|
+
if (typeof resourceType !== 'undefined') {
|
|
50235
|
+
apiPayload['resourceType'] = resourceType;
|
|
50236
|
+
}
|
|
50237
|
+
if (typeof resourceId !== 'undefined') {
|
|
50238
|
+
apiPayload['resourceId'] = resourceId;
|
|
50239
|
+
}
|
|
50240
|
+
if (typeof name !== 'undefined') {
|
|
50241
|
+
apiPayload['name'] = name;
|
|
50242
|
+
}
|
|
50243
|
+
if (typeof description !== 'undefined') {
|
|
50244
|
+
apiPayload['description'] = description;
|
|
50245
|
+
}
|
|
50246
|
+
if (typeof challengeType !== 'undefined') {
|
|
50247
|
+
apiPayload['challengeType'] = challengeType;
|
|
50248
|
+
}
|
|
50249
|
+
if (typeof priority !== 'undefined') {
|
|
50250
|
+
apiPayload['priority'] = priority;
|
|
50251
|
+
}
|
|
50252
|
+
if (typeof enabled !== 'undefined') {
|
|
50253
|
+
apiPayload['enabled'] = enabled;
|
|
50254
|
+
}
|
|
50255
|
+
if (typeof conditions !== 'undefined') {
|
|
50256
|
+
apiPayload['conditions'] = conditions;
|
|
50257
|
+
}
|
|
50258
|
+
if (typeof difficulty !== 'undefined') {
|
|
50259
|
+
apiPayload['difficulty'] = difficulty;
|
|
50260
|
+
}
|
|
50261
|
+
if (typeof ttl !== 'undefined') {
|
|
50262
|
+
apiPayload['ttl'] = ttl;
|
|
50263
|
+
}
|
|
50264
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
50265
|
+
const apiHeaders = {
|
|
50266
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
50267
|
+
'content-type': 'application/json',
|
|
50268
|
+
accept: 'application/json',
|
|
50269
|
+
};
|
|
50270
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
50271
|
+
}
|
|
50272
|
+
updateChallengeRule(paramsOrFirst, ...rest) {
|
|
50273
|
+
let params;
|
|
50274
|
+
if (paramsOrFirst &&
|
|
50275
|
+
typeof paramsOrFirst === 'object' &&
|
|
50276
|
+
!Array.isArray(paramsOrFirst)) {
|
|
50277
|
+
params = (paramsOrFirst || {});
|
|
50278
|
+
}
|
|
50279
|
+
else {
|
|
50280
|
+
params = {
|
|
50281
|
+
ruleId: paramsOrFirst,
|
|
50282
|
+
resourceType: rest[0],
|
|
50283
|
+
resourceId: rest[1],
|
|
50284
|
+
name: rest[2],
|
|
50285
|
+
description: rest[3],
|
|
50286
|
+
challengeType: rest[4],
|
|
50287
|
+
priority: rest[5],
|
|
50288
|
+
enabled: rest[6],
|
|
50289
|
+
conditions: rest[7],
|
|
50290
|
+
difficulty: rest[8],
|
|
50291
|
+
ttl: rest[9],
|
|
50292
|
+
};
|
|
50293
|
+
}
|
|
50294
|
+
const ruleId = params.ruleId;
|
|
50295
|
+
const resourceType = params.resourceType;
|
|
50296
|
+
const resourceId = params.resourceId;
|
|
50297
|
+
const name = params.name;
|
|
50298
|
+
const description = params.description;
|
|
50299
|
+
const challengeType = params.challengeType;
|
|
50300
|
+
const priority = params.priority;
|
|
50301
|
+
const enabled = params.enabled;
|
|
50302
|
+
const conditions = params.conditions;
|
|
50303
|
+
const difficulty = params.difficulty;
|
|
50304
|
+
const ttl = params.ttl;
|
|
50305
|
+
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
50306
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
50307
|
+
}
|
|
50308
|
+
const apiPath = '/waf/rules/challenge/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
|
|
50309
|
+
const apiPayload = {};
|
|
50310
|
+
if (typeof resourceType !== 'undefined') {
|
|
50311
|
+
apiPayload['resourceType'] = resourceType;
|
|
50312
|
+
}
|
|
50313
|
+
if (typeof resourceId !== 'undefined') {
|
|
50314
|
+
apiPayload['resourceId'] = resourceId;
|
|
50315
|
+
}
|
|
50316
|
+
if (typeof name !== 'undefined') {
|
|
50317
|
+
apiPayload['name'] = name;
|
|
50318
|
+
}
|
|
50319
|
+
if (typeof description !== 'undefined') {
|
|
50320
|
+
apiPayload['description'] = description;
|
|
50321
|
+
}
|
|
50322
|
+
if (typeof challengeType !== 'undefined') {
|
|
50323
|
+
apiPayload['challengeType'] = challengeType;
|
|
50324
|
+
}
|
|
50325
|
+
if (typeof priority !== 'undefined') {
|
|
50326
|
+
apiPayload['priority'] = priority;
|
|
50327
|
+
}
|
|
50328
|
+
if (typeof enabled !== 'undefined') {
|
|
50329
|
+
apiPayload['enabled'] = enabled;
|
|
50330
|
+
}
|
|
50331
|
+
if (typeof conditions !== 'undefined') {
|
|
50332
|
+
apiPayload['conditions'] = conditions;
|
|
50333
|
+
}
|
|
50334
|
+
if (typeof difficulty !== 'undefined') {
|
|
50335
|
+
apiPayload['difficulty'] = difficulty;
|
|
50336
|
+
}
|
|
50337
|
+
if (typeof ttl !== 'undefined') {
|
|
50338
|
+
apiPayload['ttl'] = ttl;
|
|
50339
|
+
}
|
|
50340
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
50341
|
+
const apiHeaders = {
|
|
50342
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
50343
|
+
'content-type': 'application/json',
|
|
50344
|
+
accept: 'application/json',
|
|
50345
|
+
};
|
|
50346
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
50347
|
+
}
|
|
50348
|
+
createDenyRule(paramsOrFirst, ...rest) {
|
|
50349
|
+
let params;
|
|
50350
|
+
if (paramsOrFirst &&
|
|
50351
|
+
typeof paramsOrFirst === 'object' &&
|
|
50352
|
+
!Array.isArray(paramsOrFirst)) {
|
|
50353
|
+
params = (paramsOrFirst || {});
|
|
50354
|
+
}
|
|
50355
|
+
else {
|
|
50356
|
+
params = {
|
|
50357
|
+
ruleId: paramsOrFirst,
|
|
50358
|
+
resourceType: rest[0],
|
|
50359
|
+
name: rest[1],
|
|
50360
|
+
resourceId: rest[2],
|
|
50361
|
+
description: rest[3],
|
|
50362
|
+
priority: rest[4],
|
|
50363
|
+
enabled: rest[5],
|
|
50364
|
+
conditions: rest[6],
|
|
50365
|
+
};
|
|
50366
|
+
}
|
|
50367
|
+
const ruleId = params.ruleId;
|
|
50368
|
+
const resourceType = params.resourceType;
|
|
50369
|
+
const name = params.name;
|
|
50370
|
+
const resourceId = params.resourceId;
|
|
50371
|
+
const description = params.description;
|
|
50372
|
+
const priority = params.priority;
|
|
50373
|
+
const enabled = params.enabled;
|
|
50374
|
+
const conditions = params.conditions;
|
|
50375
|
+
if (typeof ruleId === 'undefined') {
|
|
50376
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
50377
|
+
}
|
|
50378
|
+
if (typeof resourceType === 'undefined') {
|
|
50379
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
50380
|
+
}
|
|
50381
|
+
if (typeof name === 'undefined') {
|
|
50382
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
50383
|
+
}
|
|
50384
|
+
const apiPath = '/waf/rules/deny';
|
|
50385
|
+
const apiPayload = {};
|
|
50386
|
+
if (typeof ruleId !== 'undefined') {
|
|
50387
|
+
apiPayload['ruleId'] = ruleId;
|
|
50388
|
+
}
|
|
50389
|
+
if (typeof resourceType !== 'undefined') {
|
|
50390
|
+
apiPayload['resourceType'] = resourceType;
|
|
50391
|
+
}
|
|
50392
|
+
if (typeof resourceId !== 'undefined') {
|
|
50393
|
+
apiPayload['resourceId'] = resourceId;
|
|
50394
|
+
}
|
|
50395
|
+
if (typeof name !== 'undefined') {
|
|
50396
|
+
apiPayload['name'] = name;
|
|
50397
|
+
}
|
|
50398
|
+
if (typeof description !== 'undefined') {
|
|
50399
|
+
apiPayload['description'] = description;
|
|
50400
|
+
}
|
|
50401
|
+
if (typeof priority !== 'undefined') {
|
|
50402
|
+
apiPayload['priority'] = priority;
|
|
50403
|
+
}
|
|
50404
|
+
if (typeof enabled !== 'undefined') {
|
|
50405
|
+
apiPayload['enabled'] = enabled;
|
|
50406
|
+
}
|
|
50407
|
+
if (typeof conditions !== 'undefined') {
|
|
50408
|
+
apiPayload['conditions'] = conditions;
|
|
50409
|
+
}
|
|
50410
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
50411
|
+
const apiHeaders = {
|
|
50412
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
50413
|
+
'content-type': 'application/json',
|
|
50414
|
+
accept: 'application/json',
|
|
50415
|
+
};
|
|
50416
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
50417
|
+
}
|
|
50418
|
+
updateDenyRule(paramsOrFirst, ...rest) {
|
|
50419
|
+
let params;
|
|
50420
|
+
if (paramsOrFirst &&
|
|
50421
|
+
typeof paramsOrFirst === 'object' &&
|
|
50422
|
+
!Array.isArray(paramsOrFirst)) {
|
|
50423
|
+
params = (paramsOrFirst || {});
|
|
50424
|
+
}
|
|
50425
|
+
else {
|
|
50426
|
+
params = {
|
|
50427
|
+
ruleId: paramsOrFirst,
|
|
50428
|
+
resourceType: rest[0],
|
|
50429
|
+
resourceId: rest[1],
|
|
50430
|
+
name: rest[2],
|
|
50431
|
+
description: rest[3],
|
|
50432
|
+
priority: rest[4],
|
|
50433
|
+
enabled: rest[5],
|
|
50434
|
+
conditions: rest[6],
|
|
50435
|
+
};
|
|
50436
|
+
}
|
|
50437
|
+
const ruleId = params.ruleId;
|
|
50438
|
+
const resourceType = params.resourceType;
|
|
50439
|
+
const resourceId = params.resourceId;
|
|
50440
|
+
const name = params.name;
|
|
50441
|
+
const description = params.description;
|
|
50442
|
+
const priority = params.priority;
|
|
50443
|
+
const enabled = params.enabled;
|
|
50444
|
+
const conditions = params.conditions;
|
|
50445
|
+
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
50446
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
50447
|
+
}
|
|
50448
|
+
const apiPath = '/waf/rules/deny/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
|
|
50449
|
+
const apiPayload = {};
|
|
50450
|
+
if (typeof resourceType !== 'undefined') {
|
|
50451
|
+
apiPayload['resourceType'] = resourceType;
|
|
50452
|
+
}
|
|
50453
|
+
if (typeof resourceId !== 'undefined') {
|
|
50454
|
+
apiPayload['resourceId'] = resourceId;
|
|
50455
|
+
}
|
|
50456
|
+
if (typeof name !== 'undefined') {
|
|
50457
|
+
apiPayload['name'] = name;
|
|
50458
|
+
}
|
|
50459
|
+
if (typeof description !== 'undefined') {
|
|
50460
|
+
apiPayload['description'] = description;
|
|
50461
|
+
}
|
|
50462
|
+
if (typeof priority !== 'undefined') {
|
|
50463
|
+
apiPayload['priority'] = priority;
|
|
50464
|
+
}
|
|
50465
|
+
if (typeof enabled !== 'undefined') {
|
|
50466
|
+
apiPayload['enabled'] = enabled;
|
|
50467
|
+
}
|
|
50468
|
+
if (typeof conditions !== 'undefined') {
|
|
50469
|
+
apiPayload['conditions'] = conditions;
|
|
50470
|
+
}
|
|
50471
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
50472
|
+
const apiHeaders = {
|
|
50473
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
50474
|
+
'content-type': 'application/json',
|
|
50475
|
+
accept: 'application/json',
|
|
50476
|
+
};
|
|
50477
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
50478
|
+
}
|
|
50479
|
+
createRateLimitRule(paramsOrFirst, ...rest) {
|
|
50480
|
+
let params;
|
|
50481
|
+
if (paramsOrFirst &&
|
|
50482
|
+
typeof paramsOrFirst === 'object' &&
|
|
50483
|
+
!Array.isArray(paramsOrFirst)) {
|
|
50484
|
+
params = (paramsOrFirst || {});
|
|
50485
|
+
}
|
|
50486
|
+
else {
|
|
50487
|
+
params = {
|
|
50488
|
+
ruleId: paramsOrFirst,
|
|
50489
|
+
resourceType: rest[0],
|
|
50490
|
+
name: rest[1],
|
|
50491
|
+
limit: rest[2],
|
|
50492
|
+
interval: rest[3],
|
|
50493
|
+
resourceId: rest[4],
|
|
50494
|
+
description: rest[5],
|
|
50495
|
+
key: rest[6],
|
|
50496
|
+
strategy: rest[7],
|
|
50497
|
+
maxBucketSize: rest[8],
|
|
50498
|
+
priority: rest[9],
|
|
50499
|
+
enabled: rest[10],
|
|
50500
|
+
conditions: rest[11],
|
|
50501
|
+
};
|
|
50502
|
+
}
|
|
50503
|
+
const ruleId = params.ruleId;
|
|
50504
|
+
const resourceType = params.resourceType;
|
|
50505
|
+
const name = params.name;
|
|
50506
|
+
const limit = params.limit;
|
|
50507
|
+
const interval = params.interval;
|
|
50508
|
+
const resourceId = params.resourceId;
|
|
50509
|
+
const description = params.description;
|
|
50510
|
+
const key = params.key;
|
|
50511
|
+
const strategy = params.strategy;
|
|
50512
|
+
const maxBucketSize = params.maxBucketSize;
|
|
50513
|
+
const priority = params.priority;
|
|
50514
|
+
const enabled = params.enabled;
|
|
50515
|
+
const conditions = params.conditions;
|
|
50516
|
+
if (typeof ruleId === 'undefined') {
|
|
50517
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
50518
|
+
}
|
|
50519
|
+
if (typeof resourceType === 'undefined') {
|
|
50520
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
50521
|
+
}
|
|
50522
|
+
if (typeof name === 'undefined') {
|
|
50523
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
50524
|
+
}
|
|
50525
|
+
if (typeof limit === 'undefined') {
|
|
50526
|
+
throw new AppwriteException('Missing required parameter: "limit"');
|
|
50527
|
+
}
|
|
50528
|
+
if (typeof interval === 'undefined') {
|
|
50529
|
+
throw new AppwriteException('Missing required parameter: "interval"');
|
|
50530
|
+
}
|
|
50531
|
+
const apiPath = '/waf/rules/rate-limit';
|
|
50532
|
+
const apiPayload = {};
|
|
50533
|
+
if (typeof ruleId !== 'undefined') {
|
|
50534
|
+
apiPayload['ruleId'] = ruleId;
|
|
50535
|
+
}
|
|
50536
|
+
if (typeof resourceType !== 'undefined') {
|
|
50537
|
+
apiPayload['resourceType'] = resourceType;
|
|
50538
|
+
}
|
|
50539
|
+
if (typeof resourceId !== 'undefined') {
|
|
50540
|
+
apiPayload['resourceId'] = resourceId;
|
|
50541
|
+
}
|
|
50542
|
+
if (typeof name !== 'undefined') {
|
|
50543
|
+
apiPayload['name'] = name;
|
|
50544
|
+
}
|
|
50545
|
+
if (typeof description !== 'undefined') {
|
|
50546
|
+
apiPayload['description'] = description;
|
|
48572
50547
|
}
|
|
48573
50548
|
if (typeof limit !== 'undefined') {
|
|
48574
50549
|
apiPayload['limit'] = limit;
|
|
@@ -49800,9 +51775,8 @@
|
|
|
49800
51775
|
* );
|
|
49801
51776
|
* // sub.update({ background: true }); sub.unsubscribe();
|
|
49802
51777
|
*/
|
|
49803
|
-
class Push
|
|
51778
|
+
class Push {
|
|
49804
51779
|
constructor(client) {
|
|
49805
|
-
super(client);
|
|
49806
51780
|
this.mqtt = null;
|
|
49807
51781
|
this.connecting = null;
|
|
49808
51782
|
this.Buffer = null;
|
|
@@ -49832,6 +51806,7 @@
|
|
|
49832
51806
|
this.connectedKey = '';
|
|
49833
51807
|
this.connectionEpoch = 0;
|
|
49834
51808
|
this.subscriptions = new Map();
|
|
51809
|
+
this.client = client;
|
|
49835
51810
|
}
|
|
49836
51811
|
// The broker subscription for a filter uses the highest QoS any local subscription on
|
|
49837
51812
|
// it wants, so a QoS-0 subscription never downgrades a QoS-1 one sharing the filter.
|
|
@@ -50571,6 +52546,670 @@
|
|
|
50571
52546
|
return filterParts.length === topicParts.length;
|
|
50572
52547
|
}
|
|
50573
52548
|
|
|
52549
|
+
/**
|
|
52550
|
+
* Analytics auto-tracking helpers.
|
|
52551
|
+
*
|
|
52552
|
+
* These are hand-written companions to the generated `Analytics` service.
|
|
52553
|
+
* The generated service exposes `createEvent(params)` for arbitrary events;
|
|
52554
|
+
* this module wires up common auto-tracking behaviours (pageviews, outbound
|
|
52555
|
+
* links, downloads, scroll depth, active engagement) on top of it.
|
|
52556
|
+
*
|
|
52557
|
+
* The tracking helpers accept a plain event-emitter function so they do not
|
|
52558
|
+
* hard-couple to the generated `Analytics` class. The emitter adapts this
|
|
52559
|
+
* module's option shape to `createEvent`: `url` is required there, and `props`
|
|
52560
|
+
* is a flat alternating key/value list rather than an object.
|
|
52561
|
+
*
|
|
52562
|
+
* ```ts
|
|
52563
|
+
* const analytics = new Analytics(client);
|
|
52564
|
+
* const tracking = new AnalyticsTracking(
|
|
52565
|
+
* (name, options) => analytics.createEvent({
|
|
52566
|
+
* propertyId: options?.propertyId ?? '<PROPERTY_ID>',
|
|
52567
|
+
* name,
|
|
52568
|
+
* url: options?.url ?? window.location.href,
|
|
52569
|
+
* referrer: options?.referrer,
|
|
52570
|
+
* scrollDepth: options?.scrollDepth,
|
|
52571
|
+
* engagementTime: options?.engagementTime,
|
|
52572
|
+
* props: Object.entries(options?.props ?? {}).flatMap(
|
|
52573
|
+
* ([key, value]) => [key, String(value)],
|
|
52574
|
+
* ),
|
|
52575
|
+
* }),
|
|
52576
|
+
* { propertyId: '<PROPERTY_ID>' }
|
|
52577
|
+
* );
|
|
52578
|
+
* tracking.enableAllAutoTracking();
|
|
52579
|
+
* ```
|
|
52580
|
+
*
|
|
52581
|
+
* `propertyId` is optional: when set it is merged into the options of every
|
|
52582
|
+
* emitted event, so an emitter that forwards `options.propertyId` (as above)
|
|
52583
|
+
* picks it up instead of every caller hand-rolling it into the closure.
|
|
52584
|
+
* Per-event `propertyId` always wins over the configured default.
|
|
52585
|
+
*
|
|
52586
|
+
* All helpers respect `navigator.doNotTrack === '1'` by default; opt out with
|
|
52587
|
+
* `respectDoNotTrack: false` in the constructor options.
|
|
52588
|
+
*
|
|
52589
|
+
* Engagement time follows Plausible's model: rather than one total at unload,
|
|
52590
|
+
* a delta is emitted at every natural checkpoint of the visit (tab hidden, SPA
|
|
52591
|
+
* route change, unload). See `enableAutoEngagementTime` for details.
|
|
52592
|
+
*
|
|
52593
|
+
* Auto-emitted event names follow `snake_case` + lowercase (`pageview`,
|
|
52594
|
+
* `outbound_link`, `file_download`, `screen_view`, etc.). Any prop keys use
|
|
52595
|
+
* camelCase to match the endpoint's parameter naming. Callers can pass any
|
|
52596
|
+
* custom event name; the auto-track methods only own the events they emit
|
|
52597
|
+
* themselves.
|
|
52598
|
+
*/
|
|
52599
|
+
const DEFAULT_DOWNLOAD_EXTENSIONS = [
|
|
52600
|
+
'pdf',
|
|
52601
|
+
'zip',
|
|
52602
|
+
'rar',
|
|
52603
|
+
'7z',
|
|
52604
|
+
'tar',
|
|
52605
|
+
'gz',
|
|
52606
|
+
'csv',
|
|
52607
|
+
'tsv',
|
|
52608
|
+
'xls',
|
|
52609
|
+
'xlsx',
|
|
52610
|
+
'doc',
|
|
52611
|
+
'docx',
|
|
52612
|
+
'ppt',
|
|
52613
|
+
'pptx',
|
|
52614
|
+
'dmg',
|
|
52615
|
+
'exe',
|
|
52616
|
+
'msi',
|
|
52617
|
+
'pkg',
|
|
52618
|
+
'deb',
|
|
52619
|
+
'rpm',
|
|
52620
|
+
'apk',
|
|
52621
|
+
'mp3',
|
|
52622
|
+
'wav',
|
|
52623
|
+
'flac',
|
|
52624
|
+
'mp4',
|
|
52625
|
+
'mov',
|
|
52626
|
+
'avi',
|
|
52627
|
+
'mkv',
|
|
52628
|
+
'webm',
|
|
52629
|
+
];
|
|
52630
|
+
/**
|
|
52631
|
+
* Two-part public suffixes common enough to matter for outbound-link detection.
|
|
52632
|
+
* See `rootDomain()` for why this is a short list rather than the Public Suffix
|
|
52633
|
+
* List.
|
|
52634
|
+
*/
|
|
52635
|
+
const MULTI_PART_SUFFIXES = new Set([
|
|
52636
|
+
'co.uk',
|
|
52637
|
+
'org.uk',
|
|
52638
|
+
'ac.uk',
|
|
52639
|
+
'gov.uk',
|
|
52640
|
+
'me.uk',
|
|
52641
|
+
'net.uk',
|
|
52642
|
+
'sch.uk',
|
|
52643
|
+
'co.jp',
|
|
52644
|
+
'ne.jp',
|
|
52645
|
+
'or.jp',
|
|
52646
|
+
'ac.jp',
|
|
52647
|
+
'go.jp',
|
|
52648
|
+
'com.au',
|
|
52649
|
+
'net.au',
|
|
52650
|
+
'org.au',
|
|
52651
|
+
'edu.au',
|
|
52652
|
+
'gov.au',
|
|
52653
|
+
'com.br',
|
|
52654
|
+
'net.br',
|
|
52655
|
+
'org.br',
|
|
52656
|
+
'com.cn',
|
|
52657
|
+
'net.cn',
|
|
52658
|
+
'org.cn',
|
|
52659
|
+
'gov.cn',
|
|
52660
|
+
'co.in',
|
|
52661
|
+
'net.in',
|
|
52662
|
+
'org.in',
|
|
52663
|
+
'co.nz',
|
|
52664
|
+
'net.nz',
|
|
52665
|
+
'org.nz',
|
|
52666
|
+
'co.za',
|
|
52667
|
+
'org.za',
|
|
52668
|
+
'com.mx',
|
|
52669
|
+
'com.ar',
|
|
52670
|
+
'com.co',
|
|
52671
|
+
'com.pe',
|
|
52672
|
+
'com.tr',
|
|
52673
|
+
'com.tw',
|
|
52674
|
+
'com.sg',
|
|
52675
|
+
'com.hk',
|
|
52676
|
+
'com.my',
|
|
52677
|
+
'com.ph',
|
|
52678
|
+
'com.vn',
|
|
52679
|
+
'co.kr',
|
|
52680
|
+
'co.il',
|
|
52681
|
+
'co.id',
|
|
52682
|
+
'co.th',
|
|
52683
|
+
'com.ua',
|
|
52684
|
+
'com.pl',
|
|
52685
|
+
'com.es',
|
|
52686
|
+
]);
|
|
52687
|
+
const SCROLL_DEPTH_THROTTLE_MS = 200;
|
|
52688
|
+
class AnalyticsTracking {
|
|
52689
|
+
constructor(emit, options = {}) {
|
|
52690
|
+
this.pageviewCleanups = [];
|
|
52691
|
+
this.scrollCleanups = [];
|
|
52692
|
+
this.engagementCleanups = [];
|
|
52693
|
+
this.maxScrollDepth = 0;
|
|
52694
|
+
this.scrollTicking = false;
|
|
52695
|
+
this.lastScrollReport = 0;
|
|
52696
|
+
this.engagementStart = 0;
|
|
52697
|
+
this.engagementAccumulatedMs = 0;
|
|
52698
|
+
this.engagementActive = false;
|
|
52699
|
+
this.emit = emit;
|
|
52700
|
+
this.respectDoNotTrack = options.respectDoNotTrack !== false;
|
|
52701
|
+
this.propertyId = options.propertyId;
|
|
52702
|
+
}
|
|
52703
|
+
/**
|
|
52704
|
+
* Enable the opinionated default auto-tracking set: pageviews, outbound
|
|
52705
|
+
* links, scroll depth and active engagement time. Downloads must be opted
|
|
52706
|
+
* into separately via `enableAutoDownloadTracking()` because the extension
|
|
52707
|
+
* list is application-specific.
|
|
52708
|
+
*/
|
|
52709
|
+
enableAllAutoTracking() {
|
|
52710
|
+
this.enableAutoPageviews();
|
|
52711
|
+
this.enableAutoOutboundTracking();
|
|
52712
|
+
this.enableAutoScrollDepth();
|
|
52713
|
+
this.enableAutoEngagementTime();
|
|
52714
|
+
}
|
|
52715
|
+
/**
|
|
52716
|
+
* Track an event manually. Respects the DNT setting and swallows emitter
|
|
52717
|
+
* exceptions so tracking failures never surface to the host page.
|
|
52718
|
+
*/
|
|
52719
|
+
track(name, options) {
|
|
52720
|
+
if (!this.canTrack()) {
|
|
52721
|
+
return;
|
|
52722
|
+
}
|
|
52723
|
+
try {
|
|
52724
|
+
this.emit(name, this.withPropertyId(options));
|
|
52725
|
+
}
|
|
52726
|
+
catch (error) {
|
|
52727
|
+
console.warn('AnalyticsTracking: emitter threw', error);
|
|
52728
|
+
}
|
|
52729
|
+
}
|
|
52730
|
+
/**
|
|
52731
|
+
* Convenience wrapper for pageview-shaped events.
|
|
52732
|
+
*/
|
|
52733
|
+
pageview(url, referrer) {
|
|
52734
|
+
this.track('pageview', {
|
|
52735
|
+
url: url !== null && url !== void 0 ? url : this.currentPageUrl(),
|
|
52736
|
+
referrer: referrer !== null && referrer !== void 0 ? referrer : (typeof document !== 'undefined'
|
|
52737
|
+
? document.referrer
|
|
52738
|
+
: undefined),
|
|
52739
|
+
});
|
|
52740
|
+
}
|
|
52741
|
+
/**
|
|
52742
|
+
* Enable SPA-aware pageview tracking. Fires an initial pageview on
|
|
52743
|
+
* enable, then again on every `pushState`, `replaceState`, `popstate`
|
|
52744
|
+
* or hashchange. Idempotent — repeat calls no-op.
|
|
52745
|
+
*/
|
|
52746
|
+
enableAutoPageviews() {
|
|
52747
|
+
if (this.pageviewCleanups.length > 0) {
|
|
52748
|
+
return;
|
|
52749
|
+
}
|
|
52750
|
+
if (typeof window === 'undefined' || typeof history === 'undefined') {
|
|
52751
|
+
return;
|
|
52752
|
+
}
|
|
52753
|
+
this.currentPath = this.currentPageUrl();
|
|
52754
|
+
this.pageview();
|
|
52755
|
+
const handleNavigation = () => {
|
|
52756
|
+
const nextPath = this.currentPageUrl();
|
|
52757
|
+
if (nextPath === this.currentPath) {
|
|
52758
|
+
return;
|
|
52759
|
+
}
|
|
52760
|
+
const previous = this.currentPath;
|
|
52761
|
+
this.currentPath = nextPath;
|
|
52762
|
+
this.flushScrollDepth(previous);
|
|
52763
|
+
this.flushEngagement(previous);
|
|
52764
|
+
this.pageview(nextPath);
|
|
52765
|
+
// flushEngagement no longer auto-restarts the timer (see its
|
|
52766
|
+
// implementation note re: bfcache). SPA navigation stays on the
|
|
52767
|
+
// same document, so restart engagement tracking for the new
|
|
52768
|
+
// route as long as the tab is visible.
|
|
52769
|
+
if (this.engagementCleanups.length > 0 &&
|
|
52770
|
+
(typeof document === 'undefined' ||
|
|
52771
|
+
document.visibilityState !== 'hidden')) {
|
|
52772
|
+
this.startEngagement();
|
|
52773
|
+
}
|
|
52774
|
+
};
|
|
52775
|
+
const originalPushState = history.pushState.bind(history);
|
|
52776
|
+
const originalReplaceState = history.replaceState.bind(history);
|
|
52777
|
+
// Our wrappers stay reachable after cleanup whenever another library
|
|
52778
|
+
// patched on top of ours, so they have to be switchable off rather than
|
|
52779
|
+
// merely unreferenced.
|
|
52780
|
+
let patchActive = true;
|
|
52781
|
+
const patchedPushState = (data, unused, url) => {
|
|
52782
|
+
originalPushState(data, unused, url);
|
|
52783
|
+
if (patchActive) {
|
|
52784
|
+
handleNavigation();
|
|
52785
|
+
}
|
|
52786
|
+
};
|
|
52787
|
+
const patchedReplaceState = (data, unused, url) => {
|
|
52788
|
+
originalReplaceState(data, unused, url);
|
|
52789
|
+
if (patchActive) {
|
|
52790
|
+
handleNavigation();
|
|
52791
|
+
}
|
|
52792
|
+
};
|
|
52793
|
+
history.pushState = patchedPushState;
|
|
52794
|
+
history.replaceState = patchedReplaceState;
|
|
52795
|
+
const popstateHandler = () => handleNavigation();
|
|
52796
|
+
const hashchangeHandler = () => handleNavigation();
|
|
52797
|
+
window.addEventListener('popstate', popstateHandler);
|
|
52798
|
+
window.addEventListener('hashchange', hashchangeHandler);
|
|
52799
|
+
this.pageviewCleanups.push(() => {
|
|
52800
|
+
// Only unwind our own patch. A router (Next.js App Router, React
|
|
52801
|
+
// Router, …) that patched these after us owns the current value,
|
|
52802
|
+
// and assigning our saved reference back would silently throw its
|
|
52803
|
+
// wrapper away. In that case ours stays in the chain, which is why
|
|
52804
|
+
// `patchActive` exists: the wrapper keeps delegating to the original
|
|
52805
|
+
// but stops reporting.
|
|
52806
|
+
patchActive = false;
|
|
52807
|
+
if (history.pushState === patchedPushState) {
|
|
52808
|
+
history.pushState = originalPushState;
|
|
52809
|
+
}
|
|
52810
|
+
if (history.replaceState === patchedReplaceState) {
|
|
52811
|
+
history.replaceState = originalReplaceState;
|
|
52812
|
+
}
|
|
52813
|
+
window.removeEventListener('popstate', popstateHandler);
|
|
52814
|
+
window.removeEventListener('hashchange', hashchangeHandler);
|
|
52815
|
+
});
|
|
52816
|
+
}
|
|
52817
|
+
/**
|
|
52818
|
+
* Disable auto-pageview tracking installed by `enableAutoPageviews`.
|
|
52819
|
+
* Safe to call when auto-pageviews were never enabled.
|
|
52820
|
+
*/
|
|
52821
|
+
disableAutoPageviews() {
|
|
52822
|
+
for (const cleanup of this.pageviewCleanups) {
|
|
52823
|
+
cleanup();
|
|
52824
|
+
}
|
|
52825
|
+
this.pageviewCleanups = [];
|
|
52826
|
+
}
|
|
52827
|
+
/**
|
|
52828
|
+
* Enable click-based outbound link tracking. Detects anchor clicks that
|
|
52829
|
+
* navigate to a different origin and fires an `outbound_link` event
|
|
52830
|
+
* (with `hostname` and `href` props) before the browser navigates.
|
|
52831
|
+
*/
|
|
52832
|
+
enableAutoOutboundTracking(options = {}) {
|
|
52833
|
+
if (this.outboundCleanup) {
|
|
52834
|
+
return;
|
|
52835
|
+
}
|
|
52836
|
+
if (typeof document === 'undefined') {
|
|
52837
|
+
return;
|
|
52838
|
+
}
|
|
52839
|
+
const includeSubdomains = options.includeSubdomains === true;
|
|
52840
|
+
const clickHandler = (event) => {
|
|
52841
|
+
const anchor = this.findAnchor(event.target);
|
|
52842
|
+
if (!anchor || !anchor.href) {
|
|
52843
|
+
return;
|
|
52844
|
+
}
|
|
52845
|
+
const target = this.parseUrl(anchor.href);
|
|
52846
|
+
if (!target || !this.isExternal(target, includeSubdomains)) {
|
|
52847
|
+
return;
|
|
52848
|
+
}
|
|
52849
|
+
this.track('outbound_link', {
|
|
52850
|
+
url: target.href,
|
|
52851
|
+
props: { hostname: target.hostname, href: target.href },
|
|
52852
|
+
});
|
|
52853
|
+
};
|
|
52854
|
+
document.addEventListener('click', clickHandler, { capture: true });
|
|
52855
|
+
this.outboundCleanup = () => document.removeEventListener('click', clickHandler, {
|
|
52856
|
+
capture: true,
|
|
52857
|
+
});
|
|
52858
|
+
}
|
|
52859
|
+
/**
|
|
52860
|
+
* Disable outbound-link tracking installed by `enableAutoOutboundTracking`.
|
|
52861
|
+
* Safe to call when auto-outbound was never enabled.
|
|
52862
|
+
*/
|
|
52863
|
+
disableAutoOutboundTracking() {
|
|
52864
|
+
if (this.outboundCleanup) {
|
|
52865
|
+
this.outboundCleanup();
|
|
52866
|
+
this.outboundCleanup = undefined;
|
|
52867
|
+
}
|
|
52868
|
+
}
|
|
52869
|
+
/**
|
|
52870
|
+
* Enable click-based download tracking. Detects anchor clicks that point
|
|
52871
|
+
* at a file whose extension appears in the configured list and fires a
|
|
52872
|
+
* `file_download` event with `filename`, `extension` and `href` props.
|
|
52873
|
+
*/
|
|
52874
|
+
enableAutoDownloadTracking(options = {}) {
|
|
52875
|
+
var _a;
|
|
52876
|
+
if (this.downloadCleanup) {
|
|
52877
|
+
return;
|
|
52878
|
+
}
|
|
52879
|
+
if (typeof document === 'undefined') {
|
|
52880
|
+
return;
|
|
52881
|
+
}
|
|
52882
|
+
const extensions = ((_a = options.extensions) !== null && _a !== void 0 ? _a : DEFAULT_DOWNLOAD_EXTENSIONS).map((ext) => ext.toLowerCase().replace(/^\./, ''));
|
|
52883
|
+
const extensionSet = new Set(extensions);
|
|
52884
|
+
const clickHandler = (event) => {
|
|
52885
|
+
var _a, _b;
|
|
52886
|
+
const anchor = this.findAnchor(event.target);
|
|
52887
|
+
if (!anchor || !anchor.href) {
|
|
52888
|
+
return;
|
|
52889
|
+
}
|
|
52890
|
+
const url = this.parseUrl(anchor.href);
|
|
52891
|
+
if (!url) {
|
|
52892
|
+
return;
|
|
52893
|
+
}
|
|
52894
|
+
const filename = (_a = url.pathname.split('/').pop()) !== null && _a !== void 0 ? _a : '';
|
|
52895
|
+
const extension = filename.includes('.')
|
|
52896
|
+
? (_b = filename.split('.').pop()) === null || _b === void 0 ? void 0 : _b.toLowerCase()
|
|
52897
|
+
: undefined;
|
|
52898
|
+
if (!extension || !extensionSet.has(extension)) {
|
|
52899
|
+
return;
|
|
52900
|
+
}
|
|
52901
|
+
this.track('file_download', {
|
|
52902
|
+
url: url.href,
|
|
52903
|
+
props: { filename, extension, href: url.href },
|
|
52904
|
+
});
|
|
52905
|
+
};
|
|
52906
|
+
document.addEventListener('click', clickHandler, { capture: true });
|
|
52907
|
+
this.downloadCleanup = () => document.removeEventListener('click', clickHandler, {
|
|
52908
|
+
capture: true,
|
|
52909
|
+
});
|
|
52910
|
+
}
|
|
52911
|
+
/**
|
|
52912
|
+
* Disable file-download tracking installed by `enableAutoDownloadTracking`.
|
|
52913
|
+
* Safe to call when auto-download was never enabled.
|
|
52914
|
+
*/
|
|
52915
|
+
disableAutoDownloadTracking() {
|
|
52916
|
+
if (this.downloadCleanup) {
|
|
52917
|
+
this.downloadCleanup();
|
|
52918
|
+
this.downloadCleanup = undefined;
|
|
52919
|
+
}
|
|
52920
|
+
}
|
|
52921
|
+
/**
|
|
52922
|
+
* Enable passive scroll-depth tracking. Records the maximum percent of the
|
|
52923
|
+
* document scrolled and reports it on `beforeunload` and on SPA route
|
|
52924
|
+
* changes. Uses a throttled passive listener so it is safe on hot paths.
|
|
52925
|
+
*/
|
|
52926
|
+
enableAutoScrollDepth() {
|
|
52927
|
+
if (this.scrollCleanups.length > 0) {
|
|
52928
|
+
return;
|
|
52929
|
+
}
|
|
52930
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
52931
|
+
return;
|
|
52932
|
+
}
|
|
52933
|
+
this.maxScrollDepth = 0;
|
|
52934
|
+
this.lastScrollReport = 0;
|
|
52935
|
+
const scrollHandler = () => {
|
|
52936
|
+
if (this.scrollTicking) {
|
|
52937
|
+
return;
|
|
52938
|
+
}
|
|
52939
|
+
this.scrollTicking = true;
|
|
52940
|
+
window.requestAnimationFrame(() => {
|
|
52941
|
+
const now = Date.now();
|
|
52942
|
+
if (now - this.lastScrollReport < SCROLL_DEPTH_THROTTLE_MS) {
|
|
52943
|
+
this.scrollTicking = false;
|
|
52944
|
+
return;
|
|
52945
|
+
}
|
|
52946
|
+
this.lastScrollReport = now;
|
|
52947
|
+
const depth = this.computeScrollDepth();
|
|
52948
|
+
if (depth > this.maxScrollDepth) {
|
|
52949
|
+
this.maxScrollDepth = depth;
|
|
52950
|
+
}
|
|
52951
|
+
this.scrollTicking = false;
|
|
52952
|
+
});
|
|
52953
|
+
};
|
|
52954
|
+
const unloadHandler = () => {
|
|
52955
|
+
this.flushScrollDepth(this.currentPageUrl());
|
|
52956
|
+
};
|
|
52957
|
+
window.addEventListener('scroll', scrollHandler, { passive: true });
|
|
52958
|
+
window.addEventListener('beforeunload', unloadHandler);
|
|
52959
|
+
window.addEventListener('pagehide', unloadHandler);
|
|
52960
|
+
this.scrollCleanups.push(() => {
|
|
52961
|
+
window.removeEventListener('scroll', scrollHandler);
|
|
52962
|
+
window.removeEventListener('beforeunload', unloadHandler);
|
|
52963
|
+
window.removeEventListener('pagehide', unloadHandler);
|
|
52964
|
+
});
|
|
52965
|
+
}
|
|
52966
|
+
/**
|
|
52967
|
+
* Disable scroll-depth tracking installed by `enableAutoScrollDepth`. Safe
|
|
52968
|
+
* to call when auto-scroll-depth was never enabled. Any accumulated depth
|
|
52969
|
+
* for the current page is dropped.
|
|
52970
|
+
*/
|
|
52971
|
+
disableAutoScrollDepth() {
|
|
52972
|
+
for (const cleanup of this.scrollCleanups) {
|
|
52973
|
+
cleanup();
|
|
52974
|
+
}
|
|
52975
|
+
this.scrollCleanups = [];
|
|
52976
|
+
this.maxScrollDepth = 0;
|
|
52977
|
+
this.scrollTicking = false;
|
|
52978
|
+
this.lastScrollReport = 0;
|
|
52979
|
+
}
|
|
52980
|
+
/**
|
|
52981
|
+
* Enable active engagement-time tracking. Counts time the tab is visible
|
|
52982
|
+
* and uses `visibilitychange` to exclude background time.
|
|
52983
|
+
*
|
|
52984
|
+
* Delivery follows Plausible's model rather than a single total at the
|
|
52985
|
+
* end of the visit: an `engagement_time` event is emitted at every natural
|
|
52986
|
+
* checkpoint — the tab going hidden, an SPA route change, and finally
|
|
52987
|
+
* `beforeunload`/`pagehide`. Unload is kept only as a best-effort last
|
|
52988
|
+
* flush; it is the least reliable moment to send anything (browsers
|
|
52989
|
+
* routinely cancel in-flight requests there, and `sendBeacon` cannot set
|
|
52990
|
+
* the `X-Appwrite-Project` header the endpoint requires), so it must never
|
|
52991
|
+
* be the only delivery.
|
|
52992
|
+
*
|
|
52993
|
+
* Each event carries a **delta** — the seconds accrued since the previous
|
|
52994
|
+
* flush, not a running total — so the values are additive per session and
|
|
52995
|
+
* a lost event costs only its own slice.
|
|
52996
|
+
*
|
|
52997
|
+
* There is deliberately no periodic ping. The cadence is driven by
|
|
52998
|
+
* navigation and tab switches, so request volume tracks what the visitor
|
|
52999
|
+
* actually does instead of multiplying with time on page.
|
|
53000
|
+
*/
|
|
53001
|
+
enableAutoEngagementTime() {
|
|
53002
|
+
if (this.engagementCleanups.length > 0) {
|
|
53003
|
+
return;
|
|
53004
|
+
}
|
|
53005
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
53006
|
+
return;
|
|
53007
|
+
}
|
|
53008
|
+
this.engagementAccumulatedMs = 0;
|
|
53009
|
+
// Do not start the clock for a tab that is already hidden (prerender,
|
|
53010
|
+
// background tab restore); `visibilitychange` starts it when it is
|
|
53011
|
+
// actually looked at.
|
|
53012
|
+
if (document.visibilityState !== 'hidden') {
|
|
53013
|
+
this.startEngagement();
|
|
53014
|
+
}
|
|
53015
|
+
const visibilityHandler = () => {
|
|
53016
|
+
if (document.visibilityState === 'hidden') {
|
|
53017
|
+
// Flush, don't just pause. The page is still fully alive here,
|
|
53018
|
+
// which makes this the most reliable delivery point in the
|
|
53019
|
+
// whole visit — and it is the same moment Plausible reports on.
|
|
53020
|
+
this.flushEngagement(this.currentPageUrl());
|
|
53021
|
+
}
|
|
53022
|
+
else if (document.visibilityState === 'visible') {
|
|
53023
|
+
this.startEngagement();
|
|
53024
|
+
}
|
|
53025
|
+
};
|
|
53026
|
+
const unloadHandler = () => {
|
|
53027
|
+
this.flushEngagement(this.currentPageUrl());
|
|
53028
|
+
};
|
|
53029
|
+
const pageshowHandler = (event) => {
|
|
53030
|
+
// When the page is restored from the back-forward cache the
|
|
53031
|
+
// engagement timer is in a stopped state (flushEngagement paused
|
|
53032
|
+
// it on pagehide and does not auto-restart). Kick off a fresh
|
|
53033
|
+
// engagementStart so bfcache dwell time is not billed as
|
|
53034
|
+
// engagement.
|
|
53035
|
+
if (event.persisted) {
|
|
53036
|
+
this.startEngagement();
|
|
53037
|
+
}
|
|
53038
|
+
};
|
|
53039
|
+
document.addEventListener('visibilitychange', visibilityHandler);
|
|
53040
|
+
window.addEventListener('beforeunload', unloadHandler);
|
|
53041
|
+
window.addEventListener('pagehide', unloadHandler);
|
|
53042
|
+
window.addEventListener('pageshow', pageshowHandler);
|
|
53043
|
+
this.engagementCleanups.push(() => {
|
|
53044
|
+
document.removeEventListener('visibilitychange', visibilityHandler);
|
|
53045
|
+
window.removeEventListener('beforeunload', unloadHandler);
|
|
53046
|
+
window.removeEventListener('pagehide', unloadHandler);
|
|
53047
|
+
window.removeEventListener('pageshow', pageshowHandler);
|
|
53048
|
+
});
|
|
53049
|
+
}
|
|
53050
|
+
/**
|
|
53051
|
+
* Disable engagement-time tracking installed by `enableAutoEngagementTime`.
|
|
53052
|
+
* Safe to call when auto-engagement was never enabled. Any accumulated
|
|
53053
|
+
* engagement time is dropped without being emitted.
|
|
53054
|
+
*/
|
|
53055
|
+
disableAutoEngagementTime() {
|
|
53056
|
+
for (const cleanup of this.engagementCleanups) {
|
|
53057
|
+
cleanup();
|
|
53058
|
+
}
|
|
53059
|
+
this.engagementCleanups = [];
|
|
53060
|
+
this.engagementActive = false;
|
|
53061
|
+
this.engagementAccumulatedMs = 0;
|
|
53062
|
+
this.engagementStart = 0;
|
|
53063
|
+
}
|
|
53064
|
+
/**
|
|
53065
|
+
* Merge the configured `propertyId` into an event's options. Returns the
|
|
53066
|
+
* caller's object untouched when no default is configured (or the event
|
|
53067
|
+
* already carries one), so emitters written against the pre-`propertyId`
|
|
53068
|
+
* shape keep receiving exactly what they received before.
|
|
53069
|
+
*/
|
|
53070
|
+
withPropertyId(options) {
|
|
53071
|
+
if (this.propertyId === undefined ||
|
|
53072
|
+
(options === null || options === void 0 ? void 0 : options.propertyId) !== undefined) {
|
|
53073
|
+
return options;
|
|
53074
|
+
}
|
|
53075
|
+
return Object.assign(Object.assign({}, (options !== null && options !== void 0 ? options : {})), { propertyId: this.propertyId });
|
|
53076
|
+
}
|
|
53077
|
+
canTrack() {
|
|
53078
|
+
if (!this.respectDoNotTrack) {
|
|
53079
|
+
return true;
|
|
53080
|
+
}
|
|
53081
|
+
if (typeof navigator === 'undefined') {
|
|
53082
|
+
return true;
|
|
53083
|
+
}
|
|
53084
|
+
return navigator.doNotTrack !== '1';
|
|
53085
|
+
}
|
|
53086
|
+
currentPageUrl() {
|
|
53087
|
+
if (typeof window === 'undefined' || !window.location) {
|
|
53088
|
+
return '';
|
|
53089
|
+
}
|
|
53090
|
+
return window.location.href;
|
|
53091
|
+
}
|
|
53092
|
+
findAnchor(target) {
|
|
53093
|
+
let node = target;
|
|
53094
|
+
while (node) {
|
|
53095
|
+
if (node.tagName === 'A') {
|
|
53096
|
+
return node;
|
|
53097
|
+
}
|
|
53098
|
+
node = node.parentNode;
|
|
53099
|
+
}
|
|
53100
|
+
return null;
|
|
53101
|
+
}
|
|
53102
|
+
parseUrl(href) {
|
|
53103
|
+
try {
|
|
53104
|
+
return new URL(href, window.location.href);
|
|
53105
|
+
}
|
|
53106
|
+
catch (_a) {
|
|
53107
|
+
return null;
|
|
53108
|
+
}
|
|
53109
|
+
}
|
|
53110
|
+
isExternal(target, includeSubdomains) {
|
|
53111
|
+
if (target.protocol !== 'http:' && target.protocol !== 'https:') {
|
|
53112
|
+
return false;
|
|
53113
|
+
}
|
|
53114
|
+
if (target.hostname === window.location.hostname) {
|
|
53115
|
+
return false;
|
|
53116
|
+
}
|
|
53117
|
+
if (includeSubdomains) {
|
|
53118
|
+
return true;
|
|
53119
|
+
}
|
|
53120
|
+
const root = this.rootDomain(window.location.hostname);
|
|
53121
|
+
return this.rootDomain(target.hostname) !== root;
|
|
53122
|
+
}
|
|
53123
|
+
rootDomain(hostname) {
|
|
53124
|
+
const parts = hostname.split('.');
|
|
53125
|
+
if (parts.length <= 2) {
|
|
53126
|
+
return hostname;
|
|
53127
|
+
}
|
|
53128
|
+
// Taking the last two labels is wrong wherever the registry sells names
|
|
53129
|
+
// one level down: `shop.example.co.uk` and `google.co.uk` both reduce to
|
|
53130
|
+
// `co.uk`, so every outbound click between two `.co.uk` sites looks
|
|
53131
|
+
// internal and is dropped. Take three labels after a known two-part
|
|
53132
|
+
// suffix instead.
|
|
53133
|
+
//
|
|
53134
|
+
// This is a heuristic, not the Public Suffix List — the full list is
|
|
53135
|
+
// orders of magnitude larger than this whole file, and a tracking
|
|
53136
|
+
// snippet cannot carry it. Sites on a suffix that is missing here can
|
|
53137
|
+
// pass `includeSubdomains: true` to treat every other host as outbound.
|
|
53138
|
+
const suffix = parts.slice(-2).join('.');
|
|
53139
|
+
if (parts.length > 2 && MULTI_PART_SUFFIXES.has(suffix)) {
|
|
53140
|
+
return parts.slice(-3).join('.');
|
|
53141
|
+
}
|
|
53142
|
+
return suffix;
|
|
53143
|
+
}
|
|
53144
|
+
computeScrollDepth() {
|
|
53145
|
+
const scrollTop = window.scrollY || document.documentElement.scrollTop;
|
|
53146
|
+
const viewport = window.innerHeight || document.documentElement.clientHeight;
|
|
53147
|
+
const total = document.documentElement.scrollHeight;
|
|
53148
|
+
if (total <= viewport) {
|
|
53149
|
+
return 100;
|
|
53150
|
+
}
|
|
53151
|
+
const depth = Math.round(((scrollTop + viewport) / total) * 100);
|
|
53152
|
+
return Math.max(0, Math.min(100, depth));
|
|
53153
|
+
}
|
|
53154
|
+
flushScrollDepth(url) {
|
|
53155
|
+
if (this.scrollCleanups.length === 0) {
|
|
53156
|
+
return;
|
|
53157
|
+
}
|
|
53158
|
+
if (this.maxScrollDepth <= 0) {
|
|
53159
|
+
return;
|
|
53160
|
+
}
|
|
53161
|
+
this.track('scroll_depth', {
|
|
53162
|
+
url,
|
|
53163
|
+
scrollDepth: this.maxScrollDepth,
|
|
53164
|
+
});
|
|
53165
|
+
this.maxScrollDepth = 0;
|
|
53166
|
+
}
|
|
53167
|
+
startEngagement() {
|
|
53168
|
+
if (this.engagementActive) {
|
|
53169
|
+
return;
|
|
53170
|
+
}
|
|
53171
|
+
this.engagementActive = true;
|
|
53172
|
+
this.engagementStart = Date.now();
|
|
53173
|
+
}
|
|
53174
|
+
pauseEngagement() {
|
|
53175
|
+
if (!this.engagementActive) {
|
|
53176
|
+
return;
|
|
53177
|
+
}
|
|
53178
|
+
this.engagementActive = false;
|
|
53179
|
+
this.engagementAccumulatedMs += Date.now() - this.engagementStart;
|
|
53180
|
+
}
|
|
53181
|
+
flushEngagement(url) {
|
|
53182
|
+
if (this.engagementCleanups.length === 0) {
|
|
53183
|
+
return;
|
|
53184
|
+
}
|
|
53185
|
+
this.pauseEngagement();
|
|
53186
|
+
// Deltas, not a running total: emit only what accrued since the last
|
|
53187
|
+
// flush. `floor` plus keeping the sub-second remainder in the
|
|
53188
|
+
// accumulator is what makes repeated flushes safe — nothing is emitted
|
|
53189
|
+
// twice, and a visit chopped into many short segments does not lose a
|
|
53190
|
+
// fraction of a second to rounding on every one of them.
|
|
53191
|
+
const seconds = Math.floor(this.engagementAccumulatedMs / 1000);
|
|
53192
|
+
if (seconds > 0) {
|
|
53193
|
+
// Deduct before emitting so a synchronous emitter that re-enters
|
|
53194
|
+
// (or throws) can never bill the same seconds again.
|
|
53195
|
+
this.engagementAccumulatedMs -= seconds * 1000;
|
|
53196
|
+
this.track('engagement_time', {
|
|
53197
|
+
url,
|
|
53198
|
+
engagementTime: seconds,
|
|
53199
|
+
});
|
|
53200
|
+
}
|
|
53201
|
+
// NOTE: intentionally do NOT call startEngagement() here. flushEngagement
|
|
53202
|
+
// runs on `pagehide`, which is also the last hook before the browser
|
|
53203
|
+
// may freeze the page into the back-forward cache. Auto-restarting
|
|
53204
|
+
// would snapshot engagementStart just before the freeze; the next
|
|
53205
|
+
// pauseEngagement (after bfcache restore) would then bill the entire
|
|
53206
|
+
// bfcache dwell as active engagement. Restart is driven by explicit
|
|
53207
|
+
// resume signals: `pageshow` (with `persisted === true`),
|
|
53208
|
+
// `visibilitychange` back to visible, or the SPA navigation flow in
|
|
53209
|
+
// `enableAutoPageviews`.
|
|
53210
|
+
}
|
|
53211
|
+
}
|
|
53212
|
+
|
|
50574
53213
|
/**
|
|
50575
53214
|
* Helper class to generate permission strings for resources.
|
|
50576
53215
|
*/
|
|
@@ -51277,6 +53916,68 @@
|
|
|
51277
53916
|
OAuthProvider["Zoom"] = "zoom";
|
|
51278
53917
|
})(exports.OAuthProvider || (exports.OAuthProvider = {}));
|
|
51279
53918
|
|
|
53919
|
+
exports.PlatformResourceType = void 0;
|
|
53920
|
+
(function (PlatformResourceType) {
|
|
53921
|
+
PlatformResourceType["Projects"] = "projects";
|
|
53922
|
+
PlatformResourceType["Organizations"] = "organizations";
|
|
53923
|
+
PlatformResourceType["Users"] = "users";
|
|
53924
|
+
PlatformResourceType["Memberships"] = "memberships";
|
|
53925
|
+
PlatformResourceType["Rules"] = "rules";
|
|
53926
|
+
PlatformResourceType["Keys"] = "keys";
|
|
53927
|
+
PlatformResourceType["Platforms"] = "platforms";
|
|
53928
|
+
PlatformResourceType["Webhooks"] = "webhooks";
|
|
53929
|
+
PlatformResourceType["Certificates"] = "certificates";
|
|
53930
|
+
})(exports.PlatformResourceType || (exports.PlatformResourceType = {}));
|
|
53931
|
+
|
|
53932
|
+
exports.ProjectResourceType = void 0;
|
|
53933
|
+
(function (ProjectResourceType) {
|
|
53934
|
+
ProjectResourceType["Users"] = "users";
|
|
53935
|
+
ProjectResourceType["Teams"] = "teams";
|
|
53936
|
+
ProjectResourceType["Memberships"] = "memberships";
|
|
53937
|
+
ProjectResourceType["Databases"] = "databases";
|
|
53938
|
+
ProjectResourceType["Buckets"] = "buckets";
|
|
53939
|
+
ProjectResourceType["Functions"] = "functions";
|
|
53940
|
+
ProjectResourceType["Sites"] = "sites";
|
|
53941
|
+
ProjectResourceType["Deployments"] = "deployments";
|
|
53942
|
+
ProjectResourceType["Topics"] = "topics";
|
|
53943
|
+
ProjectResourceType["Providers"] = "providers";
|
|
53944
|
+
ProjectResourceType["Messages"] = "messages";
|
|
53945
|
+
})(exports.ProjectResourceType || (exports.ProjectResourceType = {}));
|
|
53946
|
+
|
|
53947
|
+
exports.AnalyticsInterval = void 0;
|
|
53948
|
+
(function (AnalyticsInterval) {
|
|
53949
|
+
AnalyticsInterval["OneHour"] = "1h";
|
|
53950
|
+
AnalyticsInterval["OneDay"] = "1d";
|
|
53951
|
+
AnalyticsInterval["OneWeek"] = "1w";
|
|
53952
|
+
AnalyticsInterval["OneMonth"] = "1m";
|
|
53953
|
+
})(exports.AnalyticsInterval || (exports.AnalyticsInterval = {}));
|
|
53954
|
+
|
|
53955
|
+
exports.AnalyticsDimension = void 0;
|
|
53956
|
+
(function (AnalyticsDimension) {
|
|
53957
|
+
AnalyticsDimension["Country"] = "country";
|
|
53958
|
+
AnalyticsDimension["Region"] = "region";
|
|
53959
|
+
AnalyticsDimension["City"] = "city";
|
|
53960
|
+
AnalyticsDimension["Browser"] = "browser";
|
|
53961
|
+
AnalyticsDimension["OperatingSystem"] = "operatingSystem";
|
|
53962
|
+
AnalyticsDimension["Device"] = "device";
|
|
53963
|
+
AnalyticsDimension["ScreenSize"] = "screenSize";
|
|
53964
|
+
AnalyticsDimension["ReferrerSource"] = "referrerSource";
|
|
53965
|
+
AnalyticsDimension["Channel"] = "channel";
|
|
53966
|
+
AnalyticsDimension["UtmSource"] = "utmSource";
|
|
53967
|
+
AnalyticsDimension["UtmMedium"] = "utmMedium";
|
|
53968
|
+
AnalyticsDimension["UtmCampaign"] = "utmCampaign";
|
|
53969
|
+
AnalyticsDimension["UtmContent"] = "utmContent";
|
|
53970
|
+
AnalyticsDimension["UtmTerm"] = "utmTerm";
|
|
53971
|
+
AnalyticsDimension["Page"] = "page";
|
|
53972
|
+
AnalyticsDimension["Hostname"] = "hostname";
|
|
53973
|
+
AnalyticsDimension["EntryPage"] = "entryPage";
|
|
53974
|
+
AnalyticsDimension["ExitPage"] = "exitPage";
|
|
53975
|
+
AnalyticsDimension["TrafficType"] = "trafficType";
|
|
53976
|
+
AnalyticsDimension["BotName"] = "botName";
|
|
53977
|
+
AnalyticsDimension["BotCategory"] = "botCategory";
|
|
53978
|
+
AnalyticsDimension["EventName"] = "eventName";
|
|
53979
|
+
})(exports.AnalyticsDimension || (exports.AnalyticsDimension = {}));
|
|
53980
|
+
|
|
51280
53981
|
exports.Browser = void 0;
|
|
51281
53982
|
(function (Browser) {
|
|
51282
53983
|
Browser["AvantBrowser"] = "aa";
|
|
@@ -52092,6 +54793,14 @@
|
|
|
52092
54793
|
QuerySuggestionResource["ResourceTokens"] = "resourcetokens";
|
|
52093
54794
|
QuerySuggestionResource["Transactions"] = "transactions";
|
|
52094
54795
|
QuerySuggestionResource["TransactionLogs"] = "transactionlogs";
|
|
54796
|
+
QuerySuggestionResource["Videos"] = "videos";
|
|
54797
|
+
QuerySuggestionResource["VideosPreviews"] = "videos_previews";
|
|
54798
|
+
QuerySuggestionResource["VideosRenditions"] = "videos_renditions";
|
|
54799
|
+
QuerySuggestionResource["VideosRenditionsSegments"] = "videos_renditions_segments";
|
|
54800
|
+
QuerySuggestionResource["VideosProfiles"] = "videos_profiles";
|
|
54801
|
+
QuerySuggestionResource["VideosSubtitles"] = "videos_subtitles";
|
|
54802
|
+
QuerySuggestionResource["VideosSubtitlesSegments"] = "videos_subtitles_segments";
|
|
54803
|
+
QuerySuggestionResource["AnalyticsProperties"] = "analyticsproperties";
|
|
52095
54804
|
QuerySuggestionResource["DedicatedDatabases"] = "dedicateddatabases";
|
|
52096
54805
|
QuerySuggestionResource["DedicatedDatabaseConfigs"] = "dedicateddatabaseconfigs";
|
|
52097
54806
|
QuerySuggestionResource["DedicatedDatabaseRuntimes"] = "dedicateddatabaseruntimes";
|
|
@@ -52514,6 +55223,8 @@
|
|
|
52514
55223
|
ProjectKeyScopes["ReportsWrite"] = "reports.write";
|
|
52515
55224
|
ProjectKeyScopes["PresencesRead"] = "presences.read";
|
|
52516
55225
|
ProjectKeyScopes["PresencesWrite"] = "presences.write";
|
|
55226
|
+
ProjectKeyScopes["VideosRead"] = "videos.read";
|
|
55227
|
+
ProjectKeyScopes["VideosWrite"] = "videos.write";
|
|
52517
55228
|
ProjectKeyScopes["DedicatedDatabasesExecute"] = "dedicatedDatabases.execute";
|
|
52518
55229
|
ProjectKeyScopes["BackupsPoliciesRead"] = "backups.policies.read";
|
|
52519
55230
|
ProjectKeyScopes["BackupsPoliciesWrite"] = "backups.policies.write";
|
|
@@ -52532,6 +55243,8 @@
|
|
|
52532
55243
|
ProjectKeyScopes["Oauth2Read"] = "oauth2.read";
|
|
52533
55244
|
ProjectKeyScopes["Oauth2Write"] = "oauth2.write";
|
|
52534
55245
|
ProjectKeyScopes["Oauth2Introspect"] = "oauth2.introspect";
|
|
55246
|
+
ProjectKeyScopes["AnalyticsRead"] = "analytics.read";
|
|
55247
|
+
ProjectKeyScopes["AnalyticsWrite"] = "analytics.write";
|
|
52535
55248
|
})(exports.ProjectKeyScopes || (exports.ProjectKeyScopes = {}));
|
|
52536
55249
|
|
|
52537
55250
|
exports.FunctionTemplateUseCase = void 0;
|
|
@@ -52781,6 +55494,7 @@
|
|
|
52781
55494
|
ProjectAuthMethodId["Invites"] = "invites";
|
|
52782
55495
|
ProjectAuthMethodId["Jwt"] = "jwt";
|
|
52783
55496
|
ProjectAuthMethodId["Phone"] = "phone";
|
|
55497
|
+
ProjectAuthMethodId["Passkey"] = "passkey";
|
|
52784
55498
|
})(exports.ProjectAuthMethodId || (exports.ProjectAuthMethodId = {}));
|
|
52785
55499
|
|
|
52786
55500
|
exports.ProjectOAuth2Auth0Prompt = void 0;
|
|
@@ -52922,6 +55636,7 @@
|
|
|
52922
55636
|
ProjectPolicyId["Denydisposableemail"] = "deny-disposable-email";
|
|
52923
55637
|
ProjectPolicyId["Denyfreeemail"] = "deny-free-email";
|
|
52924
55638
|
ProjectPolicyId["Denycorporateemail"] = "deny-corporate-email";
|
|
55639
|
+
ProjectPolicyId["Passkey"] = "passkey";
|
|
52925
55640
|
})(exports.ProjectPolicyId || (exports.ProjectPolicyId = {}));
|
|
52926
55641
|
|
|
52927
55642
|
exports.ProjectProtocolId = void 0;
|
|
@@ -53166,6 +55881,9 @@
|
|
|
53166
55881
|
|
|
53167
55882
|
exports.UsageEventMetric = void 0;
|
|
53168
55883
|
(function (UsageEventMetric) {
|
|
55884
|
+
UsageEventMetric["AnalyticsEvents"] = "analytics.events";
|
|
55885
|
+
UsageEventMetric["AnalyticsPageviews"] = "analytics.pageviews";
|
|
55886
|
+
UsageEventMetric["AnalyticsBotsEvents"] = "analytics.bots.events";
|
|
53169
55887
|
UsageEventMetric["NetworkRequests"] = "network.requests";
|
|
53170
55888
|
UsageEventMetric["NetworkInbound"] = "network.inbound";
|
|
53171
55889
|
UsageEventMetric["NetworkOutbound"] = "network.outbound";
|
|
@@ -53283,6 +56001,7 @@
|
|
|
53283
56001
|
|
|
53284
56002
|
exports.UsageGaugeMetric = void 0;
|
|
53285
56003
|
(function (UsageGaugeMetric) {
|
|
56004
|
+
UsageGaugeMetric["AnalyticsProperties"] = "analytics.properties";
|
|
53286
56005
|
UsageGaugeMetric["Teams"] = "teams";
|
|
53287
56006
|
UsageGaugeMetric["Users"] = "users";
|
|
53288
56007
|
UsageGaugeMetric["Messages"] = "messages";
|
|
@@ -53380,6 +56099,24 @@
|
|
|
53380
56099
|
VectorsDBIndexType["Unique"] = "unique";
|
|
53381
56100
|
})(exports.VectorsDBIndexType || (exports.VectorsDBIndexType = {}));
|
|
53382
56101
|
|
|
56102
|
+
exports.VideoOutput = void 0;
|
|
56103
|
+
(function (VideoOutput) {
|
|
56104
|
+
VideoOutput["Hls"] = "hls";
|
|
56105
|
+
VideoOutput["Dash"] = "dash";
|
|
56106
|
+
VideoOutput["Cmaf"] = "cmaf";
|
|
56107
|
+
})(exports.VideoOutput || (exports.VideoOutput = {}));
|
|
56108
|
+
|
|
56109
|
+
exports.VideoRenditionStatus = void 0;
|
|
56110
|
+
(function (VideoRenditionStatus) {
|
|
56111
|
+
VideoRenditionStatus["Pending"] = "pending";
|
|
56112
|
+
VideoRenditionStatus["Started"] = "started";
|
|
56113
|
+
VideoRenditionStatus["Ended"] = "ended";
|
|
56114
|
+
VideoRenditionStatus["Uploading"] = "uploading";
|
|
56115
|
+
VideoRenditionStatus["Ready"] = "ready";
|
|
56116
|
+
VideoRenditionStatus["Error"] = "error";
|
|
56117
|
+
VideoRenditionStatus["Aborted"] = "aborted";
|
|
56118
|
+
})(exports.VideoRenditionStatus || (exports.VideoRenditionStatus = {}));
|
|
56119
|
+
|
|
53383
56120
|
exports.DatabaseType = void 0;
|
|
53384
56121
|
(function (DatabaseType) {
|
|
53385
56122
|
DatabaseType["Legacy"] = "legacy";
|
|
@@ -53558,6 +56295,7 @@
|
|
|
53558
56295
|
(function (ProxyRuleDeploymentResourceType) {
|
|
53559
56296
|
ProxyRuleDeploymentResourceType["Function"] = "function";
|
|
53560
56297
|
ProxyRuleDeploymentResourceType["Site"] = "site";
|
|
56298
|
+
ProxyRuleDeploymentResourceType["DedicatedDatabase"] = "dedicatedDatabase";
|
|
53561
56299
|
})(exports.ProxyRuleDeploymentResourceType || (exports.ProxyRuleDeploymentResourceType = {}));
|
|
53562
56300
|
|
|
53563
56301
|
exports.ProxyRuleStatus = void 0;
|
|
@@ -55637,8 +58375,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
55637
58375
|
|
|
55638
58376
|
exports.Account = Account;
|
|
55639
58377
|
exports.Activities = Activities;
|
|
58378
|
+
exports.Admin = Admin;
|
|
55640
58379
|
exports.Advisor = Advisor;
|
|
55641
58380
|
exports.Affiliates = Affiliates;
|
|
58381
|
+
exports.Analytics = Analytics;
|
|
58382
|
+
exports.AnalyticsTracking = AnalyticsTracking;
|
|
55642
58383
|
exports.Apps = Apps;
|
|
55643
58384
|
exports.AppwriteException = AppwriteException;
|
|
55644
58385
|
exports.Assistant = Assistant;
|
|
@@ -55687,6 +58428,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
55687
58428
|
exports.Users = Users;
|
|
55688
58429
|
exports.Vcs = Vcs;
|
|
55689
58430
|
exports.VectorsDB = VectorsDB;
|
|
58431
|
+
exports.Videos = Videos;
|
|
55690
58432
|
exports.Waf = Waf;
|
|
55691
58433
|
exports.Webhooks = Webhooks;
|
|
55692
58434
|
|