@appwrite.io/console 18.3.0 → 18.4.0-rc.1
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.4.0-rc.1',
|
|
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();
|
|
@@ -19339,7 +20052,7 @@
|
|
|
19339
20052
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
19340
20053
|
apiPayload['project'] = this.client.config.project;
|
|
19341
20054
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
19342
|
-
for (const [key, value] of Object.entries(
|
|
20055
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
19343
20056
|
uri.searchParams.append(key, value);
|
|
19344
20057
|
}
|
|
19345
20058
|
return uri.toString();
|
|
@@ -29978,7 +30691,7 @@
|
|
|
29978
30691
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
29979
30692
|
apiPayload['project'] = this.client.config.project;
|
|
29980
30693
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
29981
|
-
for (const [key, value] of Object.entries(
|
|
30694
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
29982
30695
|
uri.searchParams.append(key, value);
|
|
29983
30696
|
}
|
|
29984
30697
|
return uri.toString();
|
|
@@ -30085,7 +30798,7 @@
|
|
|
30085
30798
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
30086
30799
|
apiPayload['project'] = this.client.config.project;
|
|
30087
30800
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
30088
|
-
for (const [key, value] of Object.entries(
|
|
30801
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
30089
30802
|
uri.searchParams.append(key, value);
|
|
30090
30803
|
}
|
|
30091
30804
|
return uri.toString();
|
|
@@ -35581,6 +36294,38 @@
|
|
|
35581
36294
|
};
|
|
35582
36295
|
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
35583
36296
|
}
|
|
36297
|
+
updatePasskeyPolicy(paramsOrFirst, ...rest) {
|
|
36298
|
+
let params;
|
|
36299
|
+
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
36300
|
+
(paramsOrFirst &&
|
|
36301
|
+
typeof paramsOrFirst === 'object' &&
|
|
36302
|
+
!Array.isArray(paramsOrFirst))) {
|
|
36303
|
+
params = (paramsOrFirst || {});
|
|
36304
|
+
}
|
|
36305
|
+
else {
|
|
36306
|
+
params = {
|
|
36307
|
+
rpId: paramsOrFirst,
|
|
36308
|
+
origins: rest[0],
|
|
36309
|
+
};
|
|
36310
|
+
}
|
|
36311
|
+
const rpId = params.rpId;
|
|
36312
|
+
const origins = params.origins;
|
|
36313
|
+
const apiPath = '/project/policies/passkey';
|
|
36314
|
+
const apiPayload = {};
|
|
36315
|
+
if (typeof rpId !== 'undefined') {
|
|
36316
|
+
apiPayload['rpId'] = rpId;
|
|
36317
|
+
}
|
|
36318
|
+
if (typeof origins !== 'undefined') {
|
|
36319
|
+
apiPayload['origins'] = origins;
|
|
36320
|
+
}
|
|
36321
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
36322
|
+
const apiHeaders = {
|
|
36323
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
36324
|
+
'content-type': 'application/json',
|
|
36325
|
+
accept: 'application/json',
|
|
36326
|
+
};
|
|
36327
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
36328
|
+
}
|
|
35584
36329
|
updatePasswordDictionaryPolicy(paramsOrFirst) {
|
|
35585
36330
|
let params;
|
|
35586
36331
|
if (paramsOrFirst &&
|
|
@@ -38271,7 +39016,7 @@
|
|
|
38271
39016
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
38272
39017
|
apiPayload['project'] = this.client.config.project;
|
|
38273
39018
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
38274
|
-
for (const [key, value] of Object.entries(
|
|
39019
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
38275
39020
|
uri.searchParams.append(key, value);
|
|
38276
39021
|
}
|
|
38277
39022
|
return uri.toString();
|
|
@@ -39102,7 +39847,7 @@
|
|
|
39102
39847
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
39103
39848
|
apiPayload['project'] = this.client.config.project;
|
|
39104
39849
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
39105
|
-
for (const [key, value] of Object.entries(
|
|
39850
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
39106
39851
|
uri.searchParams.append(key, value);
|
|
39107
39852
|
}
|
|
39108
39853
|
return uri.toString();
|
|
@@ -39195,7 +39940,7 @@
|
|
|
39195
39940
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
39196
39941
|
apiPayload['project'] = this.client.config.project;
|
|
39197
39942
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
39198
|
-
for (const [key, value] of Object.entries(
|
|
39943
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
39199
39944
|
uri.searchParams.append(key, value);
|
|
39200
39945
|
}
|
|
39201
39946
|
return uri.toString();
|
|
@@ -39233,7 +39978,7 @@
|
|
|
39233
39978
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
39234
39979
|
apiPayload['project'] = this.client.config.project;
|
|
39235
39980
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
39236
|
-
for (const [key, value] of Object.entries(
|
|
39981
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
39237
39982
|
uri.searchParams.append(key, value);
|
|
39238
39983
|
}
|
|
39239
39984
|
return uri.toString();
|
|
@@ -45544,6 +46289,106 @@
|
|
|
45544
46289
|
};
|
|
45545
46290
|
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
45546
46291
|
}
|
|
46292
|
+
listPasskeys(paramsOrFirst, ...rest) {
|
|
46293
|
+
let params;
|
|
46294
|
+
if (paramsOrFirst &&
|
|
46295
|
+
typeof paramsOrFirst === 'object' &&
|
|
46296
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46297
|
+
params = (paramsOrFirst || {});
|
|
46298
|
+
}
|
|
46299
|
+
else {
|
|
46300
|
+
params = {
|
|
46301
|
+
userId: paramsOrFirst,
|
|
46302
|
+
queries: rest[0],
|
|
46303
|
+
total: rest[1],
|
|
46304
|
+
};
|
|
46305
|
+
}
|
|
46306
|
+
const userId = params.userId;
|
|
46307
|
+
const queries = params.queries;
|
|
46308
|
+
const total = params.total;
|
|
46309
|
+
if (typeof userId === 'undefined' || userId === '') {
|
|
46310
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
46311
|
+
}
|
|
46312
|
+
const apiPath = '/users/{userId}/passkeys'.replace('{userId}', encodeURIComponent(String(userId)));
|
|
46313
|
+
const apiPayload = {};
|
|
46314
|
+
if (typeof queries !== 'undefined') {
|
|
46315
|
+
apiPayload['queries'] = queries;
|
|
46316
|
+
}
|
|
46317
|
+
if (typeof total !== 'undefined') {
|
|
46318
|
+
apiPayload['total'] = total;
|
|
46319
|
+
}
|
|
46320
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46321
|
+
const apiHeaders = {
|
|
46322
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46323
|
+
accept: 'application/json',
|
|
46324
|
+
};
|
|
46325
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
46326
|
+
}
|
|
46327
|
+
getPasskey(paramsOrFirst, ...rest) {
|
|
46328
|
+
let params;
|
|
46329
|
+
if (paramsOrFirst &&
|
|
46330
|
+
typeof paramsOrFirst === 'object' &&
|
|
46331
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46332
|
+
params = (paramsOrFirst || {});
|
|
46333
|
+
}
|
|
46334
|
+
else {
|
|
46335
|
+
params = {
|
|
46336
|
+
userId: paramsOrFirst,
|
|
46337
|
+
passkeyId: rest[0],
|
|
46338
|
+
};
|
|
46339
|
+
}
|
|
46340
|
+
const userId = params.userId;
|
|
46341
|
+
const passkeyId = params.passkeyId;
|
|
46342
|
+
if (typeof userId === 'undefined' || userId === '') {
|
|
46343
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
46344
|
+
}
|
|
46345
|
+
if (typeof passkeyId === 'undefined' || passkeyId === '') {
|
|
46346
|
+
throw new AppwriteException('Missing required parameter: "passkeyId"');
|
|
46347
|
+
}
|
|
46348
|
+
const apiPath = '/users/{userId}/passkeys/{passkeyId}'
|
|
46349
|
+
.replace('{userId}', encodeURIComponent(String(userId)))
|
|
46350
|
+
.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
|
|
46351
|
+
const apiPayload = {};
|
|
46352
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46353
|
+
const apiHeaders = {
|
|
46354
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46355
|
+
accept: 'application/json',
|
|
46356
|
+
};
|
|
46357
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
46358
|
+
}
|
|
46359
|
+
deletePasskey(paramsOrFirst, ...rest) {
|
|
46360
|
+
let params;
|
|
46361
|
+
if (paramsOrFirst &&
|
|
46362
|
+
typeof paramsOrFirst === 'object' &&
|
|
46363
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46364
|
+
params = (paramsOrFirst || {});
|
|
46365
|
+
}
|
|
46366
|
+
else {
|
|
46367
|
+
params = {
|
|
46368
|
+
userId: paramsOrFirst,
|
|
46369
|
+
passkeyId: rest[0],
|
|
46370
|
+
};
|
|
46371
|
+
}
|
|
46372
|
+
const userId = params.userId;
|
|
46373
|
+
const passkeyId = params.passkeyId;
|
|
46374
|
+
if (typeof userId === 'undefined' || userId === '') {
|
|
46375
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
46376
|
+
}
|
|
46377
|
+
if (typeof passkeyId === 'undefined' || passkeyId === '') {
|
|
46378
|
+
throw new AppwriteException('Missing required parameter: "passkeyId"');
|
|
46379
|
+
}
|
|
46380
|
+
const apiPath = '/users/{userId}/passkeys/{passkeyId}'
|
|
46381
|
+
.replace('{userId}', encodeURIComponent(String(userId)))
|
|
46382
|
+
.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
|
|
46383
|
+
const apiPayload = {};
|
|
46384
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46385
|
+
const apiHeaders = {
|
|
46386
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46387
|
+
'content-type': 'application/json',
|
|
46388
|
+
accept: 'application/json',
|
|
46389
|
+
};
|
|
46390
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
46391
|
+
}
|
|
45547
46392
|
updatePassword(paramsOrFirst, ...rest) {
|
|
45548
46393
|
let params;
|
|
45549
46394
|
if (paramsOrFirst &&
|
|
@@ -48050,11 +48895,11 @@
|
|
|
48050
48895
|
}
|
|
48051
48896
|
}
|
|
48052
48897
|
|
|
48053
|
-
class
|
|
48898
|
+
class Videos {
|
|
48054
48899
|
constructor(client) {
|
|
48055
48900
|
this.client = client;
|
|
48056
48901
|
}
|
|
48057
|
-
|
|
48902
|
+
list(paramsOrFirst, ...rest) {
|
|
48058
48903
|
let params;
|
|
48059
48904
|
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
48060
48905
|
(paramsOrFirst &&
|
|
@@ -48072,7 +48917,7 @@
|
|
|
48072
48917
|
const queries = params.queries;
|
|
48073
48918
|
const search = params.search;
|
|
48074
48919
|
const total = params.total;
|
|
48075
|
-
const apiPath = '/
|
|
48920
|
+
const apiPath = '/videos';
|
|
48076
48921
|
const apiPayload = {};
|
|
48077
48922
|
if (typeof queries !== 'undefined') {
|
|
48078
48923
|
apiPayload['queries'] = queries;
|
|
@@ -48090,7 +48935,7 @@
|
|
|
48090
48935
|
};
|
|
48091
48936
|
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
48092
48937
|
}
|
|
48093
|
-
|
|
48938
|
+
create(paramsOrFirst, ...rest) {
|
|
48094
48939
|
let params;
|
|
48095
48940
|
if (paramsOrFirst &&
|
|
48096
48941
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -48099,59 +48944,31 @@
|
|
|
48099
48944
|
}
|
|
48100
48945
|
else {
|
|
48101
48946
|
params = {
|
|
48102
|
-
|
|
48103
|
-
|
|
48947
|
+
bucketId: paramsOrFirst,
|
|
48948
|
+
fileId: rest[0],
|
|
48104
48949
|
name: rest[1],
|
|
48105
|
-
resourceId: rest[2],
|
|
48106
|
-
description: rest[3],
|
|
48107
|
-
priority: rest[4],
|
|
48108
|
-
enabled: rest[5],
|
|
48109
|
-
conditions: rest[6],
|
|
48110
48950
|
};
|
|
48111
48951
|
}
|
|
48112
|
-
const
|
|
48113
|
-
const
|
|
48952
|
+
const bucketId = params.bucketId;
|
|
48953
|
+
const fileId = params.fileId;
|
|
48114
48954
|
const name = params.name;
|
|
48115
|
-
|
|
48116
|
-
|
|
48117
|
-
const priority = params.priority;
|
|
48118
|
-
const enabled = params.enabled;
|
|
48119
|
-
const conditions = params.conditions;
|
|
48120
|
-
if (typeof ruleId === 'undefined') {
|
|
48121
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
48122
|
-
}
|
|
48123
|
-
if (typeof resourceType === 'undefined') {
|
|
48124
|
-
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
48955
|
+
if (typeof bucketId === 'undefined') {
|
|
48956
|
+
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
48125
48957
|
}
|
|
48126
|
-
if (typeof
|
|
48127
|
-
throw new AppwriteException('Missing required parameter: "
|
|
48958
|
+
if (typeof fileId === 'undefined') {
|
|
48959
|
+
throw new AppwriteException('Missing required parameter: "fileId"');
|
|
48128
48960
|
}
|
|
48129
|
-
const apiPath = '/
|
|
48961
|
+
const apiPath = '/videos';
|
|
48130
48962
|
const apiPayload = {};
|
|
48131
|
-
if (typeof
|
|
48132
|
-
apiPayload['
|
|
48133
|
-
}
|
|
48134
|
-
if (typeof resourceType !== 'undefined') {
|
|
48135
|
-
apiPayload['resourceType'] = resourceType;
|
|
48963
|
+
if (typeof bucketId !== 'undefined') {
|
|
48964
|
+
apiPayload['bucketId'] = bucketId;
|
|
48136
48965
|
}
|
|
48137
|
-
if (typeof
|
|
48138
|
-
apiPayload['
|
|
48966
|
+
if (typeof fileId !== 'undefined') {
|
|
48967
|
+
apiPayload['fileId'] = fileId;
|
|
48139
48968
|
}
|
|
48140
48969
|
if (typeof name !== 'undefined') {
|
|
48141
48970
|
apiPayload['name'] = name;
|
|
48142
48971
|
}
|
|
48143
|
-
if (typeof description !== 'undefined') {
|
|
48144
|
-
apiPayload['description'] = description;
|
|
48145
|
-
}
|
|
48146
|
-
if (typeof priority !== 'undefined') {
|
|
48147
|
-
apiPayload['priority'] = priority;
|
|
48148
|
-
}
|
|
48149
|
-
if (typeof enabled !== 'undefined') {
|
|
48150
|
-
apiPayload['enabled'] = enabled;
|
|
48151
|
-
}
|
|
48152
|
-
if (typeof conditions !== 'undefined') {
|
|
48153
|
-
apiPayload['conditions'] = conditions;
|
|
48154
|
-
}
|
|
48155
48972
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
48156
48973
|
const apiHeaders = {
|
|
48157
48974
|
'X-Appwrite-Project': this.client.config.project,
|
|
@@ -48160,68 +48977,33 @@
|
|
|
48160
48977
|
};
|
|
48161
48978
|
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
48162
48979
|
}
|
|
48163
|
-
|
|
48980
|
+
listProfiles(paramsOrFirst) {
|
|
48164
48981
|
let params;
|
|
48165
|
-
if (paramsOrFirst
|
|
48166
|
-
|
|
48167
|
-
|
|
48982
|
+
if (typeof paramsOrFirst === 'undefined' ||
|
|
48983
|
+
(paramsOrFirst &&
|
|
48984
|
+
typeof paramsOrFirst === 'object' &&
|
|
48985
|
+
!Array.isArray(paramsOrFirst))) {
|
|
48168
48986
|
params = (paramsOrFirst || {});
|
|
48169
48987
|
}
|
|
48170
48988
|
else {
|
|
48171
48989
|
params = {
|
|
48172
|
-
|
|
48173
|
-
resourceType: rest[0],
|
|
48174
|
-
resourceId: rest[1],
|
|
48175
|
-
name: rest[2],
|
|
48176
|
-
description: rest[3],
|
|
48177
|
-
priority: rest[4],
|
|
48178
|
-
enabled: rest[5],
|
|
48179
|
-
conditions: rest[6],
|
|
48990
|
+
search: paramsOrFirst,
|
|
48180
48991
|
};
|
|
48181
48992
|
}
|
|
48182
|
-
const
|
|
48183
|
-
const
|
|
48184
|
-
const resourceId = params.resourceId;
|
|
48185
|
-
const name = params.name;
|
|
48186
|
-
const description = params.description;
|
|
48187
|
-
const priority = params.priority;
|
|
48188
|
-
const enabled = params.enabled;
|
|
48189
|
-
const conditions = params.conditions;
|
|
48190
|
-
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
48191
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
48192
|
-
}
|
|
48193
|
-
const apiPath = '/waf/rules/bypass/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
|
|
48993
|
+
const search = params.search;
|
|
48994
|
+
const apiPath = '/videos/profiles';
|
|
48194
48995
|
const apiPayload = {};
|
|
48195
|
-
if (typeof
|
|
48196
|
-
apiPayload['
|
|
48197
|
-
}
|
|
48198
|
-
if (typeof resourceId !== 'undefined') {
|
|
48199
|
-
apiPayload['resourceId'] = resourceId;
|
|
48200
|
-
}
|
|
48201
|
-
if (typeof name !== 'undefined') {
|
|
48202
|
-
apiPayload['name'] = name;
|
|
48203
|
-
}
|
|
48204
|
-
if (typeof description !== 'undefined') {
|
|
48205
|
-
apiPayload['description'] = description;
|
|
48206
|
-
}
|
|
48207
|
-
if (typeof priority !== 'undefined') {
|
|
48208
|
-
apiPayload['priority'] = priority;
|
|
48209
|
-
}
|
|
48210
|
-
if (typeof enabled !== 'undefined') {
|
|
48211
|
-
apiPayload['enabled'] = enabled;
|
|
48212
|
-
}
|
|
48213
|
-
if (typeof conditions !== 'undefined') {
|
|
48214
|
-
apiPayload['conditions'] = conditions;
|
|
48996
|
+
if (typeof search !== 'undefined') {
|
|
48997
|
+
apiPayload['search'] = search;
|
|
48215
48998
|
}
|
|
48216
48999
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
48217
49000
|
const apiHeaders = {
|
|
48218
49001
|
'X-Appwrite-Project': this.client.config.project,
|
|
48219
|
-
'content-type': 'application/json',
|
|
48220
49002
|
accept: 'application/json',
|
|
48221
49003
|
};
|
|
48222
|
-
return this.client.call('
|
|
49004
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
48223
49005
|
}
|
|
48224
|
-
|
|
49006
|
+
createProfile(paramsOrFirst, ...rest) {
|
|
48225
49007
|
let params;
|
|
48226
49008
|
if (paramsOrFirst &&
|
|
48227
49009
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -48230,73 +49012,49 @@
|
|
|
48230
49012
|
}
|
|
48231
49013
|
else {
|
|
48232
49014
|
params = {
|
|
48233
|
-
|
|
48234
|
-
|
|
48235
|
-
|
|
48236
|
-
|
|
48237
|
-
|
|
48238
|
-
challengeType: rest[4],
|
|
48239
|
-
priority: rest[5],
|
|
48240
|
-
enabled: rest[6],
|
|
48241
|
-
conditions: rest[7],
|
|
48242
|
-
difficulty: rest[8],
|
|
48243
|
-
ttl: rest[9],
|
|
49015
|
+
name: paramsOrFirst,
|
|
49016
|
+
videoBitRate: rest[0],
|
|
49017
|
+
audioBitRate: rest[1],
|
|
49018
|
+
width: rest[2],
|
|
49019
|
+
height: rest[3],
|
|
48244
49020
|
};
|
|
48245
49021
|
}
|
|
48246
|
-
const ruleId = params.ruleId;
|
|
48247
|
-
const resourceType = params.resourceType;
|
|
48248
49022
|
const name = params.name;
|
|
48249
|
-
const
|
|
48250
|
-
const
|
|
48251
|
-
const
|
|
48252
|
-
const
|
|
48253
|
-
const enabled = params.enabled;
|
|
48254
|
-
const conditions = params.conditions;
|
|
48255
|
-
const difficulty = params.difficulty;
|
|
48256
|
-
const ttl = params.ttl;
|
|
48257
|
-
if (typeof ruleId === 'undefined') {
|
|
48258
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
48259
|
-
}
|
|
48260
|
-
if (typeof resourceType === 'undefined') {
|
|
48261
|
-
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
48262
|
-
}
|
|
49023
|
+
const videoBitRate = params.videoBitRate;
|
|
49024
|
+
const audioBitRate = params.audioBitRate;
|
|
49025
|
+
const width = params.width;
|
|
49026
|
+
const height = params.height;
|
|
48263
49027
|
if (typeof name === 'undefined') {
|
|
48264
49028
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
48265
49029
|
}
|
|
48266
|
-
|
|
48267
|
-
|
|
48268
|
-
if (typeof ruleId !== 'undefined') {
|
|
48269
|
-
apiPayload['ruleId'] = ruleId;
|
|
49030
|
+
if (typeof videoBitRate === 'undefined') {
|
|
49031
|
+
throw new AppwriteException('Missing required parameter: "videoBitRate"');
|
|
48270
49032
|
}
|
|
48271
|
-
if (typeof
|
|
48272
|
-
|
|
49033
|
+
if (typeof audioBitRate === 'undefined') {
|
|
49034
|
+
throw new AppwriteException('Missing required parameter: "audioBitRate"');
|
|
48273
49035
|
}
|
|
48274
|
-
if (typeof
|
|
48275
|
-
|
|
49036
|
+
if (typeof width === 'undefined') {
|
|
49037
|
+
throw new AppwriteException('Missing required parameter: "width"');
|
|
48276
49038
|
}
|
|
49039
|
+
if (typeof height === 'undefined') {
|
|
49040
|
+
throw new AppwriteException('Missing required parameter: "height"');
|
|
49041
|
+
}
|
|
49042
|
+
const apiPath = '/videos/profiles';
|
|
49043
|
+
const apiPayload = {};
|
|
48277
49044
|
if (typeof name !== 'undefined') {
|
|
48278
49045
|
apiPayload['name'] = name;
|
|
48279
49046
|
}
|
|
48280
|
-
if (typeof
|
|
48281
|
-
apiPayload['
|
|
48282
|
-
}
|
|
48283
|
-
if (typeof challengeType !== 'undefined') {
|
|
48284
|
-
apiPayload['challengeType'] = challengeType;
|
|
48285
|
-
}
|
|
48286
|
-
if (typeof priority !== 'undefined') {
|
|
48287
|
-
apiPayload['priority'] = priority;
|
|
48288
|
-
}
|
|
48289
|
-
if (typeof enabled !== 'undefined') {
|
|
48290
|
-
apiPayload['enabled'] = enabled;
|
|
49047
|
+
if (typeof videoBitRate !== 'undefined') {
|
|
49048
|
+
apiPayload['videoBitRate'] = videoBitRate;
|
|
48291
49049
|
}
|
|
48292
|
-
if (typeof
|
|
48293
|
-
apiPayload['
|
|
49050
|
+
if (typeof audioBitRate !== 'undefined') {
|
|
49051
|
+
apiPayload['audioBitRate'] = audioBitRate;
|
|
48294
49052
|
}
|
|
48295
|
-
if (typeof
|
|
48296
|
-
apiPayload['
|
|
49053
|
+
if (typeof width !== 'undefined') {
|
|
49054
|
+
apiPayload['width'] = width;
|
|
48297
49055
|
}
|
|
48298
|
-
if (typeof
|
|
48299
|
-
apiPayload['
|
|
49056
|
+
if (typeof height !== 'undefined') {
|
|
49057
|
+
apiPayload['height'] = height;
|
|
48300
49058
|
}
|
|
48301
49059
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
48302
49060
|
const apiHeaders = {
|
|
@@ -48306,7 +49064,7 @@
|
|
|
48306
49064
|
};
|
|
48307
49065
|
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
48308
49066
|
}
|
|
48309
|
-
|
|
49067
|
+
getProfile(paramsOrFirst) {
|
|
48310
49068
|
let params;
|
|
48311
49069
|
if (paramsOrFirst &&
|
|
48312
49070
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -48315,74 +49073,23 @@
|
|
|
48315
49073
|
}
|
|
48316
49074
|
else {
|
|
48317
49075
|
params = {
|
|
48318
|
-
|
|
48319
|
-
resourceType: rest[0],
|
|
48320
|
-
resourceId: rest[1],
|
|
48321
|
-
name: rest[2],
|
|
48322
|
-
description: rest[3],
|
|
48323
|
-
challengeType: rest[4],
|
|
48324
|
-
priority: rest[5],
|
|
48325
|
-
enabled: rest[6],
|
|
48326
|
-
conditions: rest[7],
|
|
48327
|
-
difficulty: rest[8],
|
|
48328
|
-
ttl: rest[9],
|
|
49076
|
+
profileId: paramsOrFirst,
|
|
48329
49077
|
};
|
|
48330
49078
|
}
|
|
48331
|
-
const
|
|
48332
|
-
|
|
48333
|
-
|
|
48334
|
-
const name = params.name;
|
|
48335
|
-
const description = params.description;
|
|
48336
|
-
const challengeType = params.challengeType;
|
|
48337
|
-
const priority = params.priority;
|
|
48338
|
-
const enabled = params.enabled;
|
|
48339
|
-
const conditions = params.conditions;
|
|
48340
|
-
const difficulty = params.difficulty;
|
|
48341
|
-
const ttl = params.ttl;
|
|
48342
|
-
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
48343
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
49079
|
+
const profileId = params.profileId;
|
|
49080
|
+
if (typeof profileId === 'undefined' || profileId === '') {
|
|
49081
|
+
throw new AppwriteException('Missing required parameter: "profileId"');
|
|
48344
49082
|
}
|
|
48345
|
-
const apiPath = '/
|
|
49083
|
+
const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
|
|
48346
49084
|
const apiPayload = {};
|
|
48347
|
-
if (typeof resourceType !== 'undefined') {
|
|
48348
|
-
apiPayload['resourceType'] = resourceType;
|
|
48349
|
-
}
|
|
48350
|
-
if (typeof resourceId !== 'undefined') {
|
|
48351
|
-
apiPayload['resourceId'] = resourceId;
|
|
48352
|
-
}
|
|
48353
|
-
if (typeof name !== 'undefined') {
|
|
48354
|
-
apiPayload['name'] = name;
|
|
48355
|
-
}
|
|
48356
|
-
if (typeof description !== 'undefined') {
|
|
48357
|
-
apiPayload['description'] = description;
|
|
48358
|
-
}
|
|
48359
|
-
if (typeof challengeType !== 'undefined') {
|
|
48360
|
-
apiPayload['challengeType'] = challengeType;
|
|
48361
|
-
}
|
|
48362
|
-
if (typeof priority !== 'undefined') {
|
|
48363
|
-
apiPayload['priority'] = priority;
|
|
48364
|
-
}
|
|
48365
|
-
if (typeof enabled !== 'undefined') {
|
|
48366
|
-
apiPayload['enabled'] = enabled;
|
|
48367
|
-
}
|
|
48368
|
-
if (typeof conditions !== 'undefined') {
|
|
48369
|
-
apiPayload['conditions'] = conditions;
|
|
48370
|
-
}
|
|
48371
|
-
if (typeof difficulty !== 'undefined') {
|
|
48372
|
-
apiPayload['difficulty'] = difficulty;
|
|
48373
|
-
}
|
|
48374
|
-
if (typeof ttl !== 'undefined') {
|
|
48375
|
-
apiPayload['ttl'] = ttl;
|
|
48376
|
-
}
|
|
48377
49085
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
48378
49086
|
const apiHeaders = {
|
|
48379
49087
|
'X-Appwrite-Project': this.client.config.project,
|
|
48380
|
-
'content-type': 'application/json',
|
|
48381
49088
|
accept: 'application/json',
|
|
48382
49089
|
};
|
|
48383
|
-
return this.client.call('
|
|
49090
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
48384
49091
|
}
|
|
48385
|
-
|
|
49092
|
+
updateProfile(paramsOrFirst, ...rest) {
|
|
48386
49093
|
let params;
|
|
48387
49094
|
if (paramsOrFirst &&
|
|
48388
49095
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -48391,58 +49098,54 @@
|
|
|
48391
49098
|
}
|
|
48392
49099
|
else {
|
|
48393
49100
|
params = {
|
|
48394
|
-
|
|
48395
|
-
|
|
48396
|
-
|
|
48397
|
-
|
|
48398
|
-
|
|
48399
|
-
|
|
48400
|
-
enabled: rest[5],
|
|
48401
|
-
conditions: rest[6],
|
|
49101
|
+
profileId: paramsOrFirst,
|
|
49102
|
+
name: rest[0],
|
|
49103
|
+
videoBitRate: rest[1],
|
|
49104
|
+
audioBitRate: rest[2],
|
|
49105
|
+
width: rest[3],
|
|
49106
|
+
height: rest[4],
|
|
48402
49107
|
};
|
|
48403
49108
|
}
|
|
48404
|
-
const
|
|
48405
|
-
const resourceType = params.resourceType;
|
|
49109
|
+
const profileId = params.profileId;
|
|
48406
49110
|
const name = params.name;
|
|
48407
|
-
const
|
|
48408
|
-
const
|
|
48409
|
-
const
|
|
48410
|
-
const
|
|
48411
|
-
|
|
48412
|
-
|
|
48413
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
48414
|
-
}
|
|
48415
|
-
if (typeof resourceType === 'undefined') {
|
|
48416
|
-
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
49111
|
+
const videoBitRate = params.videoBitRate;
|
|
49112
|
+
const audioBitRate = params.audioBitRate;
|
|
49113
|
+
const width = params.width;
|
|
49114
|
+
const height = params.height;
|
|
49115
|
+
if (typeof profileId === 'undefined' || profileId === '') {
|
|
49116
|
+
throw new AppwriteException('Missing required parameter: "profileId"');
|
|
48417
49117
|
}
|
|
48418
49118
|
if (typeof name === 'undefined') {
|
|
48419
49119
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
48420
49120
|
}
|
|
48421
|
-
|
|
48422
|
-
|
|
48423
|
-
if (typeof ruleId !== 'undefined') {
|
|
48424
|
-
apiPayload['ruleId'] = ruleId;
|
|
49121
|
+
if (typeof videoBitRate === 'undefined') {
|
|
49122
|
+
throw new AppwriteException('Missing required parameter: "videoBitRate"');
|
|
48425
49123
|
}
|
|
48426
|
-
if (typeof
|
|
48427
|
-
|
|
49124
|
+
if (typeof audioBitRate === 'undefined') {
|
|
49125
|
+
throw new AppwriteException('Missing required parameter: "audioBitRate"');
|
|
48428
49126
|
}
|
|
48429
|
-
if (typeof
|
|
48430
|
-
|
|
49127
|
+
if (typeof width === 'undefined') {
|
|
49128
|
+
throw new AppwriteException('Missing required parameter: "width"');
|
|
48431
49129
|
}
|
|
49130
|
+
if (typeof height === 'undefined') {
|
|
49131
|
+
throw new AppwriteException('Missing required parameter: "height"');
|
|
49132
|
+
}
|
|
49133
|
+
const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
|
|
49134
|
+
const apiPayload = {};
|
|
48432
49135
|
if (typeof name !== 'undefined') {
|
|
48433
49136
|
apiPayload['name'] = name;
|
|
48434
49137
|
}
|
|
48435
|
-
if (typeof
|
|
48436
|
-
apiPayload['
|
|
49138
|
+
if (typeof videoBitRate !== 'undefined') {
|
|
49139
|
+
apiPayload['videoBitRate'] = videoBitRate;
|
|
48437
49140
|
}
|
|
48438
|
-
if (typeof
|
|
48439
|
-
apiPayload['
|
|
49141
|
+
if (typeof audioBitRate !== 'undefined') {
|
|
49142
|
+
apiPayload['audioBitRate'] = audioBitRate;
|
|
48440
49143
|
}
|
|
48441
|
-
if (typeof
|
|
48442
|
-
apiPayload['
|
|
49144
|
+
if (typeof width !== 'undefined') {
|
|
49145
|
+
apiPayload['width'] = width;
|
|
48443
49146
|
}
|
|
48444
|
-
if (typeof
|
|
48445
|
-
apiPayload['
|
|
49147
|
+
if (typeof height !== 'undefined') {
|
|
49148
|
+
apiPayload['height'] = height;
|
|
48446
49149
|
}
|
|
48447
49150
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
48448
49151
|
const apiHeaders = {
|
|
@@ -48450,9 +49153,9 @@
|
|
|
48450
49153
|
'content-type': 'application/json',
|
|
48451
49154
|
accept: 'application/json',
|
|
48452
49155
|
};
|
|
48453
|
-
return this.client.call('
|
|
49156
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
48454
49157
|
}
|
|
48455
|
-
|
|
49158
|
+
deleteProfile(paramsOrFirst) {
|
|
48456
49159
|
let params;
|
|
48457
49160
|
if (paramsOrFirst &&
|
|
48458
49161
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -48461,59 +49164,49 @@
|
|
|
48461
49164
|
}
|
|
48462
49165
|
else {
|
|
48463
49166
|
params = {
|
|
48464
|
-
|
|
48465
|
-
resourceType: rest[0],
|
|
48466
|
-
resourceId: rest[1],
|
|
48467
|
-
name: rest[2],
|
|
48468
|
-
description: rest[3],
|
|
48469
|
-
priority: rest[4],
|
|
48470
|
-
enabled: rest[5],
|
|
48471
|
-
conditions: rest[6],
|
|
49167
|
+
profileId: paramsOrFirst,
|
|
48472
49168
|
};
|
|
48473
49169
|
}
|
|
48474
|
-
const
|
|
48475
|
-
|
|
48476
|
-
|
|
48477
|
-
const name = params.name;
|
|
48478
|
-
const description = params.description;
|
|
48479
|
-
const priority = params.priority;
|
|
48480
|
-
const enabled = params.enabled;
|
|
48481
|
-
const conditions = params.conditions;
|
|
48482
|
-
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
48483
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
49170
|
+
const profileId = params.profileId;
|
|
49171
|
+
if (typeof profileId === 'undefined' || profileId === '') {
|
|
49172
|
+
throw new AppwriteException('Missing required parameter: "profileId"');
|
|
48484
49173
|
}
|
|
48485
|
-
const apiPath = '/
|
|
49174
|
+
const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
|
|
48486
49175
|
const apiPayload = {};
|
|
48487
|
-
|
|
48488
|
-
|
|
48489
|
-
|
|
48490
|
-
|
|
48491
|
-
|
|
48492
|
-
}
|
|
48493
|
-
|
|
48494
|
-
|
|
48495
|
-
|
|
48496
|
-
|
|
48497
|
-
|
|
48498
|
-
|
|
48499
|
-
|
|
48500
|
-
|
|
49176
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49177
|
+
const apiHeaders = {
|
|
49178
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49179
|
+
'content-type': 'application/json',
|
|
49180
|
+
accept: 'application/json',
|
|
49181
|
+
};
|
|
49182
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
49183
|
+
}
|
|
49184
|
+
get(paramsOrFirst) {
|
|
49185
|
+
let params;
|
|
49186
|
+
if (paramsOrFirst &&
|
|
49187
|
+
typeof paramsOrFirst === 'object' &&
|
|
49188
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49189
|
+
params = (paramsOrFirst || {});
|
|
48501
49190
|
}
|
|
48502
|
-
|
|
48503
|
-
|
|
49191
|
+
else {
|
|
49192
|
+
params = {
|
|
49193
|
+
videoId: paramsOrFirst,
|
|
49194
|
+
};
|
|
48504
49195
|
}
|
|
48505
|
-
|
|
48506
|
-
|
|
49196
|
+
const videoId = params.videoId;
|
|
49197
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49198
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
48507
49199
|
}
|
|
49200
|
+
const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49201
|
+
const apiPayload = {};
|
|
48508
49202
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
48509
49203
|
const apiHeaders = {
|
|
48510
49204
|
'X-Appwrite-Project': this.client.config.project,
|
|
48511
|
-
'content-type': 'application/json',
|
|
48512
49205
|
accept: 'application/json',
|
|
48513
49206
|
};
|
|
48514
|
-
return this.client.call('
|
|
49207
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
48515
49208
|
}
|
|
48516
|
-
|
|
49209
|
+
update(paramsOrFirst, ...rest) {
|
|
48517
49210
|
let params;
|
|
48518
49211
|
if (paramsOrFirst &&
|
|
48519
49212
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -48522,65 +49215,1347 @@
|
|
|
48522
49215
|
}
|
|
48523
49216
|
else {
|
|
48524
49217
|
params = {
|
|
48525
|
-
|
|
48526
|
-
|
|
48527
|
-
name: rest[1],
|
|
48528
|
-
limit: rest[2],
|
|
48529
|
-
interval: rest[3],
|
|
48530
|
-
resourceId: rest[4],
|
|
48531
|
-
description: rest[5],
|
|
48532
|
-
key: rest[6],
|
|
48533
|
-
strategy: rest[7],
|
|
48534
|
-
maxBucketSize: rest[8],
|
|
48535
|
-
priority: rest[9],
|
|
48536
|
-
enabled: rest[10],
|
|
48537
|
-
conditions: rest[11],
|
|
49218
|
+
videoId: paramsOrFirst,
|
|
49219
|
+
name: rest[0],
|
|
48538
49220
|
};
|
|
48539
49221
|
}
|
|
48540
|
-
const
|
|
48541
|
-
const resourceType = params.resourceType;
|
|
49222
|
+
const videoId = params.videoId;
|
|
48542
49223
|
const name = params.name;
|
|
48543
|
-
|
|
48544
|
-
|
|
48545
|
-
const resourceId = params.resourceId;
|
|
48546
|
-
const description = params.description;
|
|
48547
|
-
const key = params.key;
|
|
48548
|
-
const strategy = params.strategy;
|
|
48549
|
-
const maxBucketSize = params.maxBucketSize;
|
|
48550
|
-
const priority = params.priority;
|
|
48551
|
-
const enabled = params.enabled;
|
|
48552
|
-
const conditions = params.conditions;
|
|
48553
|
-
if (typeof ruleId === 'undefined') {
|
|
48554
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
48555
|
-
}
|
|
48556
|
-
if (typeof resourceType === 'undefined') {
|
|
48557
|
-
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
49224
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49225
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
48558
49226
|
}
|
|
48559
49227
|
if (typeof name === 'undefined') {
|
|
48560
49228
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
48561
49229
|
}
|
|
48562
|
-
|
|
48563
|
-
throw new AppwriteException('Missing required parameter: "limit"');
|
|
48564
|
-
}
|
|
48565
|
-
if (typeof interval === 'undefined') {
|
|
48566
|
-
throw new AppwriteException('Missing required parameter: "interval"');
|
|
48567
|
-
}
|
|
48568
|
-
const apiPath = '/waf/rules/rate-limit';
|
|
49230
|
+
const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
48569
49231
|
const apiPayload = {};
|
|
48570
|
-
if (typeof ruleId !== 'undefined') {
|
|
48571
|
-
apiPayload['ruleId'] = ruleId;
|
|
48572
|
-
}
|
|
48573
|
-
if (typeof resourceType !== 'undefined') {
|
|
48574
|
-
apiPayload['resourceType'] = resourceType;
|
|
48575
|
-
}
|
|
48576
|
-
if (typeof resourceId !== 'undefined') {
|
|
48577
|
-
apiPayload['resourceId'] = resourceId;
|
|
48578
|
-
}
|
|
48579
49232
|
if (typeof name !== 'undefined') {
|
|
48580
49233
|
apiPayload['name'] = name;
|
|
48581
49234
|
}
|
|
48582
|
-
|
|
48583
|
-
|
|
49235
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49236
|
+
const apiHeaders = {
|
|
49237
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49238
|
+
'content-type': 'application/json',
|
|
49239
|
+
accept: 'application/json',
|
|
49240
|
+
};
|
|
49241
|
+
return this.client.call('put', uri, apiHeaders, apiPayload);
|
|
49242
|
+
}
|
|
49243
|
+
delete(paramsOrFirst) {
|
|
49244
|
+
let params;
|
|
49245
|
+
if (paramsOrFirst &&
|
|
49246
|
+
typeof paramsOrFirst === 'object' &&
|
|
49247
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49248
|
+
params = (paramsOrFirst || {});
|
|
49249
|
+
}
|
|
49250
|
+
else {
|
|
49251
|
+
params = {
|
|
49252
|
+
videoId: paramsOrFirst,
|
|
49253
|
+
};
|
|
49254
|
+
}
|
|
49255
|
+
const videoId = params.videoId;
|
|
49256
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49257
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49258
|
+
}
|
|
49259
|
+
const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49260
|
+
const apiPayload = {};
|
|
49261
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49262
|
+
const apiHeaders = {
|
|
49263
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49264
|
+
'content-type': 'application/json',
|
|
49265
|
+
accept: 'application/json',
|
|
49266
|
+
};
|
|
49267
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
49268
|
+
}
|
|
49269
|
+
getCmafHlsManifest(paramsOrFirst) {
|
|
49270
|
+
let params;
|
|
49271
|
+
if (paramsOrFirst &&
|
|
49272
|
+
typeof paramsOrFirst === 'object' &&
|
|
49273
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49274
|
+
params = (paramsOrFirst || {});
|
|
49275
|
+
}
|
|
49276
|
+
else {
|
|
49277
|
+
params = {
|
|
49278
|
+
videoId: paramsOrFirst,
|
|
49279
|
+
};
|
|
49280
|
+
}
|
|
49281
|
+
const videoId = params.videoId;
|
|
49282
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49283
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49284
|
+
}
|
|
49285
|
+
const apiPath = '/videos/{videoId}/outputs/cmaf/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49286
|
+
const apiPayload = {};
|
|
49287
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49288
|
+
apiPayload['project'] = this.client.config.project;
|
|
49289
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
49290
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
49291
|
+
uri.searchParams.append(key, value);
|
|
49292
|
+
}
|
|
49293
|
+
return uri.toString();
|
|
49294
|
+
}
|
|
49295
|
+
getCmafDashManifest(paramsOrFirst) {
|
|
49296
|
+
let params;
|
|
49297
|
+
if (paramsOrFirst &&
|
|
49298
|
+
typeof paramsOrFirst === 'object' &&
|
|
49299
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49300
|
+
params = (paramsOrFirst || {});
|
|
49301
|
+
}
|
|
49302
|
+
else {
|
|
49303
|
+
params = {
|
|
49304
|
+
videoId: paramsOrFirst,
|
|
49305
|
+
};
|
|
49306
|
+
}
|
|
49307
|
+
const videoId = params.videoId;
|
|
49308
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49309
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49310
|
+
}
|
|
49311
|
+
const apiPath = '/videos/{videoId}/outputs/cmaf/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49312
|
+
const apiPayload = {};
|
|
49313
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49314
|
+
apiPayload['project'] = this.client.config.project;
|
|
49315
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
49316
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
49317
|
+
uri.searchParams.append(key, value);
|
|
49318
|
+
}
|
|
49319
|
+
return uri.toString();
|
|
49320
|
+
}
|
|
49321
|
+
getCmafStreamManifest(paramsOrFirst, ...rest) {
|
|
49322
|
+
let params;
|
|
49323
|
+
if (paramsOrFirst &&
|
|
49324
|
+
typeof paramsOrFirst === 'object' &&
|
|
49325
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49326
|
+
params = (paramsOrFirst || {});
|
|
49327
|
+
}
|
|
49328
|
+
else {
|
|
49329
|
+
params = {
|
|
49330
|
+
videoId: paramsOrFirst,
|
|
49331
|
+
renditionId: rest[0],
|
|
49332
|
+
streamId: rest[1],
|
|
49333
|
+
};
|
|
49334
|
+
}
|
|
49335
|
+
const videoId = params.videoId;
|
|
49336
|
+
const renditionId = params.renditionId;
|
|
49337
|
+
const streamId = params.streamId;
|
|
49338
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49339
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49340
|
+
}
|
|
49341
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
49342
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
49343
|
+
}
|
|
49344
|
+
if (typeof streamId === 'undefined') {
|
|
49345
|
+
throw new AppwriteException('Missing required parameter: "streamId"');
|
|
49346
|
+
}
|
|
49347
|
+
const apiPath = '/videos/{videoId}/outputs/cmaf/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
|
|
49348
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
49349
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)))
|
|
49350
|
+
.replace('{streamId}', encodeURIComponent(String(streamId)));
|
|
49351
|
+
const apiPayload = {};
|
|
49352
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49353
|
+
apiPayload['project'] = this.client.config.project;
|
|
49354
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
49355
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
49356
|
+
uri.searchParams.append(key, value);
|
|
49357
|
+
}
|
|
49358
|
+
return uri.toString();
|
|
49359
|
+
}
|
|
49360
|
+
getDashManifest(paramsOrFirst) {
|
|
49361
|
+
let params;
|
|
49362
|
+
if (paramsOrFirst &&
|
|
49363
|
+
typeof paramsOrFirst === 'object' &&
|
|
49364
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49365
|
+
params = (paramsOrFirst || {});
|
|
49366
|
+
}
|
|
49367
|
+
else {
|
|
49368
|
+
params = {
|
|
49369
|
+
videoId: paramsOrFirst,
|
|
49370
|
+
};
|
|
49371
|
+
}
|
|
49372
|
+
const videoId = params.videoId;
|
|
49373
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49374
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49375
|
+
}
|
|
49376
|
+
const apiPath = '/videos/{videoId}/outputs/dash/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49377
|
+
const apiPayload = {};
|
|
49378
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49379
|
+
apiPayload['project'] = this.client.config.project;
|
|
49380
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
49381
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
49382
|
+
uri.searchParams.append(key, value);
|
|
49383
|
+
}
|
|
49384
|
+
return uri.toString();
|
|
49385
|
+
}
|
|
49386
|
+
getHlsManifest(paramsOrFirst) {
|
|
49387
|
+
let params;
|
|
49388
|
+
if (paramsOrFirst &&
|
|
49389
|
+
typeof paramsOrFirst === 'object' &&
|
|
49390
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49391
|
+
params = (paramsOrFirst || {});
|
|
49392
|
+
}
|
|
49393
|
+
else {
|
|
49394
|
+
params = {
|
|
49395
|
+
videoId: paramsOrFirst,
|
|
49396
|
+
};
|
|
49397
|
+
}
|
|
49398
|
+
const videoId = params.videoId;
|
|
49399
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49400
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49401
|
+
}
|
|
49402
|
+
const apiPath = '/videos/{videoId}/outputs/hls/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49403
|
+
const apiPayload = {};
|
|
49404
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49405
|
+
apiPayload['project'] = this.client.config.project;
|
|
49406
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
49407
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
49408
|
+
uri.searchParams.append(key, value);
|
|
49409
|
+
}
|
|
49410
|
+
return uri.toString();
|
|
49411
|
+
}
|
|
49412
|
+
getStreamManifest(paramsOrFirst, ...rest) {
|
|
49413
|
+
let params;
|
|
49414
|
+
if (paramsOrFirst &&
|
|
49415
|
+
typeof paramsOrFirst === 'object' &&
|
|
49416
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49417
|
+
params = (paramsOrFirst || {});
|
|
49418
|
+
}
|
|
49419
|
+
else {
|
|
49420
|
+
params = {
|
|
49421
|
+
videoId: paramsOrFirst,
|
|
49422
|
+
renditionId: rest[0],
|
|
49423
|
+
streamId: rest[1],
|
|
49424
|
+
};
|
|
49425
|
+
}
|
|
49426
|
+
const videoId = params.videoId;
|
|
49427
|
+
const renditionId = params.renditionId;
|
|
49428
|
+
const streamId = params.streamId;
|
|
49429
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49430
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49431
|
+
}
|
|
49432
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
49433
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
49434
|
+
}
|
|
49435
|
+
if (typeof streamId === 'undefined') {
|
|
49436
|
+
throw new AppwriteException('Missing required parameter: "streamId"');
|
|
49437
|
+
}
|
|
49438
|
+
const apiPath = '/videos/{videoId}/outputs/hls/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
|
|
49439
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
49440
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)))
|
|
49441
|
+
.replace('{streamId}', encodeURIComponent(String(streamId)));
|
|
49442
|
+
const apiPayload = {};
|
|
49443
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49444
|
+
apiPayload['project'] = this.client.config.project;
|
|
49445
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
49446
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
49447
|
+
uri.searchParams.append(key, value);
|
|
49448
|
+
}
|
|
49449
|
+
return uri.toString();
|
|
49450
|
+
}
|
|
49451
|
+
getSegment(paramsOrFirst, ...rest) {
|
|
49452
|
+
let params;
|
|
49453
|
+
if (paramsOrFirst &&
|
|
49454
|
+
typeof paramsOrFirst === 'object' &&
|
|
49455
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49456
|
+
params = (paramsOrFirst || {});
|
|
49457
|
+
}
|
|
49458
|
+
else {
|
|
49459
|
+
params = {
|
|
49460
|
+
videoId: paramsOrFirst,
|
|
49461
|
+
output: rest[0],
|
|
49462
|
+
renditionId: rest[1],
|
|
49463
|
+
segmentId: rest[2],
|
|
49464
|
+
};
|
|
49465
|
+
}
|
|
49466
|
+
const videoId = params.videoId;
|
|
49467
|
+
const output = params.output;
|
|
49468
|
+
const renditionId = params.renditionId;
|
|
49469
|
+
const segmentId = params.segmentId;
|
|
49470
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49471
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49472
|
+
}
|
|
49473
|
+
if (typeof output === 'undefined') {
|
|
49474
|
+
throw new AppwriteException('Missing required parameter: "output"');
|
|
49475
|
+
}
|
|
49476
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
49477
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
49478
|
+
}
|
|
49479
|
+
if (typeof segmentId === 'undefined' || segmentId === '') {
|
|
49480
|
+
throw new AppwriteException('Missing required parameter: "segmentId"');
|
|
49481
|
+
}
|
|
49482
|
+
const apiPath = '/videos/{videoId}/outputs/{output}/renditions/{renditionId}/segments/{segmentId}'
|
|
49483
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
49484
|
+
.replace('{output}', encodeURIComponent(String(output)))
|
|
49485
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)))
|
|
49486
|
+
.replace('{segmentId}', encodeURIComponent(String(segmentId)));
|
|
49487
|
+
const apiPayload = {};
|
|
49488
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49489
|
+
apiPayload['project'] = this.client.config.project;
|
|
49490
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
49491
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
49492
|
+
uri.searchParams.append(key, value);
|
|
49493
|
+
}
|
|
49494
|
+
return uri.toString();
|
|
49495
|
+
}
|
|
49496
|
+
getSubtitleManifest(paramsOrFirst, ...rest) {
|
|
49497
|
+
let params;
|
|
49498
|
+
if (paramsOrFirst &&
|
|
49499
|
+
typeof paramsOrFirst === 'object' &&
|
|
49500
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49501
|
+
params = (paramsOrFirst || {});
|
|
49502
|
+
}
|
|
49503
|
+
else {
|
|
49504
|
+
params = {
|
|
49505
|
+
videoId: paramsOrFirst,
|
|
49506
|
+
output: rest[0],
|
|
49507
|
+
subtitleId: rest[1],
|
|
49508
|
+
};
|
|
49509
|
+
}
|
|
49510
|
+
const videoId = params.videoId;
|
|
49511
|
+
const output = params.output;
|
|
49512
|
+
const subtitleId = params.subtitleId;
|
|
49513
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49514
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49515
|
+
}
|
|
49516
|
+
if (typeof output === 'undefined') {
|
|
49517
|
+
throw new AppwriteException('Missing required parameter: "output"');
|
|
49518
|
+
}
|
|
49519
|
+
if (typeof subtitleId === 'undefined' || subtitleId === '') {
|
|
49520
|
+
throw new AppwriteException('Missing required parameter: "subtitleId"');
|
|
49521
|
+
}
|
|
49522
|
+
const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/manifest'
|
|
49523
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
49524
|
+
.replace('{output}', encodeURIComponent(String(output)))
|
|
49525
|
+
.replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
|
|
49526
|
+
const apiPayload = {};
|
|
49527
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49528
|
+
apiPayload['project'] = this.client.config.project;
|
|
49529
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
49530
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
49531
|
+
uri.searchParams.append(key, value);
|
|
49532
|
+
}
|
|
49533
|
+
return uri.toString();
|
|
49534
|
+
}
|
|
49535
|
+
getSubtitleSegment(paramsOrFirst, ...rest) {
|
|
49536
|
+
let params;
|
|
49537
|
+
if (paramsOrFirst &&
|
|
49538
|
+
typeof paramsOrFirst === 'object' &&
|
|
49539
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49540
|
+
params = (paramsOrFirst || {});
|
|
49541
|
+
}
|
|
49542
|
+
else {
|
|
49543
|
+
params = {
|
|
49544
|
+
videoId: paramsOrFirst,
|
|
49545
|
+
output: rest[0],
|
|
49546
|
+
subtitleId: rest[1],
|
|
49547
|
+
segmentId: rest[2],
|
|
49548
|
+
};
|
|
49549
|
+
}
|
|
49550
|
+
const videoId = params.videoId;
|
|
49551
|
+
const output = params.output;
|
|
49552
|
+
const subtitleId = params.subtitleId;
|
|
49553
|
+
const segmentId = params.segmentId;
|
|
49554
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49555
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49556
|
+
}
|
|
49557
|
+
if (typeof output === 'undefined') {
|
|
49558
|
+
throw new AppwriteException('Missing required parameter: "output"');
|
|
49559
|
+
}
|
|
49560
|
+
if (typeof subtitleId === 'undefined' || subtitleId === '') {
|
|
49561
|
+
throw new AppwriteException('Missing required parameter: "subtitleId"');
|
|
49562
|
+
}
|
|
49563
|
+
if (typeof segmentId === 'undefined' || segmentId === '') {
|
|
49564
|
+
throw new AppwriteException('Missing required parameter: "segmentId"');
|
|
49565
|
+
}
|
|
49566
|
+
const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/segments/{segmentId}'
|
|
49567
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
49568
|
+
.replace('{output}', encodeURIComponent(String(output)))
|
|
49569
|
+
.replace('{subtitleId}', encodeURIComponent(String(subtitleId)))
|
|
49570
|
+
.replace('{segmentId}', encodeURIComponent(String(segmentId)));
|
|
49571
|
+
const apiPayload = {};
|
|
49572
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49573
|
+
apiPayload['project'] = this.client.config.project;
|
|
49574
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
49575
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
49576
|
+
uri.searchParams.append(key, value);
|
|
49577
|
+
}
|
|
49578
|
+
return uri.toString();
|
|
49579
|
+
}
|
|
49580
|
+
getPreview(paramsOrFirst, ...rest) {
|
|
49581
|
+
let params;
|
|
49582
|
+
if (paramsOrFirst &&
|
|
49583
|
+
typeof paramsOrFirst === 'object' &&
|
|
49584
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49585
|
+
params = (paramsOrFirst || {});
|
|
49586
|
+
}
|
|
49587
|
+
else {
|
|
49588
|
+
params = {
|
|
49589
|
+
videoId: paramsOrFirst,
|
|
49590
|
+
previewId: rest[0],
|
|
49591
|
+
width: rest[1],
|
|
49592
|
+
height: rest[2],
|
|
49593
|
+
output: rest[3],
|
|
49594
|
+
};
|
|
49595
|
+
}
|
|
49596
|
+
const videoId = params.videoId;
|
|
49597
|
+
const previewId = params.previewId;
|
|
49598
|
+
const width = params.width;
|
|
49599
|
+
const height = params.height;
|
|
49600
|
+
const output = params.output;
|
|
49601
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49602
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49603
|
+
}
|
|
49604
|
+
if (typeof previewId === 'undefined' || previewId === '') {
|
|
49605
|
+
throw new AppwriteException('Missing required parameter: "previewId"');
|
|
49606
|
+
}
|
|
49607
|
+
const apiPath = '/videos/{videoId}/previews/{previewId}'
|
|
49608
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
49609
|
+
.replace('{previewId}', encodeURIComponent(String(previewId)));
|
|
49610
|
+
const apiPayload = {};
|
|
49611
|
+
if (typeof width !== 'undefined') {
|
|
49612
|
+
apiPayload['width'] = width;
|
|
49613
|
+
}
|
|
49614
|
+
if (typeof height !== 'undefined') {
|
|
49615
|
+
apiPayload['height'] = height;
|
|
49616
|
+
}
|
|
49617
|
+
if (typeof output !== 'undefined') {
|
|
49618
|
+
apiPayload['output'] = output;
|
|
49619
|
+
}
|
|
49620
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49621
|
+
apiPayload['project'] = this.client.config.project;
|
|
49622
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
49623
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
49624
|
+
uri.searchParams.append(key, value);
|
|
49625
|
+
}
|
|
49626
|
+
return uri.toString();
|
|
49627
|
+
}
|
|
49628
|
+
listRenditions(paramsOrFirst, ...rest) {
|
|
49629
|
+
let params;
|
|
49630
|
+
if (paramsOrFirst &&
|
|
49631
|
+
typeof paramsOrFirst === 'object' &&
|
|
49632
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49633
|
+
params = (paramsOrFirst || {});
|
|
49634
|
+
}
|
|
49635
|
+
else {
|
|
49636
|
+
params = {
|
|
49637
|
+
videoId: paramsOrFirst,
|
|
49638
|
+
output: rest[0],
|
|
49639
|
+
status: rest[1],
|
|
49640
|
+
};
|
|
49641
|
+
}
|
|
49642
|
+
const videoId = params.videoId;
|
|
49643
|
+
const output = params.output;
|
|
49644
|
+
const status = params.status;
|
|
49645
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49646
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49647
|
+
}
|
|
49648
|
+
const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49649
|
+
const apiPayload = {};
|
|
49650
|
+
if (typeof output !== 'undefined') {
|
|
49651
|
+
apiPayload['output'] = output;
|
|
49652
|
+
}
|
|
49653
|
+
if (typeof status !== 'undefined') {
|
|
49654
|
+
apiPayload['status'] = status;
|
|
49655
|
+
}
|
|
49656
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49657
|
+
const apiHeaders = {
|
|
49658
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49659
|
+
accept: 'application/json',
|
|
49660
|
+
};
|
|
49661
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
49662
|
+
}
|
|
49663
|
+
createRendition(paramsOrFirst, ...rest) {
|
|
49664
|
+
let params;
|
|
49665
|
+
if (paramsOrFirst &&
|
|
49666
|
+
typeof paramsOrFirst === 'object' &&
|
|
49667
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49668
|
+
params = (paramsOrFirst || {});
|
|
49669
|
+
}
|
|
49670
|
+
else {
|
|
49671
|
+
params = {
|
|
49672
|
+
videoId: paramsOrFirst,
|
|
49673
|
+
profileId: rest[0],
|
|
49674
|
+
output: rest[1],
|
|
49675
|
+
};
|
|
49676
|
+
}
|
|
49677
|
+
const videoId = params.videoId;
|
|
49678
|
+
const profileId = params.profileId;
|
|
49679
|
+
const output = params.output;
|
|
49680
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49681
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49682
|
+
}
|
|
49683
|
+
if (typeof profileId === 'undefined') {
|
|
49684
|
+
throw new AppwriteException('Missing required parameter: "profileId"');
|
|
49685
|
+
}
|
|
49686
|
+
if (typeof output === 'undefined') {
|
|
49687
|
+
throw new AppwriteException('Missing required parameter: "output"');
|
|
49688
|
+
}
|
|
49689
|
+
const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49690
|
+
const apiPayload = {};
|
|
49691
|
+
if (typeof profileId !== 'undefined') {
|
|
49692
|
+
apiPayload['profileId'] = profileId;
|
|
49693
|
+
}
|
|
49694
|
+
if (typeof output !== 'undefined') {
|
|
49695
|
+
apiPayload['output'] = output;
|
|
49696
|
+
}
|
|
49697
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49698
|
+
const apiHeaders = {
|
|
49699
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49700
|
+
'content-type': 'application/json',
|
|
49701
|
+
accept: 'application/json',
|
|
49702
|
+
};
|
|
49703
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
49704
|
+
}
|
|
49705
|
+
getRendition(paramsOrFirst, ...rest) {
|
|
49706
|
+
let params;
|
|
49707
|
+
if (paramsOrFirst &&
|
|
49708
|
+
typeof paramsOrFirst === 'object' &&
|
|
49709
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49710
|
+
params = (paramsOrFirst || {});
|
|
49711
|
+
}
|
|
49712
|
+
else {
|
|
49713
|
+
params = {
|
|
49714
|
+
videoId: paramsOrFirst,
|
|
49715
|
+
renditionId: rest[0],
|
|
49716
|
+
};
|
|
49717
|
+
}
|
|
49718
|
+
const videoId = params.videoId;
|
|
49719
|
+
const renditionId = params.renditionId;
|
|
49720
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49721
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49722
|
+
}
|
|
49723
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
49724
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
49725
|
+
}
|
|
49726
|
+
const apiPath = '/videos/{videoId}/renditions/{renditionId}'
|
|
49727
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
49728
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)));
|
|
49729
|
+
const apiPayload = {};
|
|
49730
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49731
|
+
const apiHeaders = {
|
|
49732
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49733
|
+
accept: 'application/json',
|
|
49734
|
+
};
|
|
49735
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
49736
|
+
}
|
|
49737
|
+
deleteRendition(paramsOrFirst, ...rest) {
|
|
49738
|
+
let params;
|
|
49739
|
+
if (paramsOrFirst &&
|
|
49740
|
+
typeof paramsOrFirst === 'object' &&
|
|
49741
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49742
|
+
params = (paramsOrFirst || {});
|
|
49743
|
+
}
|
|
49744
|
+
else {
|
|
49745
|
+
params = {
|
|
49746
|
+
videoId: paramsOrFirst,
|
|
49747
|
+
renditionId: rest[0],
|
|
49748
|
+
};
|
|
49749
|
+
}
|
|
49750
|
+
const videoId = params.videoId;
|
|
49751
|
+
const renditionId = params.renditionId;
|
|
49752
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49753
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49754
|
+
}
|
|
49755
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
49756
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
49757
|
+
}
|
|
49758
|
+
const apiPath = '/videos/{videoId}/renditions/{renditionId}'
|
|
49759
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
49760
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)));
|
|
49761
|
+
const apiPayload = {};
|
|
49762
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49763
|
+
const apiHeaders = {
|
|
49764
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49765
|
+
'content-type': 'application/json',
|
|
49766
|
+
accept: 'application/json',
|
|
49767
|
+
};
|
|
49768
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
49769
|
+
}
|
|
49770
|
+
createSource(paramsOrFirst) {
|
|
49771
|
+
let params;
|
|
49772
|
+
if (paramsOrFirst &&
|
|
49773
|
+
typeof paramsOrFirst === 'object' &&
|
|
49774
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49775
|
+
params = (paramsOrFirst || {});
|
|
49776
|
+
}
|
|
49777
|
+
else {
|
|
49778
|
+
params = {
|
|
49779
|
+
videoId: paramsOrFirst,
|
|
49780
|
+
};
|
|
49781
|
+
}
|
|
49782
|
+
const videoId = params.videoId;
|
|
49783
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49784
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49785
|
+
}
|
|
49786
|
+
const apiPath = '/videos/{videoId}/source'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49787
|
+
const apiPayload = {};
|
|
49788
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49789
|
+
const apiHeaders = {
|
|
49790
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49791
|
+
'content-type': 'application/json',
|
|
49792
|
+
accept: 'application/json',
|
|
49793
|
+
};
|
|
49794
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
49795
|
+
}
|
|
49796
|
+
listSubtitles(paramsOrFirst) {
|
|
49797
|
+
let params;
|
|
49798
|
+
if (paramsOrFirst &&
|
|
49799
|
+
typeof paramsOrFirst === 'object' &&
|
|
49800
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49801
|
+
params = (paramsOrFirst || {});
|
|
49802
|
+
}
|
|
49803
|
+
else {
|
|
49804
|
+
params = {
|
|
49805
|
+
videoId: paramsOrFirst,
|
|
49806
|
+
};
|
|
49807
|
+
}
|
|
49808
|
+
const videoId = params.videoId;
|
|
49809
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49810
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49811
|
+
}
|
|
49812
|
+
const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49813
|
+
const apiPayload = {};
|
|
49814
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49815
|
+
const apiHeaders = {
|
|
49816
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49817
|
+
accept: 'application/json',
|
|
49818
|
+
};
|
|
49819
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
49820
|
+
}
|
|
49821
|
+
createSubtitle(paramsOrFirst, ...rest) {
|
|
49822
|
+
let params;
|
|
49823
|
+
if (paramsOrFirst &&
|
|
49824
|
+
typeof paramsOrFirst === 'object' &&
|
|
49825
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49826
|
+
params = (paramsOrFirst || {});
|
|
49827
|
+
}
|
|
49828
|
+
else {
|
|
49829
|
+
params = {
|
|
49830
|
+
videoId: paramsOrFirst,
|
|
49831
|
+
bucketId: rest[0],
|
|
49832
|
+
fileId: rest[1],
|
|
49833
|
+
name: rest[2],
|
|
49834
|
+
code: rest[3],
|
|
49835
|
+
xdefault: rest[4],
|
|
49836
|
+
};
|
|
49837
|
+
}
|
|
49838
|
+
const videoId = params.videoId;
|
|
49839
|
+
const bucketId = params.bucketId;
|
|
49840
|
+
const fileId = params.fileId;
|
|
49841
|
+
const name = params.name;
|
|
49842
|
+
const code = params.code;
|
|
49843
|
+
const xdefault = params.xdefault;
|
|
49844
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49845
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49846
|
+
}
|
|
49847
|
+
if (typeof bucketId === 'undefined') {
|
|
49848
|
+
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
49849
|
+
}
|
|
49850
|
+
if (typeof fileId === 'undefined') {
|
|
49851
|
+
throw new AppwriteException('Missing required parameter: "fileId"');
|
|
49852
|
+
}
|
|
49853
|
+
if (typeof name === 'undefined') {
|
|
49854
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
49855
|
+
}
|
|
49856
|
+
if (typeof code === 'undefined') {
|
|
49857
|
+
throw new AppwriteException('Missing required parameter: "code"');
|
|
49858
|
+
}
|
|
49859
|
+
const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49860
|
+
const apiPayload = {};
|
|
49861
|
+
if (typeof bucketId !== 'undefined') {
|
|
49862
|
+
apiPayload['bucketId'] = bucketId;
|
|
49863
|
+
}
|
|
49864
|
+
if (typeof fileId !== 'undefined') {
|
|
49865
|
+
apiPayload['fileId'] = fileId;
|
|
49866
|
+
}
|
|
49867
|
+
if (typeof name !== 'undefined') {
|
|
49868
|
+
apiPayload['name'] = name;
|
|
49869
|
+
}
|
|
49870
|
+
if (typeof code !== 'undefined') {
|
|
49871
|
+
apiPayload['code'] = code;
|
|
49872
|
+
}
|
|
49873
|
+
if (typeof xdefault !== 'undefined') {
|
|
49874
|
+
apiPayload['default'] = xdefault;
|
|
49875
|
+
}
|
|
49876
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49877
|
+
const apiHeaders = {
|
|
49878
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49879
|
+
'content-type': 'application/json',
|
|
49880
|
+
accept: 'application/json',
|
|
49881
|
+
};
|
|
49882
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
49883
|
+
}
|
|
49884
|
+
updateSubtitle(paramsOrFirst, ...rest) {
|
|
49885
|
+
let params;
|
|
49886
|
+
if (paramsOrFirst &&
|
|
49887
|
+
typeof paramsOrFirst === 'object' &&
|
|
49888
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49889
|
+
params = (paramsOrFirst || {});
|
|
49890
|
+
}
|
|
49891
|
+
else {
|
|
49892
|
+
params = {
|
|
49893
|
+
videoId: paramsOrFirst,
|
|
49894
|
+
subtitleId: rest[0],
|
|
49895
|
+
bucketId: rest[1],
|
|
49896
|
+
fileId: rest[2],
|
|
49897
|
+
name: rest[3],
|
|
49898
|
+
code: rest[4],
|
|
49899
|
+
xdefault: rest[5],
|
|
49900
|
+
};
|
|
49901
|
+
}
|
|
49902
|
+
const videoId = params.videoId;
|
|
49903
|
+
const subtitleId = params.subtitleId;
|
|
49904
|
+
const bucketId = params.bucketId;
|
|
49905
|
+
const fileId = params.fileId;
|
|
49906
|
+
const name = params.name;
|
|
49907
|
+
const code = params.code;
|
|
49908
|
+
const xdefault = params.xdefault;
|
|
49909
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49910
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49911
|
+
}
|
|
49912
|
+
if (typeof subtitleId === 'undefined' || subtitleId === '') {
|
|
49913
|
+
throw new AppwriteException('Missing required parameter: "subtitleId"');
|
|
49914
|
+
}
|
|
49915
|
+
const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
|
|
49916
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
49917
|
+
.replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
|
|
49918
|
+
const apiPayload = {};
|
|
49919
|
+
if (typeof bucketId !== 'undefined') {
|
|
49920
|
+
apiPayload['bucketId'] = bucketId;
|
|
49921
|
+
}
|
|
49922
|
+
if (typeof fileId !== 'undefined') {
|
|
49923
|
+
apiPayload['fileId'] = fileId;
|
|
49924
|
+
}
|
|
49925
|
+
if (typeof name !== 'undefined') {
|
|
49926
|
+
apiPayload['name'] = name;
|
|
49927
|
+
}
|
|
49928
|
+
if (typeof code !== 'undefined') {
|
|
49929
|
+
apiPayload['code'] = code;
|
|
49930
|
+
}
|
|
49931
|
+
if (typeof xdefault !== 'undefined') {
|
|
49932
|
+
apiPayload['default'] = xdefault;
|
|
49933
|
+
}
|
|
49934
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49935
|
+
const apiHeaders = {
|
|
49936
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49937
|
+
'content-type': 'application/json',
|
|
49938
|
+
accept: 'application/json',
|
|
49939
|
+
};
|
|
49940
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
49941
|
+
}
|
|
49942
|
+
deleteSubtitle(paramsOrFirst, ...rest) {
|
|
49943
|
+
let params;
|
|
49944
|
+
if (paramsOrFirst &&
|
|
49945
|
+
typeof paramsOrFirst === 'object' &&
|
|
49946
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49947
|
+
params = (paramsOrFirst || {});
|
|
49948
|
+
}
|
|
49949
|
+
else {
|
|
49950
|
+
params = {
|
|
49951
|
+
videoId: paramsOrFirst,
|
|
49952
|
+
subtitleId: rest[0],
|
|
49953
|
+
};
|
|
49954
|
+
}
|
|
49955
|
+
const videoId = params.videoId;
|
|
49956
|
+
const subtitleId = params.subtitleId;
|
|
49957
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49958
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49959
|
+
}
|
|
49960
|
+
if (typeof subtitleId === 'undefined' || subtitleId === '') {
|
|
49961
|
+
throw new AppwriteException('Missing required parameter: "subtitleId"');
|
|
49962
|
+
}
|
|
49963
|
+
const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
|
|
49964
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
49965
|
+
.replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
|
|
49966
|
+
const apiPayload = {};
|
|
49967
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49968
|
+
const apiHeaders = {
|
|
49969
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49970
|
+
'content-type': 'application/json',
|
|
49971
|
+
accept: 'application/json',
|
|
49972
|
+
};
|
|
49973
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
49974
|
+
}
|
|
49975
|
+
getTimeline(paramsOrFirst) {
|
|
49976
|
+
let params;
|
|
49977
|
+
if (paramsOrFirst &&
|
|
49978
|
+
typeof paramsOrFirst === 'object' &&
|
|
49979
|
+
!Array.isArray(paramsOrFirst)) {
|
|
49980
|
+
params = (paramsOrFirst || {});
|
|
49981
|
+
}
|
|
49982
|
+
else {
|
|
49983
|
+
params = {
|
|
49984
|
+
videoId: paramsOrFirst,
|
|
49985
|
+
};
|
|
49986
|
+
}
|
|
49987
|
+
const videoId = params.videoId;
|
|
49988
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
49989
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
49990
|
+
}
|
|
49991
|
+
const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
49992
|
+
const apiPayload = {};
|
|
49993
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
49994
|
+
const apiHeaders = {
|
|
49995
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
49996
|
+
accept: 'text/plain',
|
|
49997
|
+
};
|
|
49998
|
+
return this.client.call('get', uri, apiHeaders, apiPayload, 'text');
|
|
49999
|
+
}
|
|
50000
|
+
createTimeline(paramsOrFirst) {
|
|
50001
|
+
let params;
|
|
50002
|
+
if (paramsOrFirst &&
|
|
50003
|
+
typeof paramsOrFirst === 'object' &&
|
|
50004
|
+
!Array.isArray(paramsOrFirst)) {
|
|
50005
|
+
params = (paramsOrFirst || {});
|
|
50006
|
+
}
|
|
50007
|
+
else {
|
|
50008
|
+
params = {
|
|
50009
|
+
videoId: paramsOrFirst,
|
|
50010
|
+
};
|
|
50011
|
+
}
|
|
50012
|
+
const videoId = params.videoId;
|
|
50013
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
50014
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
50015
|
+
}
|
|
50016
|
+
const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
50017
|
+
const apiPayload = {};
|
|
50018
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
50019
|
+
const apiHeaders = {
|
|
50020
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
50021
|
+
'content-type': 'application/json',
|
|
50022
|
+
accept: 'application/json',
|
|
50023
|
+
};
|
|
50024
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
50025
|
+
}
|
|
50026
|
+
}
|
|
50027
|
+
|
|
50028
|
+
class Waf {
|
|
50029
|
+
constructor(client) {
|
|
50030
|
+
this.client = client;
|
|
50031
|
+
}
|
|
50032
|
+
listRules(paramsOrFirst, ...rest) {
|
|
50033
|
+
let params;
|
|
50034
|
+
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
50035
|
+
(paramsOrFirst &&
|
|
50036
|
+
typeof paramsOrFirst === 'object' &&
|
|
50037
|
+
!Array.isArray(paramsOrFirst))) {
|
|
50038
|
+
params = (paramsOrFirst || {});
|
|
50039
|
+
}
|
|
50040
|
+
else {
|
|
50041
|
+
params = {
|
|
50042
|
+
queries: paramsOrFirst,
|
|
50043
|
+
search: rest[0],
|
|
50044
|
+
total: rest[1],
|
|
50045
|
+
};
|
|
50046
|
+
}
|
|
50047
|
+
const queries = params.queries;
|
|
50048
|
+
const search = params.search;
|
|
50049
|
+
const total = params.total;
|
|
50050
|
+
const apiPath = '/waf/rules';
|
|
50051
|
+
const apiPayload = {};
|
|
50052
|
+
if (typeof queries !== 'undefined') {
|
|
50053
|
+
apiPayload['queries'] = queries;
|
|
50054
|
+
}
|
|
50055
|
+
if (typeof search !== 'undefined') {
|
|
50056
|
+
apiPayload['search'] = search;
|
|
50057
|
+
}
|
|
50058
|
+
if (typeof total !== 'undefined') {
|
|
50059
|
+
apiPayload['total'] = total;
|
|
50060
|
+
}
|
|
50061
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
50062
|
+
const apiHeaders = {
|
|
50063
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
50064
|
+
accept: 'application/json',
|
|
50065
|
+
};
|
|
50066
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
50067
|
+
}
|
|
50068
|
+
createBypassRule(paramsOrFirst, ...rest) {
|
|
50069
|
+
let params;
|
|
50070
|
+
if (paramsOrFirst &&
|
|
50071
|
+
typeof paramsOrFirst === 'object' &&
|
|
50072
|
+
!Array.isArray(paramsOrFirst)) {
|
|
50073
|
+
params = (paramsOrFirst || {});
|
|
50074
|
+
}
|
|
50075
|
+
else {
|
|
50076
|
+
params = {
|
|
50077
|
+
ruleId: paramsOrFirst,
|
|
50078
|
+
resourceType: rest[0],
|
|
50079
|
+
name: rest[1],
|
|
50080
|
+
resourceId: rest[2],
|
|
50081
|
+
description: rest[3],
|
|
50082
|
+
priority: rest[4],
|
|
50083
|
+
enabled: rest[5],
|
|
50084
|
+
conditions: rest[6],
|
|
50085
|
+
};
|
|
50086
|
+
}
|
|
50087
|
+
const ruleId = params.ruleId;
|
|
50088
|
+
const resourceType = params.resourceType;
|
|
50089
|
+
const name = params.name;
|
|
50090
|
+
const resourceId = params.resourceId;
|
|
50091
|
+
const description = params.description;
|
|
50092
|
+
const priority = params.priority;
|
|
50093
|
+
const enabled = params.enabled;
|
|
50094
|
+
const conditions = params.conditions;
|
|
50095
|
+
if (typeof ruleId === 'undefined') {
|
|
50096
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
50097
|
+
}
|
|
50098
|
+
if (typeof resourceType === 'undefined') {
|
|
50099
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
50100
|
+
}
|
|
50101
|
+
if (typeof name === 'undefined') {
|
|
50102
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
50103
|
+
}
|
|
50104
|
+
const apiPath = '/waf/rules/bypass';
|
|
50105
|
+
const apiPayload = {};
|
|
50106
|
+
if (typeof ruleId !== 'undefined') {
|
|
50107
|
+
apiPayload['ruleId'] = ruleId;
|
|
50108
|
+
}
|
|
50109
|
+
if (typeof resourceType !== 'undefined') {
|
|
50110
|
+
apiPayload['resourceType'] = resourceType;
|
|
50111
|
+
}
|
|
50112
|
+
if (typeof resourceId !== 'undefined') {
|
|
50113
|
+
apiPayload['resourceId'] = resourceId;
|
|
50114
|
+
}
|
|
50115
|
+
if (typeof name !== 'undefined') {
|
|
50116
|
+
apiPayload['name'] = name;
|
|
50117
|
+
}
|
|
50118
|
+
if (typeof description !== 'undefined') {
|
|
50119
|
+
apiPayload['description'] = description;
|
|
50120
|
+
}
|
|
50121
|
+
if (typeof priority !== 'undefined') {
|
|
50122
|
+
apiPayload['priority'] = priority;
|
|
50123
|
+
}
|
|
50124
|
+
if (typeof enabled !== 'undefined') {
|
|
50125
|
+
apiPayload['enabled'] = enabled;
|
|
50126
|
+
}
|
|
50127
|
+
if (typeof conditions !== 'undefined') {
|
|
50128
|
+
apiPayload['conditions'] = conditions;
|
|
50129
|
+
}
|
|
50130
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
50131
|
+
const apiHeaders = {
|
|
50132
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
50133
|
+
'content-type': 'application/json',
|
|
50134
|
+
accept: 'application/json',
|
|
50135
|
+
};
|
|
50136
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
50137
|
+
}
|
|
50138
|
+
updateBypassRule(paramsOrFirst, ...rest) {
|
|
50139
|
+
let params;
|
|
50140
|
+
if (paramsOrFirst &&
|
|
50141
|
+
typeof paramsOrFirst === 'object' &&
|
|
50142
|
+
!Array.isArray(paramsOrFirst)) {
|
|
50143
|
+
params = (paramsOrFirst || {});
|
|
50144
|
+
}
|
|
50145
|
+
else {
|
|
50146
|
+
params = {
|
|
50147
|
+
ruleId: paramsOrFirst,
|
|
50148
|
+
resourceType: rest[0],
|
|
50149
|
+
resourceId: rest[1],
|
|
50150
|
+
name: rest[2],
|
|
50151
|
+
description: rest[3],
|
|
50152
|
+
priority: rest[4],
|
|
50153
|
+
enabled: rest[5],
|
|
50154
|
+
conditions: rest[6],
|
|
50155
|
+
};
|
|
50156
|
+
}
|
|
50157
|
+
const ruleId = params.ruleId;
|
|
50158
|
+
const resourceType = params.resourceType;
|
|
50159
|
+
const resourceId = params.resourceId;
|
|
50160
|
+
const name = params.name;
|
|
50161
|
+
const description = params.description;
|
|
50162
|
+
const priority = params.priority;
|
|
50163
|
+
const enabled = params.enabled;
|
|
50164
|
+
const conditions = params.conditions;
|
|
50165
|
+
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
50166
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
50167
|
+
}
|
|
50168
|
+
const apiPath = '/waf/rules/bypass/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
|
|
50169
|
+
const apiPayload = {};
|
|
50170
|
+
if (typeof resourceType !== 'undefined') {
|
|
50171
|
+
apiPayload['resourceType'] = resourceType;
|
|
50172
|
+
}
|
|
50173
|
+
if (typeof resourceId !== 'undefined') {
|
|
50174
|
+
apiPayload['resourceId'] = resourceId;
|
|
50175
|
+
}
|
|
50176
|
+
if (typeof name !== 'undefined') {
|
|
50177
|
+
apiPayload['name'] = name;
|
|
50178
|
+
}
|
|
50179
|
+
if (typeof description !== 'undefined') {
|
|
50180
|
+
apiPayload['description'] = description;
|
|
50181
|
+
}
|
|
50182
|
+
if (typeof priority !== 'undefined') {
|
|
50183
|
+
apiPayload['priority'] = priority;
|
|
50184
|
+
}
|
|
50185
|
+
if (typeof enabled !== 'undefined') {
|
|
50186
|
+
apiPayload['enabled'] = enabled;
|
|
50187
|
+
}
|
|
50188
|
+
if (typeof conditions !== 'undefined') {
|
|
50189
|
+
apiPayload['conditions'] = conditions;
|
|
50190
|
+
}
|
|
50191
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
50192
|
+
const apiHeaders = {
|
|
50193
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
50194
|
+
'content-type': 'application/json',
|
|
50195
|
+
accept: 'application/json',
|
|
50196
|
+
};
|
|
50197
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
50198
|
+
}
|
|
50199
|
+
createChallengeRule(paramsOrFirst, ...rest) {
|
|
50200
|
+
let params;
|
|
50201
|
+
if (paramsOrFirst &&
|
|
50202
|
+
typeof paramsOrFirst === 'object' &&
|
|
50203
|
+
!Array.isArray(paramsOrFirst)) {
|
|
50204
|
+
params = (paramsOrFirst || {});
|
|
50205
|
+
}
|
|
50206
|
+
else {
|
|
50207
|
+
params = {
|
|
50208
|
+
ruleId: paramsOrFirst,
|
|
50209
|
+
resourceType: rest[0],
|
|
50210
|
+
name: rest[1],
|
|
50211
|
+
resourceId: rest[2],
|
|
50212
|
+
description: rest[3],
|
|
50213
|
+
challengeType: rest[4],
|
|
50214
|
+
priority: rest[5],
|
|
50215
|
+
enabled: rest[6],
|
|
50216
|
+
conditions: rest[7],
|
|
50217
|
+
difficulty: rest[8],
|
|
50218
|
+
ttl: rest[9],
|
|
50219
|
+
};
|
|
50220
|
+
}
|
|
50221
|
+
const ruleId = params.ruleId;
|
|
50222
|
+
const resourceType = params.resourceType;
|
|
50223
|
+
const name = params.name;
|
|
50224
|
+
const resourceId = params.resourceId;
|
|
50225
|
+
const description = params.description;
|
|
50226
|
+
const challengeType = params.challengeType;
|
|
50227
|
+
const priority = params.priority;
|
|
50228
|
+
const enabled = params.enabled;
|
|
50229
|
+
const conditions = params.conditions;
|
|
50230
|
+
const difficulty = params.difficulty;
|
|
50231
|
+
const ttl = params.ttl;
|
|
50232
|
+
if (typeof ruleId === 'undefined') {
|
|
50233
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
50234
|
+
}
|
|
50235
|
+
if (typeof resourceType === 'undefined') {
|
|
50236
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
50237
|
+
}
|
|
50238
|
+
if (typeof name === 'undefined') {
|
|
50239
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
50240
|
+
}
|
|
50241
|
+
const apiPath = '/waf/rules/challenge';
|
|
50242
|
+
const apiPayload = {};
|
|
50243
|
+
if (typeof ruleId !== 'undefined') {
|
|
50244
|
+
apiPayload['ruleId'] = ruleId;
|
|
50245
|
+
}
|
|
50246
|
+
if (typeof resourceType !== 'undefined') {
|
|
50247
|
+
apiPayload['resourceType'] = resourceType;
|
|
50248
|
+
}
|
|
50249
|
+
if (typeof resourceId !== 'undefined') {
|
|
50250
|
+
apiPayload['resourceId'] = resourceId;
|
|
50251
|
+
}
|
|
50252
|
+
if (typeof name !== 'undefined') {
|
|
50253
|
+
apiPayload['name'] = name;
|
|
50254
|
+
}
|
|
50255
|
+
if (typeof description !== 'undefined') {
|
|
50256
|
+
apiPayload['description'] = description;
|
|
50257
|
+
}
|
|
50258
|
+
if (typeof challengeType !== 'undefined') {
|
|
50259
|
+
apiPayload['challengeType'] = challengeType;
|
|
50260
|
+
}
|
|
50261
|
+
if (typeof priority !== 'undefined') {
|
|
50262
|
+
apiPayload['priority'] = priority;
|
|
50263
|
+
}
|
|
50264
|
+
if (typeof enabled !== 'undefined') {
|
|
50265
|
+
apiPayload['enabled'] = enabled;
|
|
50266
|
+
}
|
|
50267
|
+
if (typeof conditions !== 'undefined') {
|
|
50268
|
+
apiPayload['conditions'] = conditions;
|
|
50269
|
+
}
|
|
50270
|
+
if (typeof difficulty !== 'undefined') {
|
|
50271
|
+
apiPayload['difficulty'] = difficulty;
|
|
50272
|
+
}
|
|
50273
|
+
if (typeof ttl !== 'undefined') {
|
|
50274
|
+
apiPayload['ttl'] = ttl;
|
|
50275
|
+
}
|
|
50276
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
50277
|
+
const apiHeaders = {
|
|
50278
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
50279
|
+
'content-type': 'application/json',
|
|
50280
|
+
accept: 'application/json',
|
|
50281
|
+
};
|
|
50282
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
50283
|
+
}
|
|
50284
|
+
updateChallengeRule(paramsOrFirst, ...rest) {
|
|
50285
|
+
let params;
|
|
50286
|
+
if (paramsOrFirst &&
|
|
50287
|
+
typeof paramsOrFirst === 'object' &&
|
|
50288
|
+
!Array.isArray(paramsOrFirst)) {
|
|
50289
|
+
params = (paramsOrFirst || {});
|
|
50290
|
+
}
|
|
50291
|
+
else {
|
|
50292
|
+
params = {
|
|
50293
|
+
ruleId: paramsOrFirst,
|
|
50294
|
+
resourceType: rest[0],
|
|
50295
|
+
resourceId: rest[1],
|
|
50296
|
+
name: rest[2],
|
|
50297
|
+
description: rest[3],
|
|
50298
|
+
challengeType: rest[4],
|
|
50299
|
+
priority: rest[5],
|
|
50300
|
+
enabled: rest[6],
|
|
50301
|
+
conditions: rest[7],
|
|
50302
|
+
difficulty: rest[8],
|
|
50303
|
+
ttl: rest[9],
|
|
50304
|
+
};
|
|
50305
|
+
}
|
|
50306
|
+
const ruleId = params.ruleId;
|
|
50307
|
+
const resourceType = params.resourceType;
|
|
50308
|
+
const resourceId = params.resourceId;
|
|
50309
|
+
const name = params.name;
|
|
50310
|
+
const description = params.description;
|
|
50311
|
+
const challengeType = params.challengeType;
|
|
50312
|
+
const priority = params.priority;
|
|
50313
|
+
const enabled = params.enabled;
|
|
50314
|
+
const conditions = params.conditions;
|
|
50315
|
+
const difficulty = params.difficulty;
|
|
50316
|
+
const ttl = params.ttl;
|
|
50317
|
+
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
50318
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
50319
|
+
}
|
|
50320
|
+
const apiPath = '/waf/rules/challenge/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
|
|
50321
|
+
const apiPayload = {};
|
|
50322
|
+
if (typeof resourceType !== 'undefined') {
|
|
50323
|
+
apiPayload['resourceType'] = resourceType;
|
|
50324
|
+
}
|
|
50325
|
+
if (typeof resourceId !== 'undefined') {
|
|
50326
|
+
apiPayload['resourceId'] = resourceId;
|
|
50327
|
+
}
|
|
50328
|
+
if (typeof name !== 'undefined') {
|
|
50329
|
+
apiPayload['name'] = name;
|
|
50330
|
+
}
|
|
50331
|
+
if (typeof description !== 'undefined') {
|
|
50332
|
+
apiPayload['description'] = description;
|
|
50333
|
+
}
|
|
50334
|
+
if (typeof challengeType !== 'undefined') {
|
|
50335
|
+
apiPayload['challengeType'] = challengeType;
|
|
50336
|
+
}
|
|
50337
|
+
if (typeof priority !== 'undefined') {
|
|
50338
|
+
apiPayload['priority'] = priority;
|
|
50339
|
+
}
|
|
50340
|
+
if (typeof enabled !== 'undefined') {
|
|
50341
|
+
apiPayload['enabled'] = enabled;
|
|
50342
|
+
}
|
|
50343
|
+
if (typeof conditions !== 'undefined') {
|
|
50344
|
+
apiPayload['conditions'] = conditions;
|
|
50345
|
+
}
|
|
50346
|
+
if (typeof difficulty !== 'undefined') {
|
|
50347
|
+
apiPayload['difficulty'] = difficulty;
|
|
50348
|
+
}
|
|
50349
|
+
if (typeof ttl !== 'undefined') {
|
|
50350
|
+
apiPayload['ttl'] = ttl;
|
|
50351
|
+
}
|
|
50352
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
50353
|
+
const apiHeaders = {
|
|
50354
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
50355
|
+
'content-type': 'application/json',
|
|
50356
|
+
accept: 'application/json',
|
|
50357
|
+
};
|
|
50358
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
50359
|
+
}
|
|
50360
|
+
createDenyRule(paramsOrFirst, ...rest) {
|
|
50361
|
+
let params;
|
|
50362
|
+
if (paramsOrFirst &&
|
|
50363
|
+
typeof paramsOrFirst === 'object' &&
|
|
50364
|
+
!Array.isArray(paramsOrFirst)) {
|
|
50365
|
+
params = (paramsOrFirst || {});
|
|
50366
|
+
}
|
|
50367
|
+
else {
|
|
50368
|
+
params = {
|
|
50369
|
+
ruleId: paramsOrFirst,
|
|
50370
|
+
resourceType: rest[0],
|
|
50371
|
+
name: rest[1],
|
|
50372
|
+
resourceId: rest[2],
|
|
50373
|
+
description: rest[3],
|
|
50374
|
+
priority: rest[4],
|
|
50375
|
+
enabled: rest[5],
|
|
50376
|
+
conditions: rest[6],
|
|
50377
|
+
};
|
|
50378
|
+
}
|
|
50379
|
+
const ruleId = params.ruleId;
|
|
50380
|
+
const resourceType = params.resourceType;
|
|
50381
|
+
const name = params.name;
|
|
50382
|
+
const resourceId = params.resourceId;
|
|
50383
|
+
const description = params.description;
|
|
50384
|
+
const priority = params.priority;
|
|
50385
|
+
const enabled = params.enabled;
|
|
50386
|
+
const conditions = params.conditions;
|
|
50387
|
+
if (typeof ruleId === 'undefined') {
|
|
50388
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
50389
|
+
}
|
|
50390
|
+
if (typeof resourceType === 'undefined') {
|
|
50391
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
50392
|
+
}
|
|
50393
|
+
if (typeof name === 'undefined') {
|
|
50394
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
50395
|
+
}
|
|
50396
|
+
const apiPath = '/waf/rules/deny';
|
|
50397
|
+
const apiPayload = {};
|
|
50398
|
+
if (typeof ruleId !== 'undefined') {
|
|
50399
|
+
apiPayload['ruleId'] = ruleId;
|
|
50400
|
+
}
|
|
50401
|
+
if (typeof resourceType !== 'undefined') {
|
|
50402
|
+
apiPayload['resourceType'] = resourceType;
|
|
50403
|
+
}
|
|
50404
|
+
if (typeof resourceId !== 'undefined') {
|
|
50405
|
+
apiPayload['resourceId'] = resourceId;
|
|
50406
|
+
}
|
|
50407
|
+
if (typeof name !== 'undefined') {
|
|
50408
|
+
apiPayload['name'] = name;
|
|
50409
|
+
}
|
|
50410
|
+
if (typeof description !== 'undefined') {
|
|
50411
|
+
apiPayload['description'] = description;
|
|
50412
|
+
}
|
|
50413
|
+
if (typeof priority !== 'undefined') {
|
|
50414
|
+
apiPayload['priority'] = priority;
|
|
50415
|
+
}
|
|
50416
|
+
if (typeof enabled !== 'undefined') {
|
|
50417
|
+
apiPayload['enabled'] = enabled;
|
|
50418
|
+
}
|
|
50419
|
+
if (typeof conditions !== 'undefined') {
|
|
50420
|
+
apiPayload['conditions'] = conditions;
|
|
50421
|
+
}
|
|
50422
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
50423
|
+
const apiHeaders = {
|
|
50424
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
50425
|
+
'content-type': 'application/json',
|
|
50426
|
+
accept: 'application/json',
|
|
50427
|
+
};
|
|
50428
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
50429
|
+
}
|
|
50430
|
+
updateDenyRule(paramsOrFirst, ...rest) {
|
|
50431
|
+
let params;
|
|
50432
|
+
if (paramsOrFirst &&
|
|
50433
|
+
typeof paramsOrFirst === 'object' &&
|
|
50434
|
+
!Array.isArray(paramsOrFirst)) {
|
|
50435
|
+
params = (paramsOrFirst || {});
|
|
50436
|
+
}
|
|
50437
|
+
else {
|
|
50438
|
+
params = {
|
|
50439
|
+
ruleId: paramsOrFirst,
|
|
50440
|
+
resourceType: rest[0],
|
|
50441
|
+
resourceId: rest[1],
|
|
50442
|
+
name: rest[2],
|
|
50443
|
+
description: rest[3],
|
|
50444
|
+
priority: rest[4],
|
|
50445
|
+
enabled: rest[5],
|
|
50446
|
+
conditions: rest[6],
|
|
50447
|
+
};
|
|
50448
|
+
}
|
|
50449
|
+
const ruleId = params.ruleId;
|
|
50450
|
+
const resourceType = params.resourceType;
|
|
50451
|
+
const resourceId = params.resourceId;
|
|
50452
|
+
const name = params.name;
|
|
50453
|
+
const description = params.description;
|
|
50454
|
+
const priority = params.priority;
|
|
50455
|
+
const enabled = params.enabled;
|
|
50456
|
+
const conditions = params.conditions;
|
|
50457
|
+
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
50458
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
50459
|
+
}
|
|
50460
|
+
const apiPath = '/waf/rules/deny/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
|
|
50461
|
+
const apiPayload = {};
|
|
50462
|
+
if (typeof resourceType !== 'undefined') {
|
|
50463
|
+
apiPayload['resourceType'] = resourceType;
|
|
50464
|
+
}
|
|
50465
|
+
if (typeof resourceId !== 'undefined') {
|
|
50466
|
+
apiPayload['resourceId'] = resourceId;
|
|
50467
|
+
}
|
|
50468
|
+
if (typeof name !== 'undefined') {
|
|
50469
|
+
apiPayload['name'] = name;
|
|
50470
|
+
}
|
|
50471
|
+
if (typeof description !== 'undefined') {
|
|
50472
|
+
apiPayload['description'] = description;
|
|
50473
|
+
}
|
|
50474
|
+
if (typeof priority !== 'undefined') {
|
|
50475
|
+
apiPayload['priority'] = priority;
|
|
50476
|
+
}
|
|
50477
|
+
if (typeof enabled !== 'undefined') {
|
|
50478
|
+
apiPayload['enabled'] = enabled;
|
|
50479
|
+
}
|
|
50480
|
+
if (typeof conditions !== 'undefined') {
|
|
50481
|
+
apiPayload['conditions'] = conditions;
|
|
50482
|
+
}
|
|
50483
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
50484
|
+
const apiHeaders = {
|
|
50485
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
50486
|
+
'content-type': 'application/json',
|
|
50487
|
+
accept: 'application/json',
|
|
50488
|
+
};
|
|
50489
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
50490
|
+
}
|
|
50491
|
+
createRateLimitRule(paramsOrFirst, ...rest) {
|
|
50492
|
+
let params;
|
|
50493
|
+
if (paramsOrFirst &&
|
|
50494
|
+
typeof paramsOrFirst === 'object' &&
|
|
50495
|
+
!Array.isArray(paramsOrFirst)) {
|
|
50496
|
+
params = (paramsOrFirst || {});
|
|
50497
|
+
}
|
|
50498
|
+
else {
|
|
50499
|
+
params = {
|
|
50500
|
+
ruleId: paramsOrFirst,
|
|
50501
|
+
resourceType: rest[0],
|
|
50502
|
+
name: rest[1],
|
|
50503
|
+
limit: rest[2],
|
|
50504
|
+
interval: rest[3],
|
|
50505
|
+
resourceId: rest[4],
|
|
50506
|
+
description: rest[5],
|
|
50507
|
+
key: rest[6],
|
|
50508
|
+
strategy: rest[7],
|
|
50509
|
+
maxBucketSize: rest[8],
|
|
50510
|
+
priority: rest[9],
|
|
50511
|
+
enabled: rest[10],
|
|
50512
|
+
conditions: rest[11],
|
|
50513
|
+
};
|
|
50514
|
+
}
|
|
50515
|
+
const ruleId = params.ruleId;
|
|
50516
|
+
const resourceType = params.resourceType;
|
|
50517
|
+
const name = params.name;
|
|
50518
|
+
const limit = params.limit;
|
|
50519
|
+
const interval = params.interval;
|
|
50520
|
+
const resourceId = params.resourceId;
|
|
50521
|
+
const description = params.description;
|
|
50522
|
+
const key = params.key;
|
|
50523
|
+
const strategy = params.strategy;
|
|
50524
|
+
const maxBucketSize = params.maxBucketSize;
|
|
50525
|
+
const priority = params.priority;
|
|
50526
|
+
const enabled = params.enabled;
|
|
50527
|
+
const conditions = params.conditions;
|
|
50528
|
+
if (typeof ruleId === 'undefined') {
|
|
50529
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
50530
|
+
}
|
|
50531
|
+
if (typeof resourceType === 'undefined') {
|
|
50532
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
50533
|
+
}
|
|
50534
|
+
if (typeof name === 'undefined') {
|
|
50535
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
50536
|
+
}
|
|
50537
|
+
if (typeof limit === 'undefined') {
|
|
50538
|
+
throw new AppwriteException('Missing required parameter: "limit"');
|
|
50539
|
+
}
|
|
50540
|
+
if (typeof interval === 'undefined') {
|
|
50541
|
+
throw new AppwriteException('Missing required parameter: "interval"');
|
|
50542
|
+
}
|
|
50543
|
+
const apiPath = '/waf/rules/rate-limit';
|
|
50544
|
+
const apiPayload = {};
|
|
50545
|
+
if (typeof ruleId !== 'undefined') {
|
|
50546
|
+
apiPayload['ruleId'] = ruleId;
|
|
50547
|
+
}
|
|
50548
|
+
if (typeof resourceType !== 'undefined') {
|
|
50549
|
+
apiPayload['resourceType'] = resourceType;
|
|
50550
|
+
}
|
|
50551
|
+
if (typeof resourceId !== 'undefined') {
|
|
50552
|
+
apiPayload['resourceId'] = resourceId;
|
|
50553
|
+
}
|
|
50554
|
+
if (typeof name !== 'undefined') {
|
|
50555
|
+
apiPayload['name'] = name;
|
|
50556
|
+
}
|
|
50557
|
+
if (typeof description !== 'undefined') {
|
|
50558
|
+
apiPayload['description'] = description;
|
|
48584
50559
|
}
|
|
48585
50560
|
if (typeof limit !== 'undefined') {
|
|
48586
50561
|
apiPayload['limit'] = limit;
|
|
@@ -49812,9 +51787,8 @@
|
|
|
49812
51787
|
* );
|
|
49813
51788
|
* // sub.update({ background: true }); sub.unsubscribe();
|
|
49814
51789
|
*/
|
|
49815
|
-
class Push
|
|
51790
|
+
class Push {
|
|
49816
51791
|
constructor(client) {
|
|
49817
|
-
super(client);
|
|
49818
51792
|
this.mqtt = null;
|
|
49819
51793
|
this.connecting = null;
|
|
49820
51794
|
this.Buffer = null;
|
|
@@ -49844,6 +51818,7 @@
|
|
|
49844
51818
|
this.connectedKey = '';
|
|
49845
51819
|
this.connectionEpoch = 0;
|
|
49846
51820
|
this.subscriptions = new Map();
|
|
51821
|
+
this.client = client;
|
|
49847
51822
|
}
|
|
49848
51823
|
// The broker subscription for a filter uses the highest QoS any local subscription on
|
|
49849
51824
|
// it wants, so a QoS-0 subscription never downgrades a QoS-1 one sharing the filter.
|
|
@@ -50583,6 +52558,670 @@
|
|
|
50583
52558
|
return filterParts.length === topicParts.length;
|
|
50584
52559
|
}
|
|
50585
52560
|
|
|
52561
|
+
/**
|
|
52562
|
+
* Analytics auto-tracking helpers.
|
|
52563
|
+
*
|
|
52564
|
+
* These are hand-written companions to the generated `Analytics` service.
|
|
52565
|
+
* The generated service exposes `createEvent(params)` for arbitrary events;
|
|
52566
|
+
* this module wires up common auto-tracking behaviours (pageviews, outbound
|
|
52567
|
+
* links, downloads, scroll depth, active engagement) on top of it.
|
|
52568
|
+
*
|
|
52569
|
+
* The tracking helpers accept a plain event-emitter function so they do not
|
|
52570
|
+
* hard-couple to the generated `Analytics` class. The emitter adapts this
|
|
52571
|
+
* module's option shape to `createEvent`: `url` is required there, and `props`
|
|
52572
|
+
* is a flat alternating key/value list rather than an object.
|
|
52573
|
+
*
|
|
52574
|
+
* ```ts
|
|
52575
|
+
* const analytics = new Analytics(client);
|
|
52576
|
+
* const tracking = new AnalyticsTracking(
|
|
52577
|
+
* (name, options) => analytics.createEvent({
|
|
52578
|
+
* propertyId: options?.propertyId ?? '<PROPERTY_ID>',
|
|
52579
|
+
* name,
|
|
52580
|
+
* url: options?.url ?? window.location.href,
|
|
52581
|
+
* referrer: options?.referrer,
|
|
52582
|
+
* scrollDepth: options?.scrollDepth,
|
|
52583
|
+
* engagementTime: options?.engagementTime,
|
|
52584
|
+
* props: Object.entries(options?.props ?? {}).flatMap(
|
|
52585
|
+
* ([key, value]) => [key, String(value)],
|
|
52586
|
+
* ),
|
|
52587
|
+
* }),
|
|
52588
|
+
* { propertyId: '<PROPERTY_ID>' }
|
|
52589
|
+
* );
|
|
52590
|
+
* tracking.enableAllAutoTracking();
|
|
52591
|
+
* ```
|
|
52592
|
+
*
|
|
52593
|
+
* `propertyId` is optional: when set it is merged into the options of every
|
|
52594
|
+
* emitted event, so an emitter that forwards `options.propertyId` (as above)
|
|
52595
|
+
* picks it up instead of every caller hand-rolling it into the closure.
|
|
52596
|
+
* Per-event `propertyId` always wins over the configured default.
|
|
52597
|
+
*
|
|
52598
|
+
* All helpers respect `navigator.doNotTrack === '1'` by default; opt out with
|
|
52599
|
+
* `respectDoNotTrack: false` in the constructor options.
|
|
52600
|
+
*
|
|
52601
|
+
* Engagement time follows Plausible's model: rather than one total at unload,
|
|
52602
|
+
* a delta is emitted at every natural checkpoint of the visit (tab hidden, SPA
|
|
52603
|
+
* route change, unload). See `enableAutoEngagementTime` for details.
|
|
52604
|
+
*
|
|
52605
|
+
* Auto-emitted event names follow `snake_case` + lowercase (`pageview`,
|
|
52606
|
+
* `outbound_link`, `file_download`, `screen_view`, etc.). Any prop keys use
|
|
52607
|
+
* camelCase to match the endpoint's parameter naming. Callers can pass any
|
|
52608
|
+
* custom event name; the auto-track methods only own the events they emit
|
|
52609
|
+
* themselves.
|
|
52610
|
+
*/
|
|
52611
|
+
const DEFAULT_DOWNLOAD_EXTENSIONS = [
|
|
52612
|
+
'pdf',
|
|
52613
|
+
'zip',
|
|
52614
|
+
'rar',
|
|
52615
|
+
'7z',
|
|
52616
|
+
'tar',
|
|
52617
|
+
'gz',
|
|
52618
|
+
'csv',
|
|
52619
|
+
'tsv',
|
|
52620
|
+
'xls',
|
|
52621
|
+
'xlsx',
|
|
52622
|
+
'doc',
|
|
52623
|
+
'docx',
|
|
52624
|
+
'ppt',
|
|
52625
|
+
'pptx',
|
|
52626
|
+
'dmg',
|
|
52627
|
+
'exe',
|
|
52628
|
+
'msi',
|
|
52629
|
+
'pkg',
|
|
52630
|
+
'deb',
|
|
52631
|
+
'rpm',
|
|
52632
|
+
'apk',
|
|
52633
|
+
'mp3',
|
|
52634
|
+
'wav',
|
|
52635
|
+
'flac',
|
|
52636
|
+
'mp4',
|
|
52637
|
+
'mov',
|
|
52638
|
+
'avi',
|
|
52639
|
+
'mkv',
|
|
52640
|
+
'webm',
|
|
52641
|
+
];
|
|
52642
|
+
/**
|
|
52643
|
+
* Two-part public suffixes common enough to matter for outbound-link detection.
|
|
52644
|
+
* See `rootDomain()` for why this is a short list rather than the Public Suffix
|
|
52645
|
+
* List.
|
|
52646
|
+
*/
|
|
52647
|
+
const MULTI_PART_SUFFIXES = new Set([
|
|
52648
|
+
'co.uk',
|
|
52649
|
+
'org.uk',
|
|
52650
|
+
'ac.uk',
|
|
52651
|
+
'gov.uk',
|
|
52652
|
+
'me.uk',
|
|
52653
|
+
'net.uk',
|
|
52654
|
+
'sch.uk',
|
|
52655
|
+
'co.jp',
|
|
52656
|
+
'ne.jp',
|
|
52657
|
+
'or.jp',
|
|
52658
|
+
'ac.jp',
|
|
52659
|
+
'go.jp',
|
|
52660
|
+
'com.au',
|
|
52661
|
+
'net.au',
|
|
52662
|
+
'org.au',
|
|
52663
|
+
'edu.au',
|
|
52664
|
+
'gov.au',
|
|
52665
|
+
'com.br',
|
|
52666
|
+
'net.br',
|
|
52667
|
+
'org.br',
|
|
52668
|
+
'com.cn',
|
|
52669
|
+
'net.cn',
|
|
52670
|
+
'org.cn',
|
|
52671
|
+
'gov.cn',
|
|
52672
|
+
'co.in',
|
|
52673
|
+
'net.in',
|
|
52674
|
+
'org.in',
|
|
52675
|
+
'co.nz',
|
|
52676
|
+
'net.nz',
|
|
52677
|
+
'org.nz',
|
|
52678
|
+
'co.za',
|
|
52679
|
+
'org.za',
|
|
52680
|
+
'com.mx',
|
|
52681
|
+
'com.ar',
|
|
52682
|
+
'com.co',
|
|
52683
|
+
'com.pe',
|
|
52684
|
+
'com.tr',
|
|
52685
|
+
'com.tw',
|
|
52686
|
+
'com.sg',
|
|
52687
|
+
'com.hk',
|
|
52688
|
+
'com.my',
|
|
52689
|
+
'com.ph',
|
|
52690
|
+
'com.vn',
|
|
52691
|
+
'co.kr',
|
|
52692
|
+
'co.il',
|
|
52693
|
+
'co.id',
|
|
52694
|
+
'co.th',
|
|
52695
|
+
'com.ua',
|
|
52696
|
+
'com.pl',
|
|
52697
|
+
'com.es',
|
|
52698
|
+
]);
|
|
52699
|
+
const SCROLL_DEPTH_THROTTLE_MS = 200;
|
|
52700
|
+
class AnalyticsTracking {
|
|
52701
|
+
constructor(emit, options = {}) {
|
|
52702
|
+
this.pageviewCleanups = [];
|
|
52703
|
+
this.scrollCleanups = [];
|
|
52704
|
+
this.engagementCleanups = [];
|
|
52705
|
+
this.maxScrollDepth = 0;
|
|
52706
|
+
this.scrollTicking = false;
|
|
52707
|
+
this.lastScrollReport = 0;
|
|
52708
|
+
this.engagementStart = 0;
|
|
52709
|
+
this.engagementAccumulatedMs = 0;
|
|
52710
|
+
this.engagementActive = false;
|
|
52711
|
+
this.emit = emit;
|
|
52712
|
+
this.respectDoNotTrack = options.respectDoNotTrack !== false;
|
|
52713
|
+
this.propertyId = options.propertyId;
|
|
52714
|
+
}
|
|
52715
|
+
/**
|
|
52716
|
+
* Enable the opinionated default auto-tracking set: pageviews, outbound
|
|
52717
|
+
* links, scroll depth and active engagement time. Downloads must be opted
|
|
52718
|
+
* into separately via `enableAutoDownloadTracking()` because the extension
|
|
52719
|
+
* list is application-specific.
|
|
52720
|
+
*/
|
|
52721
|
+
enableAllAutoTracking() {
|
|
52722
|
+
this.enableAutoPageviews();
|
|
52723
|
+
this.enableAutoOutboundTracking();
|
|
52724
|
+
this.enableAutoScrollDepth();
|
|
52725
|
+
this.enableAutoEngagementTime();
|
|
52726
|
+
}
|
|
52727
|
+
/**
|
|
52728
|
+
* Track an event manually. Respects the DNT setting and swallows emitter
|
|
52729
|
+
* exceptions so tracking failures never surface to the host page.
|
|
52730
|
+
*/
|
|
52731
|
+
track(name, options) {
|
|
52732
|
+
if (!this.canTrack()) {
|
|
52733
|
+
return;
|
|
52734
|
+
}
|
|
52735
|
+
try {
|
|
52736
|
+
this.emit(name, this.withPropertyId(options));
|
|
52737
|
+
}
|
|
52738
|
+
catch (error) {
|
|
52739
|
+
console.warn('AnalyticsTracking: emitter threw', error);
|
|
52740
|
+
}
|
|
52741
|
+
}
|
|
52742
|
+
/**
|
|
52743
|
+
* Convenience wrapper for pageview-shaped events.
|
|
52744
|
+
*/
|
|
52745
|
+
pageview(url, referrer) {
|
|
52746
|
+
this.track('pageview', {
|
|
52747
|
+
url: url !== null && url !== void 0 ? url : this.currentPageUrl(),
|
|
52748
|
+
referrer: referrer !== null && referrer !== void 0 ? referrer : (typeof document !== 'undefined'
|
|
52749
|
+
? document.referrer
|
|
52750
|
+
: undefined),
|
|
52751
|
+
});
|
|
52752
|
+
}
|
|
52753
|
+
/**
|
|
52754
|
+
* Enable SPA-aware pageview tracking. Fires an initial pageview on
|
|
52755
|
+
* enable, then again on every `pushState`, `replaceState`, `popstate`
|
|
52756
|
+
* or hashchange. Idempotent — repeat calls no-op.
|
|
52757
|
+
*/
|
|
52758
|
+
enableAutoPageviews() {
|
|
52759
|
+
if (this.pageviewCleanups.length > 0) {
|
|
52760
|
+
return;
|
|
52761
|
+
}
|
|
52762
|
+
if (typeof window === 'undefined' || typeof history === 'undefined') {
|
|
52763
|
+
return;
|
|
52764
|
+
}
|
|
52765
|
+
this.currentPath = this.currentPageUrl();
|
|
52766
|
+
this.pageview();
|
|
52767
|
+
const handleNavigation = () => {
|
|
52768
|
+
const nextPath = this.currentPageUrl();
|
|
52769
|
+
if (nextPath === this.currentPath) {
|
|
52770
|
+
return;
|
|
52771
|
+
}
|
|
52772
|
+
const previous = this.currentPath;
|
|
52773
|
+
this.currentPath = nextPath;
|
|
52774
|
+
this.flushScrollDepth(previous);
|
|
52775
|
+
this.flushEngagement(previous);
|
|
52776
|
+
this.pageview(nextPath);
|
|
52777
|
+
// flushEngagement no longer auto-restarts the timer (see its
|
|
52778
|
+
// implementation note re: bfcache). SPA navigation stays on the
|
|
52779
|
+
// same document, so restart engagement tracking for the new
|
|
52780
|
+
// route as long as the tab is visible.
|
|
52781
|
+
if (this.engagementCleanups.length > 0 &&
|
|
52782
|
+
(typeof document === 'undefined' ||
|
|
52783
|
+
document.visibilityState !== 'hidden')) {
|
|
52784
|
+
this.startEngagement();
|
|
52785
|
+
}
|
|
52786
|
+
};
|
|
52787
|
+
const originalPushState = history.pushState.bind(history);
|
|
52788
|
+
const originalReplaceState = history.replaceState.bind(history);
|
|
52789
|
+
// Our wrappers stay reachable after cleanup whenever another library
|
|
52790
|
+
// patched on top of ours, so they have to be switchable off rather than
|
|
52791
|
+
// merely unreferenced.
|
|
52792
|
+
let patchActive = true;
|
|
52793
|
+
const patchedPushState = (data, unused, url) => {
|
|
52794
|
+
originalPushState(data, unused, url);
|
|
52795
|
+
if (patchActive) {
|
|
52796
|
+
handleNavigation();
|
|
52797
|
+
}
|
|
52798
|
+
};
|
|
52799
|
+
const patchedReplaceState = (data, unused, url) => {
|
|
52800
|
+
originalReplaceState(data, unused, url);
|
|
52801
|
+
if (patchActive) {
|
|
52802
|
+
handleNavigation();
|
|
52803
|
+
}
|
|
52804
|
+
};
|
|
52805
|
+
history.pushState = patchedPushState;
|
|
52806
|
+
history.replaceState = patchedReplaceState;
|
|
52807
|
+
const popstateHandler = () => handleNavigation();
|
|
52808
|
+
const hashchangeHandler = () => handleNavigation();
|
|
52809
|
+
window.addEventListener('popstate', popstateHandler);
|
|
52810
|
+
window.addEventListener('hashchange', hashchangeHandler);
|
|
52811
|
+
this.pageviewCleanups.push(() => {
|
|
52812
|
+
// Only unwind our own patch. A router (Next.js App Router, React
|
|
52813
|
+
// Router, …) that patched these after us owns the current value,
|
|
52814
|
+
// and assigning our saved reference back would silently throw its
|
|
52815
|
+
// wrapper away. In that case ours stays in the chain, which is why
|
|
52816
|
+
// `patchActive` exists: the wrapper keeps delegating to the original
|
|
52817
|
+
// but stops reporting.
|
|
52818
|
+
patchActive = false;
|
|
52819
|
+
if (history.pushState === patchedPushState) {
|
|
52820
|
+
history.pushState = originalPushState;
|
|
52821
|
+
}
|
|
52822
|
+
if (history.replaceState === patchedReplaceState) {
|
|
52823
|
+
history.replaceState = originalReplaceState;
|
|
52824
|
+
}
|
|
52825
|
+
window.removeEventListener('popstate', popstateHandler);
|
|
52826
|
+
window.removeEventListener('hashchange', hashchangeHandler);
|
|
52827
|
+
});
|
|
52828
|
+
}
|
|
52829
|
+
/**
|
|
52830
|
+
* Disable auto-pageview tracking installed by `enableAutoPageviews`.
|
|
52831
|
+
* Safe to call when auto-pageviews were never enabled.
|
|
52832
|
+
*/
|
|
52833
|
+
disableAutoPageviews() {
|
|
52834
|
+
for (const cleanup of this.pageviewCleanups) {
|
|
52835
|
+
cleanup();
|
|
52836
|
+
}
|
|
52837
|
+
this.pageviewCleanups = [];
|
|
52838
|
+
}
|
|
52839
|
+
/**
|
|
52840
|
+
* Enable click-based outbound link tracking. Detects anchor clicks that
|
|
52841
|
+
* navigate to a different origin and fires an `outbound_link` event
|
|
52842
|
+
* (with `hostname` and `href` props) before the browser navigates.
|
|
52843
|
+
*/
|
|
52844
|
+
enableAutoOutboundTracking(options = {}) {
|
|
52845
|
+
if (this.outboundCleanup) {
|
|
52846
|
+
return;
|
|
52847
|
+
}
|
|
52848
|
+
if (typeof document === 'undefined') {
|
|
52849
|
+
return;
|
|
52850
|
+
}
|
|
52851
|
+
const includeSubdomains = options.includeSubdomains === true;
|
|
52852
|
+
const clickHandler = (event) => {
|
|
52853
|
+
const anchor = this.findAnchor(event.target);
|
|
52854
|
+
if (!anchor || !anchor.href) {
|
|
52855
|
+
return;
|
|
52856
|
+
}
|
|
52857
|
+
const target = this.parseUrl(anchor.href);
|
|
52858
|
+
if (!target || !this.isExternal(target, includeSubdomains)) {
|
|
52859
|
+
return;
|
|
52860
|
+
}
|
|
52861
|
+
this.track('outbound_link', {
|
|
52862
|
+
url: target.href,
|
|
52863
|
+
props: { hostname: target.hostname, href: target.href },
|
|
52864
|
+
});
|
|
52865
|
+
};
|
|
52866
|
+
document.addEventListener('click', clickHandler, { capture: true });
|
|
52867
|
+
this.outboundCleanup = () => document.removeEventListener('click', clickHandler, {
|
|
52868
|
+
capture: true,
|
|
52869
|
+
});
|
|
52870
|
+
}
|
|
52871
|
+
/**
|
|
52872
|
+
* Disable outbound-link tracking installed by `enableAutoOutboundTracking`.
|
|
52873
|
+
* Safe to call when auto-outbound was never enabled.
|
|
52874
|
+
*/
|
|
52875
|
+
disableAutoOutboundTracking() {
|
|
52876
|
+
if (this.outboundCleanup) {
|
|
52877
|
+
this.outboundCleanup();
|
|
52878
|
+
this.outboundCleanup = undefined;
|
|
52879
|
+
}
|
|
52880
|
+
}
|
|
52881
|
+
/**
|
|
52882
|
+
* Enable click-based download tracking. Detects anchor clicks that point
|
|
52883
|
+
* at a file whose extension appears in the configured list and fires a
|
|
52884
|
+
* `file_download` event with `filename`, `extension` and `href` props.
|
|
52885
|
+
*/
|
|
52886
|
+
enableAutoDownloadTracking(options = {}) {
|
|
52887
|
+
var _a;
|
|
52888
|
+
if (this.downloadCleanup) {
|
|
52889
|
+
return;
|
|
52890
|
+
}
|
|
52891
|
+
if (typeof document === 'undefined') {
|
|
52892
|
+
return;
|
|
52893
|
+
}
|
|
52894
|
+
const extensions = ((_a = options.extensions) !== null && _a !== void 0 ? _a : DEFAULT_DOWNLOAD_EXTENSIONS).map((ext) => ext.toLowerCase().replace(/^\./, ''));
|
|
52895
|
+
const extensionSet = new Set(extensions);
|
|
52896
|
+
const clickHandler = (event) => {
|
|
52897
|
+
var _a, _b;
|
|
52898
|
+
const anchor = this.findAnchor(event.target);
|
|
52899
|
+
if (!anchor || !anchor.href) {
|
|
52900
|
+
return;
|
|
52901
|
+
}
|
|
52902
|
+
const url = this.parseUrl(anchor.href);
|
|
52903
|
+
if (!url) {
|
|
52904
|
+
return;
|
|
52905
|
+
}
|
|
52906
|
+
const filename = (_a = url.pathname.split('/').pop()) !== null && _a !== void 0 ? _a : '';
|
|
52907
|
+
const extension = filename.includes('.')
|
|
52908
|
+
? (_b = filename.split('.').pop()) === null || _b === void 0 ? void 0 : _b.toLowerCase()
|
|
52909
|
+
: undefined;
|
|
52910
|
+
if (!extension || !extensionSet.has(extension)) {
|
|
52911
|
+
return;
|
|
52912
|
+
}
|
|
52913
|
+
this.track('file_download', {
|
|
52914
|
+
url: url.href,
|
|
52915
|
+
props: { filename, extension, href: url.href },
|
|
52916
|
+
});
|
|
52917
|
+
};
|
|
52918
|
+
document.addEventListener('click', clickHandler, { capture: true });
|
|
52919
|
+
this.downloadCleanup = () => document.removeEventListener('click', clickHandler, {
|
|
52920
|
+
capture: true,
|
|
52921
|
+
});
|
|
52922
|
+
}
|
|
52923
|
+
/**
|
|
52924
|
+
* Disable file-download tracking installed by `enableAutoDownloadTracking`.
|
|
52925
|
+
* Safe to call when auto-download was never enabled.
|
|
52926
|
+
*/
|
|
52927
|
+
disableAutoDownloadTracking() {
|
|
52928
|
+
if (this.downloadCleanup) {
|
|
52929
|
+
this.downloadCleanup();
|
|
52930
|
+
this.downloadCleanup = undefined;
|
|
52931
|
+
}
|
|
52932
|
+
}
|
|
52933
|
+
/**
|
|
52934
|
+
* Enable passive scroll-depth tracking. Records the maximum percent of the
|
|
52935
|
+
* document scrolled and reports it on `beforeunload` and on SPA route
|
|
52936
|
+
* changes. Uses a throttled passive listener so it is safe on hot paths.
|
|
52937
|
+
*/
|
|
52938
|
+
enableAutoScrollDepth() {
|
|
52939
|
+
if (this.scrollCleanups.length > 0) {
|
|
52940
|
+
return;
|
|
52941
|
+
}
|
|
52942
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
52943
|
+
return;
|
|
52944
|
+
}
|
|
52945
|
+
this.maxScrollDepth = 0;
|
|
52946
|
+
this.lastScrollReport = 0;
|
|
52947
|
+
const scrollHandler = () => {
|
|
52948
|
+
if (this.scrollTicking) {
|
|
52949
|
+
return;
|
|
52950
|
+
}
|
|
52951
|
+
this.scrollTicking = true;
|
|
52952
|
+
window.requestAnimationFrame(() => {
|
|
52953
|
+
const now = Date.now();
|
|
52954
|
+
if (now - this.lastScrollReport < SCROLL_DEPTH_THROTTLE_MS) {
|
|
52955
|
+
this.scrollTicking = false;
|
|
52956
|
+
return;
|
|
52957
|
+
}
|
|
52958
|
+
this.lastScrollReport = now;
|
|
52959
|
+
const depth = this.computeScrollDepth();
|
|
52960
|
+
if (depth > this.maxScrollDepth) {
|
|
52961
|
+
this.maxScrollDepth = depth;
|
|
52962
|
+
}
|
|
52963
|
+
this.scrollTicking = false;
|
|
52964
|
+
});
|
|
52965
|
+
};
|
|
52966
|
+
const unloadHandler = () => {
|
|
52967
|
+
this.flushScrollDepth(this.currentPageUrl());
|
|
52968
|
+
};
|
|
52969
|
+
window.addEventListener('scroll', scrollHandler, { passive: true });
|
|
52970
|
+
window.addEventListener('beforeunload', unloadHandler);
|
|
52971
|
+
window.addEventListener('pagehide', unloadHandler);
|
|
52972
|
+
this.scrollCleanups.push(() => {
|
|
52973
|
+
window.removeEventListener('scroll', scrollHandler);
|
|
52974
|
+
window.removeEventListener('beforeunload', unloadHandler);
|
|
52975
|
+
window.removeEventListener('pagehide', unloadHandler);
|
|
52976
|
+
});
|
|
52977
|
+
}
|
|
52978
|
+
/**
|
|
52979
|
+
* Disable scroll-depth tracking installed by `enableAutoScrollDepth`. Safe
|
|
52980
|
+
* to call when auto-scroll-depth was never enabled. Any accumulated depth
|
|
52981
|
+
* for the current page is dropped.
|
|
52982
|
+
*/
|
|
52983
|
+
disableAutoScrollDepth() {
|
|
52984
|
+
for (const cleanup of this.scrollCleanups) {
|
|
52985
|
+
cleanup();
|
|
52986
|
+
}
|
|
52987
|
+
this.scrollCleanups = [];
|
|
52988
|
+
this.maxScrollDepth = 0;
|
|
52989
|
+
this.scrollTicking = false;
|
|
52990
|
+
this.lastScrollReport = 0;
|
|
52991
|
+
}
|
|
52992
|
+
/**
|
|
52993
|
+
* Enable active engagement-time tracking. Counts time the tab is visible
|
|
52994
|
+
* and uses `visibilitychange` to exclude background time.
|
|
52995
|
+
*
|
|
52996
|
+
* Delivery follows Plausible's model rather than a single total at the
|
|
52997
|
+
* end of the visit: an `engagement_time` event is emitted at every natural
|
|
52998
|
+
* checkpoint — the tab going hidden, an SPA route change, and finally
|
|
52999
|
+
* `beforeunload`/`pagehide`. Unload is kept only as a best-effort last
|
|
53000
|
+
* flush; it is the least reliable moment to send anything (browsers
|
|
53001
|
+
* routinely cancel in-flight requests there, and `sendBeacon` cannot set
|
|
53002
|
+
* the `X-Appwrite-Project` header the endpoint requires), so it must never
|
|
53003
|
+
* be the only delivery.
|
|
53004
|
+
*
|
|
53005
|
+
* Each event carries a **delta** — the seconds accrued since the previous
|
|
53006
|
+
* flush, not a running total — so the values are additive per session and
|
|
53007
|
+
* a lost event costs only its own slice.
|
|
53008
|
+
*
|
|
53009
|
+
* There is deliberately no periodic ping. The cadence is driven by
|
|
53010
|
+
* navigation and tab switches, so request volume tracks what the visitor
|
|
53011
|
+
* actually does instead of multiplying with time on page.
|
|
53012
|
+
*/
|
|
53013
|
+
enableAutoEngagementTime() {
|
|
53014
|
+
if (this.engagementCleanups.length > 0) {
|
|
53015
|
+
return;
|
|
53016
|
+
}
|
|
53017
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
53018
|
+
return;
|
|
53019
|
+
}
|
|
53020
|
+
this.engagementAccumulatedMs = 0;
|
|
53021
|
+
// Do not start the clock for a tab that is already hidden (prerender,
|
|
53022
|
+
// background tab restore); `visibilitychange` starts it when it is
|
|
53023
|
+
// actually looked at.
|
|
53024
|
+
if (document.visibilityState !== 'hidden') {
|
|
53025
|
+
this.startEngagement();
|
|
53026
|
+
}
|
|
53027
|
+
const visibilityHandler = () => {
|
|
53028
|
+
if (document.visibilityState === 'hidden') {
|
|
53029
|
+
// Flush, don't just pause. The page is still fully alive here,
|
|
53030
|
+
// which makes this the most reliable delivery point in the
|
|
53031
|
+
// whole visit — and it is the same moment Plausible reports on.
|
|
53032
|
+
this.flushEngagement(this.currentPageUrl());
|
|
53033
|
+
}
|
|
53034
|
+
else if (document.visibilityState === 'visible') {
|
|
53035
|
+
this.startEngagement();
|
|
53036
|
+
}
|
|
53037
|
+
};
|
|
53038
|
+
const unloadHandler = () => {
|
|
53039
|
+
this.flushEngagement(this.currentPageUrl());
|
|
53040
|
+
};
|
|
53041
|
+
const pageshowHandler = (event) => {
|
|
53042
|
+
// When the page is restored from the back-forward cache the
|
|
53043
|
+
// engagement timer is in a stopped state (flushEngagement paused
|
|
53044
|
+
// it on pagehide and does not auto-restart). Kick off a fresh
|
|
53045
|
+
// engagementStart so bfcache dwell time is not billed as
|
|
53046
|
+
// engagement.
|
|
53047
|
+
if (event.persisted) {
|
|
53048
|
+
this.startEngagement();
|
|
53049
|
+
}
|
|
53050
|
+
};
|
|
53051
|
+
document.addEventListener('visibilitychange', visibilityHandler);
|
|
53052
|
+
window.addEventListener('beforeunload', unloadHandler);
|
|
53053
|
+
window.addEventListener('pagehide', unloadHandler);
|
|
53054
|
+
window.addEventListener('pageshow', pageshowHandler);
|
|
53055
|
+
this.engagementCleanups.push(() => {
|
|
53056
|
+
document.removeEventListener('visibilitychange', visibilityHandler);
|
|
53057
|
+
window.removeEventListener('beforeunload', unloadHandler);
|
|
53058
|
+
window.removeEventListener('pagehide', unloadHandler);
|
|
53059
|
+
window.removeEventListener('pageshow', pageshowHandler);
|
|
53060
|
+
});
|
|
53061
|
+
}
|
|
53062
|
+
/**
|
|
53063
|
+
* Disable engagement-time tracking installed by `enableAutoEngagementTime`.
|
|
53064
|
+
* Safe to call when auto-engagement was never enabled. Any accumulated
|
|
53065
|
+
* engagement time is dropped without being emitted.
|
|
53066
|
+
*/
|
|
53067
|
+
disableAutoEngagementTime() {
|
|
53068
|
+
for (const cleanup of this.engagementCleanups) {
|
|
53069
|
+
cleanup();
|
|
53070
|
+
}
|
|
53071
|
+
this.engagementCleanups = [];
|
|
53072
|
+
this.engagementActive = false;
|
|
53073
|
+
this.engagementAccumulatedMs = 0;
|
|
53074
|
+
this.engagementStart = 0;
|
|
53075
|
+
}
|
|
53076
|
+
/**
|
|
53077
|
+
* Merge the configured `propertyId` into an event's options. Returns the
|
|
53078
|
+
* caller's object untouched when no default is configured (or the event
|
|
53079
|
+
* already carries one), so emitters written against the pre-`propertyId`
|
|
53080
|
+
* shape keep receiving exactly what they received before.
|
|
53081
|
+
*/
|
|
53082
|
+
withPropertyId(options) {
|
|
53083
|
+
if (this.propertyId === undefined ||
|
|
53084
|
+
(options === null || options === void 0 ? void 0 : options.propertyId) !== undefined) {
|
|
53085
|
+
return options;
|
|
53086
|
+
}
|
|
53087
|
+
return Object.assign(Object.assign({}, (options !== null && options !== void 0 ? options : {})), { propertyId: this.propertyId });
|
|
53088
|
+
}
|
|
53089
|
+
canTrack() {
|
|
53090
|
+
if (!this.respectDoNotTrack) {
|
|
53091
|
+
return true;
|
|
53092
|
+
}
|
|
53093
|
+
if (typeof navigator === 'undefined') {
|
|
53094
|
+
return true;
|
|
53095
|
+
}
|
|
53096
|
+
return navigator.doNotTrack !== '1';
|
|
53097
|
+
}
|
|
53098
|
+
currentPageUrl() {
|
|
53099
|
+
if (typeof window === 'undefined' || !window.location) {
|
|
53100
|
+
return '';
|
|
53101
|
+
}
|
|
53102
|
+
return window.location.href;
|
|
53103
|
+
}
|
|
53104
|
+
findAnchor(target) {
|
|
53105
|
+
let node = target;
|
|
53106
|
+
while (node) {
|
|
53107
|
+
if (node.tagName === 'A') {
|
|
53108
|
+
return node;
|
|
53109
|
+
}
|
|
53110
|
+
node = node.parentNode;
|
|
53111
|
+
}
|
|
53112
|
+
return null;
|
|
53113
|
+
}
|
|
53114
|
+
parseUrl(href) {
|
|
53115
|
+
try {
|
|
53116
|
+
return new URL(href, window.location.href);
|
|
53117
|
+
}
|
|
53118
|
+
catch (_a) {
|
|
53119
|
+
return null;
|
|
53120
|
+
}
|
|
53121
|
+
}
|
|
53122
|
+
isExternal(target, includeSubdomains) {
|
|
53123
|
+
if (target.protocol !== 'http:' && target.protocol !== 'https:') {
|
|
53124
|
+
return false;
|
|
53125
|
+
}
|
|
53126
|
+
if (target.hostname === window.location.hostname) {
|
|
53127
|
+
return false;
|
|
53128
|
+
}
|
|
53129
|
+
if (includeSubdomains) {
|
|
53130
|
+
return true;
|
|
53131
|
+
}
|
|
53132
|
+
const root = this.rootDomain(window.location.hostname);
|
|
53133
|
+
return this.rootDomain(target.hostname) !== root;
|
|
53134
|
+
}
|
|
53135
|
+
rootDomain(hostname) {
|
|
53136
|
+
const parts = hostname.split('.');
|
|
53137
|
+
if (parts.length <= 2) {
|
|
53138
|
+
return hostname;
|
|
53139
|
+
}
|
|
53140
|
+
// Taking the last two labels is wrong wherever the registry sells names
|
|
53141
|
+
// one level down: `shop.example.co.uk` and `google.co.uk` both reduce to
|
|
53142
|
+
// `co.uk`, so every outbound click between two `.co.uk` sites looks
|
|
53143
|
+
// internal and is dropped. Take three labels after a known two-part
|
|
53144
|
+
// suffix instead.
|
|
53145
|
+
//
|
|
53146
|
+
// This is a heuristic, not the Public Suffix List — the full list is
|
|
53147
|
+
// orders of magnitude larger than this whole file, and a tracking
|
|
53148
|
+
// snippet cannot carry it. Sites on a suffix that is missing here can
|
|
53149
|
+
// pass `includeSubdomains: true` to treat every other host as outbound.
|
|
53150
|
+
const suffix = parts.slice(-2).join('.');
|
|
53151
|
+
if (parts.length > 2 && MULTI_PART_SUFFIXES.has(suffix)) {
|
|
53152
|
+
return parts.slice(-3).join('.');
|
|
53153
|
+
}
|
|
53154
|
+
return suffix;
|
|
53155
|
+
}
|
|
53156
|
+
computeScrollDepth() {
|
|
53157
|
+
const scrollTop = window.scrollY || document.documentElement.scrollTop;
|
|
53158
|
+
const viewport = window.innerHeight || document.documentElement.clientHeight;
|
|
53159
|
+
const total = document.documentElement.scrollHeight;
|
|
53160
|
+
if (total <= viewport) {
|
|
53161
|
+
return 100;
|
|
53162
|
+
}
|
|
53163
|
+
const depth = Math.round(((scrollTop + viewport) / total) * 100);
|
|
53164
|
+
return Math.max(0, Math.min(100, depth));
|
|
53165
|
+
}
|
|
53166
|
+
flushScrollDepth(url) {
|
|
53167
|
+
if (this.scrollCleanups.length === 0) {
|
|
53168
|
+
return;
|
|
53169
|
+
}
|
|
53170
|
+
if (this.maxScrollDepth <= 0) {
|
|
53171
|
+
return;
|
|
53172
|
+
}
|
|
53173
|
+
this.track('scroll_depth', {
|
|
53174
|
+
url,
|
|
53175
|
+
scrollDepth: this.maxScrollDepth,
|
|
53176
|
+
});
|
|
53177
|
+
this.maxScrollDepth = 0;
|
|
53178
|
+
}
|
|
53179
|
+
startEngagement() {
|
|
53180
|
+
if (this.engagementActive) {
|
|
53181
|
+
return;
|
|
53182
|
+
}
|
|
53183
|
+
this.engagementActive = true;
|
|
53184
|
+
this.engagementStart = Date.now();
|
|
53185
|
+
}
|
|
53186
|
+
pauseEngagement() {
|
|
53187
|
+
if (!this.engagementActive) {
|
|
53188
|
+
return;
|
|
53189
|
+
}
|
|
53190
|
+
this.engagementActive = false;
|
|
53191
|
+
this.engagementAccumulatedMs += Date.now() - this.engagementStart;
|
|
53192
|
+
}
|
|
53193
|
+
flushEngagement(url) {
|
|
53194
|
+
if (this.engagementCleanups.length === 0) {
|
|
53195
|
+
return;
|
|
53196
|
+
}
|
|
53197
|
+
this.pauseEngagement();
|
|
53198
|
+
// Deltas, not a running total: emit only what accrued since the last
|
|
53199
|
+
// flush. `floor` plus keeping the sub-second remainder in the
|
|
53200
|
+
// accumulator is what makes repeated flushes safe — nothing is emitted
|
|
53201
|
+
// twice, and a visit chopped into many short segments does not lose a
|
|
53202
|
+
// fraction of a second to rounding on every one of them.
|
|
53203
|
+
const seconds = Math.floor(this.engagementAccumulatedMs / 1000);
|
|
53204
|
+
if (seconds > 0) {
|
|
53205
|
+
// Deduct before emitting so a synchronous emitter that re-enters
|
|
53206
|
+
// (or throws) can never bill the same seconds again.
|
|
53207
|
+
this.engagementAccumulatedMs -= seconds * 1000;
|
|
53208
|
+
this.track('engagement_time', {
|
|
53209
|
+
url,
|
|
53210
|
+
engagementTime: seconds,
|
|
53211
|
+
});
|
|
53212
|
+
}
|
|
53213
|
+
// NOTE: intentionally do NOT call startEngagement() here. flushEngagement
|
|
53214
|
+
// runs on `pagehide`, which is also the last hook before the browser
|
|
53215
|
+
// may freeze the page into the back-forward cache. Auto-restarting
|
|
53216
|
+
// would snapshot engagementStart just before the freeze; the next
|
|
53217
|
+
// pauseEngagement (after bfcache restore) would then bill the entire
|
|
53218
|
+
// bfcache dwell as active engagement. Restart is driven by explicit
|
|
53219
|
+
// resume signals: `pageshow` (with `persisted === true`),
|
|
53220
|
+
// `visibilitychange` back to visible, or the SPA navigation flow in
|
|
53221
|
+
// `enableAutoPageviews`.
|
|
53222
|
+
}
|
|
53223
|
+
}
|
|
53224
|
+
|
|
50586
53225
|
/**
|
|
50587
53226
|
* Helper class to generate permission strings for resources.
|
|
50588
53227
|
*/
|
|
@@ -51289,6 +53928,68 @@
|
|
|
51289
53928
|
OAuthProvider["Zoom"] = "zoom";
|
|
51290
53929
|
})(exports.OAuthProvider || (exports.OAuthProvider = {}));
|
|
51291
53930
|
|
|
53931
|
+
exports.PlatformResourceType = void 0;
|
|
53932
|
+
(function (PlatformResourceType) {
|
|
53933
|
+
PlatformResourceType["Projects"] = "projects";
|
|
53934
|
+
PlatformResourceType["Organizations"] = "organizations";
|
|
53935
|
+
PlatformResourceType["Users"] = "users";
|
|
53936
|
+
PlatformResourceType["Memberships"] = "memberships";
|
|
53937
|
+
PlatformResourceType["Rules"] = "rules";
|
|
53938
|
+
PlatformResourceType["Keys"] = "keys";
|
|
53939
|
+
PlatformResourceType["Platforms"] = "platforms";
|
|
53940
|
+
PlatformResourceType["Webhooks"] = "webhooks";
|
|
53941
|
+
PlatformResourceType["Certificates"] = "certificates";
|
|
53942
|
+
})(exports.PlatformResourceType || (exports.PlatformResourceType = {}));
|
|
53943
|
+
|
|
53944
|
+
exports.ProjectResourceType = void 0;
|
|
53945
|
+
(function (ProjectResourceType) {
|
|
53946
|
+
ProjectResourceType["Users"] = "users";
|
|
53947
|
+
ProjectResourceType["Teams"] = "teams";
|
|
53948
|
+
ProjectResourceType["Memberships"] = "memberships";
|
|
53949
|
+
ProjectResourceType["Databases"] = "databases";
|
|
53950
|
+
ProjectResourceType["Buckets"] = "buckets";
|
|
53951
|
+
ProjectResourceType["Functions"] = "functions";
|
|
53952
|
+
ProjectResourceType["Sites"] = "sites";
|
|
53953
|
+
ProjectResourceType["Deployments"] = "deployments";
|
|
53954
|
+
ProjectResourceType["Topics"] = "topics";
|
|
53955
|
+
ProjectResourceType["Providers"] = "providers";
|
|
53956
|
+
ProjectResourceType["Messages"] = "messages";
|
|
53957
|
+
})(exports.ProjectResourceType || (exports.ProjectResourceType = {}));
|
|
53958
|
+
|
|
53959
|
+
exports.AnalyticsInterval = void 0;
|
|
53960
|
+
(function (AnalyticsInterval) {
|
|
53961
|
+
AnalyticsInterval["OneHour"] = "1h";
|
|
53962
|
+
AnalyticsInterval["OneDay"] = "1d";
|
|
53963
|
+
AnalyticsInterval["OneWeek"] = "1w";
|
|
53964
|
+
AnalyticsInterval["OneMonth"] = "1m";
|
|
53965
|
+
})(exports.AnalyticsInterval || (exports.AnalyticsInterval = {}));
|
|
53966
|
+
|
|
53967
|
+
exports.AnalyticsDimension = void 0;
|
|
53968
|
+
(function (AnalyticsDimension) {
|
|
53969
|
+
AnalyticsDimension["Country"] = "country";
|
|
53970
|
+
AnalyticsDimension["Region"] = "region";
|
|
53971
|
+
AnalyticsDimension["City"] = "city";
|
|
53972
|
+
AnalyticsDimension["Browser"] = "browser";
|
|
53973
|
+
AnalyticsDimension["OperatingSystem"] = "operatingSystem";
|
|
53974
|
+
AnalyticsDimension["Device"] = "device";
|
|
53975
|
+
AnalyticsDimension["ScreenSize"] = "screenSize";
|
|
53976
|
+
AnalyticsDimension["ReferrerSource"] = "referrerSource";
|
|
53977
|
+
AnalyticsDimension["Channel"] = "channel";
|
|
53978
|
+
AnalyticsDimension["UtmSource"] = "utmSource";
|
|
53979
|
+
AnalyticsDimension["UtmMedium"] = "utmMedium";
|
|
53980
|
+
AnalyticsDimension["UtmCampaign"] = "utmCampaign";
|
|
53981
|
+
AnalyticsDimension["UtmContent"] = "utmContent";
|
|
53982
|
+
AnalyticsDimension["UtmTerm"] = "utmTerm";
|
|
53983
|
+
AnalyticsDimension["Page"] = "page";
|
|
53984
|
+
AnalyticsDimension["Hostname"] = "hostname";
|
|
53985
|
+
AnalyticsDimension["EntryPage"] = "entryPage";
|
|
53986
|
+
AnalyticsDimension["ExitPage"] = "exitPage";
|
|
53987
|
+
AnalyticsDimension["TrafficType"] = "trafficType";
|
|
53988
|
+
AnalyticsDimension["BotName"] = "botName";
|
|
53989
|
+
AnalyticsDimension["BotCategory"] = "botCategory";
|
|
53990
|
+
AnalyticsDimension["EventName"] = "eventName";
|
|
53991
|
+
})(exports.AnalyticsDimension || (exports.AnalyticsDimension = {}));
|
|
53992
|
+
|
|
51292
53993
|
exports.Browser = void 0;
|
|
51293
53994
|
(function (Browser) {
|
|
51294
53995
|
Browser["AvantBrowser"] = "aa";
|
|
@@ -52104,6 +54805,14 @@
|
|
|
52104
54805
|
QuerySuggestionResource["ResourceTokens"] = "resourcetokens";
|
|
52105
54806
|
QuerySuggestionResource["Transactions"] = "transactions";
|
|
52106
54807
|
QuerySuggestionResource["TransactionLogs"] = "transactionlogs";
|
|
54808
|
+
QuerySuggestionResource["Videos"] = "videos";
|
|
54809
|
+
QuerySuggestionResource["VideosPreviews"] = "videos_previews";
|
|
54810
|
+
QuerySuggestionResource["VideosRenditions"] = "videos_renditions";
|
|
54811
|
+
QuerySuggestionResource["VideosRenditionsSegments"] = "videos_renditions_segments";
|
|
54812
|
+
QuerySuggestionResource["VideosProfiles"] = "videos_profiles";
|
|
54813
|
+
QuerySuggestionResource["VideosSubtitles"] = "videos_subtitles";
|
|
54814
|
+
QuerySuggestionResource["VideosSubtitlesSegments"] = "videos_subtitles_segments";
|
|
54815
|
+
QuerySuggestionResource["AnalyticsProperties"] = "analyticsproperties";
|
|
52107
54816
|
QuerySuggestionResource["DedicatedDatabases"] = "dedicateddatabases";
|
|
52108
54817
|
QuerySuggestionResource["DedicatedDatabaseConfigs"] = "dedicateddatabaseconfigs";
|
|
52109
54818
|
QuerySuggestionResource["DedicatedDatabaseRuntimes"] = "dedicateddatabaseruntimes";
|
|
@@ -52526,6 +55235,8 @@
|
|
|
52526
55235
|
ProjectKeyScopes["ReportsWrite"] = "reports.write";
|
|
52527
55236
|
ProjectKeyScopes["PresencesRead"] = "presences.read";
|
|
52528
55237
|
ProjectKeyScopes["PresencesWrite"] = "presences.write";
|
|
55238
|
+
ProjectKeyScopes["VideosRead"] = "videos.read";
|
|
55239
|
+
ProjectKeyScopes["VideosWrite"] = "videos.write";
|
|
52529
55240
|
ProjectKeyScopes["DedicatedDatabasesExecute"] = "dedicatedDatabases.execute";
|
|
52530
55241
|
ProjectKeyScopes["BackupsPoliciesRead"] = "backups.policies.read";
|
|
52531
55242
|
ProjectKeyScopes["BackupsPoliciesWrite"] = "backups.policies.write";
|
|
@@ -52544,6 +55255,8 @@
|
|
|
52544
55255
|
ProjectKeyScopes["Oauth2Read"] = "oauth2.read";
|
|
52545
55256
|
ProjectKeyScopes["Oauth2Write"] = "oauth2.write";
|
|
52546
55257
|
ProjectKeyScopes["Oauth2Introspect"] = "oauth2.introspect";
|
|
55258
|
+
ProjectKeyScopes["AnalyticsRead"] = "analytics.read";
|
|
55259
|
+
ProjectKeyScopes["AnalyticsWrite"] = "analytics.write";
|
|
52547
55260
|
})(exports.ProjectKeyScopes || (exports.ProjectKeyScopes = {}));
|
|
52548
55261
|
|
|
52549
55262
|
exports.FunctionTemplateUseCase = void 0;
|
|
@@ -52793,6 +55506,7 @@
|
|
|
52793
55506
|
ProjectAuthMethodId["Invites"] = "invites";
|
|
52794
55507
|
ProjectAuthMethodId["Jwt"] = "jwt";
|
|
52795
55508
|
ProjectAuthMethodId["Phone"] = "phone";
|
|
55509
|
+
ProjectAuthMethodId["Passkey"] = "passkey";
|
|
52796
55510
|
})(exports.ProjectAuthMethodId || (exports.ProjectAuthMethodId = {}));
|
|
52797
55511
|
|
|
52798
55512
|
exports.ProjectOAuth2Auth0Prompt = void 0;
|
|
@@ -52934,6 +55648,7 @@
|
|
|
52934
55648
|
ProjectPolicyId["Denydisposableemail"] = "deny-disposable-email";
|
|
52935
55649
|
ProjectPolicyId["Denyfreeemail"] = "deny-free-email";
|
|
52936
55650
|
ProjectPolicyId["Denycorporateemail"] = "deny-corporate-email";
|
|
55651
|
+
ProjectPolicyId["Passkey"] = "passkey";
|
|
52937
55652
|
})(exports.ProjectPolicyId || (exports.ProjectPolicyId = {}));
|
|
52938
55653
|
|
|
52939
55654
|
exports.ProjectProtocolId = void 0;
|
|
@@ -53178,6 +55893,9 @@
|
|
|
53178
55893
|
|
|
53179
55894
|
exports.UsageEventMetric = void 0;
|
|
53180
55895
|
(function (UsageEventMetric) {
|
|
55896
|
+
UsageEventMetric["AnalyticsEvents"] = "analytics.events";
|
|
55897
|
+
UsageEventMetric["AnalyticsPageviews"] = "analytics.pageviews";
|
|
55898
|
+
UsageEventMetric["AnalyticsBotsEvents"] = "analytics.bots.events";
|
|
53181
55899
|
UsageEventMetric["NetworkRequests"] = "network.requests";
|
|
53182
55900
|
UsageEventMetric["NetworkInbound"] = "network.inbound";
|
|
53183
55901
|
UsageEventMetric["NetworkOutbound"] = "network.outbound";
|
|
@@ -53295,6 +56013,7 @@
|
|
|
53295
56013
|
|
|
53296
56014
|
exports.UsageGaugeMetric = void 0;
|
|
53297
56015
|
(function (UsageGaugeMetric) {
|
|
56016
|
+
UsageGaugeMetric["AnalyticsProperties"] = "analytics.properties";
|
|
53298
56017
|
UsageGaugeMetric["Teams"] = "teams";
|
|
53299
56018
|
UsageGaugeMetric["Users"] = "users";
|
|
53300
56019
|
UsageGaugeMetric["Messages"] = "messages";
|
|
@@ -53392,6 +56111,24 @@
|
|
|
53392
56111
|
VectorsDBIndexType["Unique"] = "unique";
|
|
53393
56112
|
})(exports.VectorsDBIndexType || (exports.VectorsDBIndexType = {}));
|
|
53394
56113
|
|
|
56114
|
+
exports.VideoOutput = void 0;
|
|
56115
|
+
(function (VideoOutput) {
|
|
56116
|
+
VideoOutput["Hls"] = "hls";
|
|
56117
|
+
VideoOutput["Dash"] = "dash";
|
|
56118
|
+
VideoOutput["Cmaf"] = "cmaf";
|
|
56119
|
+
})(exports.VideoOutput || (exports.VideoOutput = {}));
|
|
56120
|
+
|
|
56121
|
+
exports.VideoRenditionStatus = void 0;
|
|
56122
|
+
(function (VideoRenditionStatus) {
|
|
56123
|
+
VideoRenditionStatus["Pending"] = "pending";
|
|
56124
|
+
VideoRenditionStatus["Started"] = "started";
|
|
56125
|
+
VideoRenditionStatus["Ended"] = "ended";
|
|
56126
|
+
VideoRenditionStatus["Uploading"] = "uploading";
|
|
56127
|
+
VideoRenditionStatus["Ready"] = "ready";
|
|
56128
|
+
VideoRenditionStatus["Error"] = "error";
|
|
56129
|
+
VideoRenditionStatus["Aborted"] = "aborted";
|
|
56130
|
+
})(exports.VideoRenditionStatus || (exports.VideoRenditionStatus = {}));
|
|
56131
|
+
|
|
53395
56132
|
exports.DatabaseType = void 0;
|
|
53396
56133
|
(function (DatabaseType) {
|
|
53397
56134
|
DatabaseType["Legacy"] = "legacy";
|
|
@@ -53570,6 +56307,7 @@
|
|
|
53570
56307
|
(function (ProxyRuleDeploymentResourceType) {
|
|
53571
56308
|
ProxyRuleDeploymentResourceType["Function"] = "function";
|
|
53572
56309
|
ProxyRuleDeploymentResourceType["Site"] = "site";
|
|
56310
|
+
ProxyRuleDeploymentResourceType["DedicatedDatabase"] = "dedicatedDatabase";
|
|
53573
56311
|
})(exports.ProxyRuleDeploymentResourceType || (exports.ProxyRuleDeploymentResourceType = {}));
|
|
53574
56312
|
|
|
53575
56313
|
exports.ProxyRuleStatus = void 0;
|
|
@@ -55649,8 +58387,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
55649
58387
|
|
|
55650
58388
|
exports.Account = Account;
|
|
55651
58389
|
exports.Activities = Activities;
|
|
58390
|
+
exports.Admin = Admin;
|
|
55652
58391
|
exports.Advisor = Advisor;
|
|
55653
58392
|
exports.Affiliates = Affiliates;
|
|
58393
|
+
exports.Analytics = Analytics;
|
|
58394
|
+
exports.AnalyticsTracking = AnalyticsTracking;
|
|
55654
58395
|
exports.Apps = Apps;
|
|
55655
58396
|
exports.AppwriteException = AppwriteException;
|
|
55656
58397
|
exports.Assistant = Assistant;
|
|
@@ -55699,6 +58440,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
55699
58440
|
exports.Users = Users;
|
|
55700
58441
|
exports.Vcs = Vcs;
|
|
55701
58442
|
exports.VectorsDB = VectorsDB;
|
|
58443
|
+
exports.Videos = Videos;
|
|
55702
58444
|
exports.Waf = Waf;
|
|
55703
58445
|
exports.Webhooks = Webhooks;
|
|
55704
58446
|
|