@appwrite.io/console 18.3.0 → 18.4.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/cjs/sdk.js +3141 -384
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +3138 -385
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +3141 -384
- 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 +595 -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 +40 -12
- package/types/services/push.d.ts +2 -2
- package/types/services/teams.d.ts +4 -1
- 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.2',
|
|
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();
|
|
@@ -31066,11 +31779,13 @@ class Project {
|
|
|
31066
31779
|
platformId: paramsOrFirst,
|
|
31067
31780
|
name: rest[0],
|
|
31068
31781
|
applicationId: rest[1],
|
|
31782
|
+
fingerprints: rest[2],
|
|
31069
31783
|
};
|
|
31070
31784
|
}
|
|
31071
31785
|
const platformId = params.platformId;
|
|
31072
31786
|
const name = params.name;
|
|
31073
31787
|
const applicationId = params.applicationId;
|
|
31788
|
+
const fingerprints = params.fingerprints;
|
|
31074
31789
|
if (typeof platformId === 'undefined') {
|
|
31075
31790
|
throw new AppwriteException('Missing required parameter: "platformId"');
|
|
31076
31791
|
}
|
|
@@ -31091,6 +31806,9 @@ class Project {
|
|
|
31091
31806
|
if (typeof applicationId !== 'undefined') {
|
|
31092
31807
|
apiPayload['applicationId'] = applicationId;
|
|
31093
31808
|
}
|
|
31809
|
+
if (typeof fingerprints !== 'undefined') {
|
|
31810
|
+
apiPayload['fingerprints'] = fingerprints;
|
|
31811
|
+
}
|
|
31094
31812
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
31095
31813
|
const apiHeaders = {
|
|
31096
31814
|
'X-Appwrite-Project': this.client.config.project,
|
|
@@ -31111,11 +31829,13 @@ class Project {
|
|
|
31111
31829
|
platformId: paramsOrFirst,
|
|
31112
31830
|
name: rest[0],
|
|
31113
31831
|
applicationId: rest[1],
|
|
31832
|
+
fingerprints: rest[2],
|
|
31114
31833
|
};
|
|
31115
31834
|
}
|
|
31116
31835
|
const platformId = params.platformId;
|
|
31117
31836
|
const name = params.name;
|
|
31118
31837
|
const applicationId = params.applicationId;
|
|
31838
|
+
const fingerprints = params.fingerprints;
|
|
31119
31839
|
if (typeof platformId === 'undefined' || platformId === '') {
|
|
31120
31840
|
throw new AppwriteException('Missing required parameter: "platformId"');
|
|
31121
31841
|
}
|
|
@@ -31133,6 +31853,9 @@ class Project {
|
|
|
31133
31853
|
if (typeof applicationId !== 'undefined') {
|
|
31134
31854
|
apiPayload['applicationId'] = applicationId;
|
|
31135
31855
|
}
|
|
31856
|
+
if (typeof fingerprints !== 'undefined') {
|
|
31857
|
+
apiPayload['fingerprints'] = fingerprints;
|
|
31858
|
+
}
|
|
31136
31859
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
31137
31860
|
const apiHeaders = {
|
|
31138
31861
|
'X-Appwrite-Project': this.client.config.project,
|
|
@@ -31781,6 +32504,38 @@ class Project {
|
|
|
31781
32504
|
};
|
|
31782
32505
|
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
31783
32506
|
}
|
|
32507
|
+
updatePasskeyPolicy(paramsOrFirst, ...rest) {
|
|
32508
|
+
let params;
|
|
32509
|
+
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
32510
|
+
(paramsOrFirst &&
|
|
32511
|
+
typeof paramsOrFirst === 'object' &&
|
|
32512
|
+
!Array.isArray(paramsOrFirst))) {
|
|
32513
|
+
params = (paramsOrFirst || {});
|
|
32514
|
+
}
|
|
32515
|
+
else {
|
|
32516
|
+
params = {
|
|
32517
|
+
rpId: paramsOrFirst,
|
|
32518
|
+
origins: rest[0],
|
|
32519
|
+
};
|
|
32520
|
+
}
|
|
32521
|
+
const rpId = params.rpId;
|
|
32522
|
+
const origins = params.origins;
|
|
32523
|
+
const apiPath = '/project/policies/passkey';
|
|
32524
|
+
const apiPayload = {};
|
|
32525
|
+
if (typeof rpId !== 'undefined') {
|
|
32526
|
+
apiPayload['rpId'] = rpId;
|
|
32527
|
+
}
|
|
32528
|
+
if (typeof origins !== 'undefined') {
|
|
32529
|
+
apiPayload['origins'] = origins;
|
|
32530
|
+
}
|
|
32531
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
32532
|
+
const apiHeaders = {
|
|
32533
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
32534
|
+
'content-type': 'application/json',
|
|
32535
|
+
accept: 'application/json',
|
|
32536
|
+
};
|
|
32537
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
32538
|
+
}
|
|
31784
32539
|
updatePasswordDictionaryPolicy(paramsOrFirst) {
|
|
31785
32540
|
let params;
|
|
31786
32541
|
if (paramsOrFirst &&
|
|
@@ -34471,7 +35226,7 @@ class Sites {
|
|
|
34471
35226
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
34472
35227
|
apiPayload['project'] = this.client.config.project;
|
|
34473
35228
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
34474
|
-
for (const [key, value] of Object.entries(
|
|
35229
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
34475
35230
|
uri.searchParams.append(key, value);
|
|
34476
35231
|
}
|
|
34477
35232
|
return uri.toString();
|
|
@@ -35302,7 +36057,7 @@ class Storage {
|
|
|
35302
36057
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
35303
36058
|
apiPayload['project'] = this.client.config.project;
|
|
35304
36059
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
35305
|
-
for (const [key, value] of Object.entries(
|
|
36060
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
35306
36061
|
uri.searchParams.append(key, value);
|
|
35307
36062
|
}
|
|
35308
36063
|
return uri.toString();
|
|
@@ -35395,7 +36150,7 @@ class Storage {
|
|
|
35395
36150
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
35396
36151
|
apiPayload['project'] = this.client.config.project;
|
|
35397
36152
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
35398
|
-
for (const [key, value] of Object.entries(
|
|
36153
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
35399
36154
|
uri.searchParams.append(key, value);
|
|
35400
36155
|
}
|
|
35401
36156
|
return uri.toString();
|
|
@@ -35433,7 +36188,7 @@ class Storage {
|
|
|
35433
36188
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
35434
36189
|
apiPayload['project'] = this.client.config.project;
|
|
35435
36190
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
35436
|
-
for (const [key, value] of Object.entries(
|
|
36191
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
35437
36192
|
uri.searchParams.append(key, value);
|
|
35438
36193
|
}
|
|
35439
36194
|
return uri.toString();
|
|
@@ -39904,15 +40659,17 @@ class Teams {
|
|
|
39904
40659
|
params = {
|
|
39905
40660
|
teamId: paramsOrFirst,
|
|
39906
40661
|
roles: rest[0],
|
|
39907
|
-
|
|
39908
|
-
|
|
39909
|
-
|
|
39910
|
-
|
|
39911
|
-
|
|
40662
|
+
membershipId: rest[1],
|
|
40663
|
+
email: rest[2],
|
|
40664
|
+
userId: rest[3],
|
|
40665
|
+
phone: rest[4],
|
|
40666
|
+
url: rest[5],
|
|
40667
|
+
name: rest[6],
|
|
39912
40668
|
};
|
|
39913
40669
|
}
|
|
39914
40670
|
const teamId = params.teamId;
|
|
39915
40671
|
const roles = params.roles;
|
|
40672
|
+
const membershipId = params.membershipId;
|
|
39916
40673
|
const email = params.email;
|
|
39917
40674
|
const userId = params.userId;
|
|
39918
40675
|
const phone = params.phone;
|
|
@@ -39926,6 +40683,9 @@ class Teams {
|
|
|
39926
40683
|
}
|
|
39927
40684
|
const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', encodeURIComponent(String(teamId)));
|
|
39928
40685
|
const apiPayload = {};
|
|
40686
|
+
if (typeof membershipId !== 'undefined') {
|
|
40687
|
+
apiPayload['membershipId'] = membershipId;
|
|
40688
|
+
}
|
|
39929
40689
|
if (typeof email !== 'undefined') {
|
|
39930
40690
|
apiPayload['email'] = email;
|
|
39931
40691
|
}
|
|
@@ -41744,6 +42504,106 @@ class Users {
|
|
|
41744
42504
|
};
|
|
41745
42505
|
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
41746
42506
|
}
|
|
42507
|
+
listPasskeys(paramsOrFirst, ...rest) {
|
|
42508
|
+
let params;
|
|
42509
|
+
if (paramsOrFirst &&
|
|
42510
|
+
typeof paramsOrFirst === 'object' &&
|
|
42511
|
+
!Array.isArray(paramsOrFirst)) {
|
|
42512
|
+
params = (paramsOrFirst || {});
|
|
42513
|
+
}
|
|
42514
|
+
else {
|
|
42515
|
+
params = {
|
|
42516
|
+
userId: paramsOrFirst,
|
|
42517
|
+
queries: rest[0],
|
|
42518
|
+
total: rest[1],
|
|
42519
|
+
};
|
|
42520
|
+
}
|
|
42521
|
+
const userId = params.userId;
|
|
42522
|
+
const queries = params.queries;
|
|
42523
|
+
const total = params.total;
|
|
42524
|
+
if (typeof userId === 'undefined' || userId === '') {
|
|
42525
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
42526
|
+
}
|
|
42527
|
+
const apiPath = '/users/{userId}/passkeys'.replace('{userId}', encodeURIComponent(String(userId)));
|
|
42528
|
+
const apiPayload = {};
|
|
42529
|
+
if (typeof queries !== 'undefined') {
|
|
42530
|
+
apiPayload['queries'] = queries;
|
|
42531
|
+
}
|
|
42532
|
+
if (typeof total !== 'undefined') {
|
|
42533
|
+
apiPayload['total'] = total;
|
|
42534
|
+
}
|
|
42535
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
42536
|
+
const apiHeaders = {
|
|
42537
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
42538
|
+
accept: 'application/json',
|
|
42539
|
+
};
|
|
42540
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
42541
|
+
}
|
|
42542
|
+
getPasskey(paramsOrFirst, ...rest) {
|
|
42543
|
+
let params;
|
|
42544
|
+
if (paramsOrFirst &&
|
|
42545
|
+
typeof paramsOrFirst === 'object' &&
|
|
42546
|
+
!Array.isArray(paramsOrFirst)) {
|
|
42547
|
+
params = (paramsOrFirst || {});
|
|
42548
|
+
}
|
|
42549
|
+
else {
|
|
42550
|
+
params = {
|
|
42551
|
+
userId: paramsOrFirst,
|
|
42552
|
+
passkeyId: rest[0],
|
|
42553
|
+
};
|
|
42554
|
+
}
|
|
42555
|
+
const userId = params.userId;
|
|
42556
|
+
const passkeyId = params.passkeyId;
|
|
42557
|
+
if (typeof userId === 'undefined' || userId === '') {
|
|
42558
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
42559
|
+
}
|
|
42560
|
+
if (typeof passkeyId === 'undefined' || passkeyId === '') {
|
|
42561
|
+
throw new AppwriteException('Missing required parameter: "passkeyId"');
|
|
42562
|
+
}
|
|
42563
|
+
const apiPath = '/users/{userId}/passkeys/{passkeyId}'
|
|
42564
|
+
.replace('{userId}', encodeURIComponent(String(userId)))
|
|
42565
|
+
.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
|
|
42566
|
+
const apiPayload = {};
|
|
42567
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
42568
|
+
const apiHeaders = {
|
|
42569
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
42570
|
+
accept: 'application/json',
|
|
42571
|
+
};
|
|
42572
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
42573
|
+
}
|
|
42574
|
+
deletePasskey(paramsOrFirst, ...rest) {
|
|
42575
|
+
let params;
|
|
42576
|
+
if (paramsOrFirst &&
|
|
42577
|
+
typeof paramsOrFirst === 'object' &&
|
|
42578
|
+
!Array.isArray(paramsOrFirst)) {
|
|
42579
|
+
params = (paramsOrFirst || {});
|
|
42580
|
+
}
|
|
42581
|
+
else {
|
|
42582
|
+
params = {
|
|
42583
|
+
userId: paramsOrFirst,
|
|
42584
|
+
passkeyId: rest[0],
|
|
42585
|
+
};
|
|
42586
|
+
}
|
|
42587
|
+
const userId = params.userId;
|
|
42588
|
+
const passkeyId = params.passkeyId;
|
|
42589
|
+
if (typeof userId === 'undefined' || userId === '') {
|
|
42590
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
42591
|
+
}
|
|
42592
|
+
if (typeof passkeyId === 'undefined' || passkeyId === '') {
|
|
42593
|
+
throw new AppwriteException('Missing required parameter: "passkeyId"');
|
|
42594
|
+
}
|
|
42595
|
+
const apiPath = '/users/{userId}/passkeys/{passkeyId}'
|
|
42596
|
+
.replace('{userId}', encodeURIComponent(String(userId)))
|
|
42597
|
+
.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
|
|
42598
|
+
const apiPayload = {};
|
|
42599
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
42600
|
+
const apiHeaders = {
|
|
42601
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
42602
|
+
'content-type': 'application/json',
|
|
42603
|
+
accept: 'application/json',
|
|
42604
|
+
};
|
|
42605
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
42606
|
+
}
|
|
41747
42607
|
updatePassword(paramsOrFirst, ...rest) {
|
|
41748
42608
|
let params;
|
|
41749
42609
|
if (paramsOrFirst &&
|
|
@@ -44250,11 +45110,11 @@ class VectorsDB {
|
|
|
44250
45110
|
}
|
|
44251
45111
|
}
|
|
44252
45112
|
|
|
44253
|
-
class
|
|
45113
|
+
class Videos {
|
|
44254
45114
|
constructor(client) {
|
|
44255
45115
|
this.client = client;
|
|
44256
45116
|
}
|
|
44257
|
-
|
|
45117
|
+
list(paramsOrFirst, ...rest) {
|
|
44258
45118
|
let params;
|
|
44259
45119
|
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
44260
45120
|
(paramsOrFirst &&
|
|
@@ -44272,7 +45132,7 @@ class Waf {
|
|
|
44272
45132
|
const queries = params.queries;
|
|
44273
45133
|
const search = params.search;
|
|
44274
45134
|
const total = params.total;
|
|
44275
|
-
const apiPath = '/
|
|
45135
|
+
const apiPath = '/videos';
|
|
44276
45136
|
const apiPayload = {};
|
|
44277
45137
|
if (typeof queries !== 'undefined') {
|
|
44278
45138
|
apiPayload['queries'] = queries;
|
|
@@ -44290,7 +45150,7 @@ class Waf {
|
|
|
44290
45150
|
};
|
|
44291
45151
|
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
44292
45152
|
}
|
|
44293
|
-
|
|
45153
|
+
create(paramsOrFirst, ...rest) {
|
|
44294
45154
|
let params;
|
|
44295
45155
|
if (paramsOrFirst &&
|
|
44296
45156
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -44299,59 +45159,31 @@ class Waf {
|
|
|
44299
45159
|
}
|
|
44300
45160
|
else {
|
|
44301
45161
|
params = {
|
|
44302
|
-
|
|
44303
|
-
|
|
45162
|
+
bucketId: paramsOrFirst,
|
|
45163
|
+
fileId: rest[0],
|
|
44304
45164
|
name: rest[1],
|
|
44305
|
-
resourceId: rest[2],
|
|
44306
|
-
description: rest[3],
|
|
44307
|
-
priority: rest[4],
|
|
44308
|
-
enabled: rest[5],
|
|
44309
|
-
conditions: rest[6],
|
|
44310
45165
|
};
|
|
44311
45166
|
}
|
|
44312
|
-
const
|
|
44313
|
-
const
|
|
45167
|
+
const bucketId = params.bucketId;
|
|
45168
|
+
const fileId = params.fileId;
|
|
44314
45169
|
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"');
|
|
45170
|
+
if (typeof bucketId === 'undefined') {
|
|
45171
|
+
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
44325
45172
|
}
|
|
44326
|
-
if (typeof
|
|
44327
|
-
throw new AppwriteException('Missing required parameter: "
|
|
45173
|
+
if (typeof fileId === 'undefined') {
|
|
45174
|
+
throw new AppwriteException('Missing required parameter: "fileId"');
|
|
44328
45175
|
}
|
|
44329
|
-
const apiPath = '/
|
|
45176
|
+
const apiPath = '/videos';
|
|
44330
45177
|
const apiPayload = {};
|
|
44331
|
-
if (typeof
|
|
44332
|
-
apiPayload['
|
|
44333
|
-
}
|
|
44334
|
-
if (typeof resourceType !== 'undefined') {
|
|
44335
|
-
apiPayload['resourceType'] = resourceType;
|
|
45178
|
+
if (typeof bucketId !== 'undefined') {
|
|
45179
|
+
apiPayload['bucketId'] = bucketId;
|
|
44336
45180
|
}
|
|
44337
|
-
if (typeof
|
|
44338
|
-
apiPayload['
|
|
45181
|
+
if (typeof fileId !== 'undefined') {
|
|
45182
|
+
apiPayload['fileId'] = fileId;
|
|
44339
45183
|
}
|
|
44340
45184
|
if (typeof name !== 'undefined') {
|
|
44341
45185
|
apiPayload['name'] = name;
|
|
44342
45186
|
}
|
|
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
45187
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
44356
45188
|
const apiHeaders = {
|
|
44357
45189
|
'X-Appwrite-Project': this.client.config.project,
|
|
@@ -44360,68 +45192,33 @@ class Waf {
|
|
|
44360
45192
|
};
|
|
44361
45193
|
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
44362
45194
|
}
|
|
44363
|
-
|
|
45195
|
+
listProfiles(paramsOrFirst) {
|
|
44364
45196
|
let params;
|
|
44365
|
-
if (paramsOrFirst
|
|
44366
|
-
|
|
44367
|
-
|
|
45197
|
+
if (typeof paramsOrFirst === 'undefined' ||
|
|
45198
|
+
(paramsOrFirst &&
|
|
45199
|
+
typeof paramsOrFirst === 'object' &&
|
|
45200
|
+
!Array.isArray(paramsOrFirst))) {
|
|
44368
45201
|
params = (paramsOrFirst || {});
|
|
44369
45202
|
}
|
|
44370
45203
|
else {
|
|
44371
45204
|
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],
|
|
45205
|
+
search: paramsOrFirst,
|
|
44380
45206
|
};
|
|
44381
45207
|
}
|
|
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)));
|
|
45208
|
+
const search = params.search;
|
|
45209
|
+
const apiPath = '/videos/profiles';
|
|
44394
45210
|
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;
|
|
45211
|
+
if (typeof search !== 'undefined') {
|
|
45212
|
+
apiPayload['search'] = search;
|
|
44415
45213
|
}
|
|
44416
45214
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
44417
45215
|
const apiHeaders = {
|
|
44418
45216
|
'X-Appwrite-Project': this.client.config.project,
|
|
44419
|
-
'content-type': 'application/json',
|
|
44420
45217
|
accept: 'application/json',
|
|
44421
45218
|
};
|
|
44422
|
-
return this.client.call('
|
|
45219
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
44423
45220
|
}
|
|
44424
|
-
|
|
45221
|
+
createProfile(paramsOrFirst, ...rest) {
|
|
44425
45222
|
let params;
|
|
44426
45223
|
if (paramsOrFirst &&
|
|
44427
45224
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -44430,73 +45227,49 @@ class Waf {
|
|
|
44430
45227
|
}
|
|
44431
45228
|
else {
|
|
44432
45229
|
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],
|
|
45230
|
+
name: paramsOrFirst,
|
|
45231
|
+
videoBitRate: rest[0],
|
|
45232
|
+
audioBitRate: rest[1],
|
|
45233
|
+
width: rest[2],
|
|
45234
|
+
height: rest[3],
|
|
44444
45235
|
};
|
|
44445
45236
|
}
|
|
44446
|
-
const ruleId = params.ruleId;
|
|
44447
|
-
const resourceType = params.resourceType;
|
|
44448
45237
|
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
|
-
}
|
|
45238
|
+
const videoBitRate = params.videoBitRate;
|
|
45239
|
+
const audioBitRate = params.audioBitRate;
|
|
45240
|
+
const width = params.width;
|
|
45241
|
+
const height = params.height;
|
|
44463
45242
|
if (typeof name === 'undefined') {
|
|
44464
45243
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
44465
45244
|
}
|
|
44466
|
-
|
|
44467
|
-
|
|
44468
|
-
if (typeof ruleId !== 'undefined') {
|
|
44469
|
-
apiPayload['ruleId'] = ruleId;
|
|
45245
|
+
if (typeof videoBitRate === 'undefined') {
|
|
45246
|
+
throw new AppwriteException('Missing required parameter: "videoBitRate"');
|
|
44470
45247
|
}
|
|
44471
|
-
if (typeof
|
|
44472
|
-
|
|
45248
|
+
if (typeof audioBitRate === 'undefined') {
|
|
45249
|
+
throw new AppwriteException('Missing required parameter: "audioBitRate"');
|
|
44473
45250
|
}
|
|
44474
|
-
if (typeof
|
|
44475
|
-
|
|
45251
|
+
if (typeof width === 'undefined') {
|
|
45252
|
+
throw new AppwriteException('Missing required parameter: "width"');
|
|
44476
45253
|
}
|
|
45254
|
+
if (typeof height === 'undefined') {
|
|
45255
|
+
throw new AppwriteException('Missing required parameter: "height"');
|
|
45256
|
+
}
|
|
45257
|
+
const apiPath = '/videos/profiles';
|
|
45258
|
+
const apiPayload = {};
|
|
44477
45259
|
if (typeof name !== 'undefined') {
|
|
44478
45260
|
apiPayload['name'] = name;
|
|
44479
45261
|
}
|
|
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;
|
|
45262
|
+
if (typeof videoBitRate !== 'undefined') {
|
|
45263
|
+
apiPayload['videoBitRate'] = videoBitRate;
|
|
44491
45264
|
}
|
|
44492
|
-
if (typeof
|
|
44493
|
-
apiPayload['
|
|
45265
|
+
if (typeof audioBitRate !== 'undefined') {
|
|
45266
|
+
apiPayload['audioBitRate'] = audioBitRate;
|
|
44494
45267
|
}
|
|
44495
|
-
if (typeof
|
|
44496
|
-
apiPayload['
|
|
45268
|
+
if (typeof width !== 'undefined') {
|
|
45269
|
+
apiPayload['width'] = width;
|
|
44497
45270
|
}
|
|
44498
|
-
if (typeof
|
|
44499
|
-
apiPayload['
|
|
45271
|
+
if (typeof height !== 'undefined') {
|
|
45272
|
+
apiPayload['height'] = height;
|
|
44500
45273
|
}
|
|
44501
45274
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
44502
45275
|
const apiHeaders = {
|
|
@@ -44506,7 +45279,7 @@ class Waf {
|
|
|
44506
45279
|
};
|
|
44507
45280
|
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
44508
45281
|
}
|
|
44509
|
-
|
|
45282
|
+
getProfile(paramsOrFirst) {
|
|
44510
45283
|
let params;
|
|
44511
45284
|
if (paramsOrFirst &&
|
|
44512
45285
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -44515,74 +45288,23 @@ class Waf {
|
|
|
44515
45288
|
}
|
|
44516
45289
|
else {
|
|
44517
45290
|
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],
|
|
45291
|
+
profileId: paramsOrFirst,
|
|
44529
45292
|
};
|
|
44530
45293
|
}
|
|
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"');
|
|
45294
|
+
const profileId = params.profileId;
|
|
45295
|
+
if (typeof profileId === 'undefined' || profileId === '') {
|
|
45296
|
+
throw new AppwriteException('Missing required parameter: "profileId"');
|
|
44544
45297
|
}
|
|
44545
|
-
const apiPath = '/
|
|
45298
|
+
const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
|
|
44546
45299
|
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
45300
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
44578
45301
|
const apiHeaders = {
|
|
44579
45302
|
'X-Appwrite-Project': this.client.config.project,
|
|
44580
|
-
'content-type': 'application/json',
|
|
44581
45303
|
accept: 'application/json',
|
|
44582
45304
|
};
|
|
44583
|
-
return this.client.call('
|
|
45305
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
44584
45306
|
}
|
|
44585
|
-
|
|
45307
|
+
updateProfile(paramsOrFirst, ...rest) {
|
|
44586
45308
|
let params;
|
|
44587
45309
|
if (paramsOrFirst &&
|
|
44588
45310
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -44591,58 +45313,54 @@ class Waf {
|
|
|
44591
45313
|
}
|
|
44592
45314
|
else {
|
|
44593
45315
|
params = {
|
|
44594
|
-
|
|
44595
|
-
|
|
44596
|
-
|
|
44597
|
-
|
|
44598
|
-
|
|
44599
|
-
|
|
44600
|
-
enabled: rest[5],
|
|
44601
|
-
conditions: rest[6],
|
|
45316
|
+
profileId: paramsOrFirst,
|
|
45317
|
+
name: rest[0],
|
|
45318
|
+
videoBitRate: rest[1],
|
|
45319
|
+
audioBitRate: rest[2],
|
|
45320
|
+
width: rest[3],
|
|
45321
|
+
height: rest[4],
|
|
44602
45322
|
};
|
|
44603
45323
|
}
|
|
44604
|
-
const
|
|
44605
|
-
const resourceType = params.resourceType;
|
|
45324
|
+
const profileId = params.profileId;
|
|
44606
45325
|
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"');
|
|
45326
|
+
const videoBitRate = params.videoBitRate;
|
|
45327
|
+
const audioBitRate = params.audioBitRate;
|
|
45328
|
+
const width = params.width;
|
|
45329
|
+
const height = params.height;
|
|
45330
|
+
if (typeof profileId === 'undefined' || profileId === '') {
|
|
45331
|
+
throw new AppwriteException('Missing required parameter: "profileId"');
|
|
44617
45332
|
}
|
|
44618
45333
|
if (typeof name === 'undefined') {
|
|
44619
45334
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
44620
45335
|
}
|
|
44621
|
-
|
|
44622
|
-
|
|
44623
|
-
if (typeof ruleId !== 'undefined') {
|
|
44624
|
-
apiPayload['ruleId'] = ruleId;
|
|
45336
|
+
if (typeof videoBitRate === 'undefined') {
|
|
45337
|
+
throw new AppwriteException('Missing required parameter: "videoBitRate"');
|
|
44625
45338
|
}
|
|
44626
|
-
if (typeof
|
|
44627
|
-
|
|
45339
|
+
if (typeof audioBitRate === 'undefined') {
|
|
45340
|
+
throw new AppwriteException('Missing required parameter: "audioBitRate"');
|
|
44628
45341
|
}
|
|
44629
|
-
if (typeof
|
|
44630
|
-
|
|
45342
|
+
if (typeof width === 'undefined') {
|
|
45343
|
+
throw new AppwriteException('Missing required parameter: "width"');
|
|
44631
45344
|
}
|
|
45345
|
+
if (typeof height === 'undefined') {
|
|
45346
|
+
throw new AppwriteException('Missing required parameter: "height"');
|
|
45347
|
+
}
|
|
45348
|
+
const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
|
|
45349
|
+
const apiPayload = {};
|
|
44632
45350
|
if (typeof name !== 'undefined') {
|
|
44633
45351
|
apiPayload['name'] = name;
|
|
44634
45352
|
}
|
|
44635
|
-
if (typeof
|
|
44636
|
-
apiPayload['
|
|
45353
|
+
if (typeof videoBitRate !== 'undefined') {
|
|
45354
|
+
apiPayload['videoBitRate'] = videoBitRate;
|
|
44637
45355
|
}
|
|
44638
|
-
if (typeof
|
|
44639
|
-
apiPayload['
|
|
45356
|
+
if (typeof audioBitRate !== 'undefined') {
|
|
45357
|
+
apiPayload['audioBitRate'] = audioBitRate;
|
|
44640
45358
|
}
|
|
44641
|
-
if (typeof
|
|
44642
|
-
apiPayload['
|
|
45359
|
+
if (typeof width !== 'undefined') {
|
|
45360
|
+
apiPayload['width'] = width;
|
|
44643
45361
|
}
|
|
44644
|
-
if (typeof
|
|
44645
|
-
apiPayload['
|
|
45362
|
+
if (typeof height !== 'undefined') {
|
|
45363
|
+
apiPayload['height'] = height;
|
|
44646
45364
|
}
|
|
44647
45365
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
44648
45366
|
const apiHeaders = {
|
|
@@ -44650,9 +45368,9 @@ class Waf {
|
|
|
44650
45368
|
'content-type': 'application/json',
|
|
44651
45369
|
accept: 'application/json',
|
|
44652
45370
|
};
|
|
44653
|
-
return this.client.call('
|
|
45371
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
44654
45372
|
}
|
|
44655
|
-
|
|
45373
|
+
deleteProfile(paramsOrFirst) {
|
|
44656
45374
|
let params;
|
|
44657
45375
|
if (paramsOrFirst &&
|
|
44658
45376
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -44661,59 +45379,49 @@ class Waf {
|
|
|
44661
45379
|
}
|
|
44662
45380
|
else {
|
|
44663
45381
|
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],
|
|
45382
|
+
profileId: paramsOrFirst,
|
|
44672
45383
|
};
|
|
44673
45384
|
}
|
|
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"');
|
|
45385
|
+
const profileId = params.profileId;
|
|
45386
|
+
if (typeof profileId === 'undefined' || profileId === '') {
|
|
45387
|
+
throw new AppwriteException('Missing required parameter: "profileId"');
|
|
44684
45388
|
}
|
|
44685
|
-
const apiPath = '/
|
|
45389
|
+
const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
|
|
44686
45390
|
const apiPayload = {};
|
|
44687
|
-
|
|
44688
|
-
|
|
44689
|
-
|
|
44690
|
-
|
|
44691
|
-
|
|
44692
|
-
}
|
|
44693
|
-
|
|
44694
|
-
|
|
44695
|
-
|
|
44696
|
-
|
|
44697
|
-
|
|
44698
|
-
|
|
44699
|
-
|
|
44700
|
-
|
|
45391
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45392
|
+
const apiHeaders = {
|
|
45393
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45394
|
+
'content-type': 'application/json',
|
|
45395
|
+
accept: 'application/json',
|
|
45396
|
+
};
|
|
45397
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
45398
|
+
}
|
|
45399
|
+
get(paramsOrFirst) {
|
|
45400
|
+
let params;
|
|
45401
|
+
if (paramsOrFirst &&
|
|
45402
|
+
typeof paramsOrFirst === 'object' &&
|
|
45403
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45404
|
+
params = (paramsOrFirst || {});
|
|
44701
45405
|
}
|
|
44702
|
-
|
|
44703
|
-
|
|
45406
|
+
else {
|
|
45407
|
+
params = {
|
|
45408
|
+
videoId: paramsOrFirst,
|
|
45409
|
+
};
|
|
44704
45410
|
}
|
|
44705
|
-
|
|
44706
|
-
|
|
45411
|
+
const videoId = params.videoId;
|
|
45412
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45413
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
44707
45414
|
}
|
|
45415
|
+
const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45416
|
+
const apiPayload = {};
|
|
44708
45417
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
44709
45418
|
const apiHeaders = {
|
|
44710
45419
|
'X-Appwrite-Project': this.client.config.project,
|
|
44711
|
-
'content-type': 'application/json',
|
|
44712
45420
|
accept: 'application/json',
|
|
44713
45421
|
};
|
|
44714
|
-
return this.client.call('
|
|
45422
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
44715
45423
|
}
|
|
44716
|
-
|
|
45424
|
+
update(paramsOrFirst, ...rest) {
|
|
44717
45425
|
let params;
|
|
44718
45426
|
if (paramsOrFirst &&
|
|
44719
45427
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -44722,71 +45430,1353 @@ class Waf {
|
|
|
44722
45430
|
}
|
|
44723
45431
|
else {
|
|
44724
45432
|
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],
|
|
45433
|
+
videoId: paramsOrFirst,
|
|
45434
|
+
name: rest[0],
|
|
44738
45435
|
};
|
|
44739
45436
|
}
|
|
44740
|
-
const
|
|
44741
|
-
const resourceType = params.resourceType;
|
|
45437
|
+
const videoId = params.videoId;
|
|
44742
45438
|
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"');
|
|
45439
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45440
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
44758
45441
|
}
|
|
44759
45442
|
if (typeof name === 'undefined') {
|
|
44760
45443
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
44761
45444
|
}
|
|
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';
|
|
45445
|
+
const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
44769
45446
|
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
45447
|
if (typeof name !== 'undefined') {
|
|
44780
45448
|
apiPayload['name'] = name;
|
|
44781
45449
|
}
|
|
44782
|
-
|
|
44783
|
-
|
|
44784
|
-
|
|
44785
|
-
|
|
44786
|
-
|
|
44787
|
-
}
|
|
44788
|
-
|
|
44789
|
-
|
|
45450
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45451
|
+
const apiHeaders = {
|
|
45452
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45453
|
+
'content-type': 'application/json',
|
|
45454
|
+
accept: 'application/json',
|
|
45455
|
+
};
|
|
45456
|
+
return this.client.call('put', uri, apiHeaders, apiPayload);
|
|
45457
|
+
}
|
|
45458
|
+
delete(paramsOrFirst) {
|
|
45459
|
+
let params;
|
|
45460
|
+
if (paramsOrFirst &&
|
|
45461
|
+
typeof paramsOrFirst === 'object' &&
|
|
45462
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45463
|
+
params = (paramsOrFirst || {});
|
|
45464
|
+
}
|
|
45465
|
+
else {
|
|
45466
|
+
params = {
|
|
45467
|
+
videoId: paramsOrFirst,
|
|
45468
|
+
};
|
|
45469
|
+
}
|
|
45470
|
+
const videoId = params.videoId;
|
|
45471
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45472
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45473
|
+
}
|
|
45474
|
+
const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45475
|
+
const apiPayload = {};
|
|
45476
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45477
|
+
const apiHeaders = {
|
|
45478
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45479
|
+
'content-type': 'application/json',
|
|
45480
|
+
accept: 'application/json',
|
|
45481
|
+
};
|
|
45482
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
45483
|
+
}
|
|
45484
|
+
getCmafHlsManifest(paramsOrFirst) {
|
|
45485
|
+
let params;
|
|
45486
|
+
if (paramsOrFirst &&
|
|
45487
|
+
typeof paramsOrFirst === 'object' &&
|
|
45488
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45489
|
+
params = (paramsOrFirst || {});
|
|
45490
|
+
}
|
|
45491
|
+
else {
|
|
45492
|
+
params = {
|
|
45493
|
+
videoId: paramsOrFirst,
|
|
45494
|
+
};
|
|
45495
|
+
}
|
|
45496
|
+
const videoId = params.videoId;
|
|
45497
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45498
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45499
|
+
}
|
|
45500
|
+
const apiPath = '/videos/{videoId}/outputs/cmaf/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45501
|
+
const apiPayload = {};
|
|
45502
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45503
|
+
apiPayload['project'] = this.client.config.project;
|
|
45504
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45505
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45506
|
+
uri.searchParams.append(key, value);
|
|
45507
|
+
}
|
|
45508
|
+
return uri.toString();
|
|
45509
|
+
}
|
|
45510
|
+
getCmafDashManifest(paramsOrFirst) {
|
|
45511
|
+
let params;
|
|
45512
|
+
if (paramsOrFirst &&
|
|
45513
|
+
typeof paramsOrFirst === 'object' &&
|
|
45514
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45515
|
+
params = (paramsOrFirst || {});
|
|
45516
|
+
}
|
|
45517
|
+
else {
|
|
45518
|
+
params = {
|
|
45519
|
+
videoId: paramsOrFirst,
|
|
45520
|
+
};
|
|
45521
|
+
}
|
|
45522
|
+
const videoId = params.videoId;
|
|
45523
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45524
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45525
|
+
}
|
|
45526
|
+
const apiPath = '/videos/{videoId}/outputs/cmaf/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45527
|
+
const apiPayload = {};
|
|
45528
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45529
|
+
apiPayload['project'] = this.client.config.project;
|
|
45530
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45531
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45532
|
+
uri.searchParams.append(key, value);
|
|
45533
|
+
}
|
|
45534
|
+
return uri.toString();
|
|
45535
|
+
}
|
|
45536
|
+
getCmafStreamManifest(paramsOrFirst, ...rest) {
|
|
45537
|
+
let params;
|
|
45538
|
+
if (paramsOrFirst &&
|
|
45539
|
+
typeof paramsOrFirst === 'object' &&
|
|
45540
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45541
|
+
params = (paramsOrFirst || {});
|
|
45542
|
+
}
|
|
45543
|
+
else {
|
|
45544
|
+
params = {
|
|
45545
|
+
videoId: paramsOrFirst,
|
|
45546
|
+
renditionId: rest[0],
|
|
45547
|
+
streamId: rest[1],
|
|
45548
|
+
};
|
|
45549
|
+
}
|
|
45550
|
+
const videoId = params.videoId;
|
|
45551
|
+
const renditionId = params.renditionId;
|
|
45552
|
+
const streamId = params.streamId;
|
|
45553
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45554
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45555
|
+
}
|
|
45556
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
45557
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
45558
|
+
}
|
|
45559
|
+
if (typeof streamId === 'undefined') {
|
|
45560
|
+
throw new AppwriteException('Missing required parameter: "streamId"');
|
|
45561
|
+
}
|
|
45562
|
+
const apiPath = '/videos/{videoId}/outputs/cmaf/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
|
|
45563
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45564
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)))
|
|
45565
|
+
.replace('{streamId}', encodeURIComponent(String(streamId)));
|
|
45566
|
+
const apiPayload = {};
|
|
45567
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45568
|
+
apiPayload['project'] = this.client.config.project;
|
|
45569
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45570
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45571
|
+
uri.searchParams.append(key, value);
|
|
45572
|
+
}
|
|
45573
|
+
return uri.toString();
|
|
45574
|
+
}
|
|
45575
|
+
getDashManifest(paramsOrFirst) {
|
|
45576
|
+
let params;
|
|
45577
|
+
if (paramsOrFirst &&
|
|
45578
|
+
typeof paramsOrFirst === 'object' &&
|
|
45579
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45580
|
+
params = (paramsOrFirst || {});
|
|
45581
|
+
}
|
|
45582
|
+
else {
|
|
45583
|
+
params = {
|
|
45584
|
+
videoId: paramsOrFirst,
|
|
45585
|
+
};
|
|
45586
|
+
}
|
|
45587
|
+
const videoId = params.videoId;
|
|
45588
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45589
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45590
|
+
}
|
|
45591
|
+
const apiPath = '/videos/{videoId}/outputs/dash/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45592
|
+
const apiPayload = {};
|
|
45593
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45594
|
+
apiPayload['project'] = this.client.config.project;
|
|
45595
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45596
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45597
|
+
uri.searchParams.append(key, value);
|
|
45598
|
+
}
|
|
45599
|
+
return uri.toString();
|
|
45600
|
+
}
|
|
45601
|
+
getHlsManifest(paramsOrFirst) {
|
|
45602
|
+
let params;
|
|
45603
|
+
if (paramsOrFirst &&
|
|
45604
|
+
typeof paramsOrFirst === 'object' &&
|
|
45605
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45606
|
+
params = (paramsOrFirst || {});
|
|
45607
|
+
}
|
|
45608
|
+
else {
|
|
45609
|
+
params = {
|
|
45610
|
+
videoId: paramsOrFirst,
|
|
45611
|
+
};
|
|
45612
|
+
}
|
|
45613
|
+
const videoId = params.videoId;
|
|
45614
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45615
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45616
|
+
}
|
|
45617
|
+
const apiPath = '/videos/{videoId}/outputs/hls/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45618
|
+
const apiPayload = {};
|
|
45619
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45620
|
+
apiPayload['project'] = this.client.config.project;
|
|
45621
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45622
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45623
|
+
uri.searchParams.append(key, value);
|
|
45624
|
+
}
|
|
45625
|
+
return uri.toString();
|
|
45626
|
+
}
|
|
45627
|
+
getStreamManifest(paramsOrFirst, ...rest) {
|
|
45628
|
+
let params;
|
|
45629
|
+
if (paramsOrFirst &&
|
|
45630
|
+
typeof paramsOrFirst === 'object' &&
|
|
45631
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45632
|
+
params = (paramsOrFirst || {});
|
|
45633
|
+
}
|
|
45634
|
+
else {
|
|
45635
|
+
params = {
|
|
45636
|
+
videoId: paramsOrFirst,
|
|
45637
|
+
renditionId: rest[0],
|
|
45638
|
+
streamId: rest[1],
|
|
45639
|
+
};
|
|
45640
|
+
}
|
|
45641
|
+
const videoId = params.videoId;
|
|
45642
|
+
const renditionId = params.renditionId;
|
|
45643
|
+
const streamId = params.streamId;
|
|
45644
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45645
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45646
|
+
}
|
|
45647
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
45648
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
45649
|
+
}
|
|
45650
|
+
if (typeof streamId === 'undefined') {
|
|
45651
|
+
throw new AppwriteException('Missing required parameter: "streamId"');
|
|
45652
|
+
}
|
|
45653
|
+
const apiPath = '/videos/{videoId}/outputs/hls/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
|
|
45654
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45655
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)))
|
|
45656
|
+
.replace('{streamId}', encodeURIComponent(String(streamId)));
|
|
45657
|
+
const apiPayload = {};
|
|
45658
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45659
|
+
apiPayload['project'] = this.client.config.project;
|
|
45660
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45661
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45662
|
+
uri.searchParams.append(key, value);
|
|
45663
|
+
}
|
|
45664
|
+
return uri.toString();
|
|
45665
|
+
}
|
|
45666
|
+
getSegment(paramsOrFirst, ...rest) {
|
|
45667
|
+
let params;
|
|
45668
|
+
if (paramsOrFirst &&
|
|
45669
|
+
typeof paramsOrFirst === 'object' &&
|
|
45670
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45671
|
+
params = (paramsOrFirst || {});
|
|
45672
|
+
}
|
|
45673
|
+
else {
|
|
45674
|
+
params = {
|
|
45675
|
+
videoId: paramsOrFirst,
|
|
45676
|
+
output: rest[0],
|
|
45677
|
+
renditionId: rest[1],
|
|
45678
|
+
segmentId: rest[2],
|
|
45679
|
+
};
|
|
45680
|
+
}
|
|
45681
|
+
const videoId = params.videoId;
|
|
45682
|
+
const output = params.output;
|
|
45683
|
+
const renditionId = params.renditionId;
|
|
45684
|
+
const segmentId = params.segmentId;
|
|
45685
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45686
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45687
|
+
}
|
|
45688
|
+
if (typeof output === 'undefined') {
|
|
45689
|
+
throw new AppwriteException('Missing required parameter: "output"');
|
|
45690
|
+
}
|
|
45691
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
45692
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
45693
|
+
}
|
|
45694
|
+
if (typeof segmentId === 'undefined' || segmentId === '') {
|
|
45695
|
+
throw new AppwriteException('Missing required parameter: "segmentId"');
|
|
45696
|
+
}
|
|
45697
|
+
const apiPath = '/videos/{videoId}/outputs/{output}/renditions/{renditionId}/segments/{segmentId}'
|
|
45698
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45699
|
+
.replace('{output}', encodeURIComponent(String(output)))
|
|
45700
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)))
|
|
45701
|
+
.replace('{segmentId}', encodeURIComponent(String(segmentId)));
|
|
45702
|
+
const apiPayload = {};
|
|
45703
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45704
|
+
apiPayload['project'] = this.client.config.project;
|
|
45705
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45706
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45707
|
+
uri.searchParams.append(key, value);
|
|
45708
|
+
}
|
|
45709
|
+
return uri.toString();
|
|
45710
|
+
}
|
|
45711
|
+
getSubtitleManifest(paramsOrFirst, ...rest) {
|
|
45712
|
+
let params;
|
|
45713
|
+
if (paramsOrFirst &&
|
|
45714
|
+
typeof paramsOrFirst === 'object' &&
|
|
45715
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45716
|
+
params = (paramsOrFirst || {});
|
|
45717
|
+
}
|
|
45718
|
+
else {
|
|
45719
|
+
params = {
|
|
45720
|
+
videoId: paramsOrFirst,
|
|
45721
|
+
output: rest[0],
|
|
45722
|
+
subtitleId: rest[1],
|
|
45723
|
+
};
|
|
45724
|
+
}
|
|
45725
|
+
const videoId = params.videoId;
|
|
45726
|
+
const output = params.output;
|
|
45727
|
+
const subtitleId = params.subtitleId;
|
|
45728
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45729
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45730
|
+
}
|
|
45731
|
+
if (typeof output === 'undefined') {
|
|
45732
|
+
throw new AppwriteException('Missing required parameter: "output"');
|
|
45733
|
+
}
|
|
45734
|
+
if (typeof subtitleId === 'undefined' || subtitleId === '') {
|
|
45735
|
+
throw new AppwriteException('Missing required parameter: "subtitleId"');
|
|
45736
|
+
}
|
|
45737
|
+
const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/manifest'
|
|
45738
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45739
|
+
.replace('{output}', encodeURIComponent(String(output)))
|
|
45740
|
+
.replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
|
|
45741
|
+
const apiPayload = {};
|
|
45742
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45743
|
+
apiPayload['project'] = this.client.config.project;
|
|
45744
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45745
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45746
|
+
uri.searchParams.append(key, value);
|
|
45747
|
+
}
|
|
45748
|
+
return uri.toString();
|
|
45749
|
+
}
|
|
45750
|
+
getSubtitleSegment(paramsOrFirst, ...rest) {
|
|
45751
|
+
let params;
|
|
45752
|
+
if (paramsOrFirst &&
|
|
45753
|
+
typeof paramsOrFirst === 'object' &&
|
|
45754
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45755
|
+
params = (paramsOrFirst || {});
|
|
45756
|
+
}
|
|
45757
|
+
else {
|
|
45758
|
+
params = {
|
|
45759
|
+
videoId: paramsOrFirst,
|
|
45760
|
+
output: rest[0],
|
|
45761
|
+
subtitleId: rest[1],
|
|
45762
|
+
segmentId: rest[2],
|
|
45763
|
+
};
|
|
45764
|
+
}
|
|
45765
|
+
const videoId = params.videoId;
|
|
45766
|
+
const output = params.output;
|
|
45767
|
+
const subtitleId = params.subtitleId;
|
|
45768
|
+
const segmentId = params.segmentId;
|
|
45769
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45770
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45771
|
+
}
|
|
45772
|
+
if (typeof output === 'undefined') {
|
|
45773
|
+
throw new AppwriteException('Missing required parameter: "output"');
|
|
45774
|
+
}
|
|
45775
|
+
if (typeof subtitleId === 'undefined' || subtitleId === '') {
|
|
45776
|
+
throw new AppwriteException('Missing required parameter: "subtitleId"');
|
|
45777
|
+
}
|
|
45778
|
+
if (typeof segmentId === 'undefined' || segmentId === '') {
|
|
45779
|
+
throw new AppwriteException('Missing required parameter: "segmentId"');
|
|
45780
|
+
}
|
|
45781
|
+
const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/segments/{segmentId}'
|
|
45782
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45783
|
+
.replace('{output}', encodeURIComponent(String(output)))
|
|
45784
|
+
.replace('{subtitleId}', encodeURIComponent(String(subtitleId)))
|
|
45785
|
+
.replace('{segmentId}', encodeURIComponent(String(segmentId)));
|
|
45786
|
+
const apiPayload = {};
|
|
45787
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45788
|
+
apiPayload['project'] = this.client.config.project;
|
|
45789
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45790
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45791
|
+
uri.searchParams.append(key, value);
|
|
45792
|
+
}
|
|
45793
|
+
return uri.toString();
|
|
45794
|
+
}
|
|
45795
|
+
getPreview(paramsOrFirst, ...rest) {
|
|
45796
|
+
let params;
|
|
45797
|
+
if (paramsOrFirst &&
|
|
45798
|
+
typeof paramsOrFirst === 'object' &&
|
|
45799
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45800
|
+
params = (paramsOrFirst || {});
|
|
45801
|
+
}
|
|
45802
|
+
else {
|
|
45803
|
+
params = {
|
|
45804
|
+
videoId: paramsOrFirst,
|
|
45805
|
+
previewId: rest[0],
|
|
45806
|
+
width: rest[1],
|
|
45807
|
+
height: rest[2],
|
|
45808
|
+
output: rest[3],
|
|
45809
|
+
};
|
|
45810
|
+
}
|
|
45811
|
+
const videoId = params.videoId;
|
|
45812
|
+
const previewId = params.previewId;
|
|
45813
|
+
const width = params.width;
|
|
45814
|
+
const height = params.height;
|
|
45815
|
+
const output = params.output;
|
|
45816
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45817
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45818
|
+
}
|
|
45819
|
+
if (typeof previewId === 'undefined' || previewId === '') {
|
|
45820
|
+
throw new AppwriteException('Missing required parameter: "previewId"');
|
|
45821
|
+
}
|
|
45822
|
+
const apiPath = '/videos/{videoId}/previews/{previewId}'
|
|
45823
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45824
|
+
.replace('{previewId}', encodeURIComponent(String(previewId)));
|
|
45825
|
+
const apiPayload = {};
|
|
45826
|
+
if (typeof width !== 'undefined') {
|
|
45827
|
+
apiPayload['width'] = width;
|
|
45828
|
+
}
|
|
45829
|
+
if (typeof height !== 'undefined') {
|
|
45830
|
+
apiPayload['height'] = height;
|
|
45831
|
+
}
|
|
45832
|
+
if (typeof output !== 'undefined') {
|
|
45833
|
+
apiPayload['output'] = output;
|
|
45834
|
+
}
|
|
45835
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45836
|
+
apiPayload['project'] = this.client.config.project;
|
|
45837
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45838
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45839
|
+
uri.searchParams.append(key, value);
|
|
45840
|
+
}
|
|
45841
|
+
return uri.toString();
|
|
45842
|
+
}
|
|
45843
|
+
listRenditions(paramsOrFirst, ...rest) {
|
|
45844
|
+
let params;
|
|
45845
|
+
if (paramsOrFirst &&
|
|
45846
|
+
typeof paramsOrFirst === 'object' &&
|
|
45847
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45848
|
+
params = (paramsOrFirst || {});
|
|
45849
|
+
}
|
|
45850
|
+
else {
|
|
45851
|
+
params = {
|
|
45852
|
+
videoId: paramsOrFirst,
|
|
45853
|
+
output: rest[0],
|
|
45854
|
+
status: rest[1],
|
|
45855
|
+
};
|
|
45856
|
+
}
|
|
45857
|
+
const videoId = params.videoId;
|
|
45858
|
+
const output = params.output;
|
|
45859
|
+
const status = params.status;
|
|
45860
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45861
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45862
|
+
}
|
|
45863
|
+
const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45864
|
+
const apiPayload = {};
|
|
45865
|
+
if (typeof output !== 'undefined') {
|
|
45866
|
+
apiPayload['output'] = output;
|
|
45867
|
+
}
|
|
45868
|
+
if (typeof status !== 'undefined') {
|
|
45869
|
+
apiPayload['status'] = status;
|
|
45870
|
+
}
|
|
45871
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45872
|
+
const apiHeaders = {
|
|
45873
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45874
|
+
accept: 'application/json',
|
|
45875
|
+
};
|
|
45876
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
45877
|
+
}
|
|
45878
|
+
createRendition(paramsOrFirst, ...rest) {
|
|
45879
|
+
let params;
|
|
45880
|
+
if (paramsOrFirst &&
|
|
45881
|
+
typeof paramsOrFirst === 'object' &&
|
|
45882
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45883
|
+
params = (paramsOrFirst || {});
|
|
45884
|
+
}
|
|
45885
|
+
else {
|
|
45886
|
+
params = {
|
|
45887
|
+
videoId: paramsOrFirst,
|
|
45888
|
+
profileId: rest[0],
|
|
45889
|
+
output: rest[1],
|
|
45890
|
+
};
|
|
45891
|
+
}
|
|
45892
|
+
const videoId = params.videoId;
|
|
45893
|
+
const profileId = params.profileId;
|
|
45894
|
+
const output = params.output;
|
|
45895
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45896
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45897
|
+
}
|
|
45898
|
+
if (typeof profileId === 'undefined') {
|
|
45899
|
+
throw new AppwriteException('Missing required parameter: "profileId"');
|
|
45900
|
+
}
|
|
45901
|
+
if (typeof output === 'undefined') {
|
|
45902
|
+
throw new AppwriteException('Missing required parameter: "output"');
|
|
45903
|
+
}
|
|
45904
|
+
const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45905
|
+
const apiPayload = {};
|
|
45906
|
+
if (typeof profileId !== 'undefined') {
|
|
45907
|
+
apiPayload['profileId'] = profileId;
|
|
45908
|
+
}
|
|
45909
|
+
if (typeof output !== 'undefined') {
|
|
45910
|
+
apiPayload['output'] = output;
|
|
45911
|
+
}
|
|
45912
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45913
|
+
const apiHeaders = {
|
|
45914
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45915
|
+
'content-type': 'application/json',
|
|
45916
|
+
accept: 'application/json',
|
|
45917
|
+
};
|
|
45918
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
45919
|
+
}
|
|
45920
|
+
getRendition(paramsOrFirst, ...rest) {
|
|
45921
|
+
let params;
|
|
45922
|
+
if (paramsOrFirst &&
|
|
45923
|
+
typeof paramsOrFirst === 'object' &&
|
|
45924
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45925
|
+
params = (paramsOrFirst || {});
|
|
45926
|
+
}
|
|
45927
|
+
else {
|
|
45928
|
+
params = {
|
|
45929
|
+
videoId: paramsOrFirst,
|
|
45930
|
+
renditionId: rest[0],
|
|
45931
|
+
};
|
|
45932
|
+
}
|
|
45933
|
+
const videoId = params.videoId;
|
|
45934
|
+
const renditionId = params.renditionId;
|
|
45935
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45936
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45937
|
+
}
|
|
45938
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
45939
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
45940
|
+
}
|
|
45941
|
+
const apiPath = '/videos/{videoId}/renditions/{renditionId}'
|
|
45942
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45943
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)));
|
|
45944
|
+
const apiPayload = {};
|
|
45945
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45946
|
+
const apiHeaders = {
|
|
45947
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45948
|
+
accept: 'application/json',
|
|
45949
|
+
};
|
|
45950
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
45951
|
+
}
|
|
45952
|
+
deleteRendition(paramsOrFirst, ...rest) {
|
|
45953
|
+
let params;
|
|
45954
|
+
if (paramsOrFirst &&
|
|
45955
|
+
typeof paramsOrFirst === 'object' &&
|
|
45956
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45957
|
+
params = (paramsOrFirst || {});
|
|
45958
|
+
}
|
|
45959
|
+
else {
|
|
45960
|
+
params = {
|
|
45961
|
+
videoId: paramsOrFirst,
|
|
45962
|
+
renditionId: rest[0],
|
|
45963
|
+
};
|
|
45964
|
+
}
|
|
45965
|
+
const videoId = params.videoId;
|
|
45966
|
+
const renditionId = params.renditionId;
|
|
45967
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45968
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45969
|
+
}
|
|
45970
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
45971
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
45972
|
+
}
|
|
45973
|
+
const apiPath = '/videos/{videoId}/renditions/{renditionId}'
|
|
45974
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45975
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)));
|
|
45976
|
+
const apiPayload = {};
|
|
45977
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45978
|
+
const apiHeaders = {
|
|
45979
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45980
|
+
'content-type': 'application/json',
|
|
45981
|
+
accept: 'application/json',
|
|
45982
|
+
};
|
|
45983
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
45984
|
+
}
|
|
45985
|
+
createSource(paramsOrFirst) {
|
|
45986
|
+
let params;
|
|
45987
|
+
if (paramsOrFirst &&
|
|
45988
|
+
typeof paramsOrFirst === 'object' &&
|
|
45989
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45990
|
+
params = (paramsOrFirst || {});
|
|
45991
|
+
}
|
|
45992
|
+
else {
|
|
45993
|
+
params = {
|
|
45994
|
+
videoId: paramsOrFirst,
|
|
45995
|
+
};
|
|
45996
|
+
}
|
|
45997
|
+
const videoId = params.videoId;
|
|
45998
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45999
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
46000
|
+
}
|
|
46001
|
+
const apiPath = '/videos/{videoId}/source'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
46002
|
+
const apiPayload = {};
|
|
46003
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46004
|
+
const apiHeaders = {
|
|
46005
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46006
|
+
'content-type': 'application/json',
|
|
46007
|
+
accept: 'application/json',
|
|
46008
|
+
};
|
|
46009
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
46010
|
+
}
|
|
46011
|
+
listSubtitles(paramsOrFirst) {
|
|
46012
|
+
let params;
|
|
46013
|
+
if (paramsOrFirst &&
|
|
46014
|
+
typeof paramsOrFirst === 'object' &&
|
|
46015
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46016
|
+
params = (paramsOrFirst || {});
|
|
46017
|
+
}
|
|
46018
|
+
else {
|
|
46019
|
+
params = {
|
|
46020
|
+
videoId: paramsOrFirst,
|
|
46021
|
+
};
|
|
46022
|
+
}
|
|
46023
|
+
const videoId = params.videoId;
|
|
46024
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
46025
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
46026
|
+
}
|
|
46027
|
+
const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
46028
|
+
const apiPayload = {};
|
|
46029
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46030
|
+
const apiHeaders = {
|
|
46031
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46032
|
+
accept: 'application/json',
|
|
46033
|
+
};
|
|
46034
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
46035
|
+
}
|
|
46036
|
+
createSubtitle(paramsOrFirst, ...rest) {
|
|
46037
|
+
let params;
|
|
46038
|
+
if (paramsOrFirst &&
|
|
46039
|
+
typeof paramsOrFirst === 'object' &&
|
|
46040
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46041
|
+
params = (paramsOrFirst || {});
|
|
46042
|
+
}
|
|
46043
|
+
else {
|
|
46044
|
+
params = {
|
|
46045
|
+
videoId: paramsOrFirst,
|
|
46046
|
+
bucketId: rest[0],
|
|
46047
|
+
fileId: rest[1],
|
|
46048
|
+
name: rest[2],
|
|
46049
|
+
code: rest[3],
|
|
46050
|
+
xdefault: rest[4],
|
|
46051
|
+
};
|
|
46052
|
+
}
|
|
46053
|
+
const videoId = params.videoId;
|
|
46054
|
+
const bucketId = params.bucketId;
|
|
46055
|
+
const fileId = params.fileId;
|
|
46056
|
+
const name = params.name;
|
|
46057
|
+
const code = params.code;
|
|
46058
|
+
const xdefault = params.xdefault;
|
|
46059
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
46060
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
46061
|
+
}
|
|
46062
|
+
if (typeof bucketId === 'undefined') {
|
|
46063
|
+
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
46064
|
+
}
|
|
46065
|
+
if (typeof fileId === 'undefined') {
|
|
46066
|
+
throw new AppwriteException('Missing required parameter: "fileId"');
|
|
46067
|
+
}
|
|
46068
|
+
if (typeof name === 'undefined') {
|
|
46069
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
46070
|
+
}
|
|
46071
|
+
if (typeof code === 'undefined') {
|
|
46072
|
+
throw new AppwriteException('Missing required parameter: "code"');
|
|
46073
|
+
}
|
|
46074
|
+
const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
46075
|
+
const apiPayload = {};
|
|
46076
|
+
if (typeof bucketId !== 'undefined') {
|
|
46077
|
+
apiPayload['bucketId'] = bucketId;
|
|
46078
|
+
}
|
|
46079
|
+
if (typeof fileId !== 'undefined') {
|
|
46080
|
+
apiPayload['fileId'] = fileId;
|
|
46081
|
+
}
|
|
46082
|
+
if (typeof name !== 'undefined') {
|
|
46083
|
+
apiPayload['name'] = name;
|
|
46084
|
+
}
|
|
46085
|
+
if (typeof code !== 'undefined') {
|
|
46086
|
+
apiPayload['code'] = code;
|
|
46087
|
+
}
|
|
46088
|
+
if (typeof xdefault !== 'undefined') {
|
|
46089
|
+
apiPayload['default'] = xdefault;
|
|
46090
|
+
}
|
|
46091
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46092
|
+
const apiHeaders = {
|
|
46093
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46094
|
+
'content-type': 'application/json',
|
|
46095
|
+
accept: 'application/json',
|
|
46096
|
+
};
|
|
46097
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
46098
|
+
}
|
|
46099
|
+
updateSubtitle(paramsOrFirst, ...rest) {
|
|
46100
|
+
let params;
|
|
46101
|
+
if (paramsOrFirst &&
|
|
46102
|
+
typeof paramsOrFirst === 'object' &&
|
|
46103
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46104
|
+
params = (paramsOrFirst || {});
|
|
46105
|
+
}
|
|
46106
|
+
else {
|
|
46107
|
+
params = {
|
|
46108
|
+
videoId: paramsOrFirst,
|
|
46109
|
+
subtitleId: rest[0],
|
|
46110
|
+
bucketId: rest[1],
|
|
46111
|
+
fileId: rest[2],
|
|
46112
|
+
name: rest[3],
|
|
46113
|
+
code: rest[4],
|
|
46114
|
+
xdefault: rest[5],
|
|
46115
|
+
};
|
|
46116
|
+
}
|
|
46117
|
+
const videoId = params.videoId;
|
|
46118
|
+
const subtitleId = params.subtitleId;
|
|
46119
|
+
const bucketId = params.bucketId;
|
|
46120
|
+
const fileId = params.fileId;
|
|
46121
|
+
const name = params.name;
|
|
46122
|
+
const code = params.code;
|
|
46123
|
+
const xdefault = params.xdefault;
|
|
46124
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
46125
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
46126
|
+
}
|
|
46127
|
+
if (typeof subtitleId === 'undefined' || subtitleId === '') {
|
|
46128
|
+
throw new AppwriteException('Missing required parameter: "subtitleId"');
|
|
46129
|
+
}
|
|
46130
|
+
const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
|
|
46131
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
46132
|
+
.replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
|
|
46133
|
+
const apiPayload = {};
|
|
46134
|
+
if (typeof bucketId !== 'undefined') {
|
|
46135
|
+
apiPayload['bucketId'] = bucketId;
|
|
46136
|
+
}
|
|
46137
|
+
if (typeof fileId !== 'undefined') {
|
|
46138
|
+
apiPayload['fileId'] = fileId;
|
|
46139
|
+
}
|
|
46140
|
+
if (typeof name !== 'undefined') {
|
|
46141
|
+
apiPayload['name'] = name;
|
|
46142
|
+
}
|
|
46143
|
+
if (typeof code !== 'undefined') {
|
|
46144
|
+
apiPayload['code'] = code;
|
|
46145
|
+
}
|
|
46146
|
+
if (typeof xdefault !== 'undefined') {
|
|
46147
|
+
apiPayload['default'] = xdefault;
|
|
46148
|
+
}
|
|
46149
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46150
|
+
const apiHeaders = {
|
|
46151
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46152
|
+
'content-type': 'application/json',
|
|
46153
|
+
accept: 'application/json',
|
|
46154
|
+
};
|
|
46155
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
46156
|
+
}
|
|
46157
|
+
deleteSubtitle(paramsOrFirst, ...rest) {
|
|
46158
|
+
let params;
|
|
46159
|
+
if (paramsOrFirst &&
|
|
46160
|
+
typeof paramsOrFirst === 'object' &&
|
|
46161
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46162
|
+
params = (paramsOrFirst || {});
|
|
46163
|
+
}
|
|
46164
|
+
else {
|
|
46165
|
+
params = {
|
|
46166
|
+
videoId: paramsOrFirst,
|
|
46167
|
+
subtitleId: rest[0],
|
|
46168
|
+
};
|
|
46169
|
+
}
|
|
46170
|
+
const videoId = params.videoId;
|
|
46171
|
+
const subtitleId = params.subtitleId;
|
|
46172
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
46173
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
46174
|
+
}
|
|
46175
|
+
if (typeof subtitleId === 'undefined' || subtitleId === '') {
|
|
46176
|
+
throw new AppwriteException('Missing required parameter: "subtitleId"');
|
|
46177
|
+
}
|
|
46178
|
+
const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
|
|
46179
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
46180
|
+
.replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
|
|
46181
|
+
const apiPayload = {};
|
|
46182
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46183
|
+
const apiHeaders = {
|
|
46184
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46185
|
+
'content-type': 'application/json',
|
|
46186
|
+
accept: 'application/json',
|
|
46187
|
+
};
|
|
46188
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
46189
|
+
}
|
|
46190
|
+
getTimeline(paramsOrFirst) {
|
|
46191
|
+
let params;
|
|
46192
|
+
if (paramsOrFirst &&
|
|
46193
|
+
typeof paramsOrFirst === 'object' &&
|
|
46194
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46195
|
+
params = (paramsOrFirst || {});
|
|
46196
|
+
}
|
|
46197
|
+
else {
|
|
46198
|
+
params = {
|
|
46199
|
+
videoId: paramsOrFirst,
|
|
46200
|
+
};
|
|
46201
|
+
}
|
|
46202
|
+
const videoId = params.videoId;
|
|
46203
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
46204
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
46205
|
+
}
|
|
46206
|
+
const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
46207
|
+
const apiPayload = {};
|
|
46208
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46209
|
+
const apiHeaders = {
|
|
46210
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46211
|
+
accept: 'text/plain',
|
|
46212
|
+
};
|
|
46213
|
+
return this.client.call('get', uri, apiHeaders, apiPayload, 'text');
|
|
46214
|
+
}
|
|
46215
|
+
createTimeline(paramsOrFirst) {
|
|
46216
|
+
let params;
|
|
46217
|
+
if (paramsOrFirst &&
|
|
46218
|
+
typeof paramsOrFirst === 'object' &&
|
|
46219
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46220
|
+
params = (paramsOrFirst || {});
|
|
46221
|
+
}
|
|
46222
|
+
else {
|
|
46223
|
+
params = {
|
|
46224
|
+
videoId: paramsOrFirst,
|
|
46225
|
+
};
|
|
46226
|
+
}
|
|
46227
|
+
const videoId = params.videoId;
|
|
46228
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
46229
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
46230
|
+
}
|
|
46231
|
+
const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
46232
|
+
const apiPayload = {};
|
|
46233
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46234
|
+
const apiHeaders = {
|
|
46235
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46236
|
+
'content-type': 'application/json',
|
|
46237
|
+
accept: 'application/json',
|
|
46238
|
+
};
|
|
46239
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
46240
|
+
}
|
|
46241
|
+
}
|
|
46242
|
+
|
|
46243
|
+
class Waf {
|
|
46244
|
+
constructor(client) {
|
|
46245
|
+
this.client = client;
|
|
46246
|
+
}
|
|
46247
|
+
listRules(paramsOrFirst, ...rest) {
|
|
46248
|
+
let params;
|
|
46249
|
+
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
46250
|
+
(paramsOrFirst &&
|
|
46251
|
+
typeof paramsOrFirst === 'object' &&
|
|
46252
|
+
!Array.isArray(paramsOrFirst))) {
|
|
46253
|
+
params = (paramsOrFirst || {});
|
|
46254
|
+
}
|
|
46255
|
+
else {
|
|
46256
|
+
params = {
|
|
46257
|
+
queries: paramsOrFirst,
|
|
46258
|
+
search: rest[0],
|
|
46259
|
+
total: rest[1],
|
|
46260
|
+
};
|
|
46261
|
+
}
|
|
46262
|
+
const queries = params.queries;
|
|
46263
|
+
const search = params.search;
|
|
46264
|
+
const total = params.total;
|
|
46265
|
+
const apiPath = '/waf/rules';
|
|
46266
|
+
const apiPayload = {};
|
|
46267
|
+
if (typeof queries !== 'undefined') {
|
|
46268
|
+
apiPayload['queries'] = queries;
|
|
46269
|
+
}
|
|
46270
|
+
if (typeof search !== 'undefined') {
|
|
46271
|
+
apiPayload['search'] = search;
|
|
46272
|
+
}
|
|
46273
|
+
if (typeof total !== 'undefined') {
|
|
46274
|
+
apiPayload['total'] = total;
|
|
46275
|
+
}
|
|
46276
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46277
|
+
const apiHeaders = {
|
|
46278
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46279
|
+
accept: 'application/json',
|
|
46280
|
+
};
|
|
46281
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
46282
|
+
}
|
|
46283
|
+
createBypassRule(paramsOrFirst, ...rest) {
|
|
46284
|
+
let params;
|
|
46285
|
+
if (paramsOrFirst &&
|
|
46286
|
+
typeof paramsOrFirst === 'object' &&
|
|
46287
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46288
|
+
params = (paramsOrFirst || {});
|
|
46289
|
+
}
|
|
46290
|
+
else {
|
|
46291
|
+
params = {
|
|
46292
|
+
ruleId: paramsOrFirst,
|
|
46293
|
+
resourceType: rest[0],
|
|
46294
|
+
name: rest[1],
|
|
46295
|
+
resourceId: rest[2],
|
|
46296
|
+
description: rest[3],
|
|
46297
|
+
priority: rest[4],
|
|
46298
|
+
enabled: rest[5],
|
|
46299
|
+
conditions: rest[6],
|
|
46300
|
+
};
|
|
46301
|
+
}
|
|
46302
|
+
const ruleId = params.ruleId;
|
|
46303
|
+
const resourceType = params.resourceType;
|
|
46304
|
+
const name = params.name;
|
|
46305
|
+
const resourceId = params.resourceId;
|
|
46306
|
+
const description = params.description;
|
|
46307
|
+
const priority = params.priority;
|
|
46308
|
+
const enabled = params.enabled;
|
|
46309
|
+
const conditions = params.conditions;
|
|
46310
|
+
if (typeof ruleId === 'undefined') {
|
|
46311
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
46312
|
+
}
|
|
46313
|
+
if (typeof resourceType === 'undefined') {
|
|
46314
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
46315
|
+
}
|
|
46316
|
+
if (typeof name === 'undefined') {
|
|
46317
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
46318
|
+
}
|
|
46319
|
+
const apiPath = '/waf/rules/bypass';
|
|
46320
|
+
const apiPayload = {};
|
|
46321
|
+
if (typeof ruleId !== 'undefined') {
|
|
46322
|
+
apiPayload['ruleId'] = ruleId;
|
|
46323
|
+
}
|
|
46324
|
+
if (typeof resourceType !== 'undefined') {
|
|
46325
|
+
apiPayload['resourceType'] = resourceType;
|
|
46326
|
+
}
|
|
46327
|
+
if (typeof resourceId !== 'undefined') {
|
|
46328
|
+
apiPayload['resourceId'] = resourceId;
|
|
46329
|
+
}
|
|
46330
|
+
if (typeof name !== 'undefined') {
|
|
46331
|
+
apiPayload['name'] = name;
|
|
46332
|
+
}
|
|
46333
|
+
if (typeof description !== 'undefined') {
|
|
46334
|
+
apiPayload['description'] = description;
|
|
46335
|
+
}
|
|
46336
|
+
if (typeof priority !== 'undefined') {
|
|
46337
|
+
apiPayload['priority'] = priority;
|
|
46338
|
+
}
|
|
46339
|
+
if (typeof enabled !== 'undefined') {
|
|
46340
|
+
apiPayload['enabled'] = enabled;
|
|
46341
|
+
}
|
|
46342
|
+
if (typeof conditions !== 'undefined') {
|
|
46343
|
+
apiPayload['conditions'] = conditions;
|
|
46344
|
+
}
|
|
46345
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46346
|
+
const apiHeaders = {
|
|
46347
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46348
|
+
'content-type': 'application/json',
|
|
46349
|
+
accept: 'application/json',
|
|
46350
|
+
};
|
|
46351
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
46352
|
+
}
|
|
46353
|
+
updateBypassRule(paramsOrFirst, ...rest) {
|
|
46354
|
+
let params;
|
|
46355
|
+
if (paramsOrFirst &&
|
|
46356
|
+
typeof paramsOrFirst === 'object' &&
|
|
46357
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46358
|
+
params = (paramsOrFirst || {});
|
|
46359
|
+
}
|
|
46360
|
+
else {
|
|
46361
|
+
params = {
|
|
46362
|
+
ruleId: paramsOrFirst,
|
|
46363
|
+
resourceType: rest[0],
|
|
46364
|
+
resourceId: rest[1],
|
|
46365
|
+
name: rest[2],
|
|
46366
|
+
description: rest[3],
|
|
46367
|
+
priority: rest[4],
|
|
46368
|
+
enabled: rest[5],
|
|
46369
|
+
conditions: rest[6],
|
|
46370
|
+
};
|
|
46371
|
+
}
|
|
46372
|
+
const ruleId = params.ruleId;
|
|
46373
|
+
const resourceType = params.resourceType;
|
|
46374
|
+
const resourceId = params.resourceId;
|
|
46375
|
+
const name = params.name;
|
|
46376
|
+
const description = params.description;
|
|
46377
|
+
const priority = params.priority;
|
|
46378
|
+
const enabled = params.enabled;
|
|
46379
|
+
const conditions = params.conditions;
|
|
46380
|
+
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
46381
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
46382
|
+
}
|
|
46383
|
+
const apiPath = '/waf/rules/bypass/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
|
|
46384
|
+
const apiPayload = {};
|
|
46385
|
+
if (typeof resourceType !== 'undefined') {
|
|
46386
|
+
apiPayload['resourceType'] = resourceType;
|
|
46387
|
+
}
|
|
46388
|
+
if (typeof resourceId !== 'undefined') {
|
|
46389
|
+
apiPayload['resourceId'] = resourceId;
|
|
46390
|
+
}
|
|
46391
|
+
if (typeof name !== 'undefined') {
|
|
46392
|
+
apiPayload['name'] = name;
|
|
46393
|
+
}
|
|
46394
|
+
if (typeof description !== 'undefined') {
|
|
46395
|
+
apiPayload['description'] = description;
|
|
46396
|
+
}
|
|
46397
|
+
if (typeof priority !== 'undefined') {
|
|
46398
|
+
apiPayload['priority'] = priority;
|
|
46399
|
+
}
|
|
46400
|
+
if (typeof enabled !== 'undefined') {
|
|
46401
|
+
apiPayload['enabled'] = enabled;
|
|
46402
|
+
}
|
|
46403
|
+
if (typeof conditions !== 'undefined') {
|
|
46404
|
+
apiPayload['conditions'] = conditions;
|
|
46405
|
+
}
|
|
46406
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46407
|
+
const apiHeaders = {
|
|
46408
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46409
|
+
'content-type': 'application/json',
|
|
46410
|
+
accept: 'application/json',
|
|
46411
|
+
};
|
|
46412
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
46413
|
+
}
|
|
46414
|
+
createChallengeRule(paramsOrFirst, ...rest) {
|
|
46415
|
+
let params;
|
|
46416
|
+
if (paramsOrFirst &&
|
|
46417
|
+
typeof paramsOrFirst === 'object' &&
|
|
46418
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46419
|
+
params = (paramsOrFirst || {});
|
|
46420
|
+
}
|
|
46421
|
+
else {
|
|
46422
|
+
params = {
|
|
46423
|
+
ruleId: paramsOrFirst,
|
|
46424
|
+
resourceType: rest[0],
|
|
46425
|
+
name: rest[1],
|
|
46426
|
+
resourceId: rest[2],
|
|
46427
|
+
description: rest[3],
|
|
46428
|
+
challengeType: rest[4],
|
|
46429
|
+
priority: rest[5],
|
|
46430
|
+
enabled: rest[6],
|
|
46431
|
+
conditions: rest[7],
|
|
46432
|
+
difficulty: rest[8],
|
|
46433
|
+
ttl: rest[9],
|
|
46434
|
+
};
|
|
46435
|
+
}
|
|
46436
|
+
const ruleId = params.ruleId;
|
|
46437
|
+
const resourceType = params.resourceType;
|
|
46438
|
+
const name = params.name;
|
|
46439
|
+
const resourceId = params.resourceId;
|
|
46440
|
+
const description = params.description;
|
|
46441
|
+
const challengeType = params.challengeType;
|
|
46442
|
+
const priority = params.priority;
|
|
46443
|
+
const enabled = params.enabled;
|
|
46444
|
+
const conditions = params.conditions;
|
|
46445
|
+
const difficulty = params.difficulty;
|
|
46446
|
+
const ttl = params.ttl;
|
|
46447
|
+
if (typeof ruleId === 'undefined') {
|
|
46448
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
46449
|
+
}
|
|
46450
|
+
if (typeof resourceType === 'undefined') {
|
|
46451
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
46452
|
+
}
|
|
46453
|
+
if (typeof name === 'undefined') {
|
|
46454
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
46455
|
+
}
|
|
46456
|
+
const apiPath = '/waf/rules/challenge';
|
|
46457
|
+
const apiPayload = {};
|
|
46458
|
+
if (typeof ruleId !== 'undefined') {
|
|
46459
|
+
apiPayload['ruleId'] = ruleId;
|
|
46460
|
+
}
|
|
46461
|
+
if (typeof resourceType !== 'undefined') {
|
|
46462
|
+
apiPayload['resourceType'] = resourceType;
|
|
46463
|
+
}
|
|
46464
|
+
if (typeof resourceId !== 'undefined') {
|
|
46465
|
+
apiPayload['resourceId'] = resourceId;
|
|
46466
|
+
}
|
|
46467
|
+
if (typeof name !== 'undefined') {
|
|
46468
|
+
apiPayload['name'] = name;
|
|
46469
|
+
}
|
|
46470
|
+
if (typeof description !== 'undefined') {
|
|
46471
|
+
apiPayload['description'] = description;
|
|
46472
|
+
}
|
|
46473
|
+
if (typeof challengeType !== 'undefined') {
|
|
46474
|
+
apiPayload['challengeType'] = challengeType;
|
|
46475
|
+
}
|
|
46476
|
+
if (typeof priority !== 'undefined') {
|
|
46477
|
+
apiPayload['priority'] = priority;
|
|
46478
|
+
}
|
|
46479
|
+
if (typeof enabled !== 'undefined') {
|
|
46480
|
+
apiPayload['enabled'] = enabled;
|
|
46481
|
+
}
|
|
46482
|
+
if (typeof conditions !== 'undefined') {
|
|
46483
|
+
apiPayload['conditions'] = conditions;
|
|
46484
|
+
}
|
|
46485
|
+
if (typeof difficulty !== 'undefined') {
|
|
46486
|
+
apiPayload['difficulty'] = difficulty;
|
|
46487
|
+
}
|
|
46488
|
+
if (typeof ttl !== 'undefined') {
|
|
46489
|
+
apiPayload['ttl'] = ttl;
|
|
46490
|
+
}
|
|
46491
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46492
|
+
const apiHeaders = {
|
|
46493
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46494
|
+
'content-type': 'application/json',
|
|
46495
|
+
accept: 'application/json',
|
|
46496
|
+
};
|
|
46497
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
46498
|
+
}
|
|
46499
|
+
updateChallengeRule(paramsOrFirst, ...rest) {
|
|
46500
|
+
let params;
|
|
46501
|
+
if (paramsOrFirst &&
|
|
46502
|
+
typeof paramsOrFirst === 'object' &&
|
|
46503
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46504
|
+
params = (paramsOrFirst || {});
|
|
46505
|
+
}
|
|
46506
|
+
else {
|
|
46507
|
+
params = {
|
|
46508
|
+
ruleId: paramsOrFirst,
|
|
46509
|
+
resourceType: rest[0],
|
|
46510
|
+
resourceId: rest[1],
|
|
46511
|
+
name: rest[2],
|
|
46512
|
+
description: rest[3],
|
|
46513
|
+
challengeType: rest[4],
|
|
46514
|
+
priority: rest[5],
|
|
46515
|
+
enabled: rest[6],
|
|
46516
|
+
conditions: rest[7],
|
|
46517
|
+
difficulty: rest[8],
|
|
46518
|
+
ttl: rest[9],
|
|
46519
|
+
};
|
|
46520
|
+
}
|
|
46521
|
+
const ruleId = params.ruleId;
|
|
46522
|
+
const resourceType = params.resourceType;
|
|
46523
|
+
const resourceId = params.resourceId;
|
|
46524
|
+
const name = params.name;
|
|
46525
|
+
const description = params.description;
|
|
46526
|
+
const challengeType = params.challengeType;
|
|
46527
|
+
const priority = params.priority;
|
|
46528
|
+
const enabled = params.enabled;
|
|
46529
|
+
const conditions = params.conditions;
|
|
46530
|
+
const difficulty = params.difficulty;
|
|
46531
|
+
const ttl = params.ttl;
|
|
46532
|
+
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
46533
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
46534
|
+
}
|
|
46535
|
+
const apiPath = '/waf/rules/challenge/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
|
|
46536
|
+
const apiPayload = {};
|
|
46537
|
+
if (typeof resourceType !== 'undefined') {
|
|
46538
|
+
apiPayload['resourceType'] = resourceType;
|
|
46539
|
+
}
|
|
46540
|
+
if (typeof resourceId !== 'undefined') {
|
|
46541
|
+
apiPayload['resourceId'] = resourceId;
|
|
46542
|
+
}
|
|
46543
|
+
if (typeof name !== 'undefined') {
|
|
46544
|
+
apiPayload['name'] = name;
|
|
46545
|
+
}
|
|
46546
|
+
if (typeof description !== 'undefined') {
|
|
46547
|
+
apiPayload['description'] = description;
|
|
46548
|
+
}
|
|
46549
|
+
if (typeof challengeType !== 'undefined') {
|
|
46550
|
+
apiPayload['challengeType'] = challengeType;
|
|
46551
|
+
}
|
|
46552
|
+
if (typeof priority !== 'undefined') {
|
|
46553
|
+
apiPayload['priority'] = priority;
|
|
46554
|
+
}
|
|
46555
|
+
if (typeof enabled !== 'undefined') {
|
|
46556
|
+
apiPayload['enabled'] = enabled;
|
|
46557
|
+
}
|
|
46558
|
+
if (typeof conditions !== 'undefined') {
|
|
46559
|
+
apiPayload['conditions'] = conditions;
|
|
46560
|
+
}
|
|
46561
|
+
if (typeof difficulty !== 'undefined') {
|
|
46562
|
+
apiPayload['difficulty'] = difficulty;
|
|
46563
|
+
}
|
|
46564
|
+
if (typeof ttl !== 'undefined') {
|
|
46565
|
+
apiPayload['ttl'] = ttl;
|
|
46566
|
+
}
|
|
46567
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46568
|
+
const apiHeaders = {
|
|
46569
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46570
|
+
'content-type': 'application/json',
|
|
46571
|
+
accept: 'application/json',
|
|
46572
|
+
};
|
|
46573
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
46574
|
+
}
|
|
46575
|
+
createDenyRule(paramsOrFirst, ...rest) {
|
|
46576
|
+
let params;
|
|
46577
|
+
if (paramsOrFirst &&
|
|
46578
|
+
typeof paramsOrFirst === 'object' &&
|
|
46579
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46580
|
+
params = (paramsOrFirst || {});
|
|
46581
|
+
}
|
|
46582
|
+
else {
|
|
46583
|
+
params = {
|
|
46584
|
+
ruleId: paramsOrFirst,
|
|
46585
|
+
resourceType: rest[0],
|
|
46586
|
+
name: rest[1],
|
|
46587
|
+
resourceId: rest[2],
|
|
46588
|
+
description: rest[3],
|
|
46589
|
+
priority: rest[4],
|
|
46590
|
+
enabled: rest[5],
|
|
46591
|
+
conditions: rest[6],
|
|
46592
|
+
};
|
|
46593
|
+
}
|
|
46594
|
+
const ruleId = params.ruleId;
|
|
46595
|
+
const resourceType = params.resourceType;
|
|
46596
|
+
const name = params.name;
|
|
46597
|
+
const resourceId = params.resourceId;
|
|
46598
|
+
const description = params.description;
|
|
46599
|
+
const priority = params.priority;
|
|
46600
|
+
const enabled = params.enabled;
|
|
46601
|
+
const conditions = params.conditions;
|
|
46602
|
+
if (typeof ruleId === 'undefined') {
|
|
46603
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
46604
|
+
}
|
|
46605
|
+
if (typeof resourceType === 'undefined') {
|
|
46606
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
46607
|
+
}
|
|
46608
|
+
if (typeof name === 'undefined') {
|
|
46609
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
46610
|
+
}
|
|
46611
|
+
const apiPath = '/waf/rules/deny';
|
|
46612
|
+
const apiPayload = {};
|
|
46613
|
+
if (typeof ruleId !== 'undefined') {
|
|
46614
|
+
apiPayload['ruleId'] = ruleId;
|
|
46615
|
+
}
|
|
46616
|
+
if (typeof resourceType !== 'undefined') {
|
|
46617
|
+
apiPayload['resourceType'] = resourceType;
|
|
46618
|
+
}
|
|
46619
|
+
if (typeof resourceId !== 'undefined') {
|
|
46620
|
+
apiPayload['resourceId'] = resourceId;
|
|
46621
|
+
}
|
|
46622
|
+
if (typeof name !== 'undefined') {
|
|
46623
|
+
apiPayload['name'] = name;
|
|
46624
|
+
}
|
|
46625
|
+
if (typeof description !== 'undefined') {
|
|
46626
|
+
apiPayload['description'] = description;
|
|
46627
|
+
}
|
|
46628
|
+
if (typeof priority !== 'undefined') {
|
|
46629
|
+
apiPayload['priority'] = priority;
|
|
46630
|
+
}
|
|
46631
|
+
if (typeof enabled !== 'undefined') {
|
|
46632
|
+
apiPayload['enabled'] = enabled;
|
|
46633
|
+
}
|
|
46634
|
+
if (typeof conditions !== 'undefined') {
|
|
46635
|
+
apiPayload['conditions'] = conditions;
|
|
46636
|
+
}
|
|
46637
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46638
|
+
const apiHeaders = {
|
|
46639
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46640
|
+
'content-type': 'application/json',
|
|
46641
|
+
accept: 'application/json',
|
|
46642
|
+
};
|
|
46643
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
46644
|
+
}
|
|
46645
|
+
updateDenyRule(paramsOrFirst, ...rest) {
|
|
46646
|
+
let params;
|
|
46647
|
+
if (paramsOrFirst &&
|
|
46648
|
+
typeof paramsOrFirst === 'object' &&
|
|
46649
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46650
|
+
params = (paramsOrFirst || {});
|
|
46651
|
+
}
|
|
46652
|
+
else {
|
|
46653
|
+
params = {
|
|
46654
|
+
ruleId: paramsOrFirst,
|
|
46655
|
+
resourceType: rest[0],
|
|
46656
|
+
resourceId: rest[1],
|
|
46657
|
+
name: rest[2],
|
|
46658
|
+
description: rest[3],
|
|
46659
|
+
priority: rest[4],
|
|
46660
|
+
enabled: rest[5],
|
|
46661
|
+
conditions: rest[6],
|
|
46662
|
+
};
|
|
46663
|
+
}
|
|
46664
|
+
const ruleId = params.ruleId;
|
|
46665
|
+
const resourceType = params.resourceType;
|
|
46666
|
+
const resourceId = params.resourceId;
|
|
46667
|
+
const name = params.name;
|
|
46668
|
+
const description = params.description;
|
|
46669
|
+
const priority = params.priority;
|
|
46670
|
+
const enabled = params.enabled;
|
|
46671
|
+
const conditions = params.conditions;
|
|
46672
|
+
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
46673
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
46674
|
+
}
|
|
46675
|
+
const apiPath = '/waf/rules/deny/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
|
|
46676
|
+
const apiPayload = {};
|
|
46677
|
+
if (typeof resourceType !== 'undefined') {
|
|
46678
|
+
apiPayload['resourceType'] = resourceType;
|
|
46679
|
+
}
|
|
46680
|
+
if (typeof resourceId !== 'undefined') {
|
|
46681
|
+
apiPayload['resourceId'] = resourceId;
|
|
46682
|
+
}
|
|
46683
|
+
if (typeof name !== 'undefined') {
|
|
46684
|
+
apiPayload['name'] = name;
|
|
46685
|
+
}
|
|
46686
|
+
if (typeof description !== 'undefined') {
|
|
46687
|
+
apiPayload['description'] = description;
|
|
46688
|
+
}
|
|
46689
|
+
if (typeof priority !== 'undefined') {
|
|
46690
|
+
apiPayload['priority'] = priority;
|
|
46691
|
+
}
|
|
46692
|
+
if (typeof enabled !== 'undefined') {
|
|
46693
|
+
apiPayload['enabled'] = enabled;
|
|
46694
|
+
}
|
|
46695
|
+
if (typeof conditions !== 'undefined') {
|
|
46696
|
+
apiPayload['conditions'] = conditions;
|
|
46697
|
+
}
|
|
46698
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46699
|
+
const apiHeaders = {
|
|
46700
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46701
|
+
'content-type': 'application/json',
|
|
46702
|
+
accept: 'application/json',
|
|
46703
|
+
};
|
|
46704
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
46705
|
+
}
|
|
46706
|
+
createRateLimitRule(paramsOrFirst, ...rest) {
|
|
46707
|
+
let params;
|
|
46708
|
+
if (paramsOrFirst &&
|
|
46709
|
+
typeof paramsOrFirst === 'object' &&
|
|
46710
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46711
|
+
params = (paramsOrFirst || {});
|
|
46712
|
+
}
|
|
46713
|
+
else {
|
|
46714
|
+
params = {
|
|
46715
|
+
ruleId: paramsOrFirst,
|
|
46716
|
+
resourceType: rest[0],
|
|
46717
|
+
name: rest[1],
|
|
46718
|
+
limit: rest[2],
|
|
46719
|
+
interval: rest[3],
|
|
46720
|
+
resourceId: rest[4],
|
|
46721
|
+
description: rest[5],
|
|
46722
|
+
key: rest[6],
|
|
46723
|
+
strategy: rest[7],
|
|
46724
|
+
maxBucketSize: rest[8],
|
|
46725
|
+
priority: rest[9],
|
|
46726
|
+
enabled: rest[10],
|
|
46727
|
+
conditions: rest[11],
|
|
46728
|
+
};
|
|
46729
|
+
}
|
|
46730
|
+
const ruleId = params.ruleId;
|
|
46731
|
+
const resourceType = params.resourceType;
|
|
46732
|
+
const name = params.name;
|
|
46733
|
+
const limit = params.limit;
|
|
46734
|
+
const interval = params.interval;
|
|
46735
|
+
const resourceId = params.resourceId;
|
|
46736
|
+
const description = params.description;
|
|
46737
|
+
const key = params.key;
|
|
46738
|
+
const strategy = params.strategy;
|
|
46739
|
+
const maxBucketSize = params.maxBucketSize;
|
|
46740
|
+
const priority = params.priority;
|
|
46741
|
+
const enabled = params.enabled;
|
|
46742
|
+
const conditions = params.conditions;
|
|
46743
|
+
if (typeof ruleId === 'undefined') {
|
|
46744
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
46745
|
+
}
|
|
46746
|
+
if (typeof resourceType === 'undefined') {
|
|
46747
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
46748
|
+
}
|
|
46749
|
+
if (typeof name === 'undefined') {
|
|
46750
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
46751
|
+
}
|
|
46752
|
+
if (typeof limit === 'undefined') {
|
|
46753
|
+
throw new AppwriteException('Missing required parameter: "limit"');
|
|
46754
|
+
}
|
|
46755
|
+
if (typeof interval === 'undefined') {
|
|
46756
|
+
throw new AppwriteException('Missing required parameter: "interval"');
|
|
46757
|
+
}
|
|
46758
|
+
const apiPath = '/waf/rules/rate-limit';
|
|
46759
|
+
const apiPayload = {};
|
|
46760
|
+
if (typeof ruleId !== 'undefined') {
|
|
46761
|
+
apiPayload['ruleId'] = ruleId;
|
|
46762
|
+
}
|
|
46763
|
+
if (typeof resourceType !== 'undefined') {
|
|
46764
|
+
apiPayload['resourceType'] = resourceType;
|
|
46765
|
+
}
|
|
46766
|
+
if (typeof resourceId !== 'undefined') {
|
|
46767
|
+
apiPayload['resourceId'] = resourceId;
|
|
46768
|
+
}
|
|
46769
|
+
if (typeof name !== 'undefined') {
|
|
46770
|
+
apiPayload['name'] = name;
|
|
46771
|
+
}
|
|
46772
|
+
if (typeof description !== 'undefined') {
|
|
46773
|
+
apiPayload['description'] = description;
|
|
46774
|
+
}
|
|
46775
|
+
if (typeof limit !== 'undefined') {
|
|
46776
|
+
apiPayload['limit'] = limit;
|
|
46777
|
+
}
|
|
46778
|
+
if (typeof interval !== 'undefined') {
|
|
46779
|
+
apiPayload['interval'] = interval;
|
|
44790
46780
|
}
|
|
44791
46781
|
if (typeof key !== 'undefined') {
|
|
44792
46782
|
apiPayload['key'] = key;
|
|
@@ -46012,9 +48002,8 @@ const RECONNECT_PERIOD_MS = 2000;
|
|
|
46012
48002
|
* );
|
|
46013
48003
|
* // sub.update({ background: true }); sub.unsubscribe();
|
|
46014
48004
|
*/
|
|
46015
|
-
class Push
|
|
48005
|
+
class Push {
|
|
46016
48006
|
constructor(client) {
|
|
46017
|
-
super(client);
|
|
46018
48007
|
this.mqtt = null;
|
|
46019
48008
|
this.connecting = null;
|
|
46020
48009
|
this.Buffer = null;
|
|
@@ -46044,6 +48033,7 @@ class Push extends Service {
|
|
|
46044
48033
|
this.connectedKey = '';
|
|
46045
48034
|
this.connectionEpoch = 0;
|
|
46046
48035
|
this.subscriptions = new Map();
|
|
48036
|
+
this.client = client;
|
|
46047
48037
|
}
|
|
46048
48038
|
// The broker subscription for a filter uses the highest QoS any local subscription on
|
|
46049
48039
|
// it wants, so a QoS-0 subscription never downgrades a QoS-1 one sharing the filter.
|
|
@@ -46783,6 +48773,670 @@ function matches(filter, topic) {
|
|
|
46783
48773
|
return filterParts.length === topicParts.length;
|
|
46784
48774
|
}
|
|
46785
48775
|
|
|
48776
|
+
/**
|
|
48777
|
+
* Analytics auto-tracking helpers.
|
|
48778
|
+
*
|
|
48779
|
+
* These are hand-written companions to the generated `Analytics` service.
|
|
48780
|
+
* The generated service exposes `createEvent(params)` for arbitrary events;
|
|
48781
|
+
* this module wires up common auto-tracking behaviours (pageviews, outbound
|
|
48782
|
+
* links, downloads, scroll depth, active engagement) on top of it.
|
|
48783
|
+
*
|
|
48784
|
+
* The tracking helpers accept a plain event-emitter function so they do not
|
|
48785
|
+
* hard-couple to the generated `Analytics` class. The emitter adapts this
|
|
48786
|
+
* module's option shape to `createEvent`: `url` is required there, and `props`
|
|
48787
|
+
* is a flat alternating key/value list rather than an object.
|
|
48788
|
+
*
|
|
48789
|
+
* ```ts
|
|
48790
|
+
* const analytics = new Analytics(client);
|
|
48791
|
+
* const tracking = new AnalyticsTracking(
|
|
48792
|
+
* (name, options) => analytics.createEvent({
|
|
48793
|
+
* propertyId: options?.propertyId ?? '<PROPERTY_ID>',
|
|
48794
|
+
* name,
|
|
48795
|
+
* url: options?.url ?? window.location.href,
|
|
48796
|
+
* referrer: options?.referrer,
|
|
48797
|
+
* scrollDepth: options?.scrollDepth,
|
|
48798
|
+
* engagementTime: options?.engagementTime,
|
|
48799
|
+
* props: Object.entries(options?.props ?? {}).flatMap(
|
|
48800
|
+
* ([key, value]) => [key, String(value)],
|
|
48801
|
+
* ),
|
|
48802
|
+
* }),
|
|
48803
|
+
* { propertyId: '<PROPERTY_ID>' }
|
|
48804
|
+
* );
|
|
48805
|
+
* tracking.enableAllAutoTracking();
|
|
48806
|
+
* ```
|
|
48807
|
+
*
|
|
48808
|
+
* `propertyId` is optional: when set it is merged into the options of every
|
|
48809
|
+
* emitted event, so an emitter that forwards `options.propertyId` (as above)
|
|
48810
|
+
* picks it up instead of every caller hand-rolling it into the closure.
|
|
48811
|
+
* Per-event `propertyId` always wins over the configured default.
|
|
48812
|
+
*
|
|
48813
|
+
* All helpers respect `navigator.doNotTrack === '1'` by default; opt out with
|
|
48814
|
+
* `respectDoNotTrack: false` in the constructor options.
|
|
48815
|
+
*
|
|
48816
|
+
* Engagement time follows Plausible's model: rather than one total at unload,
|
|
48817
|
+
* a delta is emitted at every natural checkpoint of the visit (tab hidden, SPA
|
|
48818
|
+
* route change, unload). See `enableAutoEngagementTime` for details.
|
|
48819
|
+
*
|
|
48820
|
+
* Auto-emitted event names follow `snake_case` + lowercase (`pageview`,
|
|
48821
|
+
* `outbound_link`, `file_download`, `screen_view`, etc.). Any prop keys use
|
|
48822
|
+
* camelCase to match the endpoint's parameter naming. Callers can pass any
|
|
48823
|
+
* custom event name; the auto-track methods only own the events they emit
|
|
48824
|
+
* themselves.
|
|
48825
|
+
*/
|
|
48826
|
+
const DEFAULT_DOWNLOAD_EXTENSIONS = [
|
|
48827
|
+
'pdf',
|
|
48828
|
+
'zip',
|
|
48829
|
+
'rar',
|
|
48830
|
+
'7z',
|
|
48831
|
+
'tar',
|
|
48832
|
+
'gz',
|
|
48833
|
+
'csv',
|
|
48834
|
+
'tsv',
|
|
48835
|
+
'xls',
|
|
48836
|
+
'xlsx',
|
|
48837
|
+
'doc',
|
|
48838
|
+
'docx',
|
|
48839
|
+
'ppt',
|
|
48840
|
+
'pptx',
|
|
48841
|
+
'dmg',
|
|
48842
|
+
'exe',
|
|
48843
|
+
'msi',
|
|
48844
|
+
'pkg',
|
|
48845
|
+
'deb',
|
|
48846
|
+
'rpm',
|
|
48847
|
+
'apk',
|
|
48848
|
+
'mp3',
|
|
48849
|
+
'wav',
|
|
48850
|
+
'flac',
|
|
48851
|
+
'mp4',
|
|
48852
|
+
'mov',
|
|
48853
|
+
'avi',
|
|
48854
|
+
'mkv',
|
|
48855
|
+
'webm',
|
|
48856
|
+
];
|
|
48857
|
+
/**
|
|
48858
|
+
* Two-part public suffixes common enough to matter for outbound-link detection.
|
|
48859
|
+
* See `rootDomain()` for why this is a short list rather than the Public Suffix
|
|
48860
|
+
* List.
|
|
48861
|
+
*/
|
|
48862
|
+
const MULTI_PART_SUFFIXES = new Set([
|
|
48863
|
+
'co.uk',
|
|
48864
|
+
'org.uk',
|
|
48865
|
+
'ac.uk',
|
|
48866
|
+
'gov.uk',
|
|
48867
|
+
'me.uk',
|
|
48868
|
+
'net.uk',
|
|
48869
|
+
'sch.uk',
|
|
48870
|
+
'co.jp',
|
|
48871
|
+
'ne.jp',
|
|
48872
|
+
'or.jp',
|
|
48873
|
+
'ac.jp',
|
|
48874
|
+
'go.jp',
|
|
48875
|
+
'com.au',
|
|
48876
|
+
'net.au',
|
|
48877
|
+
'org.au',
|
|
48878
|
+
'edu.au',
|
|
48879
|
+
'gov.au',
|
|
48880
|
+
'com.br',
|
|
48881
|
+
'net.br',
|
|
48882
|
+
'org.br',
|
|
48883
|
+
'com.cn',
|
|
48884
|
+
'net.cn',
|
|
48885
|
+
'org.cn',
|
|
48886
|
+
'gov.cn',
|
|
48887
|
+
'co.in',
|
|
48888
|
+
'net.in',
|
|
48889
|
+
'org.in',
|
|
48890
|
+
'co.nz',
|
|
48891
|
+
'net.nz',
|
|
48892
|
+
'org.nz',
|
|
48893
|
+
'co.za',
|
|
48894
|
+
'org.za',
|
|
48895
|
+
'com.mx',
|
|
48896
|
+
'com.ar',
|
|
48897
|
+
'com.co',
|
|
48898
|
+
'com.pe',
|
|
48899
|
+
'com.tr',
|
|
48900
|
+
'com.tw',
|
|
48901
|
+
'com.sg',
|
|
48902
|
+
'com.hk',
|
|
48903
|
+
'com.my',
|
|
48904
|
+
'com.ph',
|
|
48905
|
+
'com.vn',
|
|
48906
|
+
'co.kr',
|
|
48907
|
+
'co.il',
|
|
48908
|
+
'co.id',
|
|
48909
|
+
'co.th',
|
|
48910
|
+
'com.ua',
|
|
48911
|
+
'com.pl',
|
|
48912
|
+
'com.es',
|
|
48913
|
+
]);
|
|
48914
|
+
const SCROLL_DEPTH_THROTTLE_MS = 200;
|
|
48915
|
+
class AnalyticsTracking {
|
|
48916
|
+
constructor(emit, options = {}) {
|
|
48917
|
+
this.pageviewCleanups = [];
|
|
48918
|
+
this.scrollCleanups = [];
|
|
48919
|
+
this.engagementCleanups = [];
|
|
48920
|
+
this.maxScrollDepth = 0;
|
|
48921
|
+
this.scrollTicking = false;
|
|
48922
|
+
this.lastScrollReport = 0;
|
|
48923
|
+
this.engagementStart = 0;
|
|
48924
|
+
this.engagementAccumulatedMs = 0;
|
|
48925
|
+
this.engagementActive = false;
|
|
48926
|
+
this.emit = emit;
|
|
48927
|
+
this.respectDoNotTrack = options.respectDoNotTrack !== false;
|
|
48928
|
+
this.propertyId = options.propertyId;
|
|
48929
|
+
}
|
|
48930
|
+
/**
|
|
48931
|
+
* Enable the opinionated default auto-tracking set: pageviews, outbound
|
|
48932
|
+
* links, scroll depth and active engagement time. Downloads must be opted
|
|
48933
|
+
* into separately via `enableAutoDownloadTracking()` because the extension
|
|
48934
|
+
* list is application-specific.
|
|
48935
|
+
*/
|
|
48936
|
+
enableAllAutoTracking() {
|
|
48937
|
+
this.enableAutoPageviews();
|
|
48938
|
+
this.enableAutoOutboundTracking();
|
|
48939
|
+
this.enableAutoScrollDepth();
|
|
48940
|
+
this.enableAutoEngagementTime();
|
|
48941
|
+
}
|
|
48942
|
+
/**
|
|
48943
|
+
* Track an event manually. Respects the DNT setting and swallows emitter
|
|
48944
|
+
* exceptions so tracking failures never surface to the host page.
|
|
48945
|
+
*/
|
|
48946
|
+
track(name, options) {
|
|
48947
|
+
if (!this.canTrack()) {
|
|
48948
|
+
return;
|
|
48949
|
+
}
|
|
48950
|
+
try {
|
|
48951
|
+
this.emit(name, this.withPropertyId(options));
|
|
48952
|
+
}
|
|
48953
|
+
catch (error) {
|
|
48954
|
+
console.warn('AnalyticsTracking: emitter threw', error);
|
|
48955
|
+
}
|
|
48956
|
+
}
|
|
48957
|
+
/**
|
|
48958
|
+
* Convenience wrapper for pageview-shaped events.
|
|
48959
|
+
*/
|
|
48960
|
+
pageview(url, referrer) {
|
|
48961
|
+
this.track('pageview', {
|
|
48962
|
+
url: url !== null && url !== void 0 ? url : this.currentPageUrl(),
|
|
48963
|
+
referrer: referrer !== null && referrer !== void 0 ? referrer : (typeof document !== 'undefined'
|
|
48964
|
+
? document.referrer
|
|
48965
|
+
: undefined),
|
|
48966
|
+
});
|
|
48967
|
+
}
|
|
48968
|
+
/**
|
|
48969
|
+
* Enable SPA-aware pageview tracking. Fires an initial pageview on
|
|
48970
|
+
* enable, then again on every `pushState`, `replaceState`, `popstate`
|
|
48971
|
+
* or hashchange. Idempotent — repeat calls no-op.
|
|
48972
|
+
*/
|
|
48973
|
+
enableAutoPageviews() {
|
|
48974
|
+
if (this.pageviewCleanups.length > 0) {
|
|
48975
|
+
return;
|
|
48976
|
+
}
|
|
48977
|
+
if (typeof window === 'undefined' || typeof history === 'undefined') {
|
|
48978
|
+
return;
|
|
48979
|
+
}
|
|
48980
|
+
this.currentPath = this.currentPageUrl();
|
|
48981
|
+
this.pageview();
|
|
48982
|
+
const handleNavigation = () => {
|
|
48983
|
+
const nextPath = this.currentPageUrl();
|
|
48984
|
+
if (nextPath === this.currentPath) {
|
|
48985
|
+
return;
|
|
48986
|
+
}
|
|
48987
|
+
const previous = this.currentPath;
|
|
48988
|
+
this.currentPath = nextPath;
|
|
48989
|
+
this.flushScrollDepth(previous);
|
|
48990
|
+
this.flushEngagement(previous);
|
|
48991
|
+
this.pageview(nextPath);
|
|
48992
|
+
// flushEngagement no longer auto-restarts the timer (see its
|
|
48993
|
+
// implementation note re: bfcache). SPA navigation stays on the
|
|
48994
|
+
// same document, so restart engagement tracking for the new
|
|
48995
|
+
// route as long as the tab is visible.
|
|
48996
|
+
if (this.engagementCleanups.length > 0 &&
|
|
48997
|
+
(typeof document === 'undefined' ||
|
|
48998
|
+
document.visibilityState !== 'hidden')) {
|
|
48999
|
+
this.startEngagement();
|
|
49000
|
+
}
|
|
49001
|
+
};
|
|
49002
|
+
const originalPushState = history.pushState.bind(history);
|
|
49003
|
+
const originalReplaceState = history.replaceState.bind(history);
|
|
49004
|
+
// Our wrappers stay reachable after cleanup whenever another library
|
|
49005
|
+
// patched on top of ours, so they have to be switchable off rather than
|
|
49006
|
+
// merely unreferenced.
|
|
49007
|
+
let patchActive = true;
|
|
49008
|
+
const patchedPushState = (data, unused, url) => {
|
|
49009
|
+
originalPushState(data, unused, url);
|
|
49010
|
+
if (patchActive) {
|
|
49011
|
+
handleNavigation();
|
|
49012
|
+
}
|
|
49013
|
+
};
|
|
49014
|
+
const patchedReplaceState = (data, unused, url) => {
|
|
49015
|
+
originalReplaceState(data, unused, url);
|
|
49016
|
+
if (patchActive) {
|
|
49017
|
+
handleNavigation();
|
|
49018
|
+
}
|
|
49019
|
+
};
|
|
49020
|
+
history.pushState = patchedPushState;
|
|
49021
|
+
history.replaceState = patchedReplaceState;
|
|
49022
|
+
const popstateHandler = () => handleNavigation();
|
|
49023
|
+
const hashchangeHandler = () => handleNavigation();
|
|
49024
|
+
window.addEventListener('popstate', popstateHandler);
|
|
49025
|
+
window.addEventListener('hashchange', hashchangeHandler);
|
|
49026
|
+
this.pageviewCleanups.push(() => {
|
|
49027
|
+
// Only unwind our own patch. A router (Next.js App Router, React
|
|
49028
|
+
// Router, …) that patched these after us owns the current value,
|
|
49029
|
+
// and assigning our saved reference back would silently throw its
|
|
49030
|
+
// wrapper away. In that case ours stays in the chain, which is why
|
|
49031
|
+
// `patchActive` exists: the wrapper keeps delegating to the original
|
|
49032
|
+
// but stops reporting.
|
|
49033
|
+
patchActive = false;
|
|
49034
|
+
if (history.pushState === patchedPushState) {
|
|
49035
|
+
history.pushState = originalPushState;
|
|
49036
|
+
}
|
|
49037
|
+
if (history.replaceState === patchedReplaceState) {
|
|
49038
|
+
history.replaceState = originalReplaceState;
|
|
49039
|
+
}
|
|
49040
|
+
window.removeEventListener('popstate', popstateHandler);
|
|
49041
|
+
window.removeEventListener('hashchange', hashchangeHandler);
|
|
49042
|
+
});
|
|
49043
|
+
}
|
|
49044
|
+
/**
|
|
49045
|
+
* Disable auto-pageview tracking installed by `enableAutoPageviews`.
|
|
49046
|
+
* Safe to call when auto-pageviews were never enabled.
|
|
49047
|
+
*/
|
|
49048
|
+
disableAutoPageviews() {
|
|
49049
|
+
for (const cleanup of this.pageviewCleanups) {
|
|
49050
|
+
cleanup();
|
|
49051
|
+
}
|
|
49052
|
+
this.pageviewCleanups = [];
|
|
49053
|
+
}
|
|
49054
|
+
/**
|
|
49055
|
+
* Enable click-based outbound link tracking. Detects anchor clicks that
|
|
49056
|
+
* navigate to a different origin and fires an `outbound_link` event
|
|
49057
|
+
* (with `hostname` and `href` props) before the browser navigates.
|
|
49058
|
+
*/
|
|
49059
|
+
enableAutoOutboundTracking(options = {}) {
|
|
49060
|
+
if (this.outboundCleanup) {
|
|
49061
|
+
return;
|
|
49062
|
+
}
|
|
49063
|
+
if (typeof document === 'undefined') {
|
|
49064
|
+
return;
|
|
49065
|
+
}
|
|
49066
|
+
const includeSubdomains = options.includeSubdomains === true;
|
|
49067
|
+
const clickHandler = (event) => {
|
|
49068
|
+
const anchor = this.findAnchor(event.target);
|
|
49069
|
+
if (!anchor || !anchor.href) {
|
|
49070
|
+
return;
|
|
49071
|
+
}
|
|
49072
|
+
const target = this.parseUrl(anchor.href);
|
|
49073
|
+
if (!target || !this.isExternal(target, includeSubdomains)) {
|
|
49074
|
+
return;
|
|
49075
|
+
}
|
|
49076
|
+
this.track('outbound_link', {
|
|
49077
|
+
url: target.href,
|
|
49078
|
+
props: { hostname: target.hostname, href: target.href },
|
|
49079
|
+
});
|
|
49080
|
+
};
|
|
49081
|
+
document.addEventListener('click', clickHandler, { capture: true });
|
|
49082
|
+
this.outboundCleanup = () => document.removeEventListener('click', clickHandler, {
|
|
49083
|
+
capture: true,
|
|
49084
|
+
});
|
|
49085
|
+
}
|
|
49086
|
+
/**
|
|
49087
|
+
* Disable outbound-link tracking installed by `enableAutoOutboundTracking`.
|
|
49088
|
+
* Safe to call when auto-outbound was never enabled.
|
|
49089
|
+
*/
|
|
49090
|
+
disableAutoOutboundTracking() {
|
|
49091
|
+
if (this.outboundCleanup) {
|
|
49092
|
+
this.outboundCleanup();
|
|
49093
|
+
this.outboundCleanup = undefined;
|
|
49094
|
+
}
|
|
49095
|
+
}
|
|
49096
|
+
/**
|
|
49097
|
+
* Enable click-based download tracking. Detects anchor clicks that point
|
|
49098
|
+
* at a file whose extension appears in the configured list and fires a
|
|
49099
|
+
* `file_download` event with `filename`, `extension` and `href` props.
|
|
49100
|
+
*/
|
|
49101
|
+
enableAutoDownloadTracking(options = {}) {
|
|
49102
|
+
var _a;
|
|
49103
|
+
if (this.downloadCleanup) {
|
|
49104
|
+
return;
|
|
49105
|
+
}
|
|
49106
|
+
if (typeof document === 'undefined') {
|
|
49107
|
+
return;
|
|
49108
|
+
}
|
|
49109
|
+
const extensions = ((_a = options.extensions) !== null && _a !== void 0 ? _a : DEFAULT_DOWNLOAD_EXTENSIONS).map((ext) => ext.toLowerCase().replace(/^\./, ''));
|
|
49110
|
+
const extensionSet = new Set(extensions);
|
|
49111
|
+
const clickHandler = (event) => {
|
|
49112
|
+
var _a, _b;
|
|
49113
|
+
const anchor = this.findAnchor(event.target);
|
|
49114
|
+
if (!anchor || !anchor.href) {
|
|
49115
|
+
return;
|
|
49116
|
+
}
|
|
49117
|
+
const url = this.parseUrl(anchor.href);
|
|
49118
|
+
if (!url) {
|
|
49119
|
+
return;
|
|
49120
|
+
}
|
|
49121
|
+
const filename = (_a = url.pathname.split('/').pop()) !== null && _a !== void 0 ? _a : '';
|
|
49122
|
+
const extension = filename.includes('.')
|
|
49123
|
+
? (_b = filename.split('.').pop()) === null || _b === void 0 ? void 0 : _b.toLowerCase()
|
|
49124
|
+
: undefined;
|
|
49125
|
+
if (!extension || !extensionSet.has(extension)) {
|
|
49126
|
+
return;
|
|
49127
|
+
}
|
|
49128
|
+
this.track('file_download', {
|
|
49129
|
+
url: url.href,
|
|
49130
|
+
props: { filename, extension, href: url.href },
|
|
49131
|
+
});
|
|
49132
|
+
};
|
|
49133
|
+
document.addEventListener('click', clickHandler, { capture: true });
|
|
49134
|
+
this.downloadCleanup = () => document.removeEventListener('click', clickHandler, {
|
|
49135
|
+
capture: true,
|
|
49136
|
+
});
|
|
49137
|
+
}
|
|
49138
|
+
/**
|
|
49139
|
+
* Disable file-download tracking installed by `enableAutoDownloadTracking`.
|
|
49140
|
+
* Safe to call when auto-download was never enabled.
|
|
49141
|
+
*/
|
|
49142
|
+
disableAutoDownloadTracking() {
|
|
49143
|
+
if (this.downloadCleanup) {
|
|
49144
|
+
this.downloadCleanup();
|
|
49145
|
+
this.downloadCleanup = undefined;
|
|
49146
|
+
}
|
|
49147
|
+
}
|
|
49148
|
+
/**
|
|
49149
|
+
* Enable passive scroll-depth tracking. Records the maximum percent of the
|
|
49150
|
+
* document scrolled and reports it on `beforeunload` and on SPA route
|
|
49151
|
+
* changes. Uses a throttled passive listener so it is safe on hot paths.
|
|
49152
|
+
*/
|
|
49153
|
+
enableAutoScrollDepth() {
|
|
49154
|
+
if (this.scrollCleanups.length > 0) {
|
|
49155
|
+
return;
|
|
49156
|
+
}
|
|
49157
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
49158
|
+
return;
|
|
49159
|
+
}
|
|
49160
|
+
this.maxScrollDepth = 0;
|
|
49161
|
+
this.lastScrollReport = 0;
|
|
49162
|
+
const scrollHandler = () => {
|
|
49163
|
+
if (this.scrollTicking) {
|
|
49164
|
+
return;
|
|
49165
|
+
}
|
|
49166
|
+
this.scrollTicking = true;
|
|
49167
|
+
window.requestAnimationFrame(() => {
|
|
49168
|
+
const now = Date.now();
|
|
49169
|
+
if (now - this.lastScrollReport < SCROLL_DEPTH_THROTTLE_MS) {
|
|
49170
|
+
this.scrollTicking = false;
|
|
49171
|
+
return;
|
|
49172
|
+
}
|
|
49173
|
+
this.lastScrollReport = now;
|
|
49174
|
+
const depth = this.computeScrollDepth();
|
|
49175
|
+
if (depth > this.maxScrollDepth) {
|
|
49176
|
+
this.maxScrollDepth = depth;
|
|
49177
|
+
}
|
|
49178
|
+
this.scrollTicking = false;
|
|
49179
|
+
});
|
|
49180
|
+
};
|
|
49181
|
+
const unloadHandler = () => {
|
|
49182
|
+
this.flushScrollDepth(this.currentPageUrl());
|
|
49183
|
+
};
|
|
49184
|
+
window.addEventListener('scroll', scrollHandler, { passive: true });
|
|
49185
|
+
window.addEventListener('beforeunload', unloadHandler);
|
|
49186
|
+
window.addEventListener('pagehide', unloadHandler);
|
|
49187
|
+
this.scrollCleanups.push(() => {
|
|
49188
|
+
window.removeEventListener('scroll', scrollHandler);
|
|
49189
|
+
window.removeEventListener('beforeunload', unloadHandler);
|
|
49190
|
+
window.removeEventListener('pagehide', unloadHandler);
|
|
49191
|
+
});
|
|
49192
|
+
}
|
|
49193
|
+
/**
|
|
49194
|
+
* Disable scroll-depth tracking installed by `enableAutoScrollDepth`. Safe
|
|
49195
|
+
* to call when auto-scroll-depth was never enabled. Any accumulated depth
|
|
49196
|
+
* for the current page is dropped.
|
|
49197
|
+
*/
|
|
49198
|
+
disableAutoScrollDepth() {
|
|
49199
|
+
for (const cleanup of this.scrollCleanups) {
|
|
49200
|
+
cleanup();
|
|
49201
|
+
}
|
|
49202
|
+
this.scrollCleanups = [];
|
|
49203
|
+
this.maxScrollDepth = 0;
|
|
49204
|
+
this.scrollTicking = false;
|
|
49205
|
+
this.lastScrollReport = 0;
|
|
49206
|
+
}
|
|
49207
|
+
/**
|
|
49208
|
+
* Enable active engagement-time tracking. Counts time the tab is visible
|
|
49209
|
+
* and uses `visibilitychange` to exclude background time.
|
|
49210
|
+
*
|
|
49211
|
+
* Delivery follows Plausible's model rather than a single total at the
|
|
49212
|
+
* end of the visit: an `engagement_time` event is emitted at every natural
|
|
49213
|
+
* checkpoint — the tab going hidden, an SPA route change, and finally
|
|
49214
|
+
* `beforeunload`/`pagehide`. Unload is kept only as a best-effort last
|
|
49215
|
+
* flush; it is the least reliable moment to send anything (browsers
|
|
49216
|
+
* routinely cancel in-flight requests there, and `sendBeacon` cannot set
|
|
49217
|
+
* the `X-Appwrite-Project` header the endpoint requires), so it must never
|
|
49218
|
+
* be the only delivery.
|
|
49219
|
+
*
|
|
49220
|
+
* Each event carries a **delta** — the seconds accrued since the previous
|
|
49221
|
+
* flush, not a running total — so the values are additive per session and
|
|
49222
|
+
* a lost event costs only its own slice.
|
|
49223
|
+
*
|
|
49224
|
+
* There is deliberately no periodic ping. The cadence is driven by
|
|
49225
|
+
* navigation and tab switches, so request volume tracks what the visitor
|
|
49226
|
+
* actually does instead of multiplying with time on page.
|
|
49227
|
+
*/
|
|
49228
|
+
enableAutoEngagementTime() {
|
|
49229
|
+
if (this.engagementCleanups.length > 0) {
|
|
49230
|
+
return;
|
|
49231
|
+
}
|
|
49232
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
49233
|
+
return;
|
|
49234
|
+
}
|
|
49235
|
+
this.engagementAccumulatedMs = 0;
|
|
49236
|
+
// Do not start the clock for a tab that is already hidden (prerender,
|
|
49237
|
+
// background tab restore); `visibilitychange` starts it when it is
|
|
49238
|
+
// actually looked at.
|
|
49239
|
+
if (document.visibilityState !== 'hidden') {
|
|
49240
|
+
this.startEngagement();
|
|
49241
|
+
}
|
|
49242
|
+
const visibilityHandler = () => {
|
|
49243
|
+
if (document.visibilityState === 'hidden') {
|
|
49244
|
+
// Flush, don't just pause. The page is still fully alive here,
|
|
49245
|
+
// which makes this the most reliable delivery point in the
|
|
49246
|
+
// whole visit — and it is the same moment Plausible reports on.
|
|
49247
|
+
this.flushEngagement(this.currentPageUrl());
|
|
49248
|
+
}
|
|
49249
|
+
else if (document.visibilityState === 'visible') {
|
|
49250
|
+
this.startEngagement();
|
|
49251
|
+
}
|
|
49252
|
+
};
|
|
49253
|
+
const unloadHandler = () => {
|
|
49254
|
+
this.flushEngagement(this.currentPageUrl());
|
|
49255
|
+
};
|
|
49256
|
+
const pageshowHandler = (event) => {
|
|
49257
|
+
// When the page is restored from the back-forward cache the
|
|
49258
|
+
// engagement timer is in a stopped state (flushEngagement paused
|
|
49259
|
+
// it on pagehide and does not auto-restart). Kick off a fresh
|
|
49260
|
+
// engagementStart so bfcache dwell time is not billed as
|
|
49261
|
+
// engagement.
|
|
49262
|
+
if (event.persisted) {
|
|
49263
|
+
this.startEngagement();
|
|
49264
|
+
}
|
|
49265
|
+
};
|
|
49266
|
+
document.addEventListener('visibilitychange', visibilityHandler);
|
|
49267
|
+
window.addEventListener('beforeunload', unloadHandler);
|
|
49268
|
+
window.addEventListener('pagehide', unloadHandler);
|
|
49269
|
+
window.addEventListener('pageshow', pageshowHandler);
|
|
49270
|
+
this.engagementCleanups.push(() => {
|
|
49271
|
+
document.removeEventListener('visibilitychange', visibilityHandler);
|
|
49272
|
+
window.removeEventListener('beforeunload', unloadHandler);
|
|
49273
|
+
window.removeEventListener('pagehide', unloadHandler);
|
|
49274
|
+
window.removeEventListener('pageshow', pageshowHandler);
|
|
49275
|
+
});
|
|
49276
|
+
}
|
|
49277
|
+
/**
|
|
49278
|
+
* Disable engagement-time tracking installed by `enableAutoEngagementTime`.
|
|
49279
|
+
* Safe to call when auto-engagement was never enabled. Any accumulated
|
|
49280
|
+
* engagement time is dropped without being emitted.
|
|
49281
|
+
*/
|
|
49282
|
+
disableAutoEngagementTime() {
|
|
49283
|
+
for (const cleanup of this.engagementCleanups) {
|
|
49284
|
+
cleanup();
|
|
49285
|
+
}
|
|
49286
|
+
this.engagementCleanups = [];
|
|
49287
|
+
this.engagementActive = false;
|
|
49288
|
+
this.engagementAccumulatedMs = 0;
|
|
49289
|
+
this.engagementStart = 0;
|
|
49290
|
+
}
|
|
49291
|
+
/**
|
|
49292
|
+
* Merge the configured `propertyId` into an event's options. Returns the
|
|
49293
|
+
* caller's object untouched when no default is configured (or the event
|
|
49294
|
+
* already carries one), so emitters written against the pre-`propertyId`
|
|
49295
|
+
* shape keep receiving exactly what they received before.
|
|
49296
|
+
*/
|
|
49297
|
+
withPropertyId(options) {
|
|
49298
|
+
if (this.propertyId === undefined ||
|
|
49299
|
+
(options === null || options === void 0 ? void 0 : options.propertyId) !== undefined) {
|
|
49300
|
+
return options;
|
|
49301
|
+
}
|
|
49302
|
+
return Object.assign(Object.assign({}, (options !== null && options !== void 0 ? options : {})), { propertyId: this.propertyId });
|
|
49303
|
+
}
|
|
49304
|
+
canTrack() {
|
|
49305
|
+
if (!this.respectDoNotTrack) {
|
|
49306
|
+
return true;
|
|
49307
|
+
}
|
|
49308
|
+
if (typeof navigator === 'undefined') {
|
|
49309
|
+
return true;
|
|
49310
|
+
}
|
|
49311
|
+
return navigator.doNotTrack !== '1';
|
|
49312
|
+
}
|
|
49313
|
+
currentPageUrl() {
|
|
49314
|
+
if (typeof window === 'undefined' || !window.location) {
|
|
49315
|
+
return '';
|
|
49316
|
+
}
|
|
49317
|
+
return window.location.href;
|
|
49318
|
+
}
|
|
49319
|
+
findAnchor(target) {
|
|
49320
|
+
let node = target;
|
|
49321
|
+
while (node) {
|
|
49322
|
+
if (node.tagName === 'A') {
|
|
49323
|
+
return node;
|
|
49324
|
+
}
|
|
49325
|
+
node = node.parentNode;
|
|
49326
|
+
}
|
|
49327
|
+
return null;
|
|
49328
|
+
}
|
|
49329
|
+
parseUrl(href) {
|
|
49330
|
+
try {
|
|
49331
|
+
return new URL(href, window.location.href);
|
|
49332
|
+
}
|
|
49333
|
+
catch (_a) {
|
|
49334
|
+
return null;
|
|
49335
|
+
}
|
|
49336
|
+
}
|
|
49337
|
+
isExternal(target, includeSubdomains) {
|
|
49338
|
+
if (target.protocol !== 'http:' && target.protocol !== 'https:') {
|
|
49339
|
+
return false;
|
|
49340
|
+
}
|
|
49341
|
+
if (target.hostname === window.location.hostname) {
|
|
49342
|
+
return false;
|
|
49343
|
+
}
|
|
49344
|
+
if (includeSubdomains) {
|
|
49345
|
+
return true;
|
|
49346
|
+
}
|
|
49347
|
+
const root = this.rootDomain(window.location.hostname);
|
|
49348
|
+
return this.rootDomain(target.hostname) !== root;
|
|
49349
|
+
}
|
|
49350
|
+
rootDomain(hostname) {
|
|
49351
|
+
const parts = hostname.split('.');
|
|
49352
|
+
if (parts.length <= 2) {
|
|
49353
|
+
return hostname;
|
|
49354
|
+
}
|
|
49355
|
+
// Taking the last two labels is wrong wherever the registry sells names
|
|
49356
|
+
// one level down: `shop.example.co.uk` and `google.co.uk` both reduce to
|
|
49357
|
+
// `co.uk`, so every outbound click between two `.co.uk` sites looks
|
|
49358
|
+
// internal and is dropped. Take three labels after a known two-part
|
|
49359
|
+
// suffix instead.
|
|
49360
|
+
//
|
|
49361
|
+
// This is a heuristic, not the Public Suffix List — the full list is
|
|
49362
|
+
// orders of magnitude larger than this whole file, and a tracking
|
|
49363
|
+
// snippet cannot carry it. Sites on a suffix that is missing here can
|
|
49364
|
+
// pass `includeSubdomains: true` to treat every other host as outbound.
|
|
49365
|
+
const suffix = parts.slice(-2).join('.');
|
|
49366
|
+
if (parts.length > 2 && MULTI_PART_SUFFIXES.has(suffix)) {
|
|
49367
|
+
return parts.slice(-3).join('.');
|
|
49368
|
+
}
|
|
49369
|
+
return suffix;
|
|
49370
|
+
}
|
|
49371
|
+
computeScrollDepth() {
|
|
49372
|
+
const scrollTop = window.scrollY || document.documentElement.scrollTop;
|
|
49373
|
+
const viewport = window.innerHeight || document.documentElement.clientHeight;
|
|
49374
|
+
const total = document.documentElement.scrollHeight;
|
|
49375
|
+
if (total <= viewport) {
|
|
49376
|
+
return 100;
|
|
49377
|
+
}
|
|
49378
|
+
const depth = Math.round(((scrollTop + viewport) / total) * 100);
|
|
49379
|
+
return Math.max(0, Math.min(100, depth));
|
|
49380
|
+
}
|
|
49381
|
+
flushScrollDepth(url) {
|
|
49382
|
+
if (this.scrollCleanups.length === 0) {
|
|
49383
|
+
return;
|
|
49384
|
+
}
|
|
49385
|
+
if (this.maxScrollDepth <= 0) {
|
|
49386
|
+
return;
|
|
49387
|
+
}
|
|
49388
|
+
this.track('scroll_depth', {
|
|
49389
|
+
url,
|
|
49390
|
+
scrollDepth: this.maxScrollDepth,
|
|
49391
|
+
});
|
|
49392
|
+
this.maxScrollDepth = 0;
|
|
49393
|
+
}
|
|
49394
|
+
startEngagement() {
|
|
49395
|
+
if (this.engagementActive) {
|
|
49396
|
+
return;
|
|
49397
|
+
}
|
|
49398
|
+
this.engagementActive = true;
|
|
49399
|
+
this.engagementStart = Date.now();
|
|
49400
|
+
}
|
|
49401
|
+
pauseEngagement() {
|
|
49402
|
+
if (!this.engagementActive) {
|
|
49403
|
+
return;
|
|
49404
|
+
}
|
|
49405
|
+
this.engagementActive = false;
|
|
49406
|
+
this.engagementAccumulatedMs += Date.now() - this.engagementStart;
|
|
49407
|
+
}
|
|
49408
|
+
flushEngagement(url) {
|
|
49409
|
+
if (this.engagementCleanups.length === 0) {
|
|
49410
|
+
return;
|
|
49411
|
+
}
|
|
49412
|
+
this.pauseEngagement();
|
|
49413
|
+
// Deltas, not a running total: emit only what accrued since the last
|
|
49414
|
+
// flush. `floor` plus keeping the sub-second remainder in the
|
|
49415
|
+
// accumulator is what makes repeated flushes safe — nothing is emitted
|
|
49416
|
+
// twice, and a visit chopped into many short segments does not lose a
|
|
49417
|
+
// fraction of a second to rounding on every one of them.
|
|
49418
|
+
const seconds = Math.floor(this.engagementAccumulatedMs / 1000);
|
|
49419
|
+
if (seconds > 0) {
|
|
49420
|
+
// Deduct before emitting so a synchronous emitter that re-enters
|
|
49421
|
+
// (or throws) can never bill the same seconds again.
|
|
49422
|
+
this.engagementAccumulatedMs -= seconds * 1000;
|
|
49423
|
+
this.track('engagement_time', {
|
|
49424
|
+
url,
|
|
49425
|
+
engagementTime: seconds,
|
|
49426
|
+
});
|
|
49427
|
+
}
|
|
49428
|
+
// NOTE: intentionally do NOT call startEngagement() here. flushEngagement
|
|
49429
|
+
// runs on `pagehide`, which is also the last hook before the browser
|
|
49430
|
+
// may freeze the page into the back-forward cache. Auto-restarting
|
|
49431
|
+
// would snapshot engagementStart just before the freeze; the next
|
|
49432
|
+
// pauseEngagement (after bfcache restore) would then bill the entire
|
|
49433
|
+
// bfcache dwell as active engagement. Restart is driven by explicit
|
|
49434
|
+
// resume signals: `pageshow` (with `persisted === true`),
|
|
49435
|
+
// `visibilitychange` back to visible, or the SPA navigation flow in
|
|
49436
|
+
// `enableAutoPageviews`.
|
|
49437
|
+
}
|
|
49438
|
+
}
|
|
49439
|
+
|
|
46786
49440
|
/**
|
|
46787
49441
|
* Helper class to generate permission strings for resources.
|
|
46788
49442
|
*/
|
|
@@ -47489,6 +50143,68 @@ var OAuthProvider;
|
|
|
47489
50143
|
OAuthProvider["Zoom"] = "zoom";
|
|
47490
50144
|
})(OAuthProvider || (OAuthProvider = {}));
|
|
47491
50145
|
|
|
50146
|
+
var PlatformResourceType;
|
|
50147
|
+
(function (PlatformResourceType) {
|
|
50148
|
+
PlatformResourceType["Projects"] = "projects";
|
|
50149
|
+
PlatformResourceType["Organizations"] = "organizations";
|
|
50150
|
+
PlatformResourceType["Users"] = "users";
|
|
50151
|
+
PlatformResourceType["Memberships"] = "memberships";
|
|
50152
|
+
PlatformResourceType["Rules"] = "rules";
|
|
50153
|
+
PlatformResourceType["Keys"] = "keys";
|
|
50154
|
+
PlatformResourceType["Platforms"] = "platforms";
|
|
50155
|
+
PlatformResourceType["Webhooks"] = "webhooks";
|
|
50156
|
+
PlatformResourceType["Certificates"] = "certificates";
|
|
50157
|
+
})(PlatformResourceType || (PlatformResourceType = {}));
|
|
50158
|
+
|
|
50159
|
+
var ProjectResourceType;
|
|
50160
|
+
(function (ProjectResourceType) {
|
|
50161
|
+
ProjectResourceType["Users"] = "users";
|
|
50162
|
+
ProjectResourceType["Teams"] = "teams";
|
|
50163
|
+
ProjectResourceType["Memberships"] = "memberships";
|
|
50164
|
+
ProjectResourceType["Databases"] = "databases";
|
|
50165
|
+
ProjectResourceType["Buckets"] = "buckets";
|
|
50166
|
+
ProjectResourceType["Functions"] = "functions";
|
|
50167
|
+
ProjectResourceType["Sites"] = "sites";
|
|
50168
|
+
ProjectResourceType["Deployments"] = "deployments";
|
|
50169
|
+
ProjectResourceType["Topics"] = "topics";
|
|
50170
|
+
ProjectResourceType["Providers"] = "providers";
|
|
50171
|
+
ProjectResourceType["Messages"] = "messages";
|
|
50172
|
+
})(ProjectResourceType || (ProjectResourceType = {}));
|
|
50173
|
+
|
|
50174
|
+
var AnalyticsInterval;
|
|
50175
|
+
(function (AnalyticsInterval) {
|
|
50176
|
+
AnalyticsInterval["OneHour"] = "1h";
|
|
50177
|
+
AnalyticsInterval["OneDay"] = "1d";
|
|
50178
|
+
AnalyticsInterval["OneWeek"] = "1w";
|
|
50179
|
+
AnalyticsInterval["OneMonth"] = "1m";
|
|
50180
|
+
})(AnalyticsInterval || (AnalyticsInterval = {}));
|
|
50181
|
+
|
|
50182
|
+
var AnalyticsDimension;
|
|
50183
|
+
(function (AnalyticsDimension) {
|
|
50184
|
+
AnalyticsDimension["Country"] = "country";
|
|
50185
|
+
AnalyticsDimension["Region"] = "region";
|
|
50186
|
+
AnalyticsDimension["City"] = "city";
|
|
50187
|
+
AnalyticsDimension["Browser"] = "browser";
|
|
50188
|
+
AnalyticsDimension["OperatingSystem"] = "operatingSystem";
|
|
50189
|
+
AnalyticsDimension["Device"] = "device";
|
|
50190
|
+
AnalyticsDimension["ScreenSize"] = "screenSize";
|
|
50191
|
+
AnalyticsDimension["ReferrerSource"] = "referrerSource";
|
|
50192
|
+
AnalyticsDimension["Channel"] = "channel";
|
|
50193
|
+
AnalyticsDimension["UtmSource"] = "utmSource";
|
|
50194
|
+
AnalyticsDimension["UtmMedium"] = "utmMedium";
|
|
50195
|
+
AnalyticsDimension["UtmCampaign"] = "utmCampaign";
|
|
50196
|
+
AnalyticsDimension["UtmContent"] = "utmContent";
|
|
50197
|
+
AnalyticsDimension["UtmTerm"] = "utmTerm";
|
|
50198
|
+
AnalyticsDimension["Page"] = "page";
|
|
50199
|
+
AnalyticsDimension["Hostname"] = "hostname";
|
|
50200
|
+
AnalyticsDimension["EntryPage"] = "entryPage";
|
|
50201
|
+
AnalyticsDimension["ExitPage"] = "exitPage";
|
|
50202
|
+
AnalyticsDimension["TrafficType"] = "trafficType";
|
|
50203
|
+
AnalyticsDimension["BotName"] = "botName";
|
|
50204
|
+
AnalyticsDimension["BotCategory"] = "botCategory";
|
|
50205
|
+
AnalyticsDimension["EventName"] = "eventName";
|
|
50206
|
+
})(AnalyticsDimension || (AnalyticsDimension = {}));
|
|
50207
|
+
|
|
47492
50208
|
var Browser;
|
|
47493
50209
|
(function (Browser) {
|
|
47494
50210
|
Browser["AvantBrowser"] = "aa";
|
|
@@ -48304,6 +51020,14 @@ var QuerySuggestionResource;
|
|
|
48304
51020
|
QuerySuggestionResource["ResourceTokens"] = "resourcetokens";
|
|
48305
51021
|
QuerySuggestionResource["Transactions"] = "transactions";
|
|
48306
51022
|
QuerySuggestionResource["TransactionLogs"] = "transactionlogs";
|
|
51023
|
+
QuerySuggestionResource["Videos"] = "videos";
|
|
51024
|
+
QuerySuggestionResource["VideosPreviews"] = "videos_previews";
|
|
51025
|
+
QuerySuggestionResource["VideosRenditions"] = "videos_renditions";
|
|
51026
|
+
QuerySuggestionResource["VideosRenditionsSegments"] = "videos_renditions_segments";
|
|
51027
|
+
QuerySuggestionResource["VideosProfiles"] = "videos_profiles";
|
|
51028
|
+
QuerySuggestionResource["VideosSubtitles"] = "videos_subtitles";
|
|
51029
|
+
QuerySuggestionResource["VideosSubtitlesSegments"] = "videos_subtitles_segments";
|
|
51030
|
+
QuerySuggestionResource["AnalyticsProperties"] = "analyticsproperties";
|
|
48307
51031
|
QuerySuggestionResource["DedicatedDatabases"] = "dedicateddatabases";
|
|
48308
51032
|
QuerySuggestionResource["DedicatedDatabaseConfigs"] = "dedicateddatabaseconfigs";
|
|
48309
51033
|
QuerySuggestionResource["DedicatedDatabaseRuntimes"] = "dedicateddatabaseruntimes";
|
|
@@ -48726,6 +51450,8 @@ var ProjectKeyScopes;
|
|
|
48726
51450
|
ProjectKeyScopes["ReportsWrite"] = "reports.write";
|
|
48727
51451
|
ProjectKeyScopes["PresencesRead"] = "presences.read";
|
|
48728
51452
|
ProjectKeyScopes["PresencesWrite"] = "presences.write";
|
|
51453
|
+
ProjectKeyScopes["VideosRead"] = "videos.read";
|
|
51454
|
+
ProjectKeyScopes["VideosWrite"] = "videos.write";
|
|
48729
51455
|
ProjectKeyScopes["DedicatedDatabasesExecute"] = "dedicatedDatabases.execute";
|
|
48730
51456
|
ProjectKeyScopes["BackupsPoliciesRead"] = "backups.policies.read";
|
|
48731
51457
|
ProjectKeyScopes["BackupsPoliciesWrite"] = "backups.policies.write";
|
|
@@ -48744,6 +51470,8 @@ var ProjectKeyScopes;
|
|
|
48744
51470
|
ProjectKeyScopes["Oauth2Read"] = "oauth2.read";
|
|
48745
51471
|
ProjectKeyScopes["Oauth2Write"] = "oauth2.write";
|
|
48746
51472
|
ProjectKeyScopes["Oauth2Introspect"] = "oauth2.introspect";
|
|
51473
|
+
ProjectKeyScopes["AnalyticsRead"] = "analytics.read";
|
|
51474
|
+
ProjectKeyScopes["AnalyticsWrite"] = "analytics.write";
|
|
48747
51475
|
})(ProjectKeyScopes || (ProjectKeyScopes = {}));
|
|
48748
51476
|
|
|
48749
51477
|
var FunctionTemplateUseCase;
|
|
@@ -48993,6 +51721,7 @@ var ProjectAuthMethodId;
|
|
|
48993
51721
|
ProjectAuthMethodId["Invites"] = "invites";
|
|
48994
51722
|
ProjectAuthMethodId["Jwt"] = "jwt";
|
|
48995
51723
|
ProjectAuthMethodId["Phone"] = "phone";
|
|
51724
|
+
ProjectAuthMethodId["Passkey"] = "passkey";
|
|
48996
51725
|
})(ProjectAuthMethodId || (ProjectAuthMethodId = {}));
|
|
48997
51726
|
|
|
48998
51727
|
var ProjectOAuth2Auth0Prompt;
|
|
@@ -49134,6 +51863,7 @@ var ProjectPolicyId;
|
|
|
49134
51863
|
ProjectPolicyId["Denydisposableemail"] = "deny-disposable-email";
|
|
49135
51864
|
ProjectPolicyId["Denyfreeemail"] = "deny-free-email";
|
|
49136
51865
|
ProjectPolicyId["Denycorporateemail"] = "deny-corporate-email";
|
|
51866
|
+
ProjectPolicyId["Passkey"] = "passkey";
|
|
49137
51867
|
})(ProjectPolicyId || (ProjectPolicyId = {}));
|
|
49138
51868
|
|
|
49139
51869
|
var ProjectProtocolId;
|
|
@@ -49378,6 +52108,9 @@ var TablesDBIndexType;
|
|
|
49378
52108
|
|
|
49379
52109
|
var UsageEventMetric;
|
|
49380
52110
|
(function (UsageEventMetric) {
|
|
52111
|
+
UsageEventMetric["AnalyticsEvents"] = "analytics.events";
|
|
52112
|
+
UsageEventMetric["AnalyticsPageviews"] = "analytics.pageviews";
|
|
52113
|
+
UsageEventMetric["AnalyticsBotsEvents"] = "analytics.bots.events";
|
|
49381
52114
|
UsageEventMetric["NetworkRequests"] = "network.requests";
|
|
49382
52115
|
UsageEventMetric["NetworkInbound"] = "network.inbound";
|
|
49383
52116
|
UsageEventMetric["NetworkOutbound"] = "network.outbound";
|
|
@@ -49495,6 +52228,7 @@ var UsageOrderDirection;
|
|
|
49495
52228
|
|
|
49496
52229
|
var UsageGaugeMetric;
|
|
49497
52230
|
(function (UsageGaugeMetric) {
|
|
52231
|
+
UsageGaugeMetric["AnalyticsProperties"] = "analytics.properties";
|
|
49498
52232
|
UsageGaugeMetric["Teams"] = "teams";
|
|
49499
52233
|
UsageGaugeMetric["Users"] = "users";
|
|
49500
52234
|
UsageGaugeMetric["Messages"] = "messages";
|
|
@@ -49592,6 +52326,24 @@ var VectorsDBIndexType;
|
|
|
49592
52326
|
VectorsDBIndexType["Unique"] = "unique";
|
|
49593
52327
|
})(VectorsDBIndexType || (VectorsDBIndexType = {}));
|
|
49594
52328
|
|
|
52329
|
+
var VideoOutput;
|
|
52330
|
+
(function (VideoOutput) {
|
|
52331
|
+
VideoOutput["Hls"] = "hls";
|
|
52332
|
+
VideoOutput["Dash"] = "dash";
|
|
52333
|
+
VideoOutput["Cmaf"] = "cmaf";
|
|
52334
|
+
})(VideoOutput || (VideoOutput = {}));
|
|
52335
|
+
|
|
52336
|
+
var VideoRenditionStatus;
|
|
52337
|
+
(function (VideoRenditionStatus) {
|
|
52338
|
+
VideoRenditionStatus["Pending"] = "pending";
|
|
52339
|
+
VideoRenditionStatus["Started"] = "started";
|
|
52340
|
+
VideoRenditionStatus["Ended"] = "ended";
|
|
52341
|
+
VideoRenditionStatus["Uploading"] = "uploading";
|
|
52342
|
+
VideoRenditionStatus["Ready"] = "ready";
|
|
52343
|
+
VideoRenditionStatus["Error"] = "error";
|
|
52344
|
+
VideoRenditionStatus["Aborted"] = "aborted";
|
|
52345
|
+
})(VideoRenditionStatus || (VideoRenditionStatus = {}));
|
|
52346
|
+
|
|
49595
52347
|
var DatabaseType;
|
|
49596
52348
|
(function (DatabaseType) {
|
|
49597
52349
|
DatabaseType["Legacy"] = "legacy";
|
|
@@ -49770,6 +52522,7 @@ var ProxyRuleDeploymentResourceType;
|
|
|
49770
52522
|
(function (ProxyRuleDeploymentResourceType) {
|
|
49771
52523
|
ProxyRuleDeploymentResourceType["Function"] = "function";
|
|
49772
52524
|
ProxyRuleDeploymentResourceType["Site"] = "site";
|
|
52525
|
+
ProxyRuleDeploymentResourceType["DedicatedDatabase"] = "dedicatedDatabase";
|
|
49773
52526
|
})(ProxyRuleDeploymentResourceType || (ProxyRuleDeploymentResourceType = {}));
|
|
49774
52527
|
|
|
49775
52528
|
var ProxyRuleStatus;
|
|
@@ -49825,5 +52578,5 @@ var WafRuleAction;
|
|
|
49825
52578
|
WafRuleAction["Redirect"] = "redirect";
|
|
49826
52579
|
})(WafRuleAction || (WafRuleAction = {}));
|
|
49827
52580
|
|
|
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 };
|
|
52581
|
+
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
52582
|
//# sourceMappingURL=sdk.js.map
|