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