@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/esm/sdk.js
CHANGED
|
@@ -667,7 +667,7 @@ class Client {
|
|
|
667
667
|
'x-sdk-name': 'Console',
|
|
668
668
|
'x-sdk-platform': 'console',
|
|
669
669
|
'x-sdk-language': 'web',
|
|
670
|
-
'x-sdk-version': '18.
|
|
670
|
+
'x-sdk-version': '18.4.0-rc.1',
|
|
671
671
|
'X-Appwrite-Response-Format': '2.3.0',
|
|
672
672
|
};
|
|
673
673
|
this.realtime = {
|
|
@@ -1520,29 +1520,6 @@ class Client {
|
|
|
1520
1520
|
}
|
|
1521
1521
|
Client.CHUNK_SIZE = 1024 * 1024 * 5;
|
|
1522
1522
|
|
|
1523
|
-
class Service {
|
|
1524
|
-
constructor(client) {
|
|
1525
|
-
this.client = client;
|
|
1526
|
-
}
|
|
1527
|
-
static flatten(data, prefix = '') {
|
|
1528
|
-
let output = {};
|
|
1529
|
-
for (const [key, value] of Object.entries(data)) {
|
|
1530
|
-
const finalKey = prefix ? prefix + '[' + key + ']' : key;
|
|
1531
|
-
if (Array.isArray(value)) {
|
|
1532
|
-
output = Object.assign(Object.assign({}, output), Service.flatten(value, finalKey));
|
|
1533
|
-
}
|
|
1534
|
-
else {
|
|
1535
|
-
output[finalKey] = value;
|
|
1536
|
-
}
|
|
1537
|
-
}
|
|
1538
|
-
return output;
|
|
1539
|
-
}
|
|
1540
|
-
}
|
|
1541
|
-
/**
|
|
1542
|
-
* The size for chunked uploads in bytes.
|
|
1543
|
-
*/
|
|
1544
|
-
Service.CHUNK_SIZE = 5 * 1024 * 1024; // 5MB
|
|
1545
|
-
|
|
1546
1523
|
class Account {
|
|
1547
1524
|
constructor(client) {
|
|
1548
1525
|
this.client = client;
|
|
@@ -2861,6 +2838,196 @@ class Account {
|
|
|
2861
2838
|
};
|
|
2862
2839
|
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
2863
2840
|
}
|
|
2841
|
+
listPasskeys(paramsOrFirst, ...rest) {
|
|
2842
|
+
let params;
|
|
2843
|
+
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
2844
|
+
(paramsOrFirst &&
|
|
2845
|
+
typeof paramsOrFirst === 'object' &&
|
|
2846
|
+
!Array.isArray(paramsOrFirst))) {
|
|
2847
|
+
params = (paramsOrFirst || {});
|
|
2848
|
+
}
|
|
2849
|
+
else {
|
|
2850
|
+
params = {
|
|
2851
|
+
queries: paramsOrFirst,
|
|
2852
|
+
total: rest[0],
|
|
2853
|
+
};
|
|
2854
|
+
}
|
|
2855
|
+
const queries = params.queries;
|
|
2856
|
+
const total = params.total;
|
|
2857
|
+
const apiPath = '/account/passkeys';
|
|
2858
|
+
const apiPayload = {};
|
|
2859
|
+
if (typeof queries !== 'undefined') {
|
|
2860
|
+
apiPayload['queries'] = queries;
|
|
2861
|
+
}
|
|
2862
|
+
if (typeof total !== 'undefined') {
|
|
2863
|
+
apiPayload['total'] = total;
|
|
2864
|
+
}
|
|
2865
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2866
|
+
const apiHeaders = {
|
|
2867
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
2868
|
+
accept: 'application/json',
|
|
2869
|
+
};
|
|
2870
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
2871
|
+
}
|
|
2872
|
+
createPasskey(paramsOrFirst, ...rest) {
|
|
2873
|
+
let params;
|
|
2874
|
+
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
2875
|
+
(paramsOrFirst &&
|
|
2876
|
+
typeof paramsOrFirst === 'object' &&
|
|
2877
|
+
!Array.isArray(paramsOrFirst))) {
|
|
2878
|
+
params = (paramsOrFirst || {});
|
|
2879
|
+
}
|
|
2880
|
+
else {
|
|
2881
|
+
params = {
|
|
2882
|
+
passkeyId: paramsOrFirst,
|
|
2883
|
+
name: rest[0],
|
|
2884
|
+
};
|
|
2885
|
+
}
|
|
2886
|
+
const passkeyId = params.passkeyId;
|
|
2887
|
+
const name = params.name;
|
|
2888
|
+
const apiPath = '/account/passkeys';
|
|
2889
|
+
const apiPayload = {};
|
|
2890
|
+
if (typeof passkeyId !== 'undefined') {
|
|
2891
|
+
apiPayload['passkeyId'] = passkeyId;
|
|
2892
|
+
}
|
|
2893
|
+
if (typeof name !== 'undefined') {
|
|
2894
|
+
apiPayload['name'] = name;
|
|
2895
|
+
}
|
|
2896
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2897
|
+
const apiHeaders = {
|
|
2898
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
2899
|
+
'content-type': 'application/json',
|
|
2900
|
+
accept: 'application/json',
|
|
2901
|
+
};
|
|
2902
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
2903
|
+
}
|
|
2904
|
+
getPasskey(paramsOrFirst) {
|
|
2905
|
+
let params;
|
|
2906
|
+
if (paramsOrFirst &&
|
|
2907
|
+
typeof paramsOrFirst === 'object' &&
|
|
2908
|
+
!Array.isArray(paramsOrFirst)) {
|
|
2909
|
+
params = (paramsOrFirst || {});
|
|
2910
|
+
}
|
|
2911
|
+
else {
|
|
2912
|
+
params = {
|
|
2913
|
+
passkeyId: paramsOrFirst,
|
|
2914
|
+
};
|
|
2915
|
+
}
|
|
2916
|
+
const passkeyId = params.passkeyId;
|
|
2917
|
+
if (typeof passkeyId === 'undefined' || passkeyId === '') {
|
|
2918
|
+
throw new AppwriteException('Missing required parameter: "passkeyId"');
|
|
2919
|
+
}
|
|
2920
|
+
const apiPath = '/account/passkeys/{passkeyId}'.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
|
|
2921
|
+
const apiPayload = {};
|
|
2922
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2923
|
+
const apiHeaders = {
|
|
2924
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
2925
|
+
accept: 'application/json',
|
|
2926
|
+
};
|
|
2927
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
2928
|
+
}
|
|
2929
|
+
updatePasskey(paramsOrFirst, ...rest) {
|
|
2930
|
+
let params;
|
|
2931
|
+
if (paramsOrFirst &&
|
|
2932
|
+
typeof paramsOrFirst === 'object' &&
|
|
2933
|
+
!Array.isArray(paramsOrFirst)) {
|
|
2934
|
+
params = (paramsOrFirst || {});
|
|
2935
|
+
}
|
|
2936
|
+
else {
|
|
2937
|
+
params = {
|
|
2938
|
+
passkeyId: paramsOrFirst,
|
|
2939
|
+
name: rest[0],
|
|
2940
|
+
};
|
|
2941
|
+
}
|
|
2942
|
+
const passkeyId = params.passkeyId;
|
|
2943
|
+
const name = params.name;
|
|
2944
|
+
if (typeof passkeyId === 'undefined' || passkeyId === '') {
|
|
2945
|
+
throw new AppwriteException('Missing required parameter: "passkeyId"');
|
|
2946
|
+
}
|
|
2947
|
+
if (typeof name === 'undefined') {
|
|
2948
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
2949
|
+
}
|
|
2950
|
+
const apiPath = '/account/passkeys/{passkeyId}'.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
|
|
2951
|
+
const apiPayload = {};
|
|
2952
|
+
if (typeof name !== 'undefined') {
|
|
2953
|
+
apiPayload['name'] = name;
|
|
2954
|
+
}
|
|
2955
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2956
|
+
const apiHeaders = {
|
|
2957
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
2958
|
+
'content-type': 'application/json',
|
|
2959
|
+
accept: 'application/json',
|
|
2960
|
+
};
|
|
2961
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
2962
|
+
}
|
|
2963
|
+
deletePasskey(paramsOrFirst) {
|
|
2964
|
+
let params;
|
|
2965
|
+
if (paramsOrFirst &&
|
|
2966
|
+
typeof paramsOrFirst === 'object' &&
|
|
2967
|
+
!Array.isArray(paramsOrFirst)) {
|
|
2968
|
+
params = (paramsOrFirst || {});
|
|
2969
|
+
}
|
|
2970
|
+
else {
|
|
2971
|
+
params = {
|
|
2972
|
+
passkeyId: paramsOrFirst,
|
|
2973
|
+
};
|
|
2974
|
+
}
|
|
2975
|
+
const passkeyId = params.passkeyId;
|
|
2976
|
+
if (typeof passkeyId === 'undefined' || passkeyId === '') {
|
|
2977
|
+
throw new AppwriteException('Missing required parameter: "passkeyId"');
|
|
2978
|
+
}
|
|
2979
|
+
const apiPath = '/account/passkeys/{passkeyId}'.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
|
|
2980
|
+
const apiPayload = {};
|
|
2981
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2982
|
+
const apiHeaders = {
|
|
2983
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
2984
|
+
'content-type': 'application/json',
|
|
2985
|
+
accept: 'application/json',
|
|
2986
|
+
};
|
|
2987
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
2988
|
+
}
|
|
2989
|
+
updatePasskeyVerification(paramsOrFirst, ...rest) {
|
|
2990
|
+
let params;
|
|
2991
|
+
if (paramsOrFirst &&
|
|
2992
|
+
typeof paramsOrFirst === 'object' &&
|
|
2993
|
+
!Array.isArray(paramsOrFirst)) {
|
|
2994
|
+
params = (paramsOrFirst || {});
|
|
2995
|
+
}
|
|
2996
|
+
else {
|
|
2997
|
+
params = {
|
|
2998
|
+
passkeyId: paramsOrFirst,
|
|
2999
|
+
challengeId: rest[0],
|
|
3000
|
+
credential: rest[1],
|
|
3001
|
+
};
|
|
3002
|
+
}
|
|
3003
|
+
const passkeyId = params.passkeyId;
|
|
3004
|
+
const challengeId = params.challengeId;
|
|
3005
|
+
const credential = params.credential;
|
|
3006
|
+
if (typeof passkeyId === 'undefined' || passkeyId === '') {
|
|
3007
|
+
throw new AppwriteException('Missing required parameter: "passkeyId"');
|
|
3008
|
+
}
|
|
3009
|
+
if (typeof challengeId === 'undefined') {
|
|
3010
|
+
throw new AppwriteException('Missing required parameter: "challengeId"');
|
|
3011
|
+
}
|
|
3012
|
+
if (typeof credential === 'undefined') {
|
|
3013
|
+
throw new AppwriteException('Missing required parameter: "credential"');
|
|
3014
|
+
}
|
|
3015
|
+
const apiPath = '/account/passkeys/{passkeyId}/verification'.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
|
|
3016
|
+
const apiPayload = {};
|
|
3017
|
+
if (typeof challengeId !== 'undefined') {
|
|
3018
|
+
apiPayload['challengeId'] = challengeId;
|
|
3019
|
+
}
|
|
3020
|
+
if (typeof credential !== 'undefined') {
|
|
3021
|
+
apiPayload['credential'] = credential;
|
|
3022
|
+
}
|
|
3023
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3024
|
+
const apiHeaders = {
|
|
3025
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
3026
|
+
'content-type': 'application/json',
|
|
3027
|
+
accept: 'application/json',
|
|
3028
|
+
};
|
|
3029
|
+
return this.client.call('put', uri, apiHeaders, apiPayload);
|
|
3030
|
+
}
|
|
2864
3031
|
updatePassword(paramsOrFirst, ...rest) {
|
|
2865
3032
|
let params;
|
|
2866
3033
|
if (paramsOrFirst &&
|
|
@@ -3604,7 +3771,7 @@ class Account {
|
|
|
3604
3771
|
}
|
|
3605
3772
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3606
3773
|
apiPayload['project'] = this.client.config.project;
|
|
3607
|
-
for (const [key, value] of Object.entries(
|
|
3774
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
3608
3775
|
uri.searchParams.append(key, value);
|
|
3609
3776
|
}
|
|
3610
3777
|
if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.location)) {
|
|
@@ -4013,7 +4180,7 @@ class Account {
|
|
|
4013
4180
|
}
|
|
4014
4181
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
4015
4182
|
apiPayload['project'] = this.client.config.project;
|
|
4016
|
-
for (const [key, value] of Object.entries(
|
|
4183
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
4017
4184
|
uri.searchParams.append(key, value);
|
|
4018
4185
|
}
|
|
4019
4186
|
if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.location)) {
|
|
@@ -4024,6 +4191,60 @@ class Account {
|
|
|
4024
4191
|
return uri.toString();
|
|
4025
4192
|
}
|
|
4026
4193
|
}
|
|
4194
|
+
/**
|
|
4195
|
+
* 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.
|
|
4196
|
+
*
|
|
4197
|
+
* @throws {AppwriteException}
|
|
4198
|
+
* @returns {Promise<Models.PasskeyChallenge>}
|
|
4199
|
+
*/
|
|
4200
|
+
createPasskeyToken() {
|
|
4201
|
+
const apiPath = '/account/tokens/passkey';
|
|
4202
|
+
const apiPayload = {};
|
|
4203
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
4204
|
+
const apiHeaders = {
|
|
4205
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
4206
|
+
'content-type': 'application/json',
|
|
4207
|
+
accept: 'application/json',
|
|
4208
|
+
};
|
|
4209
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
4210
|
+
}
|
|
4211
|
+
updatePasskeyToken(paramsOrFirst, ...rest) {
|
|
4212
|
+
let params;
|
|
4213
|
+
if (paramsOrFirst &&
|
|
4214
|
+
typeof paramsOrFirst === 'object' &&
|
|
4215
|
+
!Array.isArray(paramsOrFirst)) {
|
|
4216
|
+
params = (paramsOrFirst || {});
|
|
4217
|
+
}
|
|
4218
|
+
else {
|
|
4219
|
+
params = {
|
|
4220
|
+
challengeId: paramsOrFirst,
|
|
4221
|
+
credential: rest[0],
|
|
4222
|
+
};
|
|
4223
|
+
}
|
|
4224
|
+
const challengeId = params.challengeId;
|
|
4225
|
+
const credential = params.credential;
|
|
4226
|
+
if (typeof challengeId === 'undefined') {
|
|
4227
|
+
throw new AppwriteException('Missing required parameter: "challengeId"');
|
|
4228
|
+
}
|
|
4229
|
+
if (typeof credential === 'undefined') {
|
|
4230
|
+
throw new AppwriteException('Missing required parameter: "credential"');
|
|
4231
|
+
}
|
|
4232
|
+
const apiPath = '/account/tokens/passkey';
|
|
4233
|
+
const apiPayload = {};
|
|
4234
|
+
if (typeof challengeId !== 'undefined') {
|
|
4235
|
+
apiPayload['challengeId'] = challengeId;
|
|
4236
|
+
}
|
|
4237
|
+
if (typeof credential !== 'undefined') {
|
|
4238
|
+
apiPayload['credential'] = credential;
|
|
4239
|
+
}
|
|
4240
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
4241
|
+
const apiHeaders = {
|
|
4242
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
4243
|
+
'content-type': 'application/json',
|
|
4244
|
+
accept: 'application/json',
|
|
4245
|
+
};
|
|
4246
|
+
return this.client.call('put', uri, apiHeaders, apiPayload);
|
|
4247
|
+
}
|
|
4027
4248
|
createPhoneToken(paramsOrFirst, ...rest) {
|
|
4028
4249
|
let params;
|
|
4029
4250
|
if (paramsOrFirst &&
|
|
@@ -4370,6 +4591,135 @@ class Activities {
|
|
|
4370
4591
|
}
|
|
4371
4592
|
}
|
|
4372
4593
|
|
|
4594
|
+
class Admin {
|
|
4595
|
+
constructor(client) {
|
|
4596
|
+
this.client = client;
|
|
4597
|
+
}
|
|
4598
|
+
/**
|
|
4599
|
+
* Delete everything cached from the platform database in the region serving the request.
|
|
4600
|
+
*
|
|
4601
|
+
* @throws {AppwriteException}
|
|
4602
|
+
* @returns {Promise<{}>}
|
|
4603
|
+
*/
|
|
4604
|
+
deletePlatformCache() {
|
|
4605
|
+
const apiPath = '/admin/cache/platform';
|
|
4606
|
+
const apiPayload = {};
|
|
4607
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
4608
|
+
const apiHeaders = {
|
|
4609
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
4610
|
+
'content-type': 'application/json',
|
|
4611
|
+
accept: 'application/json',
|
|
4612
|
+
};
|
|
4613
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
4614
|
+
}
|
|
4615
|
+
deletePlatformResourceCache(paramsOrFirst, ...rest) {
|
|
4616
|
+
let params;
|
|
4617
|
+
if (paramsOrFirst &&
|
|
4618
|
+
typeof paramsOrFirst === 'object' &&
|
|
4619
|
+
!Array.isArray(paramsOrFirst) &&
|
|
4620
|
+
('resourceType' in paramsOrFirst || 'resourceId' in paramsOrFirst)) {
|
|
4621
|
+
params = (paramsOrFirst || {});
|
|
4622
|
+
}
|
|
4623
|
+
else {
|
|
4624
|
+
params = {
|
|
4625
|
+
resourceType: paramsOrFirst,
|
|
4626
|
+
resourceId: rest[0],
|
|
4627
|
+
};
|
|
4628
|
+
}
|
|
4629
|
+
const resourceType = params.resourceType;
|
|
4630
|
+
const resourceId = params.resourceId;
|
|
4631
|
+
if (typeof resourceType === 'undefined') {
|
|
4632
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
4633
|
+
}
|
|
4634
|
+
const apiPath = '/admin/cache/platform/resources';
|
|
4635
|
+
const apiPayload = {};
|
|
4636
|
+
if (typeof resourceType !== 'undefined') {
|
|
4637
|
+
apiPayload['resourceType'] = resourceType;
|
|
4638
|
+
}
|
|
4639
|
+
if (typeof resourceId !== 'undefined') {
|
|
4640
|
+
apiPayload['resourceId'] = resourceId;
|
|
4641
|
+
}
|
|
4642
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
4643
|
+
const apiHeaders = {
|
|
4644
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
4645
|
+
'content-type': 'application/json',
|
|
4646
|
+
accept: 'application/json',
|
|
4647
|
+
};
|
|
4648
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
4649
|
+
}
|
|
4650
|
+
deleteProjectCache(paramsOrFirst) {
|
|
4651
|
+
let params;
|
|
4652
|
+
if (paramsOrFirst &&
|
|
4653
|
+
typeof paramsOrFirst === 'object' &&
|
|
4654
|
+
!Array.isArray(paramsOrFirst)) {
|
|
4655
|
+
params = (paramsOrFirst || {});
|
|
4656
|
+
}
|
|
4657
|
+
else {
|
|
4658
|
+
params = {
|
|
4659
|
+
projectId: paramsOrFirst,
|
|
4660
|
+
};
|
|
4661
|
+
}
|
|
4662
|
+
const projectId = params.projectId;
|
|
4663
|
+
if (typeof projectId === 'undefined') {
|
|
4664
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
4665
|
+
}
|
|
4666
|
+
const apiPath = '/admin/cache/project';
|
|
4667
|
+
const apiPayload = {};
|
|
4668
|
+
if (typeof projectId !== 'undefined') {
|
|
4669
|
+
apiPayload['projectId'] = projectId;
|
|
4670
|
+
}
|
|
4671
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
4672
|
+
const apiHeaders = {
|
|
4673
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
4674
|
+
'content-type': 'application/json',
|
|
4675
|
+
accept: 'application/json',
|
|
4676
|
+
};
|
|
4677
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
4678
|
+
}
|
|
4679
|
+
deleteProjectResourceCache(paramsOrFirst, ...rest) {
|
|
4680
|
+
let params;
|
|
4681
|
+
if (paramsOrFirst &&
|
|
4682
|
+
typeof paramsOrFirst === 'object' &&
|
|
4683
|
+
!Array.isArray(paramsOrFirst)) {
|
|
4684
|
+
params = (paramsOrFirst || {});
|
|
4685
|
+
}
|
|
4686
|
+
else {
|
|
4687
|
+
params = {
|
|
4688
|
+
projectId: paramsOrFirst,
|
|
4689
|
+
resourceType: rest[0],
|
|
4690
|
+
resourceId: rest[1],
|
|
4691
|
+
};
|
|
4692
|
+
}
|
|
4693
|
+
const projectId = params.projectId;
|
|
4694
|
+
const resourceType = params.resourceType;
|
|
4695
|
+
const resourceId = params.resourceId;
|
|
4696
|
+
if (typeof projectId === 'undefined') {
|
|
4697
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
4698
|
+
}
|
|
4699
|
+
if (typeof resourceType === 'undefined') {
|
|
4700
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
4701
|
+
}
|
|
4702
|
+
const apiPath = '/admin/cache/project/resources';
|
|
4703
|
+
const apiPayload = {};
|
|
4704
|
+
if (typeof projectId !== 'undefined') {
|
|
4705
|
+
apiPayload['projectId'] = projectId;
|
|
4706
|
+
}
|
|
4707
|
+
if (typeof resourceType !== 'undefined') {
|
|
4708
|
+
apiPayload['resourceType'] = resourceType;
|
|
4709
|
+
}
|
|
4710
|
+
if (typeof resourceId !== 'undefined') {
|
|
4711
|
+
apiPayload['resourceId'] = resourceId;
|
|
4712
|
+
}
|
|
4713
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
4714
|
+
const apiHeaders = {
|
|
4715
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
4716
|
+
'content-type': 'application/json',
|
|
4717
|
+
accept: 'application/json',
|
|
4718
|
+
};
|
|
4719
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
4720
|
+
}
|
|
4721
|
+
}
|
|
4722
|
+
|
|
4373
4723
|
class Affiliates {
|
|
4374
4724
|
constructor(client) {
|
|
4375
4725
|
this.client = client;
|
|
@@ -4581,6 +4931,369 @@ class Affiliates {
|
|
|
4581
4931
|
}
|
|
4582
4932
|
}
|
|
4583
4933
|
|
|
4934
|
+
class Analytics {
|
|
4935
|
+
constructor(client) {
|
|
4936
|
+
this.client = client;
|
|
4937
|
+
}
|
|
4938
|
+
listProperties(paramsOrFirst, ...rest) {
|
|
4939
|
+
let params;
|
|
4940
|
+
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
4941
|
+
(paramsOrFirst &&
|
|
4942
|
+
typeof paramsOrFirst === 'object' &&
|
|
4943
|
+
!Array.isArray(paramsOrFirst))) {
|
|
4944
|
+
params = (paramsOrFirst || {});
|
|
4945
|
+
}
|
|
4946
|
+
else {
|
|
4947
|
+
params = {
|
|
4948
|
+
queries: paramsOrFirst,
|
|
4949
|
+
search: rest[0],
|
|
4950
|
+
total: rest[1],
|
|
4951
|
+
};
|
|
4952
|
+
}
|
|
4953
|
+
const queries = params.queries;
|
|
4954
|
+
const search = params.search;
|
|
4955
|
+
const total = params.total;
|
|
4956
|
+
const apiPath = '/analytics/properties';
|
|
4957
|
+
const apiPayload = {};
|
|
4958
|
+
if (typeof queries !== 'undefined') {
|
|
4959
|
+
apiPayload['queries'] = queries;
|
|
4960
|
+
}
|
|
4961
|
+
if (typeof search !== 'undefined') {
|
|
4962
|
+
apiPayload['search'] = search;
|
|
4963
|
+
}
|
|
4964
|
+
if (typeof total !== 'undefined') {
|
|
4965
|
+
apiPayload['total'] = total;
|
|
4966
|
+
}
|
|
4967
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
4968
|
+
const apiHeaders = {
|
|
4969
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
4970
|
+
accept: 'application/json',
|
|
4971
|
+
};
|
|
4972
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
4973
|
+
}
|
|
4974
|
+
createProperty(paramsOrFirst, ...rest) {
|
|
4975
|
+
let params;
|
|
4976
|
+
if (paramsOrFirst &&
|
|
4977
|
+
typeof paramsOrFirst === 'object' &&
|
|
4978
|
+
!Array.isArray(paramsOrFirst)) {
|
|
4979
|
+
params = (paramsOrFirst || {});
|
|
4980
|
+
}
|
|
4981
|
+
else {
|
|
4982
|
+
params = {
|
|
4983
|
+
propertyId: paramsOrFirst,
|
|
4984
|
+
name: rest[0],
|
|
4985
|
+
domain: rest[1],
|
|
4986
|
+
timezone: rest[2],
|
|
4987
|
+
enabled: rest[3],
|
|
4988
|
+
xpublic: rest[4],
|
|
4989
|
+
allowedOrigins: rest[5],
|
|
4990
|
+
};
|
|
4991
|
+
}
|
|
4992
|
+
const propertyId = params.propertyId;
|
|
4993
|
+
const name = params.name;
|
|
4994
|
+
const domain = params.domain;
|
|
4995
|
+
const timezone = params.timezone;
|
|
4996
|
+
const enabled = params.enabled;
|
|
4997
|
+
const xpublic = params.xpublic;
|
|
4998
|
+
const allowedOrigins = params.allowedOrigins;
|
|
4999
|
+
if (typeof propertyId === 'undefined') {
|
|
5000
|
+
throw new AppwriteException('Missing required parameter: "propertyId"');
|
|
5001
|
+
}
|
|
5002
|
+
if (typeof name === 'undefined') {
|
|
5003
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
5004
|
+
}
|
|
5005
|
+
const apiPath = '/analytics/properties';
|
|
5006
|
+
const apiPayload = {};
|
|
5007
|
+
if (typeof propertyId !== 'undefined') {
|
|
5008
|
+
apiPayload['propertyId'] = propertyId;
|
|
5009
|
+
}
|
|
5010
|
+
if (typeof name !== 'undefined') {
|
|
5011
|
+
apiPayload['name'] = name;
|
|
5012
|
+
}
|
|
5013
|
+
if (typeof domain !== 'undefined') {
|
|
5014
|
+
apiPayload['domain'] = domain;
|
|
5015
|
+
}
|
|
5016
|
+
if (typeof timezone !== 'undefined') {
|
|
5017
|
+
apiPayload['timezone'] = timezone;
|
|
5018
|
+
}
|
|
5019
|
+
if (typeof enabled !== 'undefined') {
|
|
5020
|
+
apiPayload['enabled'] = enabled;
|
|
5021
|
+
}
|
|
5022
|
+
if (typeof xpublic !== 'undefined') {
|
|
5023
|
+
apiPayload['public'] = xpublic;
|
|
5024
|
+
}
|
|
5025
|
+
if (typeof allowedOrigins !== 'undefined') {
|
|
5026
|
+
apiPayload['allowedOrigins'] = allowedOrigins;
|
|
5027
|
+
}
|
|
5028
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
5029
|
+
const apiHeaders = {
|
|
5030
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
5031
|
+
'content-type': 'application/json',
|
|
5032
|
+
accept: 'application/json',
|
|
5033
|
+
};
|
|
5034
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
5035
|
+
}
|
|
5036
|
+
getProperty(paramsOrFirst) {
|
|
5037
|
+
let params;
|
|
5038
|
+
if (paramsOrFirst &&
|
|
5039
|
+
typeof paramsOrFirst === 'object' &&
|
|
5040
|
+
!Array.isArray(paramsOrFirst)) {
|
|
5041
|
+
params = (paramsOrFirst || {});
|
|
5042
|
+
}
|
|
5043
|
+
else {
|
|
5044
|
+
params = {
|
|
5045
|
+
propertyId: paramsOrFirst,
|
|
5046
|
+
};
|
|
5047
|
+
}
|
|
5048
|
+
const propertyId = params.propertyId;
|
|
5049
|
+
if (typeof propertyId === 'undefined' || propertyId === '') {
|
|
5050
|
+
throw new AppwriteException('Missing required parameter: "propertyId"');
|
|
5051
|
+
}
|
|
5052
|
+
const apiPath = '/analytics/properties/{propertyId}'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
|
|
5053
|
+
const apiPayload = {};
|
|
5054
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
5055
|
+
const apiHeaders = {
|
|
5056
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
5057
|
+
accept: 'application/json',
|
|
5058
|
+
};
|
|
5059
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
5060
|
+
}
|
|
5061
|
+
updateProperty(paramsOrFirst, ...rest) {
|
|
5062
|
+
let params;
|
|
5063
|
+
if (paramsOrFirst &&
|
|
5064
|
+
typeof paramsOrFirst === 'object' &&
|
|
5065
|
+
!Array.isArray(paramsOrFirst)) {
|
|
5066
|
+
params = (paramsOrFirst || {});
|
|
5067
|
+
}
|
|
5068
|
+
else {
|
|
5069
|
+
params = {
|
|
5070
|
+
propertyId: paramsOrFirst,
|
|
5071
|
+
name: rest[0],
|
|
5072
|
+
domain: rest[1],
|
|
5073
|
+
timezone: rest[2],
|
|
5074
|
+
enabled: rest[3],
|
|
5075
|
+
xpublic: rest[4],
|
|
5076
|
+
allowedOrigins: rest[5],
|
|
5077
|
+
};
|
|
5078
|
+
}
|
|
5079
|
+
const propertyId = params.propertyId;
|
|
5080
|
+
const name = params.name;
|
|
5081
|
+
const domain = params.domain;
|
|
5082
|
+
const timezone = params.timezone;
|
|
5083
|
+
const enabled = params.enabled;
|
|
5084
|
+
const xpublic = params.xpublic;
|
|
5085
|
+
const allowedOrigins = params.allowedOrigins;
|
|
5086
|
+
if (typeof propertyId === 'undefined' || propertyId === '') {
|
|
5087
|
+
throw new AppwriteException('Missing required parameter: "propertyId"');
|
|
5088
|
+
}
|
|
5089
|
+
const apiPath = '/analytics/properties/{propertyId}'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
|
|
5090
|
+
const apiPayload = {};
|
|
5091
|
+
if (typeof name !== 'undefined') {
|
|
5092
|
+
apiPayload['name'] = name;
|
|
5093
|
+
}
|
|
5094
|
+
if (typeof domain !== 'undefined') {
|
|
5095
|
+
apiPayload['domain'] = domain;
|
|
5096
|
+
}
|
|
5097
|
+
if (typeof timezone !== 'undefined') {
|
|
5098
|
+
apiPayload['timezone'] = timezone;
|
|
5099
|
+
}
|
|
5100
|
+
if (typeof enabled !== 'undefined') {
|
|
5101
|
+
apiPayload['enabled'] = enabled;
|
|
5102
|
+
}
|
|
5103
|
+
if (typeof xpublic !== 'undefined') {
|
|
5104
|
+
apiPayload['public'] = xpublic;
|
|
5105
|
+
}
|
|
5106
|
+
if (typeof allowedOrigins !== 'undefined') {
|
|
5107
|
+
apiPayload['allowedOrigins'] = allowedOrigins;
|
|
5108
|
+
}
|
|
5109
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
5110
|
+
const apiHeaders = {
|
|
5111
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
5112
|
+
'content-type': 'application/json',
|
|
5113
|
+
accept: 'application/json',
|
|
5114
|
+
};
|
|
5115
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
5116
|
+
}
|
|
5117
|
+
deleteProperty(paramsOrFirst) {
|
|
5118
|
+
let params;
|
|
5119
|
+
if (paramsOrFirst &&
|
|
5120
|
+
typeof paramsOrFirst === 'object' &&
|
|
5121
|
+
!Array.isArray(paramsOrFirst)) {
|
|
5122
|
+
params = (paramsOrFirst || {});
|
|
5123
|
+
}
|
|
5124
|
+
else {
|
|
5125
|
+
params = {
|
|
5126
|
+
propertyId: paramsOrFirst,
|
|
5127
|
+
};
|
|
5128
|
+
}
|
|
5129
|
+
const propertyId = params.propertyId;
|
|
5130
|
+
if (typeof propertyId === 'undefined' || propertyId === '') {
|
|
5131
|
+
throw new AppwriteException('Missing required parameter: "propertyId"');
|
|
5132
|
+
}
|
|
5133
|
+
const apiPath = '/analytics/properties/{propertyId}'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
|
|
5134
|
+
const apiPayload = {};
|
|
5135
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
5136
|
+
const apiHeaders = {
|
|
5137
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
5138
|
+
'content-type': 'application/json',
|
|
5139
|
+
accept: 'application/json',
|
|
5140
|
+
};
|
|
5141
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
5142
|
+
}
|
|
5143
|
+
createEvent(paramsOrFirst, ...rest) {
|
|
5144
|
+
let params;
|
|
5145
|
+
if (paramsOrFirst &&
|
|
5146
|
+
typeof paramsOrFirst === 'object' &&
|
|
5147
|
+
!Array.isArray(paramsOrFirst)) {
|
|
5148
|
+
params = (paramsOrFirst || {});
|
|
5149
|
+
}
|
|
5150
|
+
else {
|
|
5151
|
+
params = {
|
|
5152
|
+
propertyId: paramsOrFirst,
|
|
5153
|
+
name: rest[0],
|
|
5154
|
+
url: rest[1],
|
|
5155
|
+
domain: rest[2],
|
|
5156
|
+
referrer: rest[3],
|
|
5157
|
+
screenWidth: rest[4],
|
|
5158
|
+
sessionHash: rest[5],
|
|
5159
|
+
scrollDepth: rest[6],
|
|
5160
|
+
engagementTime: rest[7],
|
|
5161
|
+
props: rest[8],
|
|
5162
|
+
userId: rest[9],
|
|
5163
|
+
ip: rest[10],
|
|
5164
|
+
userAgent: rest[11],
|
|
5165
|
+
};
|
|
5166
|
+
}
|
|
5167
|
+
const propertyId = params.propertyId;
|
|
5168
|
+
const name = params.name;
|
|
5169
|
+
const url = params.url;
|
|
5170
|
+
const domain = params.domain;
|
|
5171
|
+
const referrer = params.referrer;
|
|
5172
|
+
const screenWidth = params.screenWidth;
|
|
5173
|
+
const sessionHash = params.sessionHash;
|
|
5174
|
+
const scrollDepth = params.scrollDepth;
|
|
5175
|
+
const engagementTime = params.engagementTime;
|
|
5176
|
+
const props = params.props;
|
|
5177
|
+
const userId = params.userId;
|
|
5178
|
+
const ip = params.ip;
|
|
5179
|
+
const userAgent = params.userAgent;
|
|
5180
|
+
if (typeof propertyId === 'undefined' || propertyId === '') {
|
|
5181
|
+
throw new AppwriteException('Missing required parameter: "propertyId"');
|
|
5182
|
+
}
|
|
5183
|
+
if (typeof name === 'undefined') {
|
|
5184
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
5185
|
+
}
|
|
5186
|
+
if (typeof url === 'undefined') {
|
|
5187
|
+
throw new AppwriteException('Missing required parameter: "url"');
|
|
5188
|
+
}
|
|
5189
|
+
const apiPath = '/analytics/properties/{propertyId}/events'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
|
|
5190
|
+
const apiPayload = {};
|
|
5191
|
+
if (typeof name !== 'undefined') {
|
|
5192
|
+
apiPayload['name'] = name;
|
|
5193
|
+
}
|
|
5194
|
+
if (typeof url !== 'undefined') {
|
|
5195
|
+
apiPayload['url'] = url;
|
|
5196
|
+
}
|
|
5197
|
+
if (typeof domain !== 'undefined') {
|
|
5198
|
+
apiPayload['domain'] = domain;
|
|
5199
|
+
}
|
|
5200
|
+
if (typeof referrer !== 'undefined') {
|
|
5201
|
+
apiPayload['referrer'] = referrer;
|
|
5202
|
+
}
|
|
5203
|
+
if (typeof screenWidth !== 'undefined') {
|
|
5204
|
+
apiPayload['screenWidth'] = screenWidth;
|
|
5205
|
+
}
|
|
5206
|
+
if (typeof sessionHash !== 'undefined') {
|
|
5207
|
+
apiPayload['sessionHash'] = sessionHash;
|
|
5208
|
+
}
|
|
5209
|
+
if (typeof scrollDepth !== 'undefined') {
|
|
5210
|
+
apiPayload['scrollDepth'] = scrollDepth;
|
|
5211
|
+
}
|
|
5212
|
+
if (typeof engagementTime !== 'undefined') {
|
|
5213
|
+
apiPayload['engagementTime'] = engagementTime;
|
|
5214
|
+
}
|
|
5215
|
+
if (typeof props !== 'undefined') {
|
|
5216
|
+
apiPayload['props'] = props;
|
|
5217
|
+
}
|
|
5218
|
+
if (typeof userId !== 'undefined') {
|
|
5219
|
+
apiPayload['userId'] = userId;
|
|
5220
|
+
}
|
|
5221
|
+
if (typeof ip !== 'undefined') {
|
|
5222
|
+
apiPayload['ip'] = ip;
|
|
5223
|
+
}
|
|
5224
|
+
if (typeof userAgent !== 'undefined') {
|
|
5225
|
+
apiPayload['userAgent'] = userAgent;
|
|
5226
|
+
}
|
|
5227
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
5228
|
+
const apiHeaders = {
|
|
5229
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
5230
|
+
'content-type': 'application/json',
|
|
5231
|
+
accept: 'application/json',
|
|
5232
|
+
};
|
|
5233
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
5234
|
+
}
|
|
5235
|
+
listMetrics(paramsOrFirst, ...rest) {
|
|
5236
|
+
let params;
|
|
5237
|
+
if (paramsOrFirst &&
|
|
5238
|
+
typeof paramsOrFirst === 'object' &&
|
|
5239
|
+
!Array.isArray(paramsOrFirst)) {
|
|
5240
|
+
params = (paramsOrFirst || {});
|
|
5241
|
+
}
|
|
5242
|
+
else {
|
|
5243
|
+
params = {
|
|
5244
|
+
propertyId: paramsOrFirst,
|
|
5245
|
+
queries: rest[0],
|
|
5246
|
+
interval: rest[1],
|
|
5247
|
+
dimensions: rest[2],
|
|
5248
|
+
dateRange: rest[3],
|
|
5249
|
+
startAt: rest[4],
|
|
5250
|
+
endAt: rest[5],
|
|
5251
|
+
limit: rest[6],
|
|
5252
|
+
};
|
|
5253
|
+
}
|
|
5254
|
+
const propertyId = params.propertyId;
|
|
5255
|
+
const queries = params.queries;
|
|
5256
|
+
const interval = params.interval;
|
|
5257
|
+
const dimensions = params.dimensions;
|
|
5258
|
+
const dateRange = params.dateRange;
|
|
5259
|
+
const startAt = params.startAt;
|
|
5260
|
+
const endAt = params.endAt;
|
|
5261
|
+
const limit = params.limit;
|
|
5262
|
+
if (typeof propertyId === 'undefined' || propertyId === '') {
|
|
5263
|
+
throw new AppwriteException('Missing required parameter: "propertyId"');
|
|
5264
|
+
}
|
|
5265
|
+
const apiPath = '/analytics/properties/{propertyId}/metrics'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
|
|
5266
|
+
const apiPayload = {};
|
|
5267
|
+
if (typeof queries !== 'undefined') {
|
|
5268
|
+
apiPayload['queries'] = queries;
|
|
5269
|
+
}
|
|
5270
|
+
if (typeof interval !== 'undefined') {
|
|
5271
|
+
apiPayload['interval'] = interval;
|
|
5272
|
+
}
|
|
5273
|
+
if (typeof dimensions !== 'undefined') {
|
|
5274
|
+
apiPayload['dimensions'] = dimensions;
|
|
5275
|
+
}
|
|
5276
|
+
if (typeof dateRange !== 'undefined') {
|
|
5277
|
+
apiPayload['dateRange'] = dateRange;
|
|
5278
|
+
}
|
|
5279
|
+
if (typeof startAt !== 'undefined') {
|
|
5280
|
+
apiPayload['startAt'] = startAt;
|
|
5281
|
+
}
|
|
5282
|
+
if (typeof endAt !== 'undefined') {
|
|
5283
|
+
apiPayload['endAt'] = endAt;
|
|
5284
|
+
}
|
|
5285
|
+
if (typeof limit !== 'undefined') {
|
|
5286
|
+
apiPayload['limit'] = limit;
|
|
5287
|
+
}
|
|
5288
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
5289
|
+
const apiHeaders = {
|
|
5290
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
5291
|
+
accept: 'application/json',
|
|
5292
|
+
};
|
|
5293
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
5294
|
+
}
|
|
5295
|
+
}
|
|
5296
|
+
|
|
4584
5297
|
class Apps {
|
|
4585
5298
|
constructor(client) {
|
|
4586
5299
|
this.client = client;
|
|
@@ -5473,7 +6186,7 @@ class Avatars {
|
|
|
5473
6186
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
5474
6187
|
apiPayload['project'] = this.client.config.project;
|
|
5475
6188
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
5476
|
-
for (const [key, value] of Object.entries(
|
|
6189
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
5477
6190
|
uri.searchParams.append(key, value);
|
|
5478
6191
|
}
|
|
5479
6192
|
return uri.toString();
|
|
@@ -5518,7 +6231,7 @@ class Avatars {
|
|
|
5518
6231
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
5519
6232
|
apiPayload['project'] = this.client.config.project;
|
|
5520
6233
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
5521
|
-
for (const [key, value] of Object.entries(
|
|
6234
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
5522
6235
|
uri.searchParams.append(key, value);
|
|
5523
6236
|
}
|
|
5524
6237
|
return uri.toString();
|
|
@@ -5547,7 +6260,7 @@ class Avatars {
|
|
|
5547
6260
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
5548
6261
|
apiPayload['project'] = this.client.config.project;
|
|
5549
6262
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
5550
|
-
for (const [key, value] of Object.entries(
|
|
6263
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
5551
6264
|
uri.searchParams.append(key, value);
|
|
5552
6265
|
}
|
|
5553
6266
|
return uri.toString();
|
|
@@ -5592,7 +6305,7 @@ class Avatars {
|
|
|
5592
6305
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
5593
6306
|
apiPayload['project'] = this.client.config.project;
|
|
5594
6307
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
5595
|
-
for (const [key, value] of Object.entries(
|
|
6308
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
5596
6309
|
uri.searchParams.append(key, value);
|
|
5597
6310
|
}
|
|
5598
6311
|
return uri.toString();
|
|
@@ -5631,7 +6344,7 @@ class Avatars {
|
|
|
5631
6344
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
5632
6345
|
apiPayload['project'] = this.client.config.project;
|
|
5633
6346
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
5634
|
-
for (const [key, value] of Object.entries(
|
|
6347
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
5635
6348
|
uri.searchParams.append(key, value);
|
|
5636
6349
|
}
|
|
5637
6350
|
return uri.toString();
|
|
@@ -5673,7 +6386,7 @@ class Avatars {
|
|
|
5673
6386
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
5674
6387
|
apiPayload['project'] = this.client.config.project;
|
|
5675
6388
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
5676
|
-
for (const [key, value] of Object.entries(
|
|
6389
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
5677
6390
|
uri.searchParams.append(key, value);
|
|
5678
6391
|
}
|
|
5679
6392
|
return uri.toString();
|
|
@@ -5735,7 +6448,7 @@ class Avatars {
|
|
|
5735
6448
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
5736
6449
|
apiPayload['project'] = this.client.config.project;
|
|
5737
6450
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
5738
|
-
for (const [key, value] of Object.entries(
|
|
6451
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
5739
6452
|
uri.searchParams.append(key, value);
|
|
5740
6453
|
}
|
|
5741
6454
|
return uri.toString();
|
|
@@ -5829,7 +6542,7 @@ class Avatars {
|
|
|
5829
6542
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
5830
6543
|
apiPayload['project'] = this.client.config.project;
|
|
5831
6544
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
5832
|
-
for (const [key, value] of Object.entries(
|
|
6545
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
5833
6546
|
uri.searchParams.append(key, value);
|
|
5834
6547
|
}
|
|
5835
6548
|
return uri.toString();
|
|
@@ -5953,7 +6666,7 @@ class Avatars {
|
|
|
5953
6666
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
5954
6667
|
apiPayload['project'] = this.client.config.project;
|
|
5955
6668
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
5956
|
-
for (const [key, value] of Object.entries(
|
|
6669
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
5957
6670
|
uri.searchParams.append(key, value);
|
|
5958
6671
|
}
|
|
5959
6672
|
return uri.toString();
|
|
@@ -15539,7 +16252,7 @@ class Functions {
|
|
|
15539
16252
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
15540
16253
|
apiPayload['project'] = this.client.config.project;
|
|
15541
16254
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
15542
|
-
for (const [key, value] of Object.entries(
|
|
16255
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
15543
16256
|
uri.searchParams.append(key, value);
|
|
15544
16257
|
}
|
|
15545
16258
|
return uri.toString();
|
|
@@ -26178,7 +26891,7 @@ class Organizations {
|
|
|
26178
26891
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
26179
26892
|
apiPayload['project'] = this.client.config.project;
|
|
26180
26893
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
26181
|
-
for (const [key, value] of Object.entries(
|
|
26894
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
26182
26895
|
uri.searchParams.append(key, value);
|
|
26183
26896
|
}
|
|
26184
26897
|
return uri.toString();
|
|
@@ -26285,7 +26998,7 @@ class Organizations {
|
|
|
26285
26998
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
26286
26999
|
apiPayload['project'] = this.client.config.project;
|
|
26287
27000
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
26288
|
-
for (const [key, value] of Object.entries(
|
|
27001
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
26289
27002
|
uri.searchParams.append(key, value);
|
|
26290
27003
|
}
|
|
26291
27004
|
return uri.toString();
|
|
@@ -31781,6 +32494,38 @@ class Project {
|
|
|
31781
32494
|
};
|
|
31782
32495
|
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
31783
32496
|
}
|
|
32497
|
+
updatePasskeyPolicy(paramsOrFirst, ...rest) {
|
|
32498
|
+
let params;
|
|
32499
|
+
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
32500
|
+
(paramsOrFirst &&
|
|
32501
|
+
typeof paramsOrFirst === 'object' &&
|
|
32502
|
+
!Array.isArray(paramsOrFirst))) {
|
|
32503
|
+
params = (paramsOrFirst || {});
|
|
32504
|
+
}
|
|
32505
|
+
else {
|
|
32506
|
+
params = {
|
|
32507
|
+
rpId: paramsOrFirst,
|
|
32508
|
+
origins: rest[0],
|
|
32509
|
+
};
|
|
32510
|
+
}
|
|
32511
|
+
const rpId = params.rpId;
|
|
32512
|
+
const origins = params.origins;
|
|
32513
|
+
const apiPath = '/project/policies/passkey';
|
|
32514
|
+
const apiPayload = {};
|
|
32515
|
+
if (typeof rpId !== 'undefined') {
|
|
32516
|
+
apiPayload['rpId'] = rpId;
|
|
32517
|
+
}
|
|
32518
|
+
if (typeof origins !== 'undefined') {
|
|
32519
|
+
apiPayload['origins'] = origins;
|
|
32520
|
+
}
|
|
32521
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
32522
|
+
const apiHeaders = {
|
|
32523
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
32524
|
+
'content-type': 'application/json',
|
|
32525
|
+
accept: 'application/json',
|
|
32526
|
+
};
|
|
32527
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
32528
|
+
}
|
|
31784
32529
|
updatePasswordDictionaryPolicy(paramsOrFirst) {
|
|
31785
32530
|
let params;
|
|
31786
32531
|
if (paramsOrFirst &&
|
|
@@ -34471,7 +35216,7 @@ class Sites {
|
|
|
34471
35216
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
34472
35217
|
apiPayload['project'] = this.client.config.project;
|
|
34473
35218
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
34474
|
-
for (const [key, value] of Object.entries(
|
|
35219
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
34475
35220
|
uri.searchParams.append(key, value);
|
|
34476
35221
|
}
|
|
34477
35222
|
return uri.toString();
|
|
@@ -35302,7 +36047,7 @@ class Storage {
|
|
|
35302
36047
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
35303
36048
|
apiPayload['project'] = this.client.config.project;
|
|
35304
36049
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
35305
|
-
for (const [key, value] of Object.entries(
|
|
36050
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
35306
36051
|
uri.searchParams.append(key, value);
|
|
35307
36052
|
}
|
|
35308
36053
|
return uri.toString();
|
|
@@ -35395,7 +36140,7 @@ class Storage {
|
|
|
35395
36140
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
35396
36141
|
apiPayload['project'] = this.client.config.project;
|
|
35397
36142
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
35398
|
-
for (const [key, value] of Object.entries(
|
|
36143
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
35399
36144
|
uri.searchParams.append(key, value);
|
|
35400
36145
|
}
|
|
35401
36146
|
return uri.toString();
|
|
@@ -35433,7 +36178,7 @@ class Storage {
|
|
|
35433
36178
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
35434
36179
|
apiPayload['project'] = this.client.config.project;
|
|
35435
36180
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
35436
|
-
for (const [key, value] of Object.entries(
|
|
36181
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
35437
36182
|
uri.searchParams.append(key, value);
|
|
35438
36183
|
}
|
|
35439
36184
|
return uri.toString();
|
|
@@ -41744,6 +42489,106 @@ class Users {
|
|
|
41744
42489
|
};
|
|
41745
42490
|
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
41746
42491
|
}
|
|
42492
|
+
listPasskeys(paramsOrFirst, ...rest) {
|
|
42493
|
+
let params;
|
|
42494
|
+
if (paramsOrFirst &&
|
|
42495
|
+
typeof paramsOrFirst === 'object' &&
|
|
42496
|
+
!Array.isArray(paramsOrFirst)) {
|
|
42497
|
+
params = (paramsOrFirst || {});
|
|
42498
|
+
}
|
|
42499
|
+
else {
|
|
42500
|
+
params = {
|
|
42501
|
+
userId: paramsOrFirst,
|
|
42502
|
+
queries: rest[0],
|
|
42503
|
+
total: rest[1],
|
|
42504
|
+
};
|
|
42505
|
+
}
|
|
42506
|
+
const userId = params.userId;
|
|
42507
|
+
const queries = params.queries;
|
|
42508
|
+
const total = params.total;
|
|
42509
|
+
if (typeof userId === 'undefined' || userId === '') {
|
|
42510
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
42511
|
+
}
|
|
42512
|
+
const apiPath = '/users/{userId}/passkeys'.replace('{userId}', encodeURIComponent(String(userId)));
|
|
42513
|
+
const apiPayload = {};
|
|
42514
|
+
if (typeof queries !== 'undefined') {
|
|
42515
|
+
apiPayload['queries'] = queries;
|
|
42516
|
+
}
|
|
42517
|
+
if (typeof total !== 'undefined') {
|
|
42518
|
+
apiPayload['total'] = total;
|
|
42519
|
+
}
|
|
42520
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
42521
|
+
const apiHeaders = {
|
|
42522
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
42523
|
+
accept: 'application/json',
|
|
42524
|
+
};
|
|
42525
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
42526
|
+
}
|
|
42527
|
+
getPasskey(paramsOrFirst, ...rest) {
|
|
42528
|
+
let params;
|
|
42529
|
+
if (paramsOrFirst &&
|
|
42530
|
+
typeof paramsOrFirst === 'object' &&
|
|
42531
|
+
!Array.isArray(paramsOrFirst)) {
|
|
42532
|
+
params = (paramsOrFirst || {});
|
|
42533
|
+
}
|
|
42534
|
+
else {
|
|
42535
|
+
params = {
|
|
42536
|
+
userId: paramsOrFirst,
|
|
42537
|
+
passkeyId: rest[0],
|
|
42538
|
+
};
|
|
42539
|
+
}
|
|
42540
|
+
const userId = params.userId;
|
|
42541
|
+
const passkeyId = params.passkeyId;
|
|
42542
|
+
if (typeof userId === 'undefined' || userId === '') {
|
|
42543
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
42544
|
+
}
|
|
42545
|
+
if (typeof passkeyId === 'undefined' || passkeyId === '') {
|
|
42546
|
+
throw new AppwriteException('Missing required parameter: "passkeyId"');
|
|
42547
|
+
}
|
|
42548
|
+
const apiPath = '/users/{userId}/passkeys/{passkeyId}'
|
|
42549
|
+
.replace('{userId}', encodeURIComponent(String(userId)))
|
|
42550
|
+
.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
|
|
42551
|
+
const apiPayload = {};
|
|
42552
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
42553
|
+
const apiHeaders = {
|
|
42554
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
42555
|
+
accept: 'application/json',
|
|
42556
|
+
};
|
|
42557
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
42558
|
+
}
|
|
42559
|
+
deletePasskey(paramsOrFirst, ...rest) {
|
|
42560
|
+
let params;
|
|
42561
|
+
if (paramsOrFirst &&
|
|
42562
|
+
typeof paramsOrFirst === 'object' &&
|
|
42563
|
+
!Array.isArray(paramsOrFirst)) {
|
|
42564
|
+
params = (paramsOrFirst || {});
|
|
42565
|
+
}
|
|
42566
|
+
else {
|
|
42567
|
+
params = {
|
|
42568
|
+
userId: paramsOrFirst,
|
|
42569
|
+
passkeyId: rest[0],
|
|
42570
|
+
};
|
|
42571
|
+
}
|
|
42572
|
+
const userId = params.userId;
|
|
42573
|
+
const passkeyId = params.passkeyId;
|
|
42574
|
+
if (typeof userId === 'undefined' || userId === '') {
|
|
42575
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
42576
|
+
}
|
|
42577
|
+
if (typeof passkeyId === 'undefined' || passkeyId === '') {
|
|
42578
|
+
throw new AppwriteException('Missing required parameter: "passkeyId"');
|
|
42579
|
+
}
|
|
42580
|
+
const apiPath = '/users/{userId}/passkeys/{passkeyId}'
|
|
42581
|
+
.replace('{userId}', encodeURIComponent(String(userId)))
|
|
42582
|
+
.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
|
|
42583
|
+
const apiPayload = {};
|
|
42584
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
42585
|
+
const apiHeaders = {
|
|
42586
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
42587
|
+
'content-type': 'application/json',
|
|
42588
|
+
accept: 'application/json',
|
|
42589
|
+
};
|
|
42590
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
42591
|
+
}
|
|
41747
42592
|
updatePassword(paramsOrFirst, ...rest) {
|
|
41748
42593
|
let params;
|
|
41749
42594
|
if (paramsOrFirst &&
|
|
@@ -44250,11 +45095,11 @@ class VectorsDB {
|
|
|
44250
45095
|
}
|
|
44251
45096
|
}
|
|
44252
45097
|
|
|
44253
|
-
class
|
|
45098
|
+
class Videos {
|
|
44254
45099
|
constructor(client) {
|
|
44255
45100
|
this.client = client;
|
|
44256
45101
|
}
|
|
44257
|
-
|
|
45102
|
+
list(paramsOrFirst, ...rest) {
|
|
44258
45103
|
let params;
|
|
44259
45104
|
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
44260
45105
|
(paramsOrFirst &&
|
|
@@ -44272,7 +45117,7 @@ class Waf {
|
|
|
44272
45117
|
const queries = params.queries;
|
|
44273
45118
|
const search = params.search;
|
|
44274
45119
|
const total = params.total;
|
|
44275
|
-
const apiPath = '/
|
|
45120
|
+
const apiPath = '/videos';
|
|
44276
45121
|
const apiPayload = {};
|
|
44277
45122
|
if (typeof queries !== 'undefined') {
|
|
44278
45123
|
apiPayload['queries'] = queries;
|
|
@@ -44290,7 +45135,7 @@ class Waf {
|
|
|
44290
45135
|
};
|
|
44291
45136
|
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
44292
45137
|
}
|
|
44293
|
-
|
|
45138
|
+
create(paramsOrFirst, ...rest) {
|
|
44294
45139
|
let params;
|
|
44295
45140
|
if (paramsOrFirst &&
|
|
44296
45141
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -44299,59 +45144,31 @@ class Waf {
|
|
|
44299
45144
|
}
|
|
44300
45145
|
else {
|
|
44301
45146
|
params = {
|
|
44302
|
-
|
|
44303
|
-
|
|
45147
|
+
bucketId: paramsOrFirst,
|
|
45148
|
+
fileId: rest[0],
|
|
44304
45149
|
name: rest[1],
|
|
44305
|
-
resourceId: rest[2],
|
|
44306
|
-
description: rest[3],
|
|
44307
|
-
priority: rest[4],
|
|
44308
|
-
enabled: rest[5],
|
|
44309
|
-
conditions: rest[6],
|
|
44310
45150
|
};
|
|
44311
45151
|
}
|
|
44312
|
-
const
|
|
44313
|
-
const
|
|
45152
|
+
const bucketId = params.bucketId;
|
|
45153
|
+
const fileId = params.fileId;
|
|
44314
45154
|
const name = params.name;
|
|
44315
|
-
|
|
44316
|
-
|
|
44317
|
-
const priority = params.priority;
|
|
44318
|
-
const enabled = params.enabled;
|
|
44319
|
-
const conditions = params.conditions;
|
|
44320
|
-
if (typeof ruleId === 'undefined') {
|
|
44321
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
44322
|
-
}
|
|
44323
|
-
if (typeof resourceType === 'undefined') {
|
|
44324
|
-
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
45155
|
+
if (typeof bucketId === 'undefined') {
|
|
45156
|
+
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
44325
45157
|
}
|
|
44326
|
-
if (typeof
|
|
44327
|
-
throw new AppwriteException('Missing required parameter: "
|
|
45158
|
+
if (typeof fileId === 'undefined') {
|
|
45159
|
+
throw new AppwriteException('Missing required parameter: "fileId"');
|
|
44328
45160
|
}
|
|
44329
|
-
const apiPath = '/
|
|
45161
|
+
const apiPath = '/videos';
|
|
44330
45162
|
const apiPayload = {};
|
|
44331
|
-
if (typeof
|
|
44332
|
-
apiPayload['
|
|
44333
|
-
}
|
|
44334
|
-
if (typeof resourceType !== 'undefined') {
|
|
44335
|
-
apiPayload['resourceType'] = resourceType;
|
|
45163
|
+
if (typeof bucketId !== 'undefined') {
|
|
45164
|
+
apiPayload['bucketId'] = bucketId;
|
|
44336
45165
|
}
|
|
44337
|
-
if (typeof
|
|
44338
|
-
apiPayload['
|
|
45166
|
+
if (typeof fileId !== 'undefined') {
|
|
45167
|
+
apiPayload['fileId'] = fileId;
|
|
44339
45168
|
}
|
|
44340
45169
|
if (typeof name !== 'undefined') {
|
|
44341
45170
|
apiPayload['name'] = name;
|
|
44342
45171
|
}
|
|
44343
|
-
if (typeof description !== 'undefined') {
|
|
44344
|
-
apiPayload['description'] = description;
|
|
44345
|
-
}
|
|
44346
|
-
if (typeof priority !== 'undefined') {
|
|
44347
|
-
apiPayload['priority'] = priority;
|
|
44348
|
-
}
|
|
44349
|
-
if (typeof enabled !== 'undefined') {
|
|
44350
|
-
apiPayload['enabled'] = enabled;
|
|
44351
|
-
}
|
|
44352
|
-
if (typeof conditions !== 'undefined') {
|
|
44353
|
-
apiPayload['conditions'] = conditions;
|
|
44354
|
-
}
|
|
44355
45172
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
44356
45173
|
const apiHeaders = {
|
|
44357
45174
|
'X-Appwrite-Project': this.client.config.project,
|
|
@@ -44360,68 +45177,33 @@ class Waf {
|
|
|
44360
45177
|
};
|
|
44361
45178
|
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
44362
45179
|
}
|
|
44363
|
-
|
|
45180
|
+
listProfiles(paramsOrFirst) {
|
|
44364
45181
|
let params;
|
|
44365
|
-
if (paramsOrFirst
|
|
44366
|
-
|
|
44367
|
-
|
|
45182
|
+
if (typeof paramsOrFirst === 'undefined' ||
|
|
45183
|
+
(paramsOrFirst &&
|
|
45184
|
+
typeof paramsOrFirst === 'object' &&
|
|
45185
|
+
!Array.isArray(paramsOrFirst))) {
|
|
44368
45186
|
params = (paramsOrFirst || {});
|
|
44369
45187
|
}
|
|
44370
45188
|
else {
|
|
44371
45189
|
params = {
|
|
44372
|
-
|
|
44373
|
-
resourceType: rest[0],
|
|
44374
|
-
resourceId: rest[1],
|
|
44375
|
-
name: rest[2],
|
|
44376
|
-
description: rest[3],
|
|
44377
|
-
priority: rest[4],
|
|
44378
|
-
enabled: rest[5],
|
|
44379
|
-
conditions: rest[6],
|
|
45190
|
+
search: paramsOrFirst,
|
|
44380
45191
|
};
|
|
44381
45192
|
}
|
|
44382
|
-
const
|
|
44383
|
-
const
|
|
44384
|
-
const resourceId = params.resourceId;
|
|
44385
|
-
const name = params.name;
|
|
44386
|
-
const description = params.description;
|
|
44387
|
-
const priority = params.priority;
|
|
44388
|
-
const enabled = params.enabled;
|
|
44389
|
-
const conditions = params.conditions;
|
|
44390
|
-
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
44391
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
44392
|
-
}
|
|
44393
|
-
const apiPath = '/waf/rules/bypass/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
|
|
45193
|
+
const search = params.search;
|
|
45194
|
+
const apiPath = '/videos/profiles';
|
|
44394
45195
|
const apiPayload = {};
|
|
44395
|
-
if (typeof
|
|
44396
|
-
apiPayload['
|
|
44397
|
-
}
|
|
44398
|
-
if (typeof resourceId !== 'undefined') {
|
|
44399
|
-
apiPayload['resourceId'] = resourceId;
|
|
44400
|
-
}
|
|
44401
|
-
if (typeof name !== 'undefined') {
|
|
44402
|
-
apiPayload['name'] = name;
|
|
44403
|
-
}
|
|
44404
|
-
if (typeof description !== 'undefined') {
|
|
44405
|
-
apiPayload['description'] = description;
|
|
44406
|
-
}
|
|
44407
|
-
if (typeof priority !== 'undefined') {
|
|
44408
|
-
apiPayload['priority'] = priority;
|
|
44409
|
-
}
|
|
44410
|
-
if (typeof enabled !== 'undefined') {
|
|
44411
|
-
apiPayload['enabled'] = enabled;
|
|
44412
|
-
}
|
|
44413
|
-
if (typeof conditions !== 'undefined') {
|
|
44414
|
-
apiPayload['conditions'] = conditions;
|
|
45196
|
+
if (typeof search !== 'undefined') {
|
|
45197
|
+
apiPayload['search'] = search;
|
|
44415
45198
|
}
|
|
44416
45199
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
44417
45200
|
const apiHeaders = {
|
|
44418
45201
|
'X-Appwrite-Project': this.client.config.project,
|
|
44419
|
-
'content-type': 'application/json',
|
|
44420
45202
|
accept: 'application/json',
|
|
44421
45203
|
};
|
|
44422
|
-
return this.client.call('
|
|
45204
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
44423
45205
|
}
|
|
44424
|
-
|
|
45206
|
+
createProfile(paramsOrFirst, ...rest) {
|
|
44425
45207
|
let params;
|
|
44426
45208
|
if (paramsOrFirst &&
|
|
44427
45209
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -44430,73 +45212,49 @@ class Waf {
|
|
|
44430
45212
|
}
|
|
44431
45213
|
else {
|
|
44432
45214
|
params = {
|
|
44433
|
-
|
|
44434
|
-
|
|
44435
|
-
|
|
44436
|
-
|
|
44437
|
-
|
|
44438
|
-
challengeType: rest[4],
|
|
44439
|
-
priority: rest[5],
|
|
44440
|
-
enabled: rest[6],
|
|
44441
|
-
conditions: rest[7],
|
|
44442
|
-
difficulty: rest[8],
|
|
44443
|
-
ttl: rest[9],
|
|
45215
|
+
name: paramsOrFirst,
|
|
45216
|
+
videoBitRate: rest[0],
|
|
45217
|
+
audioBitRate: rest[1],
|
|
45218
|
+
width: rest[2],
|
|
45219
|
+
height: rest[3],
|
|
44444
45220
|
};
|
|
44445
45221
|
}
|
|
44446
|
-
const ruleId = params.ruleId;
|
|
44447
|
-
const resourceType = params.resourceType;
|
|
44448
45222
|
const name = params.name;
|
|
44449
|
-
const
|
|
44450
|
-
const
|
|
44451
|
-
const
|
|
44452
|
-
const
|
|
44453
|
-
const enabled = params.enabled;
|
|
44454
|
-
const conditions = params.conditions;
|
|
44455
|
-
const difficulty = params.difficulty;
|
|
44456
|
-
const ttl = params.ttl;
|
|
44457
|
-
if (typeof ruleId === 'undefined') {
|
|
44458
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
44459
|
-
}
|
|
44460
|
-
if (typeof resourceType === 'undefined') {
|
|
44461
|
-
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
44462
|
-
}
|
|
45223
|
+
const videoBitRate = params.videoBitRate;
|
|
45224
|
+
const audioBitRate = params.audioBitRate;
|
|
45225
|
+
const width = params.width;
|
|
45226
|
+
const height = params.height;
|
|
44463
45227
|
if (typeof name === 'undefined') {
|
|
44464
45228
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
44465
45229
|
}
|
|
44466
|
-
|
|
44467
|
-
|
|
44468
|
-
if (typeof ruleId !== 'undefined') {
|
|
44469
|
-
apiPayload['ruleId'] = ruleId;
|
|
45230
|
+
if (typeof videoBitRate === 'undefined') {
|
|
45231
|
+
throw new AppwriteException('Missing required parameter: "videoBitRate"');
|
|
44470
45232
|
}
|
|
44471
|
-
if (typeof
|
|
44472
|
-
|
|
45233
|
+
if (typeof audioBitRate === 'undefined') {
|
|
45234
|
+
throw new AppwriteException('Missing required parameter: "audioBitRate"');
|
|
44473
45235
|
}
|
|
44474
|
-
if (typeof
|
|
44475
|
-
|
|
45236
|
+
if (typeof width === 'undefined') {
|
|
45237
|
+
throw new AppwriteException('Missing required parameter: "width"');
|
|
44476
45238
|
}
|
|
45239
|
+
if (typeof height === 'undefined') {
|
|
45240
|
+
throw new AppwriteException('Missing required parameter: "height"');
|
|
45241
|
+
}
|
|
45242
|
+
const apiPath = '/videos/profiles';
|
|
45243
|
+
const apiPayload = {};
|
|
44477
45244
|
if (typeof name !== 'undefined') {
|
|
44478
45245
|
apiPayload['name'] = name;
|
|
44479
45246
|
}
|
|
44480
|
-
if (typeof
|
|
44481
|
-
apiPayload['
|
|
44482
|
-
}
|
|
44483
|
-
if (typeof challengeType !== 'undefined') {
|
|
44484
|
-
apiPayload['challengeType'] = challengeType;
|
|
44485
|
-
}
|
|
44486
|
-
if (typeof priority !== 'undefined') {
|
|
44487
|
-
apiPayload['priority'] = priority;
|
|
44488
|
-
}
|
|
44489
|
-
if (typeof enabled !== 'undefined') {
|
|
44490
|
-
apiPayload['enabled'] = enabled;
|
|
45247
|
+
if (typeof videoBitRate !== 'undefined') {
|
|
45248
|
+
apiPayload['videoBitRate'] = videoBitRate;
|
|
44491
45249
|
}
|
|
44492
|
-
if (typeof
|
|
44493
|
-
apiPayload['
|
|
45250
|
+
if (typeof audioBitRate !== 'undefined') {
|
|
45251
|
+
apiPayload['audioBitRate'] = audioBitRate;
|
|
44494
45252
|
}
|
|
44495
|
-
if (typeof
|
|
44496
|
-
apiPayload['
|
|
45253
|
+
if (typeof width !== 'undefined') {
|
|
45254
|
+
apiPayload['width'] = width;
|
|
44497
45255
|
}
|
|
44498
|
-
if (typeof
|
|
44499
|
-
apiPayload['
|
|
45256
|
+
if (typeof height !== 'undefined') {
|
|
45257
|
+
apiPayload['height'] = height;
|
|
44500
45258
|
}
|
|
44501
45259
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
44502
45260
|
const apiHeaders = {
|
|
@@ -44506,7 +45264,7 @@ class Waf {
|
|
|
44506
45264
|
};
|
|
44507
45265
|
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
44508
45266
|
}
|
|
44509
|
-
|
|
45267
|
+
getProfile(paramsOrFirst) {
|
|
44510
45268
|
let params;
|
|
44511
45269
|
if (paramsOrFirst &&
|
|
44512
45270
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -44515,74 +45273,23 @@ class Waf {
|
|
|
44515
45273
|
}
|
|
44516
45274
|
else {
|
|
44517
45275
|
params = {
|
|
44518
|
-
|
|
44519
|
-
resourceType: rest[0],
|
|
44520
|
-
resourceId: rest[1],
|
|
44521
|
-
name: rest[2],
|
|
44522
|
-
description: rest[3],
|
|
44523
|
-
challengeType: rest[4],
|
|
44524
|
-
priority: rest[5],
|
|
44525
|
-
enabled: rest[6],
|
|
44526
|
-
conditions: rest[7],
|
|
44527
|
-
difficulty: rest[8],
|
|
44528
|
-
ttl: rest[9],
|
|
45276
|
+
profileId: paramsOrFirst,
|
|
44529
45277
|
};
|
|
44530
45278
|
}
|
|
44531
|
-
const
|
|
44532
|
-
|
|
44533
|
-
|
|
44534
|
-
const name = params.name;
|
|
44535
|
-
const description = params.description;
|
|
44536
|
-
const challengeType = params.challengeType;
|
|
44537
|
-
const priority = params.priority;
|
|
44538
|
-
const enabled = params.enabled;
|
|
44539
|
-
const conditions = params.conditions;
|
|
44540
|
-
const difficulty = params.difficulty;
|
|
44541
|
-
const ttl = params.ttl;
|
|
44542
|
-
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
44543
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
45279
|
+
const profileId = params.profileId;
|
|
45280
|
+
if (typeof profileId === 'undefined' || profileId === '') {
|
|
45281
|
+
throw new AppwriteException('Missing required parameter: "profileId"');
|
|
44544
45282
|
}
|
|
44545
|
-
const apiPath = '/
|
|
45283
|
+
const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
|
|
44546
45284
|
const apiPayload = {};
|
|
44547
|
-
if (typeof resourceType !== 'undefined') {
|
|
44548
|
-
apiPayload['resourceType'] = resourceType;
|
|
44549
|
-
}
|
|
44550
|
-
if (typeof resourceId !== 'undefined') {
|
|
44551
|
-
apiPayload['resourceId'] = resourceId;
|
|
44552
|
-
}
|
|
44553
|
-
if (typeof name !== 'undefined') {
|
|
44554
|
-
apiPayload['name'] = name;
|
|
44555
|
-
}
|
|
44556
|
-
if (typeof description !== 'undefined') {
|
|
44557
|
-
apiPayload['description'] = description;
|
|
44558
|
-
}
|
|
44559
|
-
if (typeof challengeType !== 'undefined') {
|
|
44560
|
-
apiPayload['challengeType'] = challengeType;
|
|
44561
|
-
}
|
|
44562
|
-
if (typeof priority !== 'undefined') {
|
|
44563
|
-
apiPayload['priority'] = priority;
|
|
44564
|
-
}
|
|
44565
|
-
if (typeof enabled !== 'undefined') {
|
|
44566
|
-
apiPayload['enabled'] = enabled;
|
|
44567
|
-
}
|
|
44568
|
-
if (typeof conditions !== 'undefined') {
|
|
44569
|
-
apiPayload['conditions'] = conditions;
|
|
44570
|
-
}
|
|
44571
|
-
if (typeof difficulty !== 'undefined') {
|
|
44572
|
-
apiPayload['difficulty'] = difficulty;
|
|
44573
|
-
}
|
|
44574
|
-
if (typeof ttl !== 'undefined') {
|
|
44575
|
-
apiPayload['ttl'] = ttl;
|
|
44576
|
-
}
|
|
44577
45285
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
44578
45286
|
const apiHeaders = {
|
|
44579
45287
|
'X-Appwrite-Project': this.client.config.project,
|
|
44580
|
-
'content-type': 'application/json',
|
|
44581
45288
|
accept: 'application/json',
|
|
44582
45289
|
};
|
|
44583
|
-
return this.client.call('
|
|
45290
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
44584
45291
|
}
|
|
44585
|
-
|
|
45292
|
+
updateProfile(paramsOrFirst, ...rest) {
|
|
44586
45293
|
let params;
|
|
44587
45294
|
if (paramsOrFirst &&
|
|
44588
45295
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -44591,58 +45298,54 @@ class Waf {
|
|
|
44591
45298
|
}
|
|
44592
45299
|
else {
|
|
44593
45300
|
params = {
|
|
44594
|
-
|
|
44595
|
-
|
|
44596
|
-
|
|
44597
|
-
|
|
44598
|
-
|
|
44599
|
-
|
|
44600
|
-
enabled: rest[5],
|
|
44601
|
-
conditions: rest[6],
|
|
45301
|
+
profileId: paramsOrFirst,
|
|
45302
|
+
name: rest[0],
|
|
45303
|
+
videoBitRate: rest[1],
|
|
45304
|
+
audioBitRate: rest[2],
|
|
45305
|
+
width: rest[3],
|
|
45306
|
+
height: rest[4],
|
|
44602
45307
|
};
|
|
44603
45308
|
}
|
|
44604
|
-
const
|
|
44605
|
-
const resourceType = params.resourceType;
|
|
45309
|
+
const profileId = params.profileId;
|
|
44606
45310
|
const name = params.name;
|
|
44607
|
-
const
|
|
44608
|
-
const
|
|
44609
|
-
const
|
|
44610
|
-
const
|
|
44611
|
-
|
|
44612
|
-
|
|
44613
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
44614
|
-
}
|
|
44615
|
-
if (typeof resourceType === 'undefined') {
|
|
44616
|
-
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
45311
|
+
const videoBitRate = params.videoBitRate;
|
|
45312
|
+
const audioBitRate = params.audioBitRate;
|
|
45313
|
+
const width = params.width;
|
|
45314
|
+
const height = params.height;
|
|
45315
|
+
if (typeof profileId === 'undefined' || profileId === '') {
|
|
45316
|
+
throw new AppwriteException('Missing required parameter: "profileId"');
|
|
44617
45317
|
}
|
|
44618
45318
|
if (typeof name === 'undefined') {
|
|
44619
45319
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
44620
45320
|
}
|
|
44621
|
-
|
|
44622
|
-
|
|
44623
|
-
if (typeof ruleId !== 'undefined') {
|
|
44624
|
-
apiPayload['ruleId'] = ruleId;
|
|
45321
|
+
if (typeof videoBitRate === 'undefined') {
|
|
45322
|
+
throw new AppwriteException('Missing required parameter: "videoBitRate"');
|
|
44625
45323
|
}
|
|
44626
|
-
if (typeof
|
|
44627
|
-
|
|
45324
|
+
if (typeof audioBitRate === 'undefined') {
|
|
45325
|
+
throw new AppwriteException('Missing required parameter: "audioBitRate"');
|
|
44628
45326
|
}
|
|
44629
|
-
if (typeof
|
|
44630
|
-
|
|
45327
|
+
if (typeof width === 'undefined') {
|
|
45328
|
+
throw new AppwriteException('Missing required parameter: "width"');
|
|
44631
45329
|
}
|
|
45330
|
+
if (typeof height === 'undefined') {
|
|
45331
|
+
throw new AppwriteException('Missing required parameter: "height"');
|
|
45332
|
+
}
|
|
45333
|
+
const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
|
|
45334
|
+
const apiPayload = {};
|
|
44632
45335
|
if (typeof name !== 'undefined') {
|
|
44633
45336
|
apiPayload['name'] = name;
|
|
44634
45337
|
}
|
|
44635
|
-
if (typeof
|
|
44636
|
-
apiPayload['
|
|
45338
|
+
if (typeof videoBitRate !== 'undefined') {
|
|
45339
|
+
apiPayload['videoBitRate'] = videoBitRate;
|
|
44637
45340
|
}
|
|
44638
|
-
if (typeof
|
|
44639
|
-
apiPayload['
|
|
45341
|
+
if (typeof audioBitRate !== 'undefined') {
|
|
45342
|
+
apiPayload['audioBitRate'] = audioBitRate;
|
|
44640
45343
|
}
|
|
44641
|
-
if (typeof
|
|
44642
|
-
apiPayload['
|
|
45344
|
+
if (typeof width !== 'undefined') {
|
|
45345
|
+
apiPayload['width'] = width;
|
|
44643
45346
|
}
|
|
44644
|
-
if (typeof
|
|
44645
|
-
apiPayload['
|
|
45347
|
+
if (typeof height !== 'undefined') {
|
|
45348
|
+
apiPayload['height'] = height;
|
|
44646
45349
|
}
|
|
44647
45350
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
44648
45351
|
const apiHeaders = {
|
|
@@ -44650,9 +45353,9 @@ class Waf {
|
|
|
44650
45353
|
'content-type': 'application/json',
|
|
44651
45354
|
accept: 'application/json',
|
|
44652
45355
|
};
|
|
44653
|
-
return this.client.call('
|
|
45356
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
44654
45357
|
}
|
|
44655
|
-
|
|
45358
|
+
deleteProfile(paramsOrFirst) {
|
|
44656
45359
|
let params;
|
|
44657
45360
|
if (paramsOrFirst &&
|
|
44658
45361
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -44661,59 +45364,49 @@ class Waf {
|
|
|
44661
45364
|
}
|
|
44662
45365
|
else {
|
|
44663
45366
|
params = {
|
|
44664
|
-
|
|
44665
|
-
resourceType: rest[0],
|
|
44666
|
-
resourceId: rest[1],
|
|
44667
|
-
name: rest[2],
|
|
44668
|
-
description: rest[3],
|
|
44669
|
-
priority: rest[4],
|
|
44670
|
-
enabled: rest[5],
|
|
44671
|
-
conditions: rest[6],
|
|
45367
|
+
profileId: paramsOrFirst,
|
|
44672
45368
|
};
|
|
44673
45369
|
}
|
|
44674
|
-
const
|
|
44675
|
-
|
|
44676
|
-
|
|
44677
|
-
const name = params.name;
|
|
44678
|
-
const description = params.description;
|
|
44679
|
-
const priority = params.priority;
|
|
44680
|
-
const enabled = params.enabled;
|
|
44681
|
-
const conditions = params.conditions;
|
|
44682
|
-
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
44683
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
45370
|
+
const profileId = params.profileId;
|
|
45371
|
+
if (typeof profileId === 'undefined' || profileId === '') {
|
|
45372
|
+
throw new AppwriteException('Missing required parameter: "profileId"');
|
|
44684
45373
|
}
|
|
44685
|
-
const apiPath = '/
|
|
45374
|
+
const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
|
|
44686
45375
|
const apiPayload = {};
|
|
44687
|
-
|
|
44688
|
-
|
|
44689
|
-
|
|
44690
|
-
|
|
44691
|
-
|
|
44692
|
-
}
|
|
44693
|
-
|
|
44694
|
-
|
|
44695
|
-
|
|
44696
|
-
|
|
44697
|
-
|
|
44698
|
-
|
|
44699
|
-
|
|
44700
|
-
|
|
45376
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45377
|
+
const apiHeaders = {
|
|
45378
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45379
|
+
'content-type': 'application/json',
|
|
45380
|
+
accept: 'application/json',
|
|
45381
|
+
};
|
|
45382
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
45383
|
+
}
|
|
45384
|
+
get(paramsOrFirst) {
|
|
45385
|
+
let params;
|
|
45386
|
+
if (paramsOrFirst &&
|
|
45387
|
+
typeof paramsOrFirst === 'object' &&
|
|
45388
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45389
|
+
params = (paramsOrFirst || {});
|
|
44701
45390
|
}
|
|
44702
|
-
|
|
44703
|
-
|
|
45391
|
+
else {
|
|
45392
|
+
params = {
|
|
45393
|
+
videoId: paramsOrFirst,
|
|
45394
|
+
};
|
|
44704
45395
|
}
|
|
44705
|
-
|
|
44706
|
-
|
|
45396
|
+
const videoId = params.videoId;
|
|
45397
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45398
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
44707
45399
|
}
|
|
45400
|
+
const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45401
|
+
const apiPayload = {};
|
|
44708
45402
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
44709
45403
|
const apiHeaders = {
|
|
44710
45404
|
'X-Appwrite-Project': this.client.config.project,
|
|
44711
|
-
'content-type': 'application/json',
|
|
44712
45405
|
accept: 'application/json',
|
|
44713
45406
|
};
|
|
44714
|
-
return this.client.call('
|
|
45407
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
44715
45408
|
}
|
|
44716
|
-
|
|
45409
|
+
update(paramsOrFirst, ...rest) {
|
|
44717
45410
|
let params;
|
|
44718
45411
|
if (paramsOrFirst &&
|
|
44719
45412
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -44722,65 +45415,1347 @@ class Waf {
|
|
|
44722
45415
|
}
|
|
44723
45416
|
else {
|
|
44724
45417
|
params = {
|
|
44725
|
-
|
|
44726
|
-
|
|
44727
|
-
name: rest[1],
|
|
44728
|
-
limit: rest[2],
|
|
44729
|
-
interval: rest[3],
|
|
44730
|
-
resourceId: rest[4],
|
|
44731
|
-
description: rest[5],
|
|
44732
|
-
key: rest[6],
|
|
44733
|
-
strategy: rest[7],
|
|
44734
|
-
maxBucketSize: rest[8],
|
|
44735
|
-
priority: rest[9],
|
|
44736
|
-
enabled: rest[10],
|
|
44737
|
-
conditions: rest[11],
|
|
45418
|
+
videoId: paramsOrFirst,
|
|
45419
|
+
name: rest[0],
|
|
44738
45420
|
};
|
|
44739
45421
|
}
|
|
44740
|
-
const
|
|
44741
|
-
const resourceType = params.resourceType;
|
|
45422
|
+
const videoId = params.videoId;
|
|
44742
45423
|
const name = params.name;
|
|
44743
|
-
|
|
44744
|
-
|
|
44745
|
-
const resourceId = params.resourceId;
|
|
44746
|
-
const description = params.description;
|
|
44747
|
-
const key = params.key;
|
|
44748
|
-
const strategy = params.strategy;
|
|
44749
|
-
const maxBucketSize = params.maxBucketSize;
|
|
44750
|
-
const priority = params.priority;
|
|
44751
|
-
const enabled = params.enabled;
|
|
44752
|
-
const conditions = params.conditions;
|
|
44753
|
-
if (typeof ruleId === 'undefined') {
|
|
44754
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
44755
|
-
}
|
|
44756
|
-
if (typeof resourceType === 'undefined') {
|
|
44757
|
-
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
45424
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45425
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
44758
45426
|
}
|
|
44759
45427
|
if (typeof name === 'undefined') {
|
|
44760
45428
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
44761
45429
|
}
|
|
44762
|
-
|
|
44763
|
-
throw new AppwriteException('Missing required parameter: "limit"');
|
|
44764
|
-
}
|
|
44765
|
-
if (typeof interval === 'undefined') {
|
|
44766
|
-
throw new AppwriteException('Missing required parameter: "interval"');
|
|
44767
|
-
}
|
|
44768
|
-
const apiPath = '/waf/rules/rate-limit';
|
|
45430
|
+
const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
44769
45431
|
const apiPayload = {};
|
|
44770
|
-
if (typeof ruleId !== 'undefined') {
|
|
44771
|
-
apiPayload['ruleId'] = ruleId;
|
|
44772
|
-
}
|
|
44773
|
-
if (typeof resourceType !== 'undefined') {
|
|
44774
|
-
apiPayload['resourceType'] = resourceType;
|
|
44775
|
-
}
|
|
44776
|
-
if (typeof resourceId !== 'undefined') {
|
|
44777
|
-
apiPayload['resourceId'] = resourceId;
|
|
44778
|
-
}
|
|
44779
45432
|
if (typeof name !== 'undefined') {
|
|
44780
45433
|
apiPayload['name'] = name;
|
|
44781
45434
|
}
|
|
44782
|
-
|
|
44783
|
-
|
|
45435
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45436
|
+
const apiHeaders = {
|
|
45437
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45438
|
+
'content-type': 'application/json',
|
|
45439
|
+
accept: 'application/json',
|
|
45440
|
+
};
|
|
45441
|
+
return this.client.call('put', uri, apiHeaders, apiPayload);
|
|
45442
|
+
}
|
|
45443
|
+
delete(paramsOrFirst) {
|
|
45444
|
+
let params;
|
|
45445
|
+
if (paramsOrFirst &&
|
|
45446
|
+
typeof paramsOrFirst === 'object' &&
|
|
45447
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45448
|
+
params = (paramsOrFirst || {});
|
|
45449
|
+
}
|
|
45450
|
+
else {
|
|
45451
|
+
params = {
|
|
45452
|
+
videoId: paramsOrFirst,
|
|
45453
|
+
};
|
|
45454
|
+
}
|
|
45455
|
+
const videoId = params.videoId;
|
|
45456
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45457
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45458
|
+
}
|
|
45459
|
+
const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45460
|
+
const apiPayload = {};
|
|
45461
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45462
|
+
const apiHeaders = {
|
|
45463
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45464
|
+
'content-type': 'application/json',
|
|
45465
|
+
accept: 'application/json',
|
|
45466
|
+
};
|
|
45467
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
45468
|
+
}
|
|
45469
|
+
getCmafHlsManifest(paramsOrFirst) {
|
|
45470
|
+
let params;
|
|
45471
|
+
if (paramsOrFirst &&
|
|
45472
|
+
typeof paramsOrFirst === 'object' &&
|
|
45473
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45474
|
+
params = (paramsOrFirst || {});
|
|
45475
|
+
}
|
|
45476
|
+
else {
|
|
45477
|
+
params = {
|
|
45478
|
+
videoId: paramsOrFirst,
|
|
45479
|
+
};
|
|
45480
|
+
}
|
|
45481
|
+
const videoId = params.videoId;
|
|
45482
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45483
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45484
|
+
}
|
|
45485
|
+
const apiPath = '/videos/{videoId}/outputs/cmaf/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45486
|
+
const apiPayload = {};
|
|
45487
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45488
|
+
apiPayload['project'] = this.client.config.project;
|
|
45489
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45490
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45491
|
+
uri.searchParams.append(key, value);
|
|
45492
|
+
}
|
|
45493
|
+
return uri.toString();
|
|
45494
|
+
}
|
|
45495
|
+
getCmafDashManifest(paramsOrFirst) {
|
|
45496
|
+
let params;
|
|
45497
|
+
if (paramsOrFirst &&
|
|
45498
|
+
typeof paramsOrFirst === 'object' &&
|
|
45499
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45500
|
+
params = (paramsOrFirst || {});
|
|
45501
|
+
}
|
|
45502
|
+
else {
|
|
45503
|
+
params = {
|
|
45504
|
+
videoId: paramsOrFirst,
|
|
45505
|
+
};
|
|
45506
|
+
}
|
|
45507
|
+
const videoId = params.videoId;
|
|
45508
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45509
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45510
|
+
}
|
|
45511
|
+
const apiPath = '/videos/{videoId}/outputs/cmaf/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45512
|
+
const apiPayload = {};
|
|
45513
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45514
|
+
apiPayload['project'] = this.client.config.project;
|
|
45515
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45516
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45517
|
+
uri.searchParams.append(key, value);
|
|
45518
|
+
}
|
|
45519
|
+
return uri.toString();
|
|
45520
|
+
}
|
|
45521
|
+
getCmafStreamManifest(paramsOrFirst, ...rest) {
|
|
45522
|
+
let params;
|
|
45523
|
+
if (paramsOrFirst &&
|
|
45524
|
+
typeof paramsOrFirst === 'object' &&
|
|
45525
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45526
|
+
params = (paramsOrFirst || {});
|
|
45527
|
+
}
|
|
45528
|
+
else {
|
|
45529
|
+
params = {
|
|
45530
|
+
videoId: paramsOrFirst,
|
|
45531
|
+
renditionId: rest[0],
|
|
45532
|
+
streamId: rest[1],
|
|
45533
|
+
};
|
|
45534
|
+
}
|
|
45535
|
+
const videoId = params.videoId;
|
|
45536
|
+
const renditionId = params.renditionId;
|
|
45537
|
+
const streamId = params.streamId;
|
|
45538
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45539
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45540
|
+
}
|
|
45541
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
45542
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
45543
|
+
}
|
|
45544
|
+
if (typeof streamId === 'undefined') {
|
|
45545
|
+
throw new AppwriteException('Missing required parameter: "streamId"');
|
|
45546
|
+
}
|
|
45547
|
+
const apiPath = '/videos/{videoId}/outputs/cmaf/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
|
|
45548
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45549
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)))
|
|
45550
|
+
.replace('{streamId}', encodeURIComponent(String(streamId)));
|
|
45551
|
+
const apiPayload = {};
|
|
45552
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45553
|
+
apiPayload['project'] = this.client.config.project;
|
|
45554
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45555
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45556
|
+
uri.searchParams.append(key, value);
|
|
45557
|
+
}
|
|
45558
|
+
return uri.toString();
|
|
45559
|
+
}
|
|
45560
|
+
getDashManifest(paramsOrFirst) {
|
|
45561
|
+
let params;
|
|
45562
|
+
if (paramsOrFirst &&
|
|
45563
|
+
typeof paramsOrFirst === 'object' &&
|
|
45564
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45565
|
+
params = (paramsOrFirst || {});
|
|
45566
|
+
}
|
|
45567
|
+
else {
|
|
45568
|
+
params = {
|
|
45569
|
+
videoId: paramsOrFirst,
|
|
45570
|
+
};
|
|
45571
|
+
}
|
|
45572
|
+
const videoId = params.videoId;
|
|
45573
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45574
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45575
|
+
}
|
|
45576
|
+
const apiPath = '/videos/{videoId}/outputs/dash/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45577
|
+
const apiPayload = {};
|
|
45578
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45579
|
+
apiPayload['project'] = this.client.config.project;
|
|
45580
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45581
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45582
|
+
uri.searchParams.append(key, value);
|
|
45583
|
+
}
|
|
45584
|
+
return uri.toString();
|
|
45585
|
+
}
|
|
45586
|
+
getHlsManifest(paramsOrFirst) {
|
|
45587
|
+
let params;
|
|
45588
|
+
if (paramsOrFirst &&
|
|
45589
|
+
typeof paramsOrFirst === 'object' &&
|
|
45590
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45591
|
+
params = (paramsOrFirst || {});
|
|
45592
|
+
}
|
|
45593
|
+
else {
|
|
45594
|
+
params = {
|
|
45595
|
+
videoId: paramsOrFirst,
|
|
45596
|
+
};
|
|
45597
|
+
}
|
|
45598
|
+
const videoId = params.videoId;
|
|
45599
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45600
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45601
|
+
}
|
|
45602
|
+
const apiPath = '/videos/{videoId}/outputs/hls/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45603
|
+
const apiPayload = {};
|
|
45604
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45605
|
+
apiPayload['project'] = this.client.config.project;
|
|
45606
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45607
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45608
|
+
uri.searchParams.append(key, value);
|
|
45609
|
+
}
|
|
45610
|
+
return uri.toString();
|
|
45611
|
+
}
|
|
45612
|
+
getStreamManifest(paramsOrFirst, ...rest) {
|
|
45613
|
+
let params;
|
|
45614
|
+
if (paramsOrFirst &&
|
|
45615
|
+
typeof paramsOrFirst === 'object' &&
|
|
45616
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45617
|
+
params = (paramsOrFirst || {});
|
|
45618
|
+
}
|
|
45619
|
+
else {
|
|
45620
|
+
params = {
|
|
45621
|
+
videoId: paramsOrFirst,
|
|
45622
|
+
renditionId: rest[0],
|
|
45623
|
+
streamId: rest[1],
|
|
45624
|
+
};
|
|
45625
|
+
}
|
|
45626
|
+
const videoId = params.videoId;
|
|
45627
|
+
const renditionId = params.renditionId;
|
|
45628
|
+
const streamId = params.streamId;
|
|
45629
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45630
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45631
|
+
}
|
|
45632
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
45633
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
45634
|
+
}
|
|
45635
|
+
if (typeof streamId === 'undefined') {
|
|
45636
|
+
throw new AppwriteException('Missing required parameter: "streamId"');
|
|
45637
|
+
}
|
|
45638
|
+
const apiPath = '/videos/{videoId}/outputs/hls/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
|
|
45639
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45640
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)))
|
|
45641
|
+
.replace('{streamId}', encodeURIComponent(String(streamId)));
|
|
45642
|
+
const apiPayload = {};
|
|
45643
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45644
|
+
apiPayload['project'] = this.client.config.project;
|
|
45645
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45646
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45647
|
+
uri.searchParams.append(key, value);
|
|
45648
|
+
}
|
|
45649
|
+
return uri.toString();
|
|
45650
|
+
}
|
|
45651
|
+
getSegment(paramsOrFirst, ...rest) {
|
|
45652
|
+
let params;
|
|
45653
|
+
if (paramsOrFirst &&
|
|
45654
|
+
typeof paramsOrFirst === 'object' &&
|
|
45655
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45656
|
+
params = (paramsOrFirst || {});
|
|
45657
|
+
}
|
|
45658
|
+
else {
|
|
45659
|
+
params = {
|
|
45660
|
+
videoId: paramsOrFirst,
|
|
45661
|
+
output: rest[0],
|
|
45662
|
+
renditionId: rest[1],
|
|
45663
|
+
segmentId: rest[2],
|
|
45664
|
+
};
|
|
45665
|
+
}
|
|
45666
|
+
const videoId = params.videoId;
|
|
45667
|
+
const output = params.output;
|
|
45668
|
+
const renditionId = params.renditionId;
|
|
45669
|
+
const segmentId = params.segmentId;
|
|
45670
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45671
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45672
|
+
}
|
|
45673
|
+
if (typeof output === 'undefined') {
|
|
45674
|
+
throw new AppwriteException('Missing required parameter: "output"');
|
|
45675
|
+
}
|
|
45676
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
45677
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
45678
|
+
}
|
|
45679
|
+
if (typeof segmentId === 'undefined' || segmentId === '') {
|
|
45680
|
+
throw new AppwriteException('Missing required parameter: "segmentId"');
|
|
45681
|
+
}
|
|
45682
|
+
const apiPath = '/videos/{videoId}/outputs/{output}/renditions/{renditionId}/segments/{segmentId}'
|
|
45683
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45684
|
+
.replace('{output}', encodeURIComponent(String(output)))
|
|
45685
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)))
|
|
45686
|
+
.replace('{segmentId}', encodeURIComponent(String(segmentId)));
|
|
45687
|
+
const apiPayload = {};
|
|
45688
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45689
|
+
apiPayload['project'] = this.client.config.project;
|
|
45690
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45691
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45692
|
+
uri.searchParams.append(key, value);
|
|
45693
|
+
}
|
|
45694
|
+
return uri.toString();
|
|
45695
|
+
}
|
|
45696
|
+
getSubtitleManifest(paramsOrFirst, ...rest) {
|
|
45697
|
+
let params;
|
|
45698
|
+
if (paramsOrFirst &&
|
|
45699
|
+
typeof paramsOrFirst === 'object' &&
|
|
45700
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45701
|
+
params = (paramsOrFirst || {});
|
|
45702
|
+
}
|
|
45703
|
+
else {
|
|
45704
|
+
params = {
|
|
45705
|
+
videoId: paramsOrFirst,
|
|
45706
|
+
output: rest[0],
|
|
45707
|
+
subtitleId: rest[1],
|
|
45708
|
+
};
|
|
45709
|
+
}
|
|
45710
|
+
const videoId = params.videoId;
|
|
45711
|
+
const output = params.output;
|
|
45712
|
+
const subtitleId = params.subtitleId;
|
|
45713
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45714
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45715
|
+
}
|
|
45716
|
+
if (typeof output === 'undefined') {
|
|
45717
|
+
throw new AppwriteException('Missing required parameter: "output"');
|
|
45718
|
+
}
|
|
45719
|
+
if (typeof subtitleId === 'undefined' || subtitleId === '') {
|
|
45720
|
+
throw new AppwriteException('Missing required parameter: "subtitleId"');
|
|
45721
|
+
}
|
|
45722
|
+
const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/manifest'
|
|
45723
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45724
|
+
.replace('{output}', encodeURIComponent(String(output)))
|
|
45725
|
+
.replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
|
|
45726
|
+
const apiPayload = {};
|
|
45727
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45728
|
+
apiPayload['project'] = this.client.config.project;
|
|
45729
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45730
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45731
|
+
uri.searchParams.append(key, value);
|
|
45732
|
+
}
|
|
45733
|
+
return uri.toString();
|
|
45734
|
+
}
|
|
45735
|
+
getSubtitleSegment(paramsOrFirst, ...rest) {
|
|
45736
|
+
let params;
|
|
45737
|
+
if (paramsOrFirst &&
|
|
45738
|
+
typeof paramsOrFirst === 'object' &&
|
|
45739
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45740
|
+
params = (paramsOrFirst || {});
|
|
45741
|
+
}
|
|
45742
|
+
else {
|
|
45743
|
+
params = {
|
|
45744
|
+
videoId: paramsOrFirst,
|
|
45745
|
+
output: rest[0],
|
|
45746
|
+
subtitleId: rest[1],
|
|
45747
|
+
segmentId: rest[2],
|
|
45748
|
+
};
|
|
45749
|
+
}
|
|
45750
|
+
const videoId = params.videoId;
|
|
45751
|
+
const output = params.output;
|
|
45752
|
+
const subtitleId = params.subtitleId;
|
|
45753
|
+
const segmentId = params.segmentId;
|
|
45754
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45755
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45756
|
+
}
|
|
45757
|
+
if (typeof output === 'undefined') {
|
|
45758
|
+
throw new AppwriteException('Missing required parameter: "output"');
|
|
45759
|
+
}
|
|
45760
|
+
if (typeof subtitleId === 'undefined' || subtitleId === '') {
|
|
45761
|
+
throw new AppwriteException('Missing required parameter: "subtitleId"');
|
|
45762
|
+
}
|
|
45763
|
+
if (typeof segmentId === 'undefined' || segmentId === '') {
|
|
45764
|
+
throw new AppwriteException('Missing required parameter: "segmentId"');
|
|
45765
|
+
}
|
|
45766
|
+
const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/segments/{segmentId}'
|
|
45767
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45768
|
+
.replace('{output}', encodeURIComponent(String(output)))
|
|
45769
|
+
.replace('{subtitleId}', encodeURIComponent(String(subtitleId)))
|
|
45770
|
+
.replace('{segmentId}', encodeURIComponent(String(segmentId)));
|
|
45771
|
+
const apiPayload = {};
|
|
45772
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45773
|
+
apiPayload['project'] = this.client.config.project;
|
|
45774
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45775
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45776
|
+
uri.searchParams.append(key, value);
|
|
45777
|
+
}
|
|
45778
|
+
return uri.toString();
|
|
45779
|
+
}
|
|
45780
|
+
getPreview(paramsOrFirst, ...rest) {
|
|
45781
|
+
let params;
|
|
45782
|
+
if (paramsOrFirst &&
|
|
45783
|
+
typeof paramsOrFirst === 'object' &&
|
|
45784
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45785
|
+
params = (paramsOrFirst || {});
|
|
45786
|
+
}
|
|
45787
|
+
else {
|
|
45788
|
+
params = {
|
|
45789
|
+
videoId: paramsOrFirst,
|
|
45790
|
+
previewId: rest[0],
|
|
45791
|
+
width: rest[1],
|
|
45792
|
+
height: rest[2],
|
|
45793
|
+
output: rest[3],
|
|
45794
|
+
};
|
|
45795
|
+
}
|
|
45796
|
+
const videoId = params.videoId;
|
|
45797
|
+
const previewId = params.previewId;
|
|
45798
|
+
const width = params.width;
|
|
45799
|
+
const height = params.height;
|
|
45800
|
+
const output = params.output;
|
|
45801
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45802
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45803
|
+
}
|
|
45804
|
+
if (typeof previewId === 'undefined' || previewId === '') {
|
|
45805
|
+
throw new AppwriteException('Missing required parameter: "previewId"');
|
|
45806
|
+
}
|
|
45807
|
+
const apiPath = '/videos/{videoId}/previews/{previewId}'
|
|
45808
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45809
|
+
.replace('{previewId}', encodeURIComponent(String(previewId)));
|
|
45810
|
+
const apiPayload = {};
|
|
45811
|
+
if (typeof width !== 'undefined') {
|
|
45812
|
+
apiPayload['width'] = width;
|
|
45813
|
+
}
|
|
45814
|
+
if (typeof height !== 'undefined') {
|
|
45815
|
+
apiPayload['height'] = height;
|
|
45816
|
+
}
|
|
45817
|
+
if (typeof output !== 'undefined') {
|
|
45818
|
+
apiPayload['output'] = output;
|
|
45819
|
+
}
|
|
45820
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45821
|
+
apiPayload['project'] = this.client.config.project;
|
|
45822
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45823
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45824
|
+
uri.searchParams.append(key, value);
|
|
45825
|
+
}
|
|
45826
|
+
return uri.toString();
|
|
45827
|
+
}
|
|
45828
|
+
listRenditions(paramsOrFirst, ...rest) {
|
|
45829
|
+
let params;
|
|
45830
|
+
if (paramsOrFirst &&
|
|
45831
|
+
typeof paramsOrFirst === 'object' &&
|
|
45832
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45833
|
+
params = (paramsOrFirst || {});
|
|
45834
|
+
}
|
|
45835
|
+
else {
|
|
45836
|
+
params = {
|
|
45837
|
+
videoId: paramsOrFirst,
|
|
45838
|
+
output: rest[0],
|
|
45839
|
+
status: rest[1],
|
|
45840
|
+
};
|
|
45841
|
+
}
|
|
45842
|
+
const videoId = params.videoId;
|
|
45843
|
+
const output = params.output;
|
|
45844
|
+
const status = params.status;
|
|
45845
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45846
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45847
|
+
}
|
|
45848
|
+
const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45849
|
+
const apiPayload = {};
|
|
45850
|
+
if (typeof output !== 'undefined') {
|
|
45851
|
+
apiPayload['output'] = output;
|
|
45852
|
+
}
|
|
45853
|
+
if (typeof status !== 'undefined') {
|
|
45854
|
+
apiPayload['status'] = status;
|
|
45855
|
+
}
|
|
45856
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45857
|
+
const apiHeaders = {
|
|
45858
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45859
|
+
accept: 'application/json',
|
|
45860
|
+
};
|
|
45861
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
45862
|
+
}
|
|
45863
|
+
createRendition(paramsOrFirst, ...rest) {
|
|
45864
|
+
let params;
|
|
45865
|
+
if (paramsOrFirst &&
|
|
45866
|
+
typeof paramsOrFirst === 'object' &&
|
|
45867
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45868
|
+
params = (paramsOrFirst || {});
|
|
45869
|
+
}
|
|
45870
|
+
else {
|
|
45871
|
+
params = {
|
|
45872
|
+
videoId: paramsOrFirst,
|
|
45873
|
+
profileId: rest[0],
|
|
45874
|
+
output: rest[1],
|
|
45875
|
+
};
|
|
45876
|
+
}
|
|
45877
|
+
const videoId = params.videoId;
|
|
45878
|
+
const profileId = params.profileId;
|
|
45879
|
+
const output = params.output;
|
|
45880
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45881
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45882
|
+
}
|
|
45883
|
+
if (typeof profileId === 'undefined') {
|
|
45884
|
+
throw new AppwriteException('Missing required parameter: "profileId"');
|
|
45885
|
+
}
|
|
45886
|
+
if (typeof output === 'undefined') {
|
|
45887
|
+
throw new AppwriteException('Missing required parameter: "output"');
|
|
45888
|
+
}
|
|
45889
|
+
const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45890
|
+
const apiPayload = {};
|
|
45891
|
+
if (typeof profileId !== 'undefined') {
|
|
45892
|
+
apiPayload['profileId'] = profileId;
|
|
45893
|
+
}
|
|
45894
|
+
if (typeof output !== 'undefined') {
|
|
45895
|
+
apiPayload['output'] = output;
|
|
45896
|
+
}
|
|
45897
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45898
|
+
const apiHeaders = {
|
|
45899
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45900
|
+
'content-type': 'application/json',
|
|
45901
|
+
accept: 'application/json',
|
|
45902
|
+
};
|
|
45903
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
45904
|
+
}
|
|
45905
|
+
getRendition(paramsOrFirst, ...rest) {
|
|
45906
|
+
let params;
|
|
45907
|
+
if (paramsOrFirst &&
|
|
45908
|
+
typeof paramsOrFirst === 'object' &&
|
|
45909
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45910
|
+
params = (paramsOrFirst || {});
|
|
45911
|
+
}
|
|
45912
|
+
else {
|
|
45913
|
+
params = {
|
|
45914
|
+
videoId: paramsOrFirst,
|
|
45915
|
+
renditionId: rest[0],
|
|
45916
|
+
};
|
|
45917
|
+
}
|
|
45918
|
+
const videoId = params.videoId;
|
|
45919
|
+
const renditionId = params.renditionId;
|
|
45920
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45921
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45922
|
+
}
|
|
45923
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
45924
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
45925
|
+
}
|
|
45926
|
+
const apiPath = '/videos/{videoId}/renditions/{renditionId}'
|
|
45927
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45928
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)));
|
|
45929
|
+
const apiPayload = {};
|
|
45930
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45931
|
+
const apiHeaders = {
|
|
45932
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45933
|
+
accept: 'application/json',
|
|
45934
|
+
};
|
|
45935
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
45936
|
+
}
|
|
45937
|
+
deleteRendition(paramsOrFirst, ...rest) {
|
|
45938
|
+
let params;
|
|
45939
|
+
if (paramsOrFirst &&
|
|
45940
|
+
typeof paramsOrFirst === 'object' &&
|
|
45941
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45942
|
+
params = (paramsOrFirst || {});
|
|
45943
|
+
}
|
|
45944
|
+
else {
|
|
45945
|
+
params = {
|
|
45946
|
+
videoId: paramsOrFirst,
|
|
45947
|
+
renditionId: rest[0],
|
|
45948
|
+
};
|
|
45949
|
+
}
|
|
45950
|
+
const videoId = params.videoId;
|
|
45951
|
+
const renditionId = params.renditionId;
|
|
45952
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45953
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45954
|
+
}
|
|
45955
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
45956
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
45957
|
+
}
|
|
45958
|
+
const apiPath = '/videos/{videoId}/renditions/{renditionId}'
|
|
45959
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45960
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)));
|
|
45961
|
+
const apiPayload = {};
|
|
45962
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45963
|
+
const apiHeaders = {
|
|
45964
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45965
|
+
'content-type': 'application/json',
|
|
45966
|
+
accept: 'application/json',
|
|
45967
|
+
};
|
|
45968
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
45969
|
+
}
|
|
45970
|
+
createSource(paramsOrFirst) {
|
|
45971
|
+
let params;
|
|
45972
|
+
if (paramsOrFirst &&
|
|
45973
|
+
typeof paramsOrFirst === 'object' &&
|
|
45974
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45975
|
+
params = (paramsOrFirst || {});
|
|
45976
|
+
}
|
|
45977
|
+
else {
|
|
45978
|
+
params = {
|
|
45979
|
+
videoId: paramsOrFirst,
|
|
45980
|
+
};
|
|
45981
|
+
}
|
|
45982
|
+
const videoId = params.videoId;
|
|
45983
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45984
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45985
|
+
}
|
|
45986
|
+
const apiPath = '/videos/{videoId}/source'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45987
|
+
const apiPayload = {};
|
|
45988
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45989
|
+
const apiHeaders = {
|
|
45990
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45991
|
+
'content-type': 'application/json',
|
|
45992
|
+
accept: 'application/json',
|
|
45993
|
+
};
|
|
45994
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
45995
|
+
}
|
|
45996
|
+
listSubtitles(paramsOrFirst) {
|
|
45997
|
+
let params;
|
|
45998
|
+
if (paramsOrFirst &&
|
|
45999
|
+
typeof paramsOrFirst === 'object' &&
|
|
46000
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46001
|
+
params = (paramsOrFirst || {});
|
|
46002
|
+
}
|
|
46003
|
+
else {
|
|
46004
|
+
params = {
|
|
46005
|
+
videoId: paramsOrFirst,
|
|
46006
|
+
};
|
|
46007
|
+
}
|
|
46008
|
+
const videoId = params.videoId;
|
|
46009
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
46010
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
46011
|
+
}
|
|
46012
|
+
const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
46013
|
+
const apiPayload = {};
|
|
46014
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46015
|
+
const apiHeaders = {
|
|
46016
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46017
|
+
accept: 'application/json',
|
|
46018
|
+
};
|
|
46019
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
46020
|
+
}
|
|
46021
|
+
createSubtitle(paramsOrFirst, ...rest) {
|
|
46022
|
+
let params;
|
|
46023
|
+
if (paramsOrFirst &&
|
|
46024
|
+
typeof paramsOrFirst === 'object' &&
|
|
46025
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46026
|
+
params = (paramsOrFirst || {});
|
|
46027
|
+
}
|
|
46028
|
+
else {
|
|
46029
|
+
params = {
|
|
46030
|
+
videoId: paramsOrFirst,
|
|
46031
|
+
bucketId: rest[0],
|
|
46032
|
+
fileId: rest[1],
|
|
46033
|
+
name: rest[2],
|
|
46034
|
+
code: rest[3],
|
|
46035
|
+
xdefault: rest[4],
|
|
46036
|
+
};
|
|
46037
|
+
}
|
|
46038
|
+
const videoId = params.videoId;
|
|
46039
|
+
const bucketId = params.bucketId;
|
|
46040
|
+
const fileId = params.fileId;
|
|
46041
|
+
const name = params.name;
|
|
46042
|
+
const code = params.code;
|
|
46043
|
+
const xdefault = params.xdefault;
|
|
46044
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
46045
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
46046
|
+
}
|
|
46047
|
+
if (typeof bucketId === 'undefined') {
|
|
46048
|
+
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
46049
|
+
}
|
|
46050
|
+
if (typeof fileId === 'undefined') {
|
|
46051
|
+
throw new AppwriteException('Missing required parameter: "fileId"');
|
|
46052
|
+
}
|
|
46053
|
+
if (typeof name === 'undefined') {
|
|
46054
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
46055
|
+
}
|
|
46056
|
+
if (typeof code === 'undefined') {
|
|
46057
|
+
throw new AppwriteException('Missing required parameter: "code"');
|
|
46058
|
+
}
|
|
46059
|
+
const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
46060
|
+
const apiPayload = {};
|
|
46061
|
+
if (typeof bucketId !== 'undefined') {
|
|
46062
|
+
apiPayload['bucketId'] = bucketId;
|
|
46063
|
+
}
|
|
46064
|
+
if (typeof fileId !== 'undefined') {
|
|
46065
|
+
apiPayload['fileId'] = fileId;
|
|
46066
|
+
}
|
|
46067
|
+
if (typeof name !== 'undefined') {
|
|
46068
|
+
apiPayload['name'] = name;
|
|
46069
|
+
}
|
|
46070
|
+
if (typeof code !== 'undefined') {
|
|
46071
|
+
apiPayload['code'] = code;
|
|
46072
|
+
}
|
|
46073
|
+
if (typeof xdefault !== 'undefined') {
|
|
46074
|
+
apiPayload['default'] = xdefault;
|
|
46075
|
+
}
|
|
46076
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46077
|
+
const apiHeaders = {
|
|
46078
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46079
|
+
'content-type': 'application/json',
|
|
46080
|
+
accept: 'application/json',
|
|
46081
|
+
};
|
|
46082
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
46083
|
+
}
|
|
46084
|
+
updateSubtitle(paramsOrFirst, ...rest) {
|
|
46085
|
+
let params;
|
|
46086
|
+
if (paramsOrFirst &&
|
|
46087
|
+
typeof paramsOrFirst === 'object' &&
|
|
46088
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46089
|
+
params = (paramsOrFirst || {});
|
|
46090
|
+
}
|
|
46091
|
+
else {
|
|
46092
|
+
params = {
|
|
46093
|
+
videoId: paramsOrFirst,
|
|
46094
|
+
subtitleId: rest[0],
|
|
46095
|
+
bucketId: rest[1],
|
|
46096
|
+
fileId: rest[2],
|
|
46097
|
+
name: rest[3],
|
|
46098
|
+
code: rest[4],
|
|
46099
|
+
xdefault: rest[5],
|
|
46100
|
+
};
|
|
46101
|
+
}
|
|
46102
|
+
const videoId = params.videoId;
|
|
46103
|
+
const subtitleId = params.subtitleId;
|
|
46104
|
+
const bucketId = params.bucketId;
|
|
46105
|
+
const fileId = params.fileId;
|
|
46106
|
+
const name = params.name;
|
|
46107
|
+
const code = params.code;
|
|
46108
|
+
const xdefault = params.xdefault;
|
|
46109
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
46110
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
46111
|
+
}
|
|
46112
|
+
if (typeof subtitleId === 'undefined' || subtitleId === '') {
|
|
46113
|
+
throw new AppwriteException('Missing required parameter: "subtitleId"');
|
|
46114
|
+
}
|
|
46115
|
+
const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
|
|
46116
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
46117
|
+
.replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
|
|
46118
|
+
const apiPayload = {};
|
|
46119
|
+
if (typeof bucketId !== 'undefined') {
|
|
46120
|
+
apiPayload['bucketId'] = bucketId;
|
|
46121
|
+
}
|
|
46122
|
+
if (typeof fileId !== 'undefined') {
|
|
46123
|
+
apiPayload['fileId'] = fileId;
|
|
46124
|
+
}
|
|
46125
|
+
if (typeof name !== 'undefined') {
|
|
46126
|
+
apiPayload['name'] = name;
|
|
46127
|
+
}
|
|
46128
|
+
if (typeof code !== 'undefined') {
|
|
46129
|
+
apiPayload['code'] = code;
|
|
46130
|
+
}
|
|
46131
|
+
if (typeof xdefault !== 'undefined') {
|
|
46132
|
+
apiPayload['default'] = xdefault;
|
|
46133
|
+
}
|
|
46134
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46135
|
+
const apiHeaders = {
|
|
46136
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46137
|
+
'content-type': 'application/json',
|
|
46138
|
+
accept: 'application/json',
|
|
46139
|
+
};
|
|
46140
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
46141
|
+
}
|
|
46142
|
+
deleteSubtitle(paramsOrFirst, ...rest) {
|
|
46143
|
+
let params;
|
|
46144
|
+
if (paramsOrFirst &&
|
|
46145
|
+
typeof paramsOrFirst === 'object' &&
|
|
46146
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46147
|
+
params = (paramsOrFirst || {});
|
|
46148
|
+
}
|
|
46149
|
+
else {
|
|
46150
|
+
params = {
|
|
46151
|
+
videoId: paramsOrFirst,
|
|
46152
|
+
subtitleId: rest[0],
|
|
46153
|
+
};
|
|
46154
|
+
}
|
|
46155
|
+
const videoId = params.videoId;
|
|
46156
|
+
const subtitleId = params.subtitleId;
|
|
46157
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
46158
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
46159
|
+
}
|
|
46160
|
+
if (typeof subtitleId === 'undefined' || subtitleId === '') {
|
|
46161
|
+
throw new AppwriteException('Missing required parameter: "subtitleId"');
|
|
46162
|
+
}
|
|
46163
|
+
const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
|
|
46164
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
46165
|
+
.replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
|
|
46166
|
+
const apiPayload = {};
|
|
46167
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46168
|
+
const apiHeaders = {
|
|
46169
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46170
|
+
'content-type': 'application/json',
|
|
46171
|
+
accept: 'application/json',
|
|
46172
|
+
};
|
|
46173
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
46174
|
+
}
|
|
46175
|
+
getTimeline(paramsOrFirst) {
|
|
46176
|
+
let params;
|
|
46177
|
+
if (paramsOrFirst &&
|
|
46178
|
+
typeof paramsOrFirst === 'object' &&
|
|
46179
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46180
|
+
params = (paramsOrFirst || {});
|
|
46181
|
+
}
|
|
46182
|
+
else {
|
|
46183
|
+
params = {
|
|
46184
|
+
videoId: paramsOrFirst,
|
|
46185
|
+
};
|
|
46186
|
+
}
|
|
46187
|
+
const videoId = params.videoId;
|
|
46188
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
46189
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
46190
|
+
}
|
|
46191
|
+
const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
46192
|
+
const apiPayload = {};
|
|
46193
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46194
|
+
const apiHeaders = {
|
|
46195
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46196
|
+
accept: 'text/plain',
|
|
46197
|
+
};
|
|
46198
|
+
return this.client.call('get', uri, apiHeaders, apiPayload, 'text');
|
|
46199
|
+
}
|
|
46200
|
+
createTimeline(paramsOrFirst) {
|
|
46201
|
+
let params;
|
|
46202
|
+
if (paramsOrFirst &&
|
|
46203
|
+
typeof paramsOrFirst === 'object' &&
|
|
46204
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46205
|
+
params = (paramsOrFirst || {});
|
|
46206
|
+
}
|
|
46207
|
+
else {
|
|
46208
|
+
params = {
|
|
46209
|
+
videoId: paramsOrFirst,
|
|
46210
|
+
};
|
|
46211
|
+
}
|
|
46212
|
+
const videoId = params.videoId;
|
|
46213
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
46214
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
46215
|
+
}
|
|
46216
|
+
const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
46217
|
+
const apiPayload = {};
|
|
46218
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46219
|
+
const apiHeaders = {
|
|
46220
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46221
|
+
'content-type': 'application/json',
|
|
46222
|
+
accept: 'application/json',
|
|
46223
|
+
};
|
|
46224
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
46225
|
+
}
|
|
46226
|
+
}
|
|
46227
|
+
|
|
46228
|
+
class Waf {
|
|
46229
|
+
constructor(client) {
|
|
46230
|
+
this.client = client;
|
|
46231
|
+
}
|
|
46232
|
+
listRules(paramsOrFirst, ...rest) {
|
|
46233
|
+
let params;
|
|
46234
|
+
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
46235
|
+
(paramsOrFirst &&
|
|
46236
|
+
typeof paramsOrFirst === 'object' &&
|
|
46237
|
+
!Array.isArray(paramsOrFirst))) {
|
|
46238
|
+
params = (paramsOrFirst || {});
|
|
46239
|
+
}
|
|
46240
|
+
else {
|
|
46241
|
+
params = {
|
|
46242
|
+
queries: paramsOrFirst,
|
|
46243
|
+
search: rest[0],
|
|
46244
|
+
total: rest[1],
|
|
46245
|
+
};
|
|
46246
|
+
}
|
|
46247
|
+
const queries = params.queries;
|
|
46248
|
+
const search = params.search;
|
|
46249
|
+
const total = params.total;
|
|
46250
|
+
const apiPath = '/waf/rules';
|
|
46251
|
+
const apiPayload = {};
|
|
46252
|
+
if (typeof queries !== 'undefined') {
|
|
46253
|
+
apiPayload['queries'] = queries;
|
|
46254
|
+
}
|
|
46255
|
+
if (typeof search !== 'undefined') {
|
|
46256
|
+
apiPayload['search'] = search;
|
|
46257
|
+
}
|
|
46258
|
+
if (typeof total !== 'undefined') {
|
|
46259
|
+
apiPayload['total'] = total;
|
|
46260
|
+
}
|
|
46261
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46262
|
+
const apiHeaders = {
|
|
46263
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46264
|
+
accept: 'application/json',
|
|
46265
|
+
};
|
|
46266
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
46267
|
+
}
|
|
46268
|
+
createBypassRule(paramsOrFirst, ...rest) {
|
|
46269
|
+
let params;
|
|
46270
|
+
if (paramsOrFirst &&
|
|
46271
|
+
typeof paramsOrFirst === 'object' &&
|
|
46272
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46273
|
+
params = (paramsOrFirst || {});
|
|
46274
|
+
}
|
|
46275
|
+
else {
|
|
46276
|
+
params = {
|
|
46277
|
+
ruleId: paramsOrFirst,
|
|
46278
|
+
resourceType: rest[0],
|
|
46279
|
+
name: rest[1],
|
|
46280
|
+
resourceId: rest[2],
|
|
46281
|
+
description: rest[3],
|
|
46282
|
+
priority: rest[4],
|
|
46283
|
+
enabled: rest[5],
|
|
46284
|
+
conditions: rest[6],
|
|
46285
|
+
};
|
|
46286
|
+
}
|
|
46287
|
+
const ruleId = params.ruleId;
|
|
46288
|
+
const resourceType = params.resourceType;
|
|
46289
|
+
const name = params.name;
|
|
46290
|
+
const resourceId = params.resourceId;
|
|
46291
|
+
const description = params.description;
|
|
46292
|
+
const priority = params.priority;
|
|
46293
|
+
const enabled = params.enabled;
|
|
46294
|
+
const conditions = params.conditions;
|
|
46295
|
+
if (typeof ruleId === 'undefined') {
|
|
46296
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
46297
|
+
}
|
|
46298
|
+
if (typeof resourceType === 'undefined') {
|
|
46299
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
46300
|
+
}
|
|
46301
|
+
if (typeof name === 'undefined') {
|
|
46302
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
46303
|
+
}
|
|
46304
|
+
const apiPath = '/waf/rules/bypass';
|
|
46305
|
+
const apiPayload = {};
|
|
46306
|
+
if (typeof ruleId !== 'undefined') {
|
|
46307
|
+
apiPayload['ruleId'] = ruleId;
|
|
46308
|
+
}
|
|
46309
|
+
if (typeof resourceType !== 'undefined') {
|
|
46310
|
+
apiPayload['resourceType'] = resourceType;
|
|
46311
|
+
}
|
|
46312
|
+
if (typeof resourceId !== 'undefined') {
|
|
46313
|
+
apiPayload['resourceId'] = resourceId;
|
|
46314
|
+
}
|
|
46315
|
+
if (typeof name !== 'undefined') {
|
|
46316
|
+
apiPayload['name'] = name;
|
|
46317
|
+
}
|
|
46318
|
+
if (typeof description !== 'undefined') {
|
|
46319
|
+
apiPayload['description'] = description;
|
|
46320
|
+
}
|
|
46321
|
+
if (typeof priority !== 'undefined') {
|
|
46322
|
+
apiPayload['priority'] = priority;
|
|
46323
|
+
}
|
|
46324
|
+
if (typeof enabled !== 'undefined') {
|
|
46325
|
+
apiPayload['enabled'] = enabled;
|
|
46326
|
+
}
|
|
46327
|
+
if (typeof conditions !== 'undefined') {
|
|
46328
|
+
apiPayload['conditions'] = conditions;
|
|
46329
|
+
}
|
|
46330
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46331
|
+
const apiHeaders = {
|
|
46332
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46333
|
+
'content-type': 'application/json',
|
|
46334
|
+
accept: 'application/json',
|
|
46335
|
+
};
|
|
46336
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
46337
|
+
}
|
|
46338
|
+
updateBypassRule(paramsOrFirst, ...rest) {
|
|
46339
|
+
let params;
|
|
46340
|
+
if (paramsOrFirst &&
|
|
46341
|
+
typeof paramsOrFirst === 'object' &&
|
|
46342
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46343
|
+
params = (paramsOrFirst || {});
|
|
46344
|
+
}
|
|
46345
|
+
else {
|
|
46346
|
+
params = {
|
|
46347
|
+
ruleId: paramsOrFirst,
|
|
46348
|
+
resourceType: rest[0],
|
|
46349
|
+
resourceId: rest[1],
|
|
46350
|
+
name: rest[2],
|
|
46351
|
+
description: rest[3],
|
|
46352
|
+
priority: rest[4],
|
|
46353
|
+
enabled: rest[5],
|
|
46354
|
+
conditions: rest[6],
|
|
46355
|
+
};
|
|
46356
|
+
}
|
|
46357
|
+
const ruleId = params.ruleId;
|
|
46358
|
+
const resourceType = params.resourceType;
|
|
46359
|
+
const resourceId = params.resourceId;
|
|
46360
|
+
const name = params.name;
|
|
46361
|
+
const description = params.description;
|
|
46362
|
+
const priority = params.priority;
|
|
46363
|
+
const enabled = params.enabled;
|
|
46364
|
+
const conditions = params.conditions;
|
|
46365
|
+
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
46366
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
46367
|
+
}
|
|
46368
|
+
const apiPath = '/waf/rules/bypass/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
|
|
46369
|
+
const apiPayload = {};
|
|
46370
|
+
if (typeof resourceType !== 'undefined') {
|
|
46371
|
+
apiPayload['resourceType'] = resourceType;
|
|
46372
|
+
}
|
|
46373
|
+
if (typeof resourceId !== 'undefined') {
|
|
46374
|
+
apiPayload['resourceId'] = resourceId;
|
|
46375
|
+
}
|
|
46376
|
+
if (typeof name !== 'undefined') {
|
|
46377
|
+
apiPayload['name'] = name;
|
|
46378
|
+
}
|
|
46379
|
+
if (typeof description !== 'undefined') {
|
|
46380
|
+
apiPayload['description'] = description;
|
|
46381
|
+
}
|
|
46382
|
+
if (typeof priority !== 'undefined') {
|
|
46383
|
+
apiPayload['priority'] = priority;
|
|
46384
|
+
}
|
|
46385
|
+
if (typeof enabled !== 'undefined') {
|
|
46386
|
+
apiPayload['enabled'] = enabled;
|
|
46387
|
+
}
|
|
46388
|
+
if (typeof conditions !== 'undefined') {
|
|
46389
|
+
apiPayload['conditions'] = conditions;
|
|
46390
|
+
}
|
|
46391
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46392
|
+
const apiHeaders = {
|
|
46393
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46394
|
+
'content-type': 'application/json',
|
|
46395
|
+
accept: 'application/json',
|
|
46396
|
+
};
|
|
46397
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
46398
|
+
}
|
|
46399
|
+
createChallengeRule(paramsOrFirst, ...rest) {
|
|
46400
|
+
let params;
|
|
46401
|
+
if (paramsOrFirst &&
|
|
46402
|
+
typeof paramsOrFirst === 'object' &&
|
|
46403
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46404
|
+
params = (paramsOrFirst || {});
|
|
46405
|
+
}
|
|
46406
|
+
else {
|
|
46407
|
+
params = {
|
|
46408
|
+
ruleId: paramsOrFirst,
|
|
46409
|
+
resourceType: rest[0],
|
|
46410
|
+
name: rest[1],
|
|
46411
|
+
resourceId: rest[2],
|
|
46412
|
+
description: rest[3],
|
|
46413
|
+
challengeType: rest[4],
|
|
46414
|
+
priority: rest[5],
|
|
46415
|
+
enabled: rest[6],
|
|
46416
|
+
conditions: rest[7],
|
|
46417
|
+
difficulty: rest[8],
|
|
46418
|
+
ttl: rest[9],
|
|
46419
|
+
};
|
|
46420
|
+
}
|
|
46421
|
+
const ruleId = params.ruleId;
|
|
46422
|
+
const resourceType = params.resourceType;
|
|
46423
|
+
const name = params.name;
|
|
46424
|
+
const resourceId = params.resourceId;
|
|
46425
|
+
const description = params.description;
|
|
46426
|
+
const challengeType = params.challengeType;
|
|
46427
|
+
const priority = params.priority;
|
|
46428
|
+
const enabled = params.enabled;
|
|
46429
|
+
const conditions = params.conditions;
|
|
46430
|
+
const difficulty = params.difficulty;
|
|
46431
|
+
const ttl = params.ttl;
|
|
46432
|
+
if (typeof ruleId === 'undefined') {
|
|
46433
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
46434
|
+
}
|
|
46435
|
+
if (typeof resourceType === 'undefined') {
|
|
46436
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
46437
|
+
}
|
|
46438
|
+
if (typeof name === 'undefined') {
|
|
46439
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
46440
|
+
}
|
|
46441
|
+
const apiPath = '/waf/rules/challenge';
|
|
46442
|
+
const apiPayload = {};
|
|
46443
|
+
if (typeof ruleId !== 'undefined') {
|
|
46444
|
+
apiPayload['ruleId'] = ruleId;
|
|
46445
|
+
}
|
|
46446
|
+
if (typeof resourceType !== 'undefined') {
|
|
46447
|
+
apiPayload['resourceType'] = resourceType;
|
|
46448
|
+
}
|
|
46449
|
+
if (typeof resourceId !== 'undefined') {
|
|
46450
|
+
apiPayload['resourceId'] = resourceId;
|
|
46451
|
+
}
|
|
46452
|
+
if (typeof name !== 'undefined') {
|
|
46453
|
+
apiPayload['name'] = name;
|
|
46454
|
+
}
|
|
46455
|
+
if (typeof description !== 'undefined') {
|
|
46456
|
+
apiPayload['description'] = description;
|
|
46457
|
+
}
|
|
46458
|
+
if (typeof challengeType !== 'undefined') {
|
|
46459
|
+
apiPayload['challengeType'] = challengeType;
|
|
46460
|
+
}
|
|
46461
|
+
if (typeof priority !== 'undefined') {
|
|
46462
|
+
apiPayload['priority'] = priority;
|
|
46463
|
+
}
|
|
46464
|
+
if (typeof enabled !== 'undefined') {
|
|
46465
|
+
apiPayload['enabled'] = enabled;
|
|
46466
|
+
}
|
|
46467
|
+
if (typeof conditions !== 'undefined') {
|
|
46468
|
+
apiPayload['conditions'] = conditions;
|
|
46469
|
+
}
|
|
46470
|
+
if (typeof difficulty !== 'undefined') {
|
|
46471
|
+
apiPayload['difficulty'] = difficulty;
|
|
46472
|
+
}
|
|
46473
|
+
if (typeof ttl !== 'undefined') {
|
|
46474
|
+
apiPayload['ttl'] = ttl;
|
|
46475
|
+
}
|
|
46476
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46477
|
+
const apiHeaders = {
|
|
46478
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46479
|
+
'content-type': 'application/json',
|
|
46480
|
+
accept: 'application/json',
|
|
46481
|
+
};
|
|
46482
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
46483
|
+
}
|
|
46484
|
+
updateChallengeRule(paramsOrFirst, ...rest) {
|
|
46485
|
+
let params;
|
|
46486
|
+
if (paramsOrFirst &&
|
|
46487
|
+
typeof paramsOrFirst === 'object' &&
|
|
46488
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46489
|
+
params = (paramsOrFirst || {});
|
|
46490
|
+
}
|
|
46491
|
+
else {
|
|
46492
|
+
params = {
|
|
46493
|
+
ruleId: paramsOrFirst,
|
|
46494
|
+
resourceType: rest[0],
|
|
46495
|
+
resourceId: rest[1],
|
|
46496
|
+
name: rest[2],
|
|
46497
|
+
description: rest[3],
|
|
46498
|
+
challengeType: rest[4],
|
|
46499
|
+
priority: rest[5],
|
|
46500
|
+
enabled: rest[6],
|
|
46501
|
+
conditions: rest[7],
|
|
46502
|
+
difficulty: rest[8],
|
|
46503
|
+
ttl: rest[9],
|
|
46504
|
+
};
|
|
46505
|
+
}
|
|
46506
|
+
const ruleId = params.ruleId;
|
|
46507
|
+
const resourceType = params.resourceType;
|
|
46508
|
+
const resourceId = params.resourceId;
|
|
46509
|
+
const name = params.name;
|
|
46510
|
+
const description = params.description;
|
|
46511
|
+
const challengeType = params.challengeType;
|
|
46512
|
+
const priority = params.priority;
|
|
46513
|
+
const enabled = params.enabled;
|
|
46514
|
+
const conditions = params.conditions;
|
|
46515
|
+
const difficulty = params.difficulty;
|
|
46516
|
+
const ttl = params.ttl;
|
|
46517
|
+
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
46518
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
46519
|
+
}
|
|
46520
|
+
const apiPath = '/waf/rules/challenge/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
|
|
46521
|
+
const apiPayload = {};
|
|
46522
|
+
if (typeof resourceType !== 'undefined') {
|
|
46523
|
+
apiPayload['resourceType'] = resourceType;
|
|
46524
|
+
}
|
|
46525
|
+
if (typeof resourceId !== 'undefined') {
|
|
46526
|
+
apiPayload['resourceId'] = resourceId;
|
|
46527
|
+
}
|
|
46528
|
+
if (typeof name !== 'undefined') {
|
|
46529
|
+
apiPayload['name'] = name;
|
|
46530
|
+
}
|
|
46531
|
+
if (typeof description !== 'undefined') {
|
|
46532
|
+
apiPayload['description'] = description;
|
|
46533
|
+
}
|
|
46534
|
+
if (typeof challengeType !== 'undefined') {
|
|
46535
|
+
apiPayload['challengeType'] = challengeType;
|
|
46536
|
+
}
|
|
46537
|
+
if (typeof priority !== 'undefined') {
|
|
46538
|
+
apiPayload['priority'] = priority;
|
|
46539
|
+
}
|
|
46540
|
+
if (typeof enabled !== 'undefined') {
|
|
46541
|
+
apiPayload['enabled'] = enabled;
|
|
46542
|
+
}
|
|
46543
|
+
if (typeof conditions !== 'undefined') {
|
|
46544
|
+
apiPayload['conditions'] = conditions;
|
|
46545
|
+
}
|
|
46546
|
+
if (typeof difficulty !== 'undefined') {
|
|
46547
|
+
apiPayload['difficulty'] = difficulty;
|
|
46548
|
+
}
|
|
46549
|
+
if (typeof ttl !== 'undefined') {
|
|
46550
|
+
apiPayload['ttl'] = ttl;
|
|
46551
|
+
}
|
|
46552
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46553
|
+
const apiHeaders = {
|
|
46554
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46555
|
+
'content-type': 'application/json',
|
|
46556
|
+
accept: 'application/json',
|
|
46557
|
+
};
|
|
46558
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
46559
|
+
}
|
|
46560
|
+
createDenyRule(paramsOrFirst, ...rest) {
|
|
46561
|
+
let params;
|
|
46562
|
+
if (paramsOrFirst &&
|
|
46563
|
+
typeof paramsOrFirst === 'object' &&
|
|
46564
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46565
|
+
params = (paramsOrFirst || {});
|
|
46566
|
+
}
|
|
46567
|
+
else {
|
|
46568
|
+
params = {
|
|
46569
|
+
ruleId: paramsOrFirst,
|
|
46570
|
+
resourceType: rest[0],
|
|
46571
|
+
name: rest[1],
|
|
46572
|
+
resourceId: rest[2],
|
|
46573
|
+
description: rest[3],
|
|
46574
|
+
priority: rest[4],
|
|
46575
|
+
enabled: rest[5],
|
|
46576
|
+
conditions: rest[6],
|
|
46577
|
+
};
|
|
46578
|
+
}
|
|
46579
|
+
const ruleId = params.ruleId;
|
|
46580
|
+
const resourceType = params.resourceType;
|
|
46581
|
+
const name = params.name;
|
|
46582
|
+
const resourceId = params.resourceId;
|
|
46583
|
+
const description = params.description;
|
|
46584
|
+
const priority = params.priority;
|
|
46585
|
+
const enabled = params.enabled;
|
|
46586
|
+
const conditions = params.conditions;
|
|
46587
|
+
if (typeof ruleId === 'undefined') {
|
|
46588
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
46589
|
+
}
|
|
46590
|
+
if (typeof resourceType === 'undefined') {
|
|
46591
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
46592
|
+
}
|
|
46593
|
+
if (typeof name === 'undefined') {
|
|
46594
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
46595
|
+
}
|
|
46596
|
+
const apiPath = '/waf/rules/deny';
|
|
46597
|
+
const apiPayload = {};
|
|
46598
|
+
if (typeof ruleId !== 'undefined') {
|
|
46599
|
+
apiPayload['ruleId'] = ruleId;
|
|
46600
|
+
}
|
|
46601
|
+
if (typeof resourceType !== 'undefined') {
|
|
46602
|
+
apiPayload['resourceType'] = resourceType;
|
|
46603
|
+
}
|
|
46604
|
+
if (typeof resourceId !== 'undefined') {
|
|
46605
|
+
apiPayload['resourceId'] = resourceId;
|
|
46606
|
+
}
|
|
46607
|
+
if (typeof name !== 'undefined') {
|
|
46608
|
+
apiPayload['name'] = name;
|
|
46609
|
+
}
|
|
46610
|
+
if (typeof description !== 'undefined') {
|
|
46611
|
+
apiPayload['description'] = description;
|
|
46612
|
+
}
|
|
46613
|
+
if (typeof priority !== 'undefined') {
|
|
46614
|
+
apiPayload['priority'] = priority;
|
|
46615
|
+
}
|
|
46616
|
+
if (typeof enabled !== 'undefined') {
|
|
46617
|
+
apiPayload['enabled'] = enabled;
|
|
46618
|
+
}
|
|
46619
|
+
if (typeof conditions !== 'undefined') {
|
|
46620
|
+
apiPayload['conditions'] = conditions;
|
|
46621
|
+
}
|
|
46622
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46623
|
+
const apiHeaders = {
|
|
46624
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46625
|
+
'content-type': 'application/json',
|
|
46626
|
+
accept: 'application/json',
|
|
46627
|
+
};
|
|
46628
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
46629
|
+
}
|
|
46630
|
+
updateDenyRule(paramsOrFirst, ...rest) {
|
|
46631
|
+
let params;
|
|
46632
|
+
if (paramsOrFirst &&
|
|
46633
|
+
typeof paramsOrFirst === 'object' &&
|
|
46634
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46635
|
+
params = (paramsOrFirst || {});
|
|
46636
|
+
}
|
|
46637
|
+
else {
|
|
46638
|
+
params = {
|
|
46639
|
+
ruleId: paramsOrFirst,
|
|
46640
|
+
resourceType: rest[0],
|
|
46641
|
+
resourceId: rest[1],
|
|
46642
|
+
name: rest[2],
|
|
46643
|
+
description: rest[3],
|
|
46644
|
+
priority: rest[4],
|
|
46645
|
+
enabled: rest[5],
|
|
46646
|
+
conditions: rest[6],
|
|
46647
|
+
};
|
|
46648
|
+
}
|
|
46649
|
+
const ruleId = params.ruleId;
|
|
46650
|
+
const resourceType = params.resourceType;
|
|
46651
|
+
const resourceId = params.resourceId;
|
|
46652
|
+
const name = params.name;
|
|
46653
|
+
const description = params.description;
|
|
46654
|
+
const priority = params.priority;
|
|
46655
|
+
const enabled = params.enabled;
|
|
46656
|
+
const conditions = params.conditions;
|
|
46657
|
+
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
46658
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
46659
|
+
}
|
|
46660
|
+
const apiPath = '/waf/rules/deny/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
|
|
46661
|
+
const apiPayload = {};
|
|
46662
|
+
if (typeof resourceType !== 'undefined') {
|
|
46663
|
+
apiPayload['resourceType'] = resourceType;
|
|
46664
|
+
}
|
|
46665
|
+
if (typeof resourceId !== 'undefined') {
|
|
46666
|
+
apiPayload['resourceId'] = resourceId;
|
|
46667
|
+
}
|
|
46668
|
+
if (typeof name !== 'undefined') {
|
|
46669
|
+
apiPayload['name'] = name;
|
|
46670
|
+
}
|
|
46671
|
+
if (typeof description !== 'undefined') {
|
|
46672
|
+
apiPayload['description'] = description;
|
|
46673
|
+
}
|
|
46674
|
+
if (typeof priority !== 'undefined') {
|
|
46675
|
+
apiPayload['priority'] = priority;
|
|
46676
|
+
}
|
|
46677
|
+
if (typeof enabled !== 'undefined') {
|
|
46678
|
+
apiPayload['enabled'] = enabled;
|
|
46679
|
+
}
|
|
46680
|
+
if (typeof conditions !== 'undefined') {
|
|
46681
|
+
apiPayload['conditions'] = conditions;
|
|
46682
|
+
}
|
|
46683
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46684
|
+
const apiHeaders = {
|
|
46685
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46686
|
+
'content-type': 'application/json',
|
|
46687
|
+
accept: 'application/json',
|
|
46688
|
+
};
|
|
46689
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
46690
|
+
}
|
|
46691
|
+
createRateLimitRule(paramsOrFirst, ...rest) {
|
|
46692
|
+
let params;
|
|
46693
|
+
if (paramsOrFirst &&
|
|
46694
|
+
typeof paramsOrFirst === 'object' &&
|
|
46695
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46696
|
+
params = (paramsOrFirst || {});
|
|
46697
|
+
}
|
|
46698
|
+
else {
|
|
46699
|
+
params = {
|
|
46700
|
+
ruleId: paramsOrFirst,
|
|
46701
|
+
resourceType: rest[0],
|
|
46702
|
+
name: rest[1],
|
|
46703
|
+
limit: rest[2],
|
|
46704
|
+
interval: rest[3],
|
|
46705
|
+
resourceId: rest[4],
|
|
46706
|
+
description: rest[5],
|
|
46707
|
+
key: rest[6],
|
|
46708
|
+
strategy: rest[7],
|
|
46709
|
+
maxBucketSize: rest[8],
|
|
46710
|
+
priority: rest[9],
|
|
46711
|
+
enabled: rest[10],
|
|
46712
|
+
conditions: rest[11],
|
|
46713
|
+
};
|
|
46714
|
+
}
|
|
46715
|
+
const ruleId = params.ruleId;
|
|
46716
|
+
const resourceType = params.resourceType;
|
|
46717
|
+
const name = params.name;
|
|
46718
|
+
const limit = params.limit;
|
|
46719
|
+
const interval = params.interval;
|
|
46720
|
+
const resourceId = params.resourceId;
|
|
46721
|
+
const description = params.description;
|
|
46722
|
+
const key = params.key;
|
|
46723
|
+
const strategy = params.strategy;
|
|
46724
|
+
const maxBucketSize = params.maxBucketSize;
|
|
46725
|
+
const priority = params.priority;
|
|
46726
|
+
const enabled = params.enabled;
|
|
46727
|
+
const conditions = params.conditions;
|
|
46728
|
+
if (typeof ruleId === 'undefined') {
|
|
46729
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
46730
|
+
}
|
|
46731
|
+
if (typeof resourceType === 'undefined') {
|
|
46732
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
46733
|
+
}
|
|
46734
|
+
if (typeof name === 'undefined') {
|
|
46735
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
46736
|
+
}
|
|
46737
|
+
if (typeof limit === 'undefined') {
|
|
46738
|
+
throw new AppwriteException('Missing required parameter: "limit"');
|
|
46739
|
+
}
|
|
46740
|
+
if (typeof interval === 'undefined') {
|
|
46741
|
+
throw new AppwriteException('Missing required parameter: "interval"');
|
|
46742
|
+
}
|
|
46743
|
+
const apiPath = '/waf/rules/rate-limit';
|
|
46744
|
+
const apiPayload = {};
|
|
46745
|
+
if (typeof ruleId !== 'undefined') {
|
|
46746
|
+
apiPayload['ruleId'] = ruleId;
|
|
46747
|
+
}
|
|
46748
|
+
if (typeof resourceType !== 'undefined') {
|
|
46749
|
+
apiPayload['resourceType'] = resourceType;
|
|
46750
|
+
}
|
|
46751
|
+
if (typeof resourceId !== 'undefined') {
|
|
46752
|
+
apiPayload['resourceId'] = resourceId;
|
|
46753
|
+
}
|
|
46754
|
+
if (typeof name !== 'undefined') {
|
|
46755
|
+
apiPayload['name'] = name;
|
|
46756
|
+
}
|
|
46757
|
+
if (typeof description !== 'undefined') {
|
|
46758
|
+
apiPayload['description'] = description;
|
|
44784
46759
|
}
|
|
44785
46760
|
if (typeof limit !== 'undefined') {
|
|
44786
46761
|
apiPayload['limit'] = limit;
|
|
@@ -46012,9 +47987,8 @@ const RECONNECT_PERIOD_MS = 2000;
|
|
|
46012
47987
|
* );
|
|
46013
47988
|
* // sub.update({ background: true }); sub.unsubscribe();
|
|
46014
47989
|
*/
|
|
46015
|
-
class Push
|
|
47990
|
+
class Push {
|
|
46016
47991
|
constructor(client) {
|
|
46017
|
-
super(client);
|
|
46018
47992
|
this.mqtt = null;
|
|
46019
47993
|
this.connecting = null;
|
|
46020
47994
|
this.Buffer = null;
|
|
@@ -46044,6 +48018,7 @@ class Push extends Service {
|
|
|
46044
48018
|
this.connectedKey = '';
|
|
46045
48019
|
this.connectionEpoch = 0;
|
|
46046
48020
|
this.subscriptions = new Map();
|
|
48021
|
+
this.client = client;
|
|
46047
48022
|
}
|
|
46048
48023
|
// The broker subscription for a filter uses the highest QoS any local subscription on
|
|
46049
48024
|
// it wants, so a QoS-0 subscription never downgrades a QoS-1 one sharing the filter.
|
|
@@ -46783,6 +48758,670 @@ function matches(filter, topic) {
|
|
|
46783
48758
|
return filterParts.length === topicParts.length;
|
|
46784
48759
|
}
|
|
46785
48760
|
|
|
48761
|
+
/**
|
|
48762
|
+
* Analytics auto-tracking helpers.
|
|
48763
|
+
*
|
|
48764
|
+
* These are hand-written companions to the generated `Analytics` service.
|
|
48765
|
+
* The generated service exposes `createEvent(params)` for arbitrary events;
|
|
48766
|
+
* this module wires up common auto-tracking behaviours (pageviews, outbound
|
|
48767
|
+
* links, downloads, scroll depth, active engagement) on top of it.
|
|
48768
|
+
*
|
|
48769
|
+
* The tracking helpers accept a plain event-emitter function so they do not
|
|
48770
|
+
* hard-couple to the generated `Analytics` class. The emitter adapts this
|
|
48771
|
+
* module's option shape to `createEvent`: `url` is required there, and `props`
|
|
48772
|
+
* is a flat alternating key/value list rather than an object.
|
|
48773
|
+
*
|
|
48774
|
+
* ```ts
|
|
48775
|
+
* const analytics = new Analytics(client);
|
|
48776
|
+
* const tracking = new AnalyticsTracking(
|
|
48777
|
+
* (name, options) => analytics.createEvent({
|
|
48778
|
+
* propertyId: options?.propertyId ?? '<PROPERTY_ID>',
|
|
48779
|
+
* name,
|
|
48780
|
+
* url: options?.url ?? window.location.href,
|
|
48781
|
+
* referrer: options?.referrer,
|
|
48782
|
+
* scrollDepth: options?.scrollDepth,
|
|
48783
|
+
* engagementTime: options?.engagementTime,
|
|
48784
|
+
* props: Object.entries(options?.props ?? {}).flatMap(
|
|
48785
|
+
* ([key, value]) => [key, String(value)],
|
|
48786
|
+
* ),
|
|
48787
|
+
* }),
|
|
48788
|
+
* { propertyId: '<PROPERTY_ID>' }
|
|
48789
|
+
* );
|
|
48790
|
+
* tracking.enableAllAutoTracking();
|
|
48791
|
+
* ```
|
|
48792
|
+
*
|
|
48793
|
+
* `propertyId` is optional: when set it is merged into the options of every
|
|
48794
|
+
* emitted event, so an emitter that forwards `options.propertyId` (as above)
|
|
48795
|
+
* picks it up instead of every caller hand-rolling it into the closure.
|
|
48796
|
+
* Per-event `propertyId` always wins over the configured default.
|
|
48797
|
+
*
|
|
48798
|
+
* All helpers respect `navigator.doNotTrack === '1'` by default; opt out with
|
|
48799
|
+
* `respectDoNotTrack: false` in the constructor options.
|
|
48800
|
+
*
|
|
48801
|
+
* Engagement time follows Plausible's model: rather than one total at unload,
|
|
48802
|
+
* a delta is emitted at every natural checkpoint of the visit (tab hidden, SPA
|
|
48803
|
+
* route change, unload). See `enableAutoEngagementTime` for details.
|
|
48804
|
+
*
|
|
48805
|
+
* Auto-emitted event names follow `snake_case` + lowercase (`pageview`,
|
|
48806
|
+
* `outbound_link`, `file_download`, `screen_view`, etc.). Any prop keys use
|
|
48807
|
+
* camelCase to match the endpoint's parameter naming. Callers can pass any
|
|
48808
|
+
* custom event name; the auto-track methods only own the events they emit
|
|
48809
|
+
* themselves.
|
|
48810
|
+
*/
|
|
48811
|
+
const DEFAULT_DOWNLOAD_EXTENSIONS = [
|
|
48812
|
+
'pdf',
|
|
48813
|
+
'zip',
|
|
48814
|
+
'rar',
|
|
48815
|
+
'7z',
|
|
48816
|
+
'tar',
|
|
48817
|
+
'gz',
|
|
48818
|
+
'csv',
|
|
48819
|
+
'tsv',
|
|
48820
|
+
'xls',
|
|
48821
|
+
'xlsx',
|
|
48822
|
+
'doc',
|
|
48823
|
+
'docx',
|
|
48824
|
+
'ppt',
|
|
48825
|
+
'pptx',
|
|
48826
|
+
'dmg',
|
|
48827
|
+
'exe',
|
|
48828
|
+
'msi',
|
|
48829
|
+
'pkg',
|
|
48830
|
+
'deb',
|
|
48831
|
+
'rpm',
|
|
48832
|
+
'apk',
|
|
48833
|
+
'mp3',
|
|
48834
|
+
'wav',
|
|
48835
|
+
'flac',
|
|
48836
|
+
'mp4',
|
|
48837
|
+
'mov',
|
|
48838
|
+
'avi',
|
|
48839
|
+
'mkv',
|
|
48840
|
+
'webm',
|
|
48841
|
+
];
|
|
48842
|
+
/**
|
|
48843
|
+
* Two-part public suffixes common enough to matter for outbound-link detection.
|
|
48844
|
+
* See `rootDomain()` for why this is a short list rather than the Public Suffix
|
|
48845
|
+
* List.
|
|
48846
|
+
*/
|
|
48847
|
+
const MULTI_PART_SUFFIXES = new Set([
|
|
48848
|
+
'co.uk',
|
|
48849
|
+
'org.uk',
|
|
48850
|
+
'ac.uk',
|
|
48851
|
+
'gov.uk',
|
|
48852
|
+
'me.uk',
|
|
48853
|
+
'net.uk',
|
|
48854
|
+
'sch.uk',
|
|
48855
|
+
'co.jp',
|
|
48856
|
+
'ne.jp',
|
|
48857
|
+
'or.jp',
|
|
48858
|
+
'ac.jp',
|
|
48859
|
+
'go.jp',
|
|
48860
|
+
'com.au',
|
|
48861
|
+
'net.au',
|
|
48862
|
+
'org.au',
|
|
48863
|
+
'edu.au',
|
|
48864
|
+
'gov.au',
|
|
48865
|
+
'com.br',
|
|
48866
|
+
'net.br',
|
|
48867
|
+
'org.br',
|
|
48868
|
+
'com.cn',
|
|
48869
|
+
'net.cn',
|
|
48870
|
+
'org.cn',
|
|
48871
|
+
'gov.cn',
|
|
48872
|
+
'co.in',
|
|
48873
|
+
'net.in',
|
|
48874
|
+
'org.in',
|
|
48875
|
+
'co.nz',
|
|
48876
|
+
'net.nz',
|
|
48877
|
+
'org.nz',
|
|
48878
|
+
'co.za',
|
|
48879
|
+
'org.za',
|
|
48880
|
+
'com.mx',
|
|
48881
|
+
'com.ar',
|
|
48882
|
+
'com.co',
|
|
48883
|
+
'com.pe',
|
|
48884
|
+
'com.tr',
|
|
48885
|
+
'com.tw',
|
|
48886
|
+
'com.sg',
|
|
48887
|
+
'com.hk',
|
|
48888
|
+
'com.my',
|
|
48889
|
+
'com.ph',
|
|
48890
|
+
'com.vn',
|
|
48891
|
+
'co.kr',
|
|
48892
|
+
'co.il',
|
|
48893
|
+
'co.id',
|
|
48894
|
+
'co.th',
|
|
48895
|
+
'com.ua',
|
|
48896
|
+
'com.pl',
|
|
48897
|
+
'com.es',
|
|
48898
|
+
]);
|
|
48899
|
+
const SCROLL_DEPTH_THROTTLE_MS = 200;
|
|
48900
|
+
class AnalyticsTracking {
|
|
48901
|
+
constructor(emit, options = {}) {
|
|
48902
|
+
this.pageviewCleanups = [];
|
|
48903
|
+
this.scrollCleanups = [];
|
|
48904
|
+
this.engagementCleanups = [];
|
|
48905
|
+
this.maxScrollDepth = 0;
|
|
48906
|
+
this.scrollTicking = false;
|
|
48907
|
+
this.lastScrollReport = 0;
|
|
48908
|
+
this.engagementStart = 0;
|
|
48909
|
+
this.engagementAccumulatedMs = 0;
|
|
48910
|
+
this.engagementActive = false;
|
|
48911
|
+
this.emit = emit;
|
|
48912
|
+
this.respectDoNotTrack = options.respectDoNotTrack !== false;
|
|
48913
|
+
this.propertyId = options.propertyId;
|
|
48914
|
+
}
|
|
48915
|
+
/**
|
|
48916
|
+
* Enable the opinionated default auto-tracking set: pageviews, outbound
|
|
48917
|
+
* links, scroll depth and active engagement time. Downloads must be opted
|
|
48918
|
+
* into separately via `enableAutoDownloadTracking()` because the extension
|
|
48919
|
+
* list is application-specific.
|
|
48920
|
+
*/
|
|
48921
|
+
enableAllAutoTracking() {
|
|
48922
|
+
this.enableAutoPageviews();
|
|
48923
|
+
this.enableAutoOutboundTracking();
|
|
48924
|
+
this.enableAutoScrollDepth();
|
|
48925
|
+
this.enableAutoEngagementTime();
|
|
48926
|
+
}
|
|
48927
|
+
/**
|
|
48928
|
+
* Track an event manually. Respects the DNT setting and swallows emitter
|
|
48929
|
+
* exceptions so tracking failures never surface to the host page.
|
|
48930
|
+
*/
|
|
48931
|
+
track(name, options) {
|
|
48932
|
+
if (!this.canTrack()) {
|
|
48933
|
+
return;
|
|
48934
|
+
}
|
|
48935
|
+
try {
|
|
48936
|
+
this.emit(name, this.withPropertyId(options));
|
|
48937
|
+
}
|
|
48938
|
+
catch (error) {
|
|
48939
|
+
console.warn('AnalyticsTracking: emitter threw', error);
|
|
48940
|
+
}
|
|
48941
|
+
}
|
|
48942
|
+
/**
|
|
48943
|
+
* Convenience wrapper for pageview-shaped events.
|
|
48944
|
+
*/
|
|
48945
|
+
pageview(url, referrer) {
|
|
48946
|
+
this.track('pageview', {
|
|
48947
|
+
url: url !== null && url !== void 0 ? url : this.currentPageUrl(),
|
|
48948
|
+
referrer: referrer !== null && referrer !== void 0 ? referrer : (typeof document !== 'undefined'
|
|
48949
|
+
? document.referrer
|
|
48950
|
+
: undefined),
|
|
48951
|
+
});
|
|
48952
|
+
}
|
|
48953
|
+
/**
|
|
48954
|
+
* Enable SPA-aware pageview tracking. Fires an initial pageview on
|
|
48955
|
+
* enable, then again on every `pushState`, `replaceState`, `popstate`
|
|
48956
|
+
* or hashchange. Idempotent — repeat calls no-op.
|
|
48957
|
+
*/
|
|
48958
|
+
enableAutoPageviews() {
|
|
48959
|
+
if (this.pageviewCleanups.length > 0) {
|
|
48960
|
+
return;
|
|
48961
|
+
}
|
|
48962
|
+
if (typeof window === 'undefined' || typeof history === 'undefined') {
|
|
48963
|
+
return;
|
|
48964
|
+
}
|
|
48965
|
+
this.currentPath = this.currentPageUrl();
|
|
48966
|
+
this.pageview();
|
|
48967
|
+
const handleNavigation = () => {
|
|
48968
|
+
const nextPath = this.currentPageUrl();
|
|
48969
|
+
if (nextPath === this.currentPath) {
|
|
48970
|
+
return;
|
|
48971
|
+
}
|
|
48972
|
+
const previous = this.currentPath;
|
|
48973
|
+
this.currentPath = nextPath;
|
|
48974
|
+
this.flushScrollDepth(previous);
|
|
48975
|
+
this.flushEngagement(previous);
|
|
48976
|
+
this.pageview(nextPath);
|
|
48977
|
+
// flushEngagement no longer auto-restarts the timer (see its
|
|
48978
|
+
// implementation note re: bfcache). SPA navigation stays on the
|
|
48979
|
+
// same document, so restart engagement tracking for the new
|
|
48980
|
+
// route as long as the tab is visible.
|
|
48981
|
+
if (this.engagementCleanups.length > 0 &&
|
|
48982
|
+
(typeof document === 'undefined' ||
|
|
48983
|
+
document.visibilityState !== 'hidden')) {
|
|
48984
|
+
this.startEngagement();
|
|
48985
|
+
}
|
|
48986
|
+
};
|
|
48987
|
+
const originalPushState = history.pushState.bind(history);
|
|
48988
|
+
const originalReplaceState = history.replaceState.bind(history);
|
|
48989
|
+
// Our wrappers stay reachable after cleanup whenever another library
|
|
48990
|
+
// patched on top of ours, so they have to be switchable off rather than
|
|
48991
|
+
// merely unreferenced.
|
|
48992
|
+
let patchActive = true;
|
|
48993
|
+
const patchedPushState = (data, unused, url) => {
|
|
48994
|
+
originalPushState(data, unused, url);
|
|
48995
|
+
if (patchActive) {
|
|
48996
|
+
handleNavigation();
|
|
48997
|
+
}
|
|
48998
|
+
};
|
|
48999
|
+
const patchedReplaceState = (data, unused, url) => {
|
|
49000
|
+
originalReplaceState(data, unused, url);
|
|
49001
|
+
if (patchActive) {
|
|
49002
|
+
handleNavigation();
|
|
49003
|
+
}
|
|
49004
|
+
};
|
|
49005
|
+
history.pushState = patchedPushState;
|
|
49006
|
+
history.replaceState = patchedReplaceState;
|
|
49007
|
+
const popstateHandler = () => handleNavigation();
|
|
49008
|
+
const hashchangeHandler = () => handleNavigation();
|
|
49009
|
+
window.addEventListener('popstate', popstateHandler);
|
|
49010
|
+
window.addEventListener('hashchange', hashchangeHandler);
|
|
49011
|
+
this.pageviewCleanups.push(() => {
|
|
49012
|
+
// Only unwind our own patch. A router (Next.js App Router, React
|
|
49013
|
+
// Router, …) that patched these after us owns the current value,
|
|
49014
|
+
// and assigning our saved reference back would silently throw its
|
|
49015
|
+
// wrapper away. In that case ours stays in the chain, which is why
|
|
49016
|
+
// `patchActive` exists: the wrapper keeps delegating to the original
|
|
49017
|
+
// but stops reporting.
|
|
49018
|
+
patchActive = false;
|
|
49019
|
+
if (history.pushState === patchedPushState) {
|
|
49020
|
+
history.pushState = originalPushState;
|
|
49021
|
+
}
|
|
49022
|
+
if (history.replaceState === patchedReplaceState) {
|
|
49023
|
+
history.replaceState = originalReplaceState;
|
|
49024
|
+
}
|
|
49025
|
+
window.removeEventListener('popstate', popstateHandler);
|
|
49026
|
+
window.removeEventListener('hashchange', hashchangeHandler);
|
|
49027
|
+
});
|
|
49028
|
+
}
|
|
49029
|
+
/**
|
|
49030
|
+
* Disable auto-pageview tracking installed by `enableAutoPageviews`.
|
|
49031
|
+
* Safe to call when auto-pageviews were never enabled.
|
|
49032
|
+
*/
|
|
49033
|
+
disableAutoPageviews() {
|
|
49034
|
+
for (const cleanup of this.pageviewCleanups) {
|
|
49035
|
+
cleanup();
|
|
49036
|
+
}
|
|
49037
|
+
this.pageviewCleanups = [];
|
|
49038
|
+
}
|
|
49039
|
+
/**
|
|
49040
|
+
* Enable click-based outbound link tracking. Detects anchor clicks that
|
|
49041
|
+
* navigate to a different origin and fires an `outbound_link` event
|
|
49042
|
+
* (with `hostname` and `href` props) before the browser navigates.
|
|
49043
|
+
*/
|
|
49044
|
+
enableAutoOutboundTracking(options = {}) {
|
|
49045
|
+
if (this.outboundCleanup) {
|
|
49046
|
+
return;
|
|
49047
|
+
}
|
|
49048
|
+
if (typeof document === 'undefined') {
|
|
49049
|
+
return;
|
|
49050
|
+
}
|
|
49051
|
+
const includeSubdomains = options.includeSubdomains === true;
|
|
49052
|
+
const clickHandler = (event) => {
|
|
49053
|
+
const anchor = this.findAnchor(event.target);
|
|
49054
|
+
if (!anchor || !anchor.href) {
|
|
49055
|
+
return;
|
|
49056
|
+
}
|
|
49057
|
+
const target = this.parseUrl(anchor.href);
|
|
49058
|
+
if (!target || !this.isExternal(target, includeSubdomains)) {
|
|
49059
|
+
return;
|
|
49060
|
+
}
|
|
49061
|
+
this.track('outbound_link', {
|
|
49062
|
+
url: target.href,
|
|
49063
|
+
props: { hostname: target.hostname, href: target.href },
|
|
49064
|
+
});
|
|
49065
|
+
};
|
|
49066
|
+
document.addEventListener('click', clickHandler, { capture: true });
|
|
49067
|
+
this.outboundCleanup = () => document.removeEventListener('click', clickHandler, {
|
|
49068
|
+
capture: true,
|
|
49069
|
+
});
|
|
49070
|
+
}
|
|
49071
|
+
/**
|
|
49072
|
+
* Disable outbound-link tracking installed by `enableAutoOutboundTracking`.
|
|
49073
|
+
* Safe to call when auto-outbound was never enabled.
|
|
49074
|
+
*/
|
|
49075
|
+
disableAutoOutboundTracking() {
|
|
49076
|
+
if (this.outboundCleanup) {
|
|
49077
|
+
this.outboundCleanup();
|
|
49078
|
+
this.outboundCleanup = undefined;
|
|
49079
|
+
}
|
|
49080
|
+
}
|
|
49081
|
+
/**
|
|
49082
|
+
* Enable click-based download tracking. Detects anchor clicks that point
|
|
49083
|
+
* at a file whose extension appears in the configured list and fires a
|
|
49084
|
+
* `file_download` event with `filename`, `extension` and `href` props.
|
|
49085
|
+
*/
|
|
49086
|
+
enableAutoDownloadTracking(options = {}) {
|
|
49087
|
+
var _a;
|
|
49088
|
+
if (this.downloadCleanup) {
|
|
49089
|
+
return;
|
|
49090
|
+
}
|
|
49091
|
+
if (typeof document === 'undefined') {
|
|
49092
|
+
return;
|
|
49093
|
+
}
|
|
49094
|
+
const extensions = ((_a = options.extensions) !== null && _a !== void 0 ? _a : DEFAULT_DOWNLOAD_EXTENSIONS).map((ext) => ext.toLowerCase().replace(/^\./, ''));
|
|
49095
|
+
const extensionSet = new Set(extensions);
|
|
49096
|
+
const clickHandler = (event) => {
|
|
49097
|
+
var _a, _b;
|
|
49098
|
+
const anchor = this.findAnchor(event.target);
|
|
49099
|
+
if (!anchor || !anchor.href) {
|
|
49100
|
+
return;
|
|
49101
|
+
}
|
|
49102
|
+
const url = this.parseUrl(anchor.href);
|
|
49103
|
+
if (!url) {
|
|
49104
|
+
return;
|
|
49105
|
+
}
|
|
49106
|
+
const filename = (_a = url.pathname.split('/').pop()) !== null && _a !== void 0 ? _a : '';
|
|
49107
|
+
const extension = filename.includes('.')
|
|
49108
|
+
? (_b = filename.split('.').pop()) === null || _b === void 0 ? void 0 : _b.toLowerCase()
|
|
49109
|
+
: undefined;
|
|
49110
|
+
if (!extension || !extensionSet.has(extension)) {
|
|
49111
|
+
return;
|
|
49112
|
+
}
|
|
49113
|
+
this.track('file_download', {
|
|
49114
|
+
url: url.href,
|
|
49115
|
+
props: { filename, extension, href: url.href },
|
|
49116
|
+
});
|
|
49117
|
+
};
|
|
49118
|
+
document.addEventListener('click', clickHandler, { capture: true });
|
|
49119
|
+
this.downloadCleanup = () => document.removeEventListener('click', clickHandler, {
|
|
49120
|
+
capture: true,
|
|
49121
|
+
});
|
|
49122
|
+
}
|
|
49123
|
+
/**
|
|
49124
|
+
* Disable file-download tracking installed by `enableAutoDownloadTracking`.
|
|
49125
|
+
* Safe to call when auto-download was never enabled.
|
|
49126
|
+
*/
|
|
49127
|
+
disableAutoDownloadTracking() {
|
|
49128
|
+
if (this.downloadCleanup) {
|
|
49129
|
+
this.downloadCleanup();
|
|
49130
|
+
this.downloadCleanup = undefined;
|
|
49131
|
+
}
|
|
49132
|
+
}
|
|
49133
|
+
/**
|
|
49134
|
+
* Enable passive scroll-depth tracking. Records the maximum percent of the
|
|
49135
|
+
* document scrolled and reports it on `beforeunload` and on SPA route
|
|
49136
|
+
* changes. Uses a throttled passive listener so it is safe on hot paths.
|
|
49137
|
+
*/
|
|
49138
|
+
enableAutoScrollDepth() {
|
|
49139
|
+
if (this.scrollCleanups.length > 0) {
|
|
49140
|
+
return;
|
|
49141
|
+
}
|
|
49142
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
49143
|
+
return;
|
|
49144
|
+
}
|
|
49145
|
+
this.maxScrollDepth = 0;
|
|
49146
|
+
this.lastScrollReport = 0;
|
|
49147
|
+
const scrollHandler = () => {
|
|
49148
|
+
if (this.scrollTicking) {
|
|
49149
|
+
return;
|
|
49150
|
+
}
|
|
49151
|
+
this.scrollTicking = true;
|
|
49152
|
+
window.requestAnimationFrame(() => {
|
|
49153
|
+
const now = Date.now();
|
|
49154
|
+
if (now - this.lastScrollReport < SCROLL_DEPTH_THROTTLE_MS) {
|
|
49155
|
+
this.scrollTicking = false;
|
|
49156
|
+
return;
|
|
49157
|
+
}
|
|
49158
|
+
this.lastScrollReport = now;
|
|
49159
|
+
const depth = this.computeScrollDepth();
|
|
49160
|
+
if (depth > this.maxScrollDepth) {
|
|
49161
|
+
this.maxScrollDepth = depth;
|
|
49162
|
+
}
|
|
49163
|
+
this.scrollTicking = false;
|
|
49164
|
+
});
|
|
49165
|
+
};
|
|
49166
|
+
const unloadHandler = () => {
|
|
49167
|
+
this.flushScrollDepth(this.currentPageUrl());
|
|
49168
|
+
};
|
|
49169
|
+
window.addEventListener('scroll', scrollHandler, { passive: true });
|
|
49170
|
+
window.addEventListener('beforeunload', unloadHandler);
|
|
49171
|
+
window.addEventListener('pagehide', unloadHandler);
|
|
49172
|
+
this.scrollCleanups.push(() => {
|
|
49173
|
+
window.removeEventListener('scroll', scrollHandler);
|
|
49174
|
+
window.removeEventListener('beforeunload', unloadHandler);
|
|
49175
|
+
window.removeEventListener('pagehide', unloadHandler);
|
|
49176
|
+
});
|
|
49177
|
+
}
|
|
49178
|
+
/**
|
|
49179
|
+
* Disable scroll-depth tracking installed by `enableAutoScrollDepth`. Safe
|
|
49180
|
+
* to call when auto-scroll-depth was never enabled. Any accumulated depth
|
|
49181
|
+
* for the current page is dropped.
|
|
49182
|
+
*/
|
|
49183
|
+
disableAutoScrollDepth() {
|
|
49184
|
+
for (const cleanup of this.scrollCleanups) {
|
|
49185
|
+
cleanup();
|
|
49186
|
+
}
|
|
49187
|
+
this.scrollCleanups = [];
|
|
49188
|
+
this.maxScrollDepth = 0;
|
|
49189
|
+
this.scrollTicking = false;
|
|
49190
|
+
this.lastScrollReport = 0;
|
|
49191
|
+
}
|
|
49192
|
+
/**
|
|
49193
|
+
* Enable active engagement-time tracking. Counts time the tab is visible
|
|
49194
|
+
* and uses `visibilitychange` to exclude background time.
|
|
49195
|
+
*
|
|
49196
|
+
* Delivery follows Plausible's model rather than a single total at the
|
|
49197
|
+
* end of the visit: an `engagement_time` event is emitted at every natural
|
|
49198
|
+
* checkpoint — the tab going hidden, an SPA route change, and finally
|
|
49199
|
+
* `beforeunload`/`pagehide`. Unload is kept only as a best-effort last
|
|
49200
|
+
* flush; it is the least reliable moment to send anything (browsers
|
|
49201
|
+
* routinely cancel in-flight requests there, and `sendBeacon` cannot set
|
|
49202
|
+
* the `X-Appwrite-Project` header the endpoint requires), so it must never
|
|
49203
|
+
* be the only delivery.
|
|
49204
|
+
*
|
|
49205
|
+
* Each event carries a **delta** — the seconds accrued since the previous
|
|
49206
|
+
* flush, not a running total — so the values are additive per session and
|
|
49207
|
+
* a lost event costs only its own slice.
|
|
49208
|
+
*
|
|
49209
|
+
* There is deliberately no periodic ping. The cadence is driven by
|
|
49210
|
+
* navigation and tab switches, so request volume tracks what the visitor
|
|
49211
|
+
* actually does instead of multiplying with time on page.
|
|
49212
|
+
*/
|
|
49213
|
+
enableAutoEngagementTime() {
|
|
49214
|
+
if (this.engagementCleanups.length > 0) {
|
|
49215
|
+
return;
|
|
49216
|
+
}
|
|
49217
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
49218
|
+
return;
|
|
49219
|
+
}
|
|
49220
|
+
this.engagementAccumulatedMs = 0;
|
|
49221
|
+
// Do not start the clock for a tab that is already hidden (prerender,
|
|
49222
|
+
// background tab restore); `visibilitychange` starts it when it is
|
|
49223
|
+
// actually looked at.
|
|
49224
|
+
if (document.visibilityState !== 'hidden') {
|
|
49225
|
+
this.startEngagement();
|
|
49226
|
+
}
|
|
49227
|
+
const visibilityHandler = () => {
|
|
49228
|
+
if (document.visibilityState === 'hidden') {
|
|
49229
|
+
// Flush, don't just pause. The page is still fully alive here,
|
|
49230
|
+
// which makes this the most reliable delivery point in the
|
|
49231
|
+
// whole visit — and it is the same moment Plausible reports on.
|
|
49232
|
+
this.flushEngagement(this.currentPageUrl());
|
|
49233
|
+
}
|
|
49234
|
+
else if (document.visibilityState === 'visible') {
|
|
49235
|
+
this.startEngagement();
|
|
49236
|
+
}
|
|
49237
|
+
};
|
|
49238
|
+
const unloadHandler = () => {
|
|
49239
|
+
this.flushEngagement(this.currentPageUrl());
|
|
49240
|
+
};
|
|
49241
|
+
const pageshowHandler = (event) => {
|
|
49242
|
+
// When the page is restored from the back-forward cache the
|
|
49243
|
+
// engagement timer is in a stopped state (flushEngagement paused
|
|
49244
|
+
// it on pagehide and does not auto-restart). Kick off a fresh
|
|
49245
|
+
// engagementStart so bfcache dwell time is not billed as
|
|
49246
|
+
// engagement.
|
|
49247
|
+
if (event.persisted) {
|
|
49248
|
+
this.startEngagement();
|
|
49249
|
+
}
|
|
49250
|
+
};
|
|
49251
|
+
document.addEventListener('visibilitychange', visibilityHandler);
|
|
49252
|
+
window.addEventListener('beforeunload', unloadHandler);
|
|
49253
|
+
window.addEventListener('pagehide', unloadHandler);
|
|
49254
|
+
window.addEventListener('pageshow', pageshowHandler);
|
|
49255
|
+
this.engagementCleanups.push(() => {
|
|
49256
|
+
document.removeEventListener('visibilitychange', visibilityHandler);
|
|
49257
|
+
window.removeEventListener('beforeunload', unloadHandler);
|
|
49258
|
+
window.removeEventListener('pagehide', unloadHandler);
|
|
49259
|
+
window.removeEventListener('pageshow', pageshowHandler);
|
|
49260
|
+
});
|
|
49261
|
+
}
|
|
49262
|
+
/**
|
|
49263
|
+
* Disable engagement-time tracking installed by `enableAutoEngagementTime`.
|
|
49264
|
+
* Safe to call when auto-engagement was never enabled. Any accumulated
|
|
49265
|
+
* engagement time is dropped without being emitted.
|
|
49266
|
+
*/
|
|
49267
|
+
disableAutoEngagementTime() {
|
|
49268
|
+
for (const cleanup of this.engagementCleanups) {
|
|
49269
|
+
cleanup();
|
|
49270
|
+
}
|
|
49271
|
+
this.engagementCleanups = [];
|
|
49272
|
+
this.engagementActive = false;
|
|
49273
|
+
this.engagementAccumulatedMs = 0;
|
|
49274
|
+
this.engagementStart = 0;
|
|
49275
|
+
}
|
|
49276
|
+
/**
|
|
49277
|
+
* Merge the configured `propertyId` into an event's options. Returns the
|
|
49278
|
+
* caller's object untouched when no default is configured (or the event
|
|
49279
|
+
* already carries one), so emitters written against the pre-`propertyId`
|
|
49280
|
+
* shape keep receiving exactly what they received before.
|
|
49281
|
+
*/
|
|
49282
|
+
withPropertyId(options) {
|
|
49283
|
+
if (this.propertyId === undefined ||
|
|
49284
|
+
(options === null || options === void 0 ? void 0 : options.propertyId) !== undefined) {
|
|
49285
|
+
return options;
|
|
49286
|
+
}
|
|
49287
|
+
return Object.assign(Object.assign({}, (options !== null && options !== void 0 ? options : {})), { propertyId: this.propertyId });
|
|
49288
|
+
}
|
|
49289
|
+
canTrack() {
|
|
49290
|
+
if (!this.respectDoNotTrack) {
|
|
49291
|
+
return true;
|
|
49292
|
+
}
|
|
49293
|
+
if (typeof navigator === 'undefined') {
|
|
49294
|
+
return true;
|
|
49295
|
+
}
|
|
49296
|
+
return navigator.doNotTrack !== '1';
|
|
49297
|
+
}
|
|
49298
|
+
currentPageUrl() {
|
|
49299
|
+
if (typeof window === 'undefined' || !window.location) {
|
|
49300
|
+
return '';
|
|
49301
|
+
}
|
|
49302
|
+
return window.location.href;
|
|
49303
|
+
}
|
|
49304
|
+
findAnchor(target) {
|
|
49305
|
+
let node = target;
|
|
49306
|
+
while (node) {
|
|
49307
|
+
if (node.tagName === 'A') {
|
|
49308
|
+
return node;
|
|
49309
|
+
}
|
|
49310
|
+
node = node.parentNode;
|
|
49311
|
+
}
|
|
49312
|
+
return null;
|
|
49313
|
+
}
|
|
49314
|
+
parseUrl(href) {
|
|
49315
|
+
try {
|
|
49316
|
+
return new URL(href, window.location.href);
|
|
49317
|
+
}
|
|
49318
|
+
catch (_a) {
|
|
49319
|
+
return null;
|
|
49320
|
+
}
|
|
49321
|
+
}
|
|
49322
|
+
isExternal(target, includeSubdomains) {
|
|
49323
|
+
if (target.protocol !== 'http:' && target.protocol !== 'https:') {
|
|
49324
|
+
return false;
|
|
49325
|
+
}
|
|
49326
|
+
if (target.hostname === window.location.hostname) {
|
|
49327
|
+
return false;
|
|
49328
|
+
}
|
|
49329
|
+
if (includeSubdomains) {
|
|
49330
|
+
return true;
|
|
49331
|
+
}
|
|
49332
|
+
const root = this.rootDomain(window.location.hostname);
|
|
49333
|
+
return this.rootDomain(target.hostname) !== root;
|
|
49334
|
+
}
|
|
49335
|
+
rootDomain(hostname) {
|
|
49336
|
+
const parts = hostname.split('.');
|
|
49337
|
+
if (parts.length <= 2) {
|
|
49338
|
+
return hostname;
|
|
49339
|
+
}
|
|
49340
|
+
// Taking the last two labels is wrong wherever the registry sells names
|
|
49341
|
+
// one level down: `shop.example.co.uk` and `google.co.uk` both reduce to
|
|
49342
|
+
// `co.uk`, so every outbound click between two `.co.uk` sites looks
|
|
49343
|
+
// internal and is dropped. Take three labels after a known two-part
|
|
49344
|
+
// suffix instead.
|
|
49345
|
+
//
|
|
49346
|
+
// This is a heuristic, not the Public Suffix List — the full list is
|
|
49347
|
+
// orders of magnitude larger than this whole file, and a tracking
|
|
49348
|
+
// snippet cannot carry it. Sites on a suffix that is missing here can
|
|
49349
|
+
// pass `includeSubdomains: true` to treat every other host as outbound.
|
|
49350
|
+
const suffix = parts.slice(-2).join('.');
|
|
49351
|
+
if (parts.length > 2 && MULTI_PART_SUFFIXES.has(suffix)) {
|
|
49352
|
+
return parts.slice(-3).join('.');
|
|
49353
|
+
}
|
|
49354
|
+
return suffix;
|
|
49355
|
+
}
|
|
49356
|
+
computeScrollDepth() {
|
|
49357
|
+
const scrollTop = window.scrollY || document.documentElement.scrollTop;
|
|
49358
|
+
const viewport = window.innerHeight || document.documentElement.clientHeight;
|
|
49359
|
+
const total = document.documentElement.scrollHeight;
|
|
49360
|
+
if (total <= viewport) {
|
|
49361
|
+
return 100;
|
|
49362
|
+
}
|
|
49363
|
+
const depth = Math.round(((scrollTop + viewport) / total) * 100);
|
|
49364
|
+
return Math.max(0, Math.min(100, depth));
|
|
49365
|
+
}
|
|
49366
|
+
flushScrollDepth(url) {
|
|
49367
|
+
if (this.scrollCleanups.length === 0) {
|
|
49368
|
+
return;
|
|
49369
|
+
}
|
|
49370
|
+
if (this.maxScrollDepth <= 0) {
|
|
49371
|
+
return;
|
|
49372
|
+
}
|
|
49373
|
+
this.track('scroll_depth', {
|
|
49374
|
+
url,
|
|
49375
|
+
scrollDepth: this.maxScrollDepth,
|
|
49376
|
+
});
|
|
49377
|
+
this.maxScrollDepth = 0;
|
|
49378
|
+
}
|
|
49379
|
+
startEngagement() {
|
|
49380
|
+
if (this.engagementActive) {
|
|
49381
|
+
return;
|
|
49382
|
+
}
|
|
49383
|
+
this.engagementActive = true;
|
|
49384
|
+
this.engagementStart = Date.now();
|
|
49385
|
+
}
|
|
49386
|
+
pauseEngagement() {
|
|
49387
|
+
if (!this.engagementActive) {
|
|
49388
|
+
return;
|
|
49389
|
+
}
|
|
49390
|
+
this.engagementActive = false;
|
|
49391
|
+
this.engagementAccumulatedMs += Date.now() - this.engagementStart;
|
|
49392
|
+
}
|
|
49393
|
+
flushEngagement(url) {
|
|
49394
|
+
if (this.engagementCleanups.length === 0) {
|
|
49395
|
+
return;
|
|
49396
|
+
}
|
|
49397
|
+
this.pauseEngagement();
|
|
49398
|
+
// Deltas, not a running total: emit only what accrued since the last
|
|
49399
|
+
// flush. `floor` plus keeping the sub-second remainder in the
|
|
49400
|
+
// accumulator is what makes repeated flushes safe — nothing is emitted
|
|
49401
|
+
// twice, and a visit chopped into many short segments does not lose a
|
|
49402
|
+
// fraction of a second to rounding on every one of them.
|
|
49403
|
+
const seconds = Math.floor(this.engagementAccumulatedMs / 1000);
|
|
49404
|
+
if (seconds > 0) {
|
|
49405
|
+
// Deduct before emitting so a synchronous emitter that re-enters
|
|
49406
|
+
// (or throws) can never bill the same seconds again.
|
|
49407
|
+
this.engagementAccumulatedMs -= seconds * 1000;
|
|
49408
|
+
this.track('engagement_time', {
|
|
49409
|
+
url,
|
|
49410
|
+
engagementTime: seconds,
|
|
49411
|
+
});
|
|
49412
|
+
}
|
|
49413
|
+
// NOTE: intentionally do NOT call startEngagement() here. flushEngagement
|
|
49414
|
+
// runs on `pagehide`, which is also the last hook before the browser
|
|
49415
|
+
// may freeze the page into the back-forward cache. Auto-restarting
|
|
49416
|
+
// would snapshot engagementStart just before the freeze; the next
|
|
49417
|
+
// pauseEngagement (after bfcache restore) would then bill the entire
|
|
49418
|
+
// bfcache dwell as active engagement. Restart is driven by explicit
|
|
49419
|
+
// resume signals: `pageshow` (with `persisted === true`),
|
|
49420
|
+
// `visibilitychange` back to visible, or the SPA navigation flow in
|
|
49421
|
+
// `enableAutoPageviews`.
|
|
49422
|
+
}
|
|
49423
|
+
}
|
|
49424
|
+
|
|
46786
49425
|
/**
|
|
46787
49426
|
* Helper class to generate permission strings for resources.
|
|
46788
49427
|
*/
|
|
@@ -47489,6 +50128,68 @@ var OAuthProvider;
|
|
|
47489
50128
|
OAuthProvider["Zoom"] = "zoom";
|
|
47490
50129
|
})(OAuthProvider || (OAuthProvider = {}));
|
|
47491
50130
|
|
|
50131
|
+
var PlatformResourceType;
|
|
50132
|
+
(function (PlatformResourceType) {
|
|
50133
|
+
PlatformResourceType["Projects"] = "projects";
|
|
50134
|
+
PlatformResourceType["Organizations"] = "organizations";
|
|
50135
|
+
PlatformResourceType["Users"] = "users";
|
|
50136
|
+
PlatformResourceType["Memberships"] = "memberships";
|
|
50137
|
+
PlatformResourceType["Rules"] = "rules";
|
|
50138
|
+
PlatformResourceType["Keys"] = "keys";
|
|
50139
|
+
PlatformResourceType["Platforms"] = "platforms";
|
|
50140
|
+
PlatformResourceType["Webhooks"] = "webhooks";
|
|
50141
|
+
PlatformResourceType["Certificates"] = "certificates";
|
|
50142
|
+
})(PlatformResourceType || (PlatformResourceType = {}));
|
|
50143
|
+
|
|
50144
|
+
var ProjectResourceType;
|
|
50145
|
+
(function (ProjectResourceType) {
|
|
50146
|
+
ProjectResourceType["Users"] = "users";
|
|
50147
|
+
ProjectResourceType["Teams"] = "teams";
|
|
50148
|
+
ProjectResourceType["Memberships"] = "memberships";
|
|
50149
|
+
ProjectResourceType["Databases"] = "databases";
|
|
50150
|
+
ProjectResourceType["Buckets"] = "buckets";
|
|
50151
|
+
ProjectResourceType["Functions"] = "functions";
|
|
50152
|
+
ProjectResourceType["Sites"] = "sites";
|
|
50153
|
+
ProjectResourceType["Deployments"] = "deployments";
|
|
50154
|
+
ProjectResourceType["Topics"] = "topics";
|
|
50155
|
+
ProjectResourceType["Providers"] = "providers";
|
|
50156
|
+
ProjectResourceType["Messages"] = "messages";
|
|
50157
|
+
})(ProjectResourceType || (ProjectResourceType = {}));
|
|
50158
|
+
|
|
50159
|
+
var AnalyticsInterval;
|
|
50160
|
+
(function (AnalyticsInterval) {
|
|
50161
|
+
AnalyticsInterval["OneHour"] = "1h";
|
|
50162
|
+
AnalyticsInterval["OneDay"] = "1d";
|
|
50163
|
+
AnalyticsInterval["OneWeek"] = "1w";
|
|
50164
|
+
AnalyticsInterval["OneMonth"] = "1m";
|
|
50165
|
+
})(AnalyticsInterval || (AnalyticsInterval = {}));
|
|
50166
|
+
|
|
50167
|
+
var AnalyticsDimension;
|
|
50168
|
+
(function (AnalyticsDimension) {
|
|
50169
|
+
AnalyticsDimension["Country"] = "country";
|
|
50170
|
+
AnalyticsDimension["Region"] = "region";
|
|
50171
|
+
AnalyticsDimension["City"] = "city";
|
|
50172
|
+
AnalyticsDimension["Browser"] = "browser";
|
|
50173
|
+
AnalyticsDimension["OperatingSystem"] = "operatingSystem";
|
|
50174
|
+
AnalyticsDimension["Device"] = "device";
|
|
50175
|
+
AnalyticsDimension["ScreenSize"] = "screenSize";
|
|
50176
|
+
AnalyticsDimension["ReferrerSource"] = "referrerSource";
|
|
50177
|
+
AnalyticsDimension["Channel"] = "channel";
|
|
50178
|
+
AnalyticsDimension["UtmSource"] = "utmSource";
|
|
50179
|
+
AnalyticsDimension["UtmMedium"] = "utmMedium";
|
|
50180
|
+
AnalyticsDimension["UtmCampaign"] = "utmCampaign";
|
|
50181
|
+
AnalyticsDimension["UtmContent"] = "utmContent";
|
|
50182
|
+
AnalyticsDimension["UtmTerm"] = "utmTerm";
|
|
50183
|
+
AnalyticsDimension["Page"] = "page";
|
|
50184
|
+
AnalyticsDimension["Hostname"] = "hostname";
|
|
50185
|
+
AnalyticsDimension["EntryPage"] = "entryPage";
|
|
50186
|
+
AnalyticsDimension["ExitPage"] = "exitPage";
|
|
50187
|
+
AnalyticsDimension["TrafficType"] = "trafficType";
|
|
50188
|
+
AnalyticsDimension["BotName"] = "botName";
|
|
50189
|
+
AnalyticsDimension["BotCategory"] = "botCategory";
|
|
50190
|
+
AnalyticsDimension["EventName"] = "eventName";
|
|
50191
|
+
})(AnalyticsDimension || (AnalyticsDimension = {}));
|
|
50192
|
+
|
|
47492
50193
|
var Browser;
|
|
47493
50194
|
(function (Browser) {
|
|
47494
50195
|
Browser["AvantBrowser"] = "aa";
|
|
@@ -48304,6 +51005,14 @@ var QuerySuggestionResource;
|
|
|
48304
51005
|
QuerySuggestionResource["ResourceTokens"] = "resourcetokens";
|
|
48305
51006
|
QuerySuggestionResource["Transactions"] = "transactions";
|
|
48306
51007
|
QuerySuggestionResource["TransactionLogs"] = "transactionlogs";
|
|
51008
|
+
QuerySuggestionResource["Videos"] = "videos";
|
|
51009
|
+
QuerySuggestionResource["VideosPreviews"] = "videos_previews";
|
|
51010
|
+
QuerySuggestionResource["VideosRenditions"] = "videos_renditions";
|
|
51011
|
+
QuerySuggestionResource["VideosRenditionsSegments"] = "videos_renditions_segments";
|
|
51012
|
+
QuerySuggestionResource["VideosProfiles"] = "videos_profiles";
|
|
51013
|
+
QuerySuggestionResource["VideosSubtitles"] = "videos_subtitles";
|
|
51014
|
+
QuerySuggestionResource["VideosSubtitlesSegments"] = "videos_subtitles_segments";
|
|
51015
|
+
QuerySuggestionResource["AnalyticsProperties"] = "analyticsproperties";
|
|
48307
51016
|
QuerySuggestionResource["DedicatedDatabases"] = "dedicateddatabases";
|
|
48308
51017
|
QuerySuggestionResource["DedicatedDatabaseConfigs"] = "dedicateddatabaseconfigs";
|
|
48309
51018
|
QuerySuggestionResource["DedicatedDatabaseRuntimes"] = "dedicateddatabaseruntimes";
|
|
@@ -48726,6 +51435,8 @@ var ProjectKeyScopes;
|
|
|
48726
51435
|
ProjectKeyScopes["ReportsWrite"] = "reports.write";
|
|
48727
51436
|
ProjectKeyScopes["PresencesRead"] = "presences.read";
|
|
48728
51437
|
ProjectKeyScopes["PresencesWrite"] = "presences.write";
|
|
51438
|
+
ProjectKeyScopes["VideosRead"] = "videos.read";
|
|
51439
|
+
ProjectKeyScopes["VideosWrite"] = "videos.write";
|
|
48729
51440
|
ProjectKeyScopes["DedicatedDatabasesExecute"] = "dedicatedDatabases.execute";
|
|
48730
51441
|
ProjectKeyScopes["BackupsPoliciesRead"] = "backups.policies.read";
|
|
48731
51442
|
ProjectKeyScopes["BackupsPoliciesWrite"] = "backups.policies.write";
|
|
@@ -48744,6 +51455,8 @@ var ProjectKeyScopes;
|
|
|
48744
51455
|
ProjectKeyScopes["Oauth2Read"] = "oauth2.read";
|
|
48745
51456
|
ProjectKeyScopes["Oauth2Write"] = "oauth2.write";
|
|
48746
51457
|
ProjectKeyScopes["Oauth2Introspect"] = "oauth2.introspect";
|
|
51458
|
+
ProjectKeyScopes["AnalyticsRead"] = "analytics.read";
|
|
51459
|
+
ProjectKeyScopes["AnalyticsWrite"] = "analytics.write";
|
|
48747
51460
|
})(ProjectKeyScopes || (ProjectKeyScopes = {}));
|
|
48748
51461
|
|
|
48749
51462
|
var FunctionTemplateUseCase;
|
|
@@ -48993,6 +51706,7 @@ var ProjectAuthMethodId;
|
|
|
48993
51706
|
ProjectAuthMethodId["Invites"] = "invites";
|
|
48994
51707
|
ProjectAuthMethodId["Jwt"] = "jwt";
|
|
48995
51708
|
ProjectAuthMethodId["Phone"] = "phone";
|
|
51709
|
+
ProjectAuthMethodId["Passkey"] = "passkey";
|
|
48996
51710
|
})(ProjectAuthMethodId || (ProjectAuthMethodId = {}));
|
|
48997
51711
|
|
|
48998
51712
|
var ProjectOAuth2Auth0Prompt;
|
|
@@ -49134,6 +51848,7 @@ var ProjectPolicyId;
|
|
|
49134
51848
|
ProjectPolicyId["Denydisposableemail"] = "deny-disposable-email";
|
|
49135
51849
|
ProjectPolicyId["Denyfreeemail"] = "deny-free-email";
|
|
49136
51850
|
ProjectPolicyId["Denycorporateemail"] = "deny-corporate-email";
|
|
51851
|
+
ProjectPolicyId["Passkey"] = "passkey";
|
|
49137
51852
|
})(ProjectPolicyId || (ProjectPolicyId = {}));
|
|
49138
51853
|
|
|
49139
51854
|
var ProjectProtocolId;
|
|
@@ -49378,6 +52093,9 @@ var TablesDBIndexType;
|
|
|
49378
52093
|
|
|
49379
52094
|
var UsageEventMetric;
|
|
49380
52095
|
(function (UsageEventMetric) {
|
|
52096
|
+
UsageEventMetric["AnalyticsEvents"] = "analytics.events";
|
|
52097
|
+
UsageEventMetric["AnalyticsPageviews"] = "analytics.pageviews";
|
|
52098
|
+
UsageEventMetric["AnalyticsBotsEvents"] = "analytics.bots.events";
|
|
49381
52099
|
UsageEventMetric["NetworkRequests"] = "network.requests";
|
|
49382
52100
|
UsageEventMetric["NetworkInbound"] = "network.inbound";
|
|
49383
52101
|
UsageEventMetric["NetworkOutbound"] = "network.outbound";
|
|
@@ -49495,6 +52213,7 @@ var UsageOrderDirection;
|
|
|
49495
52213
|
|
|
49496
52214
|
var UsageGaugeMetric;
|
|
49497
52215
|
(function (UsageGaugeMetric) {
|
|
52216
|
+
UsageGaugeMetric["AnalyticsProperties"] = "analytics.properties";
|
|
49498
52217
|
UsageGaugeMetric["Teams"] = "teams";
|
|
49499
52218
|
UsageGaugeMetric["Users"] = "users";
|
|
49500
52219
|
UsageGaugeMetric["Messages"] = "messages";
|
|
@@ -49592,6 +52311,24 @@ var VectorsDBIndexType;
|
|
|
49592
52311
|
VectorsDBIndexType["Unique"] = "unique";
|
|
49593
52312
|
})(VectorsDBIndexType || (VectorsDBIndexType = {}));
|
|
49594
52313
|
|
|
52314
|
+
var VideoOutput;
|
|
52315
|
+
(function (VideoOutput) {
|
|
52316
|
+
VideoOutput["Hls"] = "hls";
|
|
52317
|
+
VideoOutput["Dash"] = "dash";
|
|
52318
|
+
VideoOutput["Cmaf"] = "cmaf";
|
|
52319
|
+
})(VideoOutput || (VideoOutput = {}));
|
|
52320
|
+
|
|
52321
|
+
var VideoRenditionStatus;
|
|
52322
|
+
(function (VideoRenditionStatus) {
|
|
52323
|
+
VideoRenditionStatus["Pending"] = "pending";
|
|
52324
|
+
VideoRenditionStatus["Started"] = "started";
|
|
52325
|
+
VideoRenditionStatus["Ended"] = "ended";
|
|
52326
|
+
VideoRenditionStatus["Uploading"] = "uploading";
|
|
52327
|
+
VideoRenditionStatus["Ready"] = "ready";
|
|
52328
|
+
VideoRenditionStatus["Error"] = "error";
|
|
52329
|
+
VideoRenditionStatus["Aborted"] = "aborted";
|
|
52330
|
+
})(VideoRenditionStatus || (VideoRenditionStatus = {}));
|
|
52331
|
+
|
|
49595
52332
|
var DatabaseType;
|
|
49596
52333
|
(function (DatabaseType) {
|
|
49597
52334
|
DatabaseType["Legacy"] = "legacy";
|
|
@@ -49770,6 +52507,7 @@ var ProxyRuleDeploymentResourceType;
|
|
|
49770
52507
|
(function (ProxyRuleDeploymentResourceType) {
|
|
49771
52508
|
ProxyRuleDeploymentResourceType["Function"] = "function";
|
|
49772
52509
|
ProxyRuleDeploymentResourceType["Site"] = "site";
|
|
52510
|
+
ProxyRuleDeploymentResourceType["DedicatedDatabase"] = "dedicatedDatabase";
|
|
49773
52511
|
})(ProxyRuleDeploymentResourceType || (ProxyRuleDeploymentResourceType = {}));
|
|
49774
52512
|
|
|
49775
52513
|
var ProxyRuleStatus;
|
|
@@ -49825,5 +52563,5 @@ var WafRuleAction;
|
|
|
49825
52563
|
WafRuleAction["Redirect"] = "redirect";
|
|
49826
52564
|
})(WafRuleAction || (WafRuleAction = {}));
|
|
49827
52565
|
|
|
49828
|
-
export { Account, AccountKeyScopes, Activities, Adapter, AddonKey, Advisor, Affiliates, Apps, AppwriteException, AppwriteMigrationResource, Assistant, AttributeStatus, AuthenticationFactor, AuthenticatorType, Avatars, BackupServices, Backups, BillingPlanGroup, BlockMode, BlockResourceType, Browser, BrowserPermission, BrowserTheme, BuildRuntime, CacheDatabase, CacheTarget, Channel, Client, ColumnStatus, Compression, Condition, Console, ConsoleResourceType, ConversationType, CreditCard, DatabaseStatus, DatabaseType, Databases, DatabasesIndexType, DeploymentDownloadType, DeploymentStatus, DetectionFrameworkType, DetectionRuntimeType, DocumentsDB, DocumentsDBIndexType, DomainPurchaseStatus, DomainRegistrationType, DomainSuggestionType, DomainTransferStatusEnum, Domains, EmbeddingModel, Embeddings, ExecutionMethod, ExecutionResourceType, ExecutionStatus, ExecutionTrigger, FirebaseMigrationResource, Flag, Framework, FunctionTemplateUseCase, Functions, Graphql, Growth, ID, IdTokenProvider, ImageFormat, ImageGravity, IndexStatus, InvalidationType, Locale, Manager, MessagePriority, MessageStatus, Messaging, MessagingProviderType, Migrations, Mongo, Mysql, NHostMigrationResource, Notifications, OAuth2Auth0Prompt, OAuth2DiscordPrompt, OAuth2GithubPrompt, OAuth2GooglePrompt, OAuth2KakaoPrompt, OAuth2MicrosoftPrompt, OAuth2OidcPrompt, OAuth2OktaPrompt, OAuth2SalesforcePrompt, OAuth2ZohoPrompt, OAuthProvider, Oauth2, OnDuplicate, Operator, OrderBy, Organization, OrganizationKeyScopes, Organizations, PasswordHash, Permission, Platform, PlatformType, Postgresql, Presences, Project, ProjectAuthMethodId, ProjectEmailTemplateId, ProjectEmailTemplateLocale, ProjectKeyScopes, ProjectOAuth2Auth0Prompt, ProjectOAuth2DiscordPrompt, ProjectOAuth2GitHubPrompt, ProjectOAuth2GooglePrompt, ProjectOAuth2KakaoPrompt, ProjectOAuth2MicrosoftPrompt, ProjectOAuth2OidcPrompt, ProjectOAuth2OktaPrompt, ProjectOAuth2SalesforcePrompt, ProjectOAuth2ZohoPrompt, ProjectOAuthProviderId, ProjectPolicyId, ProjectProtocolId, ProjectSMTPSecure, ProjectServiceId, Projects, Proxy, ProxyResourceType, ProxyRuleDeploymentResourceType, ProxyRuleStatus, Push, Query, QuerySuggestionResource, Realtime, Region, RelationMutate, RelationshipType, ResolvedTopic, Role, Runtime, ScheduleResourceType, SiteTemplateUseCase, Sites, SmtpEncryption, Status, StatusCode, Storage, SupabaseMigrationResource, TablesDB, TablesDBIndexType, Teams, TemplateReferenceType, Timezone, Tokens, Topic, Usage, UsageEventDimension, UsageEventMetric, UsageGaugeDimension, UsageGaugeMetric, UsageInterval, UsageOrderBy, UsageOrderDirection, UsageRange, Users, VCSDetectionType, VCSReferenceType, Vcs, VectorsDB, VectorsDBIndexType, Waf, WafRuleAction, Webhooks };
|
|
52566
|
+
export { Account, AccountKeyScopes, Activities, Adapter, AddonKey, Admin, Advisor, Affiliates, Analytics, AnalyticsDimension, AnalyticsInterval, AnalyticsTracking, Apps, AppwriteException, AppwriteMigrationResource, Assistant, AttributeStatus, AuthenticationFactor, AuthenticatorType, Avatars, BackupServices, Backups, BillingPlanGroup, BlockMode, BlockResourceType, Browser, BrowserPermission, BrowserTheme, BuildRuntime, CacheDatabase, CacheTarget, Channel, Client, ColumnStatus, Compression, Condition, Console, ConsoleResourceType, ConversationType, CreditCard, DatabaseStatus, DatabaseType, Databases, DatabasesIndexType, DeploymentDownloadType, DeploymentStatus, DetectionFrameworkType, DetectionRuntimeType, DocumentsDB, DocumentsDBIndexType, DomainPurchaseStatus, DomainRegistrationType, DomainSuggestionType, DomainTransferStatusEnum, Domains, EmbeddingModel, Embeddings, ExecutionMethod, ExecutionResourceType, ExecutionStatus, ExecutionTrigger, FirebaseMigrationResource, Flag, Framework, FunctionTemplateUseCase, Functions, Graphql, Growth, ID, IdTokenProvider, ImageFormat, ImageGravity, IndexStatus, InvalidationType, Locale, Manager, MessagePriority, MessageStatus, Messaging, MessagingProviderType, Migrations, Mongo, Mysql, NHostMigrationResource, Notifications, OAuth2Auth0Prompt, OAuth2DiscordPrompt, OAuth2GithubPrompt, OAuth2GooglePrompt, OAuth2KakaoPrompt, OAuth2MicrosoftPrompt, OAuth2OidcPrompt, OAuth2OktaPrompt, OAuth2SalesforcePrompt, OAuth2ZohoPrompt, OAuthProvider, Oauth2, OnDuplicate, Operator, OrderBy, Organization, OrganizationKeyScopes, Organizations, PasswordHash, Permission, Platform, PlatformResourceType, PlatformType, Postgresql, Presences, Project, ProjectAuthMethodId, ProjectEmailTemplateId, ProjectEmailTemplateLocale, ProjectKeyScopes, ProjectOAuth2Auth0Prompt, ProjectOAuth2DiscordPrompt, ProjectOAuth2GitHubPrompt, ProjectOAuth2GooglePrompt, ProjectOAuth2KakaoPrompt, ProjectOAuth2MicrosoftPrompt, ProjectOAuth2OidcPrompt, ProjectOAuth2OktaPrompt, ProjectOAuth2SalesforcePrompt, ProjectOAuth2ZohoPrompt, ProjectOAuthProviderId, ProjectPolicyId, ProjectProtocolId, ProjectResourceType, ProjectSMTPSecure, ProjectServiceId, Projects, Proxy, ProxyResourceType, ProxyRuleDeploymentResourceType, ProxyRuleStatus, Push, Query, QuerySuggestionResource, Realtime, Region, RelationMutate, RelationshipType, ResolvedTopic, Role, Runtime, ScheduleResourceType, SiteTemplateUseCase, Sites, SmtpEncryption, Status, StatusCode, Storage, SupabaseMigrationResource, TablesDB, TablesDBIndexType, Teams, TemplateReferenceType, Timezone, Tokens, Topic, Usage, UsageEventDimension, UsageEventMetric, UsageGaugeDimension, UsageGaugeMetric, UsageInterval, UsageOrderBy, UsageOrderDirection, UsageRange, Users, VCSDetectionType, VCSReferenceType, Vcs, VectorsDB, VectorsDBIndexType, VideoOutput, VideoRenditionStatus, Videos, Waf, WafRuleAction, Webhooks };
|
|
49829
52567
|
//# sourceMappingURL=sdk.js.map
|