@appwrite.io/console 18.2.0 → 18.3.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/cjs/sdk.js +3115 -373
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +3112 -374
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +3115 -373
- package/package.json +1 -1
- package/types/enums/analytics-dimension.d.ts +24 -0
- package/types/enums/analytics-interval.d.ts +6 -0
- package/types/enums/platform-resource-type.d.ts +11 -0
- package/types/enums/project-auth-method-id.d.ts +2 -1
- package/types/enums/project-key-scopes.d.ts +5 -1
- package/types/enums/project-policy-id.d.ts +2 -1
- package/types/enums/project-resource-type.d.ts +13 -0
- package/types/enums/proxy-rule-deployment-resource-type.d.ts +2 -1
- package/types/enums/query-suggestion-resource.d.ts +8 -0
- package/types/enums/usage-event-metric.d.ts +3 -0
- package/types/enums/usage-gauge-metric.d.ts +1 -0
- package/types/enums/video-output.d.ts +5 -0
- package/types/enums/video-rendition-status.d.ts +9 -0
- package/types/index.d.ts +11 -0
- package/types/models.d.ts +591 -55
- package/types/services/account.d.ts +158 -0
- package/types/services/admin.d.ts +80 -0
- package/types/services/analytics-tracking.d.ts +211 -0
- package/types/services/analytics.d.ts +254 -0
- package/types/services/project.d.ts +30 -8
- package/types/services/push.d.ts +2 -2
- package/types/services/users.d.ts +69 -0
- package/types/services/videos.d.ts +860 -0
- package/types/service.d.ts +0 -11
package/dist/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.3.0-rc.2',
|
|
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();
|
|
@@ -15531,7 +16244,7 @@ class Functions {
|
|
|
15531
16244
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
15532
16245
|
apiPayload['project'] = this.client.config.project;
|
|
15533
16246
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
15534
|
-
for (const [key, value] of Object.entries(
|
|
16247
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
15535
16248
|
uri.searchParams.append(key, value);
|
|
15536
16249
|
}
|
|
15537
16250
|
return uri.toString();
|
|
@@ -26170,7 +26883,7 @@ class Organizations {
|
|
|
26170
26883
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
26171
26884
|
apiPayload['project'] = this.client.config.project;
|
|
26172
26885
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
26173
|
-
for (const [key, value] of Object.entries(
|
|
26886
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
26174
26887
|
uri.searchParams.append(key, value);
|
|
26175
26888
|
}
|
|
26176
26889
|
return uri.toString();
|
|
@@ -26277,7 +26990,7 @@ class Organizations {
|
|
|
26277
26990
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
26278
26991
|
apiPayload['project'] = this.client.config.project;
|
|
26279
26992
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
26280
|
-
for (const [key, value] of Object.entries(
|
|
26993
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
26281
26994
|
uri.searchParams.append(key, value);
|
|
26282
26995
|
}
|
|
26283
26996
|
return uri.toString();
|
|
@@ -31773,6 +32486,38 @@ class Project {
|
|
|
31773
32486
|
};
|
|
31774
32487
|
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
31775
32488
|
}
|
|
32489
|
+
updatePasskeyPolicy(paramsOrFirst, ...rest) {
|
|
32490
|
+
let params;
|
|
32491
|
+
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
32492
|
+
(paramsOrFirst &&
|
|
32493
|
+
typeof paramsOrFirst === 'object' &&
|
|
32494
|
+
!Array.isArray(paramsOrFirst))) {
|
|
32495
|
+
params = (paramsOrFirst || {});
|
|
32496
|
+
}
|
|
32497
|
+
else {
|
|
32498
|
+
params = {
|
|
32499
|
+
rpId: paramsOrFirst,
|
|
32500
|
+
origins: rest[0],
|
|
32501
|
+
};
|
|
32502
|
+
}
|
|
32503
|
+
const rpId = params.rpId;
|
|
32504
|
+
const origins = params.origins;
|
|
32505
|
+
const apiPath = '/project/policies/passkey';
|
|
32506
|
+
const apiPayload = {};
|
|
32507
|
+
if (typeof rpId !== 'undefined') {
|
|
32508
|
+
apiPayload['rpId'] = rpId;
|
|
32509
|
+
}
|
|
32510
|
+
if (typeof origins !== 'undefined') {
|
|
32511
|
+
apiPayload['origins'] = origins;
|
|
32512
|
+
}
|
|
32513
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
32514
|
+
const apiHeaders = {
|
|
32515
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
32516
|
+
'content-type': 'application/json',
|
|
32517
|
+
accept: 'application/json',
|
|
32518
|
+
};
|
|
32519
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
32520
|
+
}
|
|
31776
32521
|
updatePasswordDictionaryPolicy(paramsOrFirst) {
|
|
31777
32522
|
let params;
|
|
31778
32523
|
if (paramsOrFirst &&
|
|
@@ -34461,7 +35206,7 @@ class Sites {
|
|
|
34461
35206
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
34462
35207
|
apiPayload['project'] = this.client.config.project;
|
|
34463
35208
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
34464
|
-
for (const [key, value] of Object.entries(
|
|
35209
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
34465
35210
|
uri.searchParams.append(key, value);
|
|
34466
35211
|
}
|
|
34467
35212
|
return uri.toString();
|
|
@@ -35292,7 +36037,7 @@ class Storage {
|
|
|
35292
36037
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
35293
36038
|
apiPayload['project'] = this.client.config.project;
|
|
35294
36039
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
35295
|
-
for (const [key, value] of Object.entries(
|
|
36040
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
35296
36041
|
uri.searchParams.append(key, value);
|
|
35297
36042
|
}
|
|
35298
36043
|
return uri.toString();
|
|
@@ -35385,7 +36130,7 @@ class Storage {
|
|
|
35385
36130
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
35386
36131
|
apiPayload['project'] = this.client.config.project;
|
|
35387
36132
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
35388
|
-
for (const [key, value] of Object.entries(
|
|
36133
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
35389
36134
|
uri.searchParams.append(key, value);
|
|
35390
36135
|
}
|
|
35391
36136
|
return uri.toString();
|
|
@@ -35423,7 +36168,7 @@ class Storage {
|
|
|
35423
36168
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
35424
36169
|
apiPayload['project'] = this.client.config.project;
|
|
35425
36170
|
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
35426
|
-
for (const [key, value] of Object.entries(
|
|
36171
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
35427
36172
|
uri.searchParams.append(key, value);
|
|
35428
36173
|
}
|
|
35429
36174
|
return uri.toString();
|
|
@@ -41734,6 +42479,106 @@ class Users {
|
|
|
41734
42479
|
};
|
|
41735
42480
|
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
41736
42481
|
}
|
|
42482
|
+
listPasskeys(paramsOrFirst, ...rest) {
|
|
42483
|
+
let params;
|
|
42484
|
+
if (paramsOrFirst &&
|
|
42485
|
+
typeof paramsOrFirst === 'object' &&
|
|
42486
|
+
!Array.isArray(paramsOrFirst)) {
|
|
42487
|
+
params = (paramsOrFirst || {});
|
|
42488
|
+
}
|
|
42489
|
+
else {
|
|
42490
|
+
params = {
|
|
42491
|
+
userId: paramsOrFirst,
|
|
42492
|
+
queries: rest[0],
|
|
42493
|
+
total: rest[1],
|
|
42494
|
+
};
|
|
42495
|
+
}
|
|
42496
|
+
const userId = params.userId;
|
|
42497
|
+
const queries = params.queries;
|
|
42498
|
+
const total = params.total;
|
|
42499
|
+
if (typeof userId === 'undefined' || userId === '') {
|
|
42500
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
42501
|
+
}
|
|
42502
|
+
const apiPath = '/users/{userId}/passkeys'.replace('{userId}', encodeURIComponent(String(userId)));
|
|
42503
|
+
const apiPayload = {};
|
|
42504
|
+
if (typeof queries !== 'undefined') {
|
|
42505
|
+
apiPayload['queries'] = queries;
|
|
42506
|
+
}
|
|
42507
|
+
if (typeof total !== 'undefined') {
|
|
42508
|
+
apiPayload['total'] = total;
|
|
42509
|
+
}
|
|
42510
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
42511
|
+
const apiHeaders = {
|
|
42512
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
42513
|
+
accept: 'application/json',
|
|
42514
|
+
};
|
|
42515
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
42516
|
+
}
|
|
42517
|
+
getPasskey(paramsOrFirst, ...rest) {
|
|
42518
|
+
let params;
|
|
42519
|
+
if (paramsOrFirst &&
|
|
42520
|
+
typeof paramsOrFirst === 'object' &&
|
|
42521
|
+
!Array.isArray(paramsOrFirst)) {
|
|
42522
|
+
params = (paramsOrFirst || {});
|
|
42523
|
+
}
|
|
42524
|
+
else {
|
|
42525
|
+
params = {
|
|
42526
|
+
userId: paramsOrFirst,
|
|
42527
|
+
passkeyId: rest[0],
|
|
42528
|
+
};
|
|
42529
|
+
}
|
|
42530
|
+
const userId = params.userId;
|
|
42531
|
+
const passkeyId = params.passkeyId;
|
|
42532
|
+
if (typeof userId === 'undefined' || userId === '') {
|
|
42533
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
42534
|
+
}
|
|
42535
|
+
if (typeof passkeyId === 'undefined' || passkeyId === '') {
|
|
42536
|
+
throw new AppwriteException('Missing required parameter: "passkeyId"');
|
|
42537
|
+
}
|
|
42538
|
+
const apiPath = '/users/{userId}/passkeys/{passkeyId}'
|
|
42539
|
+
.replace('{userId}', encodeURIComponent(String(userId)))
|
|
42540
|
+
.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
|
|
42541
|
+
const apiPayload = {};
|
|
42542
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
42543
|
+
const apiHeaders = {
|
|
42544
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
42545
|
+
accept: 'application/json',
|
|
42546
|
+
};
|
|
42547
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
42548
|
+
}
|
|
42549
|
+
deletePasskey(paramsOrFirst, ...rest) {
|
|
42550
|
+
let params;
|
|
42551
|
+
if (paramsOrFirst &&
|
|
42552
|
+
typeof paramsOrFirst === 'object' &&
|
|
42553
|
+
!Array.isArray(paramsOrFirst)) {
|
|
42554
|
+
params = (paramsOrFirst || {});
|
|
42555
|
+
}
|
|
42556
|
+
else {
|
|
42557
|
+
params = {
|
|
42558
|
+
userId: paramsOrFirst,
|
|
42559
|
+
passkeyId: rest[0],
|
|
42560
|
+
};
|
|
42561
|
+
}
|
|
42562
|
+
const userId = params.userId;
|
|
42563
|
+
const passkeyId = params.passkeyId;
|
|
42564
|
+
if (typeof userId === 'undefined' || userId === '') {
|
|
42565
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
42566
|
+
}
|
|
42567
|
+
if (typeof passkeyId === 'undefined' || passkeyId === '') {
|
|
42568
|
+
throw new AppwriteException('Missing required parameter: "passkeyId"');
|
|
42569
|
+
}
|
|
42570
|
+
const apiPath = '/users/{userId}/passkeys/{passkeyId}'
|
|
42571
|
+
.replace('{userId}', encodeURIComponent(String(userId)))
|
|
42572
|
+
.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
|
|
42573
|
+
const apiPayload = {};
|
|
42574
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
42575
|
+
const apiHeaders = {
|
|
42576
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
42577
|
+
'content-type': 'application/json',
|
|
42578
|
+
accept: 'application/json',
|
|
42579
|
+
};
|
|
42580
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
42581
|
+
}
|
|
41737
42582
|
updatePassword(paramsOrFirst, ...rest) {
|
|
41738
42583
|
let params;
|
|
41739
42584
|
if (paramsOrFirst &&
|
|
@@ -44240,11 +45085,11 @@ class VectorsDB {
|
|
|
44240
45085
|
}
|
|
44241
45086
|
}
|
|
44242
45087
|
|
|
44243
|
-
class
|
|
45088
|
+
class Videos {
|
|
44244
45089
|
constructor(client) {
|
|
44245
45090
|
this.client = client;
|
|
44246
45091
|
}
|
|
44247
|
-
|
|
45092
|
+
list(paramsOrFirst, ...rest) {
|
|
44248
45093
|
let params;
|
|
44249
45094
|
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
44250
45095
|
(paramsOrFirst &&
|
|
@@ -44262,7 +45107,7 @@ class Waf {
|
|
|
44262
45107
|
const queries = params.queries;
|
|
44263
45108
|
const search = params.search;
|
|
44264
45109
|
const total = params.total;
|
|
44265
|
-
const apiPath = '/
|
|
45110
|
+
const apiPath = '/videos';
|
|
44266
45111
|
const apiPayload = {};
|
|
44267
45112
|
if (typeof queries !== 'undefined') {
|
|
44268
45113
|
apiPayload['queries'] = queries;
|
|
@@ -44280,7 +45125,7 @@ class Waf {
|
|
|
44280
45125
|
};
|
|
44281
45126
|
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
44282
45127
|
}
|
|
44283
|
-
|
|
45128
|
+
create(paramsOrFirst, ...rest) {
|
|
44284
45129
|
let params;
|
|
44285
45130
|
if (paramsOrFirst &&
|
|
44286
45131
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -44289,59 +45134,31 @@ class Waf {
|
|
|
44289
45134
|
}
|
|
44290
45135
|
else {
|
|
44291
45136
|
params = {
|
|
44292
|
-
|
|
44293
|
-
|
|
45137
|
+
bucketId: paramsOrFirst,
|
|
45138
|
+
fileId: rest[0],
|
|
44294
45139
|
name: rest[1],
|
|
44295
|
-
resourceId: rest[2],
|
|
44296
|
-
description: rest[3],
|
|
44297
|
-
priority: rest[4],
|
|
44298
|
-
enabled: rest[5],
|
|
44299
|
-
conditions: rest[6],
|
|
44300
45140
|
};
|
|
44301
45141
|
}
|
|
44302
|
-
const
|
|
44303
|
-
const
|
|
45142
|
+
const bucketId = params.bucketId;
|
|
45143
|
+
const fileId = params.fileId;
|
|
44304
45144
|
const name = params.name;
|
|
44305
|
-
|
|
44306
|
-
|
|
44307
|
-
const priority = params.priority;
|
|
44308
|
-
const enabled = params.enabled;
|
|
44309
|
-
const conditions = params.conditions;
|
|
44310
|
-
if (typeof ruleId === 'undefined') {
|
|
44311
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
44312
|
-
}
|
|
44313
|
-
if (typeof resourceType === 'undefined') {
|
|
44314
|
-
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
45145
|
+
if (typeof bucketId === 'undefined') {
|
|
45146
|
+
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
44315
45147
|
}
|
|
44316
|
-
if (typeof
|
|
44317
|
-
throw new AppwriteException('Missing required parameter: "
|
|
45148
|
+
if (typeof fileId === 'undefined') {
|
|
45149
|
+
throw new AppwriteException('Missing required parameter: "fileId"');
|
|
44318
45150
|
}
|
|
44319
|
-
const apiPath = '/
|
|
45151
|
+
const apiPath = '/videos';
|
|
44320
45152
|
const apiPayload = {};
|
|
44321
|
-
if (typeof
|
|
44322
|
-
apiPayload['
|
|
44323
|
-
}
|
|
44324
|
-
if (typeof resourceType !== 'undefined') {
|
|
44325
|
-
apiPayload['resourceType'] = resourceType;
|
|
45153
|
+
if (typeof bucketId !== 'undefined') {
|
|
45154
|
+
apiPayload['bucketId'] = bucketId;
|
|
44326
45155
|
}
|
|
44327
|
-
if (typeof
|
|
44328
|
-
apiPayload['
|
|
45156
|
+
if (typeof fileId !== 'undefined') {
|
|
45157
|
+
apiPayload['fileId'] = fileId;
|
|
44329
45158
|
}
|
|
44330
45159
|
if (typeof name !== 'undefined') {
|
|
44331
45160
|
apiPayload['name'] = name;
|
|
44332
45161
|
}
|
|
44333
|
-
if (typeof description !== 'undefined') {
|
|
44334
|
-
apiPayload['description'] = description;
|
|
44335
|
-
}
|
|
44336
|
-
if (typeof priority !== 'undefined') {
|
|
44337
|
-
apiPayload['priority'] = priority;
|
|
44338
|
-
}
|
|
44339
|
-
if (typeof enabled !== 'undefined') {
|
|
44340
|
-
apiPayload['enabled'] = enabled;
|
|
44341
|
-
}
|
|
44342
|
-
if (typeof conditions !== 'undefined') {
|
|
44343
|
-
apiPayload['conditions'] = conditions;
|
|
44344
|
-
}
|
|
44345
45162
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
44346
45163
|
const apiHeaders = {
|
|
44347
45164
|
'X-Appwrite-Project': this.client.config.project,
|
|
@@ -44350,68 +45167,33 @@ class Waf {
|
|
|
44350
45167
|
};
|
|
44351
45168
|
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
44352
45169
|
}
|
|
44353
|
-
|
|
45170
|
+
listProfiles(paramsOrFirst) {
|
|
44354
45171
|
let params;
|
|
44355
|
-
if (paramsOrFirst
|
|
44356
|
-
|
|
44357
|
-
|
|
45172
|
+
if (typeof paramsOrFirst === 'undefined' ||
|
|
45173
|
+
(paramsOrFirst &&
|
|
45174
|
+
typeof paramsOrFirst === 'object' &&
|
|
45175
|
+
!Array.isArray(paramsOrFirst))) {
|
|
44358
45176
|
params = (paramsOrFirst || {});
|
|
44359
45177
|
}
|
|
44360
45178
|
else {
|
|
44361
45179
|
params = {
|
|
44362
|
-
|
|
44363
|
-
resourceType: rest[0],
|
|
44364
|
-
resourceId: rest[1],
|
|
44365
|
-
name: rest[2],
|
|
44366
|
-
description: rest[3],
|
|
44367
|
-
priority: rest[4],
|
|
44368
|
-
enabled: rest[5],
|
|
44369
|
-
conditions: rest[6],
|
|
45180
|
+
search: paramsOrFirst,
|
|
44370
45181
|
};
|
|
44371
45182
|
}
|
|
44372
|
-
const
|
|
44373
|
-
const
|
|
44374
|
-
const resourceId = params.resourceId;
|
|
44375
|
-
const name = params.name;
|
|
44376
|
-
const description = params.description;
|
|
44377
|
-
const priority = params.priority;
|
|
44378
|
-
const enabled = params.enabled;
|
|
44379
|
-
const conditions = params.conditions;
|
|
44380
|
-
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
44381
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
44382
|
-
}
|
|
44383
|
-
const apiPath = '/waf/rules/bypass/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
|
|
45183
|
+
const search = params.search;
|
|
45184
|
+
const apiPath = '/videos/profiles';
|
|
44384
45185
|
const apiPayload = {};
|
|
44385
|
-
if (typeof
|
|
44386
|
-
apiPayload['
|
|
44387
|
-
}
|
|
44388
|
-
if (typeof resourceId !== 'undefined') {
|
|
44389
|
-
apiPayload['resourceId'] = resourceId;
|
|
44390
|
-
}
|
|
44391
|
-
if (typeof name !== 'undefined') {
|
|
44392
|
-
apiPayload['name'] = name;
|
|
44393
|
-
}
|
|
44394
|
-
if (typeof description !== 'undefined') {
|
|
44395
|
-
apiPayload['description'] = description;
|
|
44396
|
-
}
|
|
44397
|
-
if (typeof priority !== 'undefined') {
|
|
44398
|
-
apiPayload['priority'] = priority;
|
|
44399
|
-
}
|
|
44400
|
-
if (typeof enabled !== 'undefined') {
|
|
44401
|
-
apiPayload['enabled'] = enabled;
|
|
44402
|
-
}
|
|
44403
|
-
if (typeof conditions !== 'undefined') {
|
|
44404
|
-
apiPayload['conditions'] = conditions;
|
|
45186
|
+
if (typeof search !== 'undefined') {
|
|
45187
|
+
apiPayload['search'] = search;
|
|
44405
45188
|
}
|
|
44406
45189
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
44407
45190
|
const apiHeaders = {
|
|
44408
45191
|
'X-Appwrite-Project': this.client.config.project,
|
|
44409
|
-
'content-type': 'application/json',
|
|
44410
45192
|
accept: 'application/json',
|
|
44411
45193
|
};
|
|
44412
|
-
return this.client.call('
|
|
45194
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
44413
45195
|
}
|
|
44414
|
-
|
|
45196
|
+
createProfile(paramsOrFirst, ...rest) {
|
|
44415
45197
|
let params;
|
|
44416
45198
|
if (paramsOrFirst &&
|
|
44417
45199
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -44420,73 +45202,49 @@ class Waf {
|
|
|
44420
45202
|
}
|
|
44421
45203
|
else {
|
|
44422
45204
|
params = {
|
|
44423
|
-
|
|
44424
|
-
|
|
44425
|
-
|
|
44426
|
-
|
|
44427
|
-
|
|
44428
|
-
challengeType: rest[4],
|
|
44429
|
-
priority: rest[5],
|
|
44430
|
-
enabled: rest[6],
|
|
44431
|
-
conditions: rest[7],
|
|
44432
|
-
difficulty: rest[8],
|
|
44433
|
-
ttl: rest[9],
|
|
45205
|
+
name: paramsOrFirst,
|
|
45206
|
+
videoBitRate: rest[0],
|
|
45207
|
+
audioBitRate: rest[1],
|
|
45208
|
+
width: rest[2],
|
|
45209
|
+
height: rest[3],
|
|
44434
45210
|
};
|
|
44435
45211
|
}
|
|
44436
|
-
const ruleId = params.ruleId;
|
|
44437
|
-
const resourceType = params.resourceType;
|
|
44438
45212
|
const name = params.name;
|
|
44439
|
-
const
|
|
44440
|
-
const
|
|
44441
|
-
const
|
|
44442
|
-
const
|
|
44443
|
-
const enabled = params.enabled;
|
|
44444
|
-
const conditions = params.conditions;
|
|
44445
|
-
const difficulty = params.difficulty;
|
|
44446
|
-
const ttl = params.ttl;
|
|
44447
|
-
if (typeof ruleId === 'undefined') {
|
|
44448
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
44449
|
-
}
|
|
44450
|
-
if (typeof resourceType === 'undefined') {
|
|
44451
|
-
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
44452
|
-
}
|
|
45213
|
+
const videoBitRate = params.videoBitRate;
|
|
45214
|
+
const audioBitRate = params.audioBitRate;
|
|
45215
|
+
const width = params.width;
|
|
45216
|
+
const height = params.height;
|
|
44453
45217
|
if (typeof name === 'undefined') {
|
|
44454
45218
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
44455
45219
|
}
|
|
44456
|
-
|
|
44457
|
-
|
|
44458
|
-
if (typeof ruleId !== 'undefined') {
|
|
44459
|
-
apiPayload['ruleId'] = ruleId;
|
|
45220
|
+
if (typeof videoBitRate === 'undefined') {
|
|
45221
|
+
throw new AppwriteException('Missing required parameter: "videoBitRate"');
|
|
44460
45222
|
}
|
|
44461
|
-
if (typeof
|
|
44462
|
-
|
|
45223
|
+
if (typeof audioBitRate === 'undefined') {
|
|
45224
|
+
throw new AppwriteException('Missing required parameter: "audioBitRate"');
|
|
44463
45225
|
}
|
|
44464
|
-
if (typeof
|
|
44465
|
-
|
|
45226
|
+
if (typeof width === 'undefined') {
|
|
45227
|
+
throw new AppwriteException('Missing required parameter: "width"');
|
|
44466
45228
|
}
|
|
45229
|
+
if (typeof height === 'undefined') {
|
|
45230
|
+
throw new AppwriteException('Missing required parameter: "height"');
|
|
45231
|
+
}
|
|
45232
|
+
const apiPath = '/videos/profiles';
|
|
45233
|
+
const apiPayload = {};
|
|
44467
45234
|
if (typeof name !== 'undefined') {
|
|
44468
45235
|
apiPayload['name'] = name;
|
|
44469
45236
|
}
|
|
44470
|
-
if (typeof
|
|
44471
|
-
apiPayload['
|
|
44472
|
-
}
|
|
44473
|
-
if (typeof challengeType !== 'undefined') {
|
|
44474
|
-
apiPayload['challengeType'] = challengeType;
|
|
44475
|
-
}
|
|
44476
|
-
if (typeof priority !== 'undefined') {
|
|
44477
|
-
apiPayload['priority'] = priority;
|
|
44478
|
-
}
|
|
44479
|
-
if (typeof enabled !== 'undefined') {
|
|
44480
|
-
apiPayload['enabled'] = enabled;
|
|
45237
|
+
if (typeof videoBitRate !== 'undefined') {
|
|
45238
|
+
apiPayload['videoBitRate'] = videoBitRate;
|
|
44481
45239
|
}
|
|
44482
|
-
if (typeof
|
|
44483
|
-
apiPayload['
|
|
45240
|
+
if (typeof audioBitRate !== 'undefined') {
|
|
45241
|
+
apiPayload['audioBitRate'] = audioBitRate;
|
|
44484
45242
|
}
|
|
44485
|
-
if (typeof
|
|
44486
|
-
apiPayload['
|
|
45243
|
+
if (typeof width !== 'undefined') {
|
|
45244
|
+
apiPayload['width'] = width;
|
|
44487
45245
|
}
|
|
44488
|
-
if (typeof
|
|
44489
|
-
apiPayload['
|
|
45246
|
+
if (typeof height !== 'undefined') {
|
|
45247
|
+
apiPayload['height'] = height;
|
|
44490
45248
|
}
|
|
44491
45249
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
44492
45250
|
const apiHeaders = {
|
|
@@ -44496,7 +45254,7 @@ class Waf {
|
|
|
44496
45254
|
};
|
|
44497
45255
|
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
44498
45256
|
}
|
|
44499
|
-
|
|
45257
|
+
getProfile(paramsOrFirst) {
|
|
44500
45258
|
let params;
|
|
44501
45259
|
if (paramsOrFirst &&
|
|
44502
45260
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -44505,74 +45263,23 @@ class Waf {
|
|
|
44505
45263
|
}
|
|
44506
45264
|
else {
|
|
44507
45265
|
params = {
|
|
44508
|
-
|
|
44509
|
-
resourceType: rest[0],
|
|
44510
|
-
resourceId: rest[1],
|
|
44511
|
-
name: rest[2],
|
|
44512
|
-
description: rest[3],
|
|
44513
|
-
challengeType: rest[4],
|
|
44514
|
-
priority: rest[5],
|
|
44515
|
-
enabled: rest[6],
|
|
44516
|
-
conditions: rest[7],
|
|
44517
|
-
difficulty: rest[8],
|
|
44518
|
-
ttl: rest[9],
|
|
45266
|
+
profileId: paramsOrFirst,
|
|
44519
45267
|
};
|
|
44520
45268
|
}
|
|
44521
|
-
const
|
|
44522
|
-
|
|
44523
|
-
|
|
44524
|
-
const name = params.name;
|
|
44525
|
-
const description = params.description;
|
|
44526
|
-
const challengeType = params.challengeType;
|
|
44527
|
-
const priority = params.priority;
|
|
44528
|
-
const enabled = params.enabled;
|
|
44529
|
-
const conditions = params.conditions;
|
|
44530
|
-
const difficulty = params.difficulty;
|
|
44531
|
-
const ttl = params.ttl;
|
|
44532
|
-
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
44533
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
45269
|
+
const profileId = params.profileId;
|
|
45270
|
+
if (typeof profileId === 'undefined' || profileId === '') {
|
|
45271
|
+
throw new AppwriteException('Missing required parameter: "profileId"');
|
|
44534
45272
|
}
|
|
44535
|
-
const apiPath = '/
|
|
45273
|
+
const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
|
|
44536
45274
|
const apiPayload = {};
|
|
44537
|
-
if (typeof resourceType !== 'undefined') {
|
|
44538
|
-
apiPayload['resourceType'] = resourceType;
|
|
44539
|
-
}
|
|
44540
|
-
if (typeof resourceId !== 'undefined') {
|
|
44541
|
-
apiPayload['resourceId'] = resourceId;
|
|
44542
|
-
}
|
|
44543
|
-
if (typeof name !== 'undefined') {
|
|
44544
|
-
apiPayload['name'] = name;
|
|
44545
|
-
}
|
|
44546
|
-
if (typeof description !== 'undefined') {
|
|
44547
|
-
apiPayload['description'] = description;
|
|
44548
|
-
}
|
|
44549
|
-
if (typeof challengeType !== 'undefined') {
|
|
44550
|
-
apiPayload['challengeType'] = challengeType;
|
|
44551
|
-
}
|
|
44552
|
-
if (typeof priority !== 'undefined') {
|
|
44553
|
-
apiPayload['priority'] = priority;
|
|
44554
|
-
}
|
|
44555
|
-
if (typeof enabled !== 'undefined') {
|
|
44556
|
-
apiPayload['enabled'] = enabled;
|
|
44557
|
-
}
|
|
44558
|
-
if (typeof conditions !== 'undefined') {
|
|
44559
|
-
apiPayload['conditions'] = conditions;
|
|
44560
|
-
}
|
|
44561
|
-
if (typeof difficulty !== 'undefined') {
|
|
44562
|
-
apiPayload['difficulty'] = difficulty;
|
|
44563
|
-
}
|
|
44564
|
-
if (typeof ttl !== 'undefined') {
|
|
44565
|
-
apiPayload['ttl'] = ttl;
|
|
44566
|
-
}
|
|
44567
45275
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
44568
45276
|
const apiHeaders = {
|
|
44569
45277
|
'X-Appwrite-Project': this.client.config.project,
|
|
44570
|
-
'content-type': 'application/json',
|
|
44571
45278
|
accept: 'application/json',
|
|
44572
45279
|
};
|
|
44573
|
-
return this.client.call('
|
|
45280
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
44574
45281
|
}
|
|
44575
|
-
|
|
45282
|
+
updateProfile(paramsOrFirst, ...rest) {
|
|
44576
45283
|
let params;
|
|
44577
45284
|
if (paramsOrFirst &&
|
|
44578
45285
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -44581,58 +45288,54 @@ class Waf {
|
|
|
44581
45288
|
}
|
|
44582
45289
|
else {
|
|
44583
45290
|
params = {
|
|
44584
|
-
|
|
44585
|
-
|
|
44586
|
-
|
|
44587
|
-
|
|
44588
|
-
|
|
44589
|
-
|
|
44590
|
-
enabled: rest[5],
|
|
44591
|
-
conditions: rest[6],
|
|
45291
|
+
profileId: paramsOrFirst,
|
|
45292
|
+
name: rest[0],
|
|
45293
|
+
videoBitRate: rest[1],
|
|
45294
|
+
audioBitRate: rest[2],
|
|
45295
|
+
width: rest[3],
|
|
45296
|
+
height: rest[4],
|
|
44592
45297
|
};
|
|
44593
45298
|
}
|
|
44594
|
-
const
|
|
44595
|
-
const resourceType = params.resourceType;
|
|
45299
|
+
const profileId = params.profileId;
|
|
44596
45300
|
const name = params.name;
|
|
44597
|
-
const
|
|
44598
|
-
const
|
|
44599
|
-
const
|
|
44600
|
-
const
|
|
44601
|
-
|
|
44602
|
-
|
|
44603
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
44604
|
-
}
|
|
44605
|
-
if (typeof resourceType === 'undefined') {
|
|
44606
|
-
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
45301
|
+
const videoBitRate = params.videoBitRate;
|
|
45302
|
+
const audioBitRate = params.audioBitRate;
|
|
45303
|
+
const width = params.width;
|
|
45304
|
+
const height = params.height;
|
|
45305
|
+
if (typeof profileId === 'undefined' || profileId === '') {
|
|
45306
|
+
throw new AppwriteException('Missing required parameter: "profileId"');
|
|
44607
45307
|
}
|
|
44608
45308
|
if (typeof name === 'undefined') {
|
|
44609
45309
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
44610
45310
|
}
|
|
44611
|
-
|
|
44612
|
-
|
|
44613
|
-
if (typeof ruleId !== 'undefined') {
|
|
44614
|
-
apiPayload['ruleId'] = ruleId;
|
|
45311
|
+
if (typeof videoBitRate === 'undefined') {
|
|
45312
|
+
throw new AppwriteException('Missing required parameter: "videoBitRate"');
|
|
44615
45313
|
}
|
|
44616
|
-
if (typeof
|
|
44617
|
-
|
|
45314
|
+
if (typeof audioBitRate === 'undefined') {
|
|
45315
|
+
throw new AppwriteException('Missing required parameter: "audioBitRate"');
|
|
44618
45316
|
}
|
|
44619
|
-
if (typeof
|
|
44620
|
-
|
|
45317
|
+
if (typeof width === 'undefined') {
|
|
45318
|
+
throw new AppwriteException('Missing required parameter: "width"');
|
|
44621
45319
|
}
|
|
45320
|
+
if (typeof height === 'undefined') {
|
|
45321
|
+
throw new AppwriteException('Missing required parameter: "height"');
|
|
45322
|
+
}
|
|
45323
|
+
const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
|
|
45324
|
+
const apiPayload = {};
|
|
44622
45325
|
if (typeof name !== 'undefined') {
|
|
44623
45326
|
apiPayload['name'] = name;
|
|
44624
45327
|
}
|
|
44625
|
-
if (typeof
|
|
44626
|
-
apiPayload['
|
|
45328
|
+
if (typeof videoBitRate !== 'undefined') {
|
|
45329
|
+
apiPayload['videoBitRate'] = videoBitRate;
|
|
44627
45330
|
}
|
|
44628
|
-
if (typeof
|
|
44629
|
-
apiPayload['
|
|
45331
|
+
if (typeof audioBitRate !== 'undefined') {
|
|
45332
|
+
apiPayload['audioBitRate'] = audioBitRate;
|
|
44630
45333
|
}
|
|
44631
|
-
if (typeof
|
|
44632
|
-
apiPayload['
|
|
45334
|
+
if (typeof width !== 'undefined') {
|
|
45335
|
+
apiPayload['width'] = width;
|
|
44633
45336
|
}
|
|
44634
|
-
if (typeof
|
|
44635
|
-
apiPayload['
|
|
45337
|
+
if (typeof height !== 'undefined') {
|
|
45338
|
+
apiPayload['height'] = height;
|
|
44636
45339
|
}
|
|
44637
45340
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
44638
45341
|
const apiHeaders = {
|
|
@@ -44640,9 +45343,9 @@ class Waf {
|
|
|
44640
45343
|
'content-type': 'application/json',
|
|
44641
45344
|
accept: 'application/json',
|
|
44642
45345
|
};
|
|
44643
|
-
return this.client.call('
|
|
45346
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
44644
45347
|
}
|
|
44645
|
-
|
|
45348
|
+
deleteProfile(paramsOrFirst) {
|
|
44646
45349
|
let params;
|
|
44647
45350
|
if (paramsOrFirst &&
|
|
44648
45351
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -44651,59 +45354,49 @@ class Waf {
|
|
|
44651
45354
|
}
|
|
44652
45355
|
else {
|
|
44653
45356
|
params = {
|
|
44654
|
-
|
|
44655
|
-
resourceType: rest[0],
|
|
44656
|
-
resourceId: rest[1],
|
|
44657
|
-
name: rest[2],
|
|
44658
|
-
description: rest[3],
|
|
44659
|
-
priority: rest[4],
|
|
44660
|
-
enabled: rest[5],
|
|
44661
|
-
conditions: rest[6],
|
|
45357
|
+
profileId: paramsOrFirst,
|
|
44662
45358
|
};
|
|
44663
45359
|
}
|
|
44664
|
-
const
|
|
44665
|
-
|
|
44666
|
-
|
|
44667
|
-
const name = params.name;
|
|
44668
|
-
const description = params.description;
|
|
44669
|
-
const priority = params.priority;
|
|
44670
|
-
const enabled = params.enabled;
|
|
44671
|
-
const conditions = params.conditions;
|
|
44672
|
-
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
44673
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
45360
|
+
const profileId = params.profileId;
|
|
45361
|
+
if (typeof profileId === 'undefined' || profileId === '') {
|
|
45362
|
+
throw new AppwriteException('Missing required parameter: "profileId"');
|
|
44674
45363
|
}
|
|
44675
|
-
const apiPath = '/
|
|
45364
|
+
const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
|
|
44676
45365
|
const apiPayload = {};
|
|
44677
|
-
|
|
44678
|
-
|
|
44679
|
-
|
|
44680
|
-
|
|
44681
|
-
|
|
44682
|
-
}
|
|
44683
|
-
|
|
44684
|
-
|
|
44685
|
-
|
|
44686
|
-
|
|
44687
|
-
|
|
44688
|
-
|
|
44689
|
-
|
|
44690
|
-
|
|
45366
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45367
|
+
const apiHeaders = {
|
|
45368
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45369
|
+
'content-type': 'application/json',
|
|
45370
|
+
accept: 'application/json',
|
|
45371
|
+
};
|
|
45372
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
45373
|
+
}
|
|
45374
|
+
get(paramsOrFirst) {
|
|
45375
|
+
let params;
|
|
45376
|
+
if (paramsOrFirst &&
|
|
45377
|
+
typeof paramsOrFirst === 'object' &&
|
|
45378
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45379
|
+
params = (paramsOrFirst || {});
|
|
44691
45380
|
}
|
|
44692
|
-
|
|
44693
|
-
|
|
45381
|
+
else {
|
|
45382
|
+
params = {
|
|
45383
|
+
videoId: paramsOrFirst,
|
|
45384
|
+
};
|
|
44694
45385
|
}
|
|
44695
|
-
|
|
44696
|
-
|
|
45386
|
+
const videoId = params.videoId;
|
|
45387
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45388
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
44697
45389
|
}
|
|
45390
|
+
const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45391
|
+
const apiPayload = {};
|
|
44698
45392
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
44699
45393
|
const apiHeaders = {
|
|
44700
45394
|
'X-Appwrite-Project': this.client.config.project,
|
|
44701
|
-
'content-type': 'application/json',
|
|
44702
45395
|
accept: 'application/json',
|
|
44703
45396
|
};
|
|
44704
|
-
return this.client.call('
|
|
45397
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
44705
45398
|
}
|
|
44706
|
-
|
|
45399
|
+
update(paramsOrFirst, ...rest) {
|
|
44707
45400
|
let params;
|
|
44708
45401
|
if (paramsOrFirst &&
|
|
44709
45402
|
typeof paramsOrFirst === 'object' &&
|
|
@@ -44712,65 +45405,1347 @@ class Waf {
|
|
|
44712
45405
|
}
|
|
44713
45406
|
else {
|
|
44714
45407
|
params = {
|
|
44715
|
-
|
|
44716
|
-
|
|
44717
|
-
name: rest[1],
|
|
44718
|
-
limit: rest[2],
|
|
44719
|
-
interval: rest[3],
|
|
44720
|
-
resourceId: rest[4],
|
|
44721
|
-
description: rest[5],
|
|
44722
|
-
key: rest[6],
|
|
44723
|
-
strategy: rest[7],
|
|
44724
|
-
maxBucketSize: rest[8],
|
|
44725
|
-
priority: rest[9],
|
|
44726
|
-
enabled: rest[10],
|
|
44727
|
-
conditions: rest[11],
|
|
45408
|
+
videoId: paramsOrFirst,
|
|
45409
|
+
name: rest[0],
|
|
44728
45410
|
};
|
|
44729
45411
|
}
|
|
44730
|
-
const
|
|
44731
|
-
const resourceType = params.resourceType;
|
|
45412
|
+
const videoId = params.videoId;
|
|
44732
45413
|
const name = params.name;
|
|
44733
|
-
|
|
44734
|
-
|
|
44735
|
-
const resourceId = params.resourceId;
|
|
44736
|
-
const description = params.description;
|
|
44737
|
-
const key = params.key;
|
|
44738
|
-
const strategy = params.strategy;
|
|
44739
|
-
const maxBucketSize = params.maxBucketSize;
|
|
44740
|
-
const priority = params.priority;
|
|
44741
|
-
const enabled = params.enabled;
|
|
44742
|
-
const conditions = params.conditions;
|
|
44743
|
-
if (typeof ruleId === 'undefined') {
|
|
44744
|
-
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
44745
|
-
}
|
|
44746
|
-
if (typeof resourceType === 'undefined') {
|
|
44747
|
-
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
45414
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45415
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
44748
45416
|
}
|
|
44749
45417
|
if (typeof name === 'undefined') {
|
|
44750
45418
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
44751
45419
|
}
|
|
44752
|
-
|
|
44753
|
-
throw new AppwriteException('Missing required parameter: "limit"');
|
|
44754
|
-
}
|
|
44755
|
-
if (typeof interval === 'undefined') {
|
|
44756
|
-
throw new AppwriteException('Missing required parameter: "interval"');
|
|
44757
|
-
}
|
|
44758
|
-
const apiPath = '/waf/rules/rate-limit';
|
|
45420
|
+
const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
44759
45421
|
const apiPayload = {};
|
|
44760
|
-
if (typeof ruleId !== 'undefined') {
|
|
44761
|
-
apiPayload['ruleId'] = ruleId;
|
|
44762
|
-
}
|
|
44763
|
-
if (typeof resourceType !== 'undefined') {
|
|
44764
|
-
apiPayload['resourceType'] = resourceType;
|
|
44765
|
-
}
|
|
44766
|
-
if (typeof resourceId !== 'undefined') {
|
|
44767
|
-
apiPayload['resourceId'] = resourceId;
|
|
44768
|
-
}
|
|
44769
45422
|
if (typeof name !== 'undefined') {
|
|
44770
45423
|
apiPayload['name'] = name;
|
|
44771
45424
|
}
|
|
44772
|
-
|
|
44773
|
-
|
|
45425
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45426
|
+
const apiHeaders = {
|
|
45427
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45428
|
+
'content-type': 'application/json',
|
|
45429
|
+
accept: 'application/json',
|
|
45430
|
+
};
|
|
45431
|
+
return this.client.call('put', uri, apiHeaders, apiPayload);
|
|
45432
|
+
}
|
|
45433
|
+
delete(paramsOrFirst) {
|
|
45434
|
+
let params;
|
|
45435
|
+
if (paramsOrFirst &&
|
|
45436
|
+
typeof paramsOrFirst === 'object' &&
|
|
45437
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45438
|
+
params = (paramsOrFirst || {});
|
|
45439
|
+
}
|
|
45440
|
+
else {
|
|
45441
|
+
params = {
|
|
45442
|
+
videoId: paramsOrFirst,
|
|
45443
|
+
};
|
|
45444
|
+
}
|
|
45445
|
+
const videoId = params.videoId;
|
|
45446
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45447
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45448
|
+
}
|
|
45449
|
+
const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45450
|
+
const apiPayload = {};
|
|
45451
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45452
|
+
const apiHeaders = {
|
|
45453
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45454
|
+
'content-type': 'application/json',
|
|
45455
|
+
accept: 'application/json',
|
|
45456
|
+
};
|
|
45457
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
45458
|
+
}
|
|
45459
|
+
getCmafHlsManifest(paramsOrFirst) {
|
|
45460
|
+
let params;
|
|
45461
|
+
if (paramsOrFirst &&
|
|
45462
|
+
typeof paramsOrFirst === 'object' &&
|
|
45463
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45464
|
+
params = (paramsOrFirst || {});
|
|
45465
|
+
}
|
|
45466
|
+
else {
|
|
45467
|
+
params = {
|
|
45468
|
+
videoId: paramsOrFirst,
|
|
45469
|
+
};
|
|
45470
|
+
}
|
|
45471
|
+
const videoId = params.videoId;
|
|
45472
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45473
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45474
|
+
}
|
|
45475
|
+
const apiPath = '/videos/{videoId}/outputs/cmaf/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45476
|
+
const apiPayload = {};
|
|
45477
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45478
|
+
apiPayload['project'] = this.client.config.project;
|
|
45479
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45480
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45481
|
+
uri.searchParams.append(key, value);
|
|
45482
|
+
}
|
|
45483
|
+
return uri.toString();
|
|
45484
|
+
}
|
|
45485
|
+
getCmafDashManifest(paramsOrFirst) {
|
|
45486
|
+
let params;
|
|
45487
|
+
if (paramsOrFirst &&
|
|
45488
|
+
typeof paramsOrFirst === 'object' &&
|
|
45489
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45490
|
+
params = (paramsOrFirst || {});
|
|
45491
|
+
}
|
|
45492
|
+
else {
|
|
45493
|
+
params = {
|
|
45494
|
+
videoId: paramsOrFirst,
|
|
45495
|
+
};
|
|
45496
|
+
}
|
|
45497
|
+
const videoId = params.videoId;
|
|
45498
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45499
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45500
|
+
}
|
|
45501
|
+
const apiPath = '/videos/{videoId}/outputs/cmaf/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45502
|
+
const apiPayload = {};
|
|
45503
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45504
|
+
apiPayload['project'] = this.client.config.project;
|
|
45505
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45506
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45507
|
+
uri.searchParams.append(key, value);
|
|
45508
|
+
}
|
|
45509
|
+
return uri.toString();
|
|
45510
|
+
}
|
|
45511
|
+
getCmafStreamManifest(paramsOrFirst, ...rest) {
|
|
45512
|
+
let params;
|
|
45513
|
+
if (paramsOrFirst &&
|
|
45514
|
+
typeof paramsOrFirst === 'object' &&
|
|
45515
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45516
|
+
params = (paramsOrFirst || {});
|
|
45517
|
+
}
|
|
45518
|
+
else {
|
|
45519
|
+
params = {
|
|
45520
|
+
videoId: paramsOrFirst,
|
|
45521
|
+
renditionId: rest[0],
|
|
45522
|
+
streamId: rest[1],
|
|
45523
|
+
};
|
|
45524
|
+
}
|
|
45525
|
+
const videoId = params.videoId;
|
|
45526
|
+
const renditionId = params.renditionId;
|
|
45527
|
+
const streamId = params.streamId;
|
|
45528
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45529
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45530
|
+
}
|
|
45531
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
45532
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
45533
|
+
}
|
|
45534
|
+
if (typeof streamId === 'undefined') {
|
|
45535
|
+
throw new AppwriteException('Missing required parameter: "streamId"');
|
|
45536
|
+
}
|
|
45537
|
+
const apiPath = '/videos/{videoId}/outputs/cmaf/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
|
|
45538
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45539
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)))
|
|
45540
|
+
.replace('{streamId}', encodeURIComponent(String(streamId)));
|
|
45541
|
+
const apiPayload = {};
|
|
45542
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45543
|
+
apiPayload['project'] = this.client.config.project;
|
|
45544
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45545
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45546
|
+
uri.searchParams.append(key, value);
|
|
45547
|
+
}
|
|
45548
|
+
return uri.toString();
|
|
45549
|
+
}
|
|
45550
|
+
getDashManifest(paramsOrFirst) {
|
|
45551
|
+
let params;
|
|
45552
|
+
if (paramsOrFirst &&
|
|
45553
|
+
typeof paramsOrFirst === 'object' &&
|
|
45554
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45555
|
+
params = (paramsOrFirst || {});
|
|
45556
|
+
}
|
|
45557
|
+
else {
|
|
45558
|
+
params = {
|
|
45559
|
+
videoId: paramsOrFirst,
|
|
45560
|
+
};
|
|
45561
|
+
}
|
|
45562
|
+
const videoId = params.videoId;
|
|
45563
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45564
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45565
|
+
}
|
|
45566
|
+
const apiPath = '/videos/{videoId}/outputs/dash/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45567
|
+
const apiPayload = {};
|
|
45568
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45569
|
+
apiPayload['project'] = this.client.config.project;
|
|
45570
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45571
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45572
|
+
uri.searchParams.append(key, value);
|
|
45573
|
+
}
|
|
45574
|
+
return uri.toString();
|
|
45575
|
+
}
|
|
45576
|
+
getHlsManifest(paramsOrFirst) {
|
|
45577
|
+
let params;
|
|
45578
|
+
if (paramsOrFirst &&
|
|
45579
|
+
typeof paramsOrFirst === 'object' &&
|
|
45580
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45581
|
+
params = (paramsOrFirst || {});
|
|
45582
|
+
}
|
|
45583
|
+
else {
|
|
45584
|
+
params = {
|
|
45585
|
+
videoId: paramsOrFirst,
|
|
45586
|
+
};
|
|
45587
|
+
}
|
|
45588
|
+
const videoId = params.videoId;
|
|
45589
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45590
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45591
|
+
}
|
|
45592
|
+
const apiPath = '/videos/{videoId}/outputs/hls/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45593
|
+
const apiPayload = {};
|
|
45594
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45595
|
+
apiPayload['project'] = this.client.config.project;
|
|
45596
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45597
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45598
|
+
uri.searchParams.append(key, value);
|
|
45599
|
+
}
|
|
45600
|
+
return uri.toString();
|
|
45601
|
+
}
|
|
45602
|
+
getStreamManifest(paramsOrFirst, ...rest) {
|
|
45603
|
+
let params;
|
|
45604
|
+
if (paramsOrFirst &&
|
|
45605
|
+
typeof paramsOrFirst === 'object' &&
|
|
45606
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45607
|
+
params = (paramsOrFirst || {});
|
|
45608
|
+
}
|
|
45609
|
+
else {
|
|
45610
|
+
params = {
|
|
45611
|
+
videoId: paramsOrFirst,
|
|
45612
|
+
renditionId: rest[0],
|
|
45613
|
+
streamId: rest[1],
|
|
45614
|
+
};
|
|
45615
|
+
}
|
|
45616
|
+
const videoId = params.videoId;
|
|
45617
|
+
const renditionId = params.renditionId;
|
|
45618
|
+
const streamId = params.streamId;
|
|
45619
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45620
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45621
|
+
}
|
|
45622
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
45623
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
45624
|
+
}
|
|
45625
|
+
if (typeof streamId === 'undefined') {
|
|
45626
|
+
throw new AppwriteException('Missing required parameter: "streamId"');
|
|
45627
|
+
}
|
|
45628
|
+
const apiPath = '/videos/{videoId}/outputs/hls/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
|
|
45629
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45630
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)))
|
|
45631
|
+
.replace('{streamId}', encodeURIComponent(String(streamId)));
|
|
45632
|
+
const apiPayload = {};
|
|
45633
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45634
|
+
apiPayload['project'] = this.client.config.project;
|
|
45635
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45636
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45637
|
+
uri.searchParams.append(key, value);
|
|
45638
|
+
}
|
|
45639
|
+
return uri.toString();
|
|
45640
|
+
}
|
|
45641
|
+
getSegment(paramsOrFirst, ...rest) {
|
|
45642
|
+
let params;
|
|
45643
|
+
if (paramsOrFirst &&
|
|
45644
|
+
typeof paramsOrFirst === 'object' &&
|
|
45645
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45646
|
+
params = (paramsOrFirst || {});
|
|
45647
|
+
}
|
|
45648
|
+
else {
|
|
45649
|
+
params = {
|
|
45650
|
+
videoId: paramsOrFirst,
|
|
45651
|
+
output: rest[0],
|
|
45652
|
+
renditionId: rest[1],
|
|
45653
|
+
segmentId: rest[2],
|
|
45654
|
+
};
|
|
45655
|
+
}
|
|
45656
|
+
const videoId = params.videoId;
|
|
45657
|
+
const output = params.output;
|
|
45658
|
+
const renditionId = params.renditionId;
|
|
45659
|
+
const segmentId = params.segmentId;
|
|
45660
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45661
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45662
|
+
}
|
|
45663
|
+
if (typeof output === 'undefined') {
|
|
45664
|
+
throw new AppwriteException('Missing required parameter: "output"');
|
|
45665
|
+
}
|
|
45666
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
45667
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
45668
|
+
}
|
|
45669
|
+
if (typeof segmentId === 'undefined' || segmentId === '') {
|
|
45670
|
+
throw new AppwriteException('Missing required parameter: "segmentId"');
|
|
45671
|
+
}
|
|
45672
|
+
const apiPath = '/videos/{videoId}/outputs/{output}/renditions/{renditionId}/segments/{segmentId}'
|
|
45673
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45674
|
+
.replace('{output}', encodeURIComponent(String(output)))
|
|
45675
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)))
|
|
45676
|
+
.replace('{segmentId}', encodeURIComponent(String(segmentId)));
|
|
45677
|
+
const apiPayload = {};
|
|
45678
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45679
|
+
apiPayload['project'] = this.client.config.project;
|
|
45680
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45681
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45682
|
+
uri.searchParams.append(key, value);
|
|
45683
|
+
}
|
|
45684
|
+
return uri.toString();
|
|
45685
|
+
}
|
|
45686
|
+
getSubtitleManifest(paramsOrFirst, ...rest) {
|
|
45687
|
+
let params;
|
|
45688
|
+
if (paramsOrFirst &&
|
|
45689
|
+
typeof paramsOrFirst === 'object' &&
|
|
45690
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45691
|
+
params = (paramsOrFirst || {});
|
|
45692
|
+
}
|
|
45693
|
+
else {
|
|
45694
|
+
params = {
|
|
45695
|
+
videoId: paramsOrFirst,
|
|
45696
|
+
output: rest[0],
|
|
45697
|
+
subtitleId: rest[1],
|
|
45698
|
+
};
|
|
45699
|
+
}
|
|
45700
|
+
const videoId = params.videoId;
|
|
45701
|
+
const output = params.output;
|
|
45702
|
+
const subtitleId = params.subtitleId;
|
|
45703
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45704
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45705
|
+
}
|
|
45706
|
+
if (typeof output === 'undefined') {
|
|
45707
|
+
throw new AppwriteException('Missing required parameter: "output"');
|
|
45708
|
+
}
|
|
45709
|
+
if (typeof subtitleId === 'undefined' || subtitleId === '') {
|
|
45710
|
+
throw new AppwriteException('Missing required parameter: "subtitleId"');
|
|
45711
|
+
}
|
|
45712
|
+
const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/manifest'
|
|
45713
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45714
|
+
.replace('{output}', encodeURIComponent(String(output)))
|
|
45715
|
+
.replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
|
|
45716
|
+
const apiPayload = {};
|
|
45717
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45718
|
+
apiPayload['project'] = this.client.config.project;
|
|
45719
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45720
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45721
|
+
uri.searchParams.append(key, value);
|
|
45722
|
+
}
|
|
45723
|
+
return uri.toString();
|
|
45724
|
+
}
|
|
45725
|
+
getSubtitleSegment(paramsOrFirst, ...rest) {
|
|
45726
|
+
let params;
|
|
45727
|
+
if (paramsOrFirst &&
|
|
45728
|
+
typeof paramsOrFirst === 'object' &&
|
|
45729
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45730
|
+
params = (paramsOrFirst || {});
|
|
45731
|
+
}
|
|
45732
|
+
else {
|
|
45733
|
+
params = {
|
|
45734
|
+
videoId: paramsOrFirst,
|
|
45735
|
+
output: rest[0],
|
|
45736
|
+
subtitleId: rest[1],
|
|
45737
|
+
segmentId: rest[2],
|
|
45738
|
+
};
|
|
45739
|
+
}
|
|
45740
|
+
const videoId = params.videoId;
|
|
45741
|
+
const output = params.output;
|
|
45742
|
+
const subtitleId = params.subtitleId;
|
|
45743
|
+
const segmentId = params.segmentId;
|
|
45744
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45745
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45746
|
+
}
|
|
45747
|
+
if (typeof output === 'undefined') {
|
|
45748
|
+
throw new AppwriteException('Missing required parameter: "output"');
|
|
45749
|
+
}
|
|
45750
|
+
if (typeof subtitleId === 'undefined' || subtitleId === '') {
|
|
45751
|
+
throw new AppwriteException('Missing required parameter: "subtitleId"');
|
|
45752
|
+
}
|
|
45753
|
+
if (typeof segmentId === 'undefined' || segmentId === '') {
|
|
45754
|
+
throw new AppwriteException('Missing required parameter: "segmentId"');
|
|
45755
|
+
}
|
|
45756
|
+
const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/segments/{segmentId}'
|
|
45757
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45758
|
+
.replace('{output}', encodeURIComponent(String(output)))
|
|
45759
|
+
.replace('{subtitleId}', encodeURIComponent(String(subtitleId)))
|
|
45760
|
+
.replace('{segmentId}', encodeURIComponent(String(segmentId)));
|
|
45761
|
+
const apiPayload = {};
|
|
45762
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45763
|
+
apiPayload['project'] = this.client.config.project;
|
|
45764
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45765
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45766
|
+
uri.searchParams.append(key, value);
|
|
45767
|
+
}
|
|
45768
|
+
return uri.toString();
|
|
45769
|
+
}
|
|
45770
|
+
getPreview(paramsOrFirst, ...rest) {
|
|
45771
|
+
let params;
|
|
45772
|
+
if (paramsOrFirst &&
|
|
45773
|
+
typeof paramsOrFirst === 'object' &&
|
|
45774
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45775
|
+
params = (paramsOrFirst || {});
|
|
45776
|
+
}
|
|
45777
|
+
else {
|
|
45778
|
+
params = {
|
|
45779
|
+
videoId: paramsOrFirst,
|
|
45780
|
+
previewId: rest[0],
|
|
45781
|
+
width: rest[1],
|
|
45782
|
+
height: rest[2],
|
|
45783
|
+
output: rest[3],
|
|
45784
|
+
};
|
|
45785
|
+
}
|
|
45786
|
+
const videoId = params.videoId;
|
|
45787
|
+
const previewId = params.previewId;
|
|
45788
|
+
const width = params.width;
|
|
45789
|
+
const height = params.height;
|
|
45790
|
+
const output = params.output;
|
|
45791
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45792
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45793
|
+
}
|
|
45794
|
+
if (typeof previewId === 'undefined' || previewId === '') {
|
|
45795
|
+
throw new AppwriteException('Missing required parameter: "previewId"');
|
|
45796
|
+
}
|
|
45797
|
+
const apiPath = '/videos/{videoId}/previews/{previewId}'
|
|
45798
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45799
|
+
.replace('{previewId}', encodeURIComponent(String(previewId)));
|
|
45800
|
+
const apiPayload = {};
|
|
45801
|
+
if (typeof width !== 'undefined') {
|
|
45802
|
+
apiPayload['width'] = width;
|
|
45803
|
+
}
|
|
45804
|
+
if (typeof height !== 'undefined') {
|
|
45805
|
+
apiPayload['height'] = height;
|
|
45806
|
+
}
|
|
45807
|
+
if (typeof output !== 'undefined') {
|
|
45808
|
+
apiPayload['output'] = output;
|
|
45809
|
+
}
|
|
45810
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45811
|
+
apiPayload['project'] = this.client.config.project;
|
|
45812
|
+
apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
|
|
45813
|
+
for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
|
|
45814
|
+
uri.searchParams.append(key, value);
|
|
45815
|
+
}
|
|
45816
|
+
return uri.toString();
|
|
45817
|
+
}
|
|
45818
|
+
listRenditions(paramsOrFirst, ...rest) {
|
|
45819
|
+
let params;
|
|
45820
|
+
if (paramsOrFirst &&
|
|
45821
|
+
typeof paramsOrFirst === 'object' &&
|
|
45822
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45823
|
+
params = (paramsOrFirst || {});
|
|
45824
|
+
}
|
|
45825
|
+
else {
|
|
45826
|
+
params = {
|
|
45827
|
+
videoId: paramsOrFirst,
|
|
45828
|
+
output: rest[0],
|
|
45829
|
+
status: rest[1],
|
|
45830
|
+
};
|
|
45831
|
+
}
|
|
45832
|
+
const videoId = params.videoId;
|
|
45833
|
+
const output = params.output;
|
|
45834
|
+
const status = params.status;
|
|
45835
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45836
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45837
|
+
}
|
|
45838
|
+
const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45839
|
+
const apiPayload = {};
|
|
45840
|
+
if (typeof output !== 'undefined') {
|
|
45841
|
+
apiPayload['output'] = output;
|
|
45842
|
+
}
|
|
45843
|
+
if (typeof status !== 'undefined') {
|
|
45844
|
+
apiPayload['status'] = status;
|
|
45845
|
+
}
|
|
45846
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45847
|
+
const apiHeaders = {
|
|
45848
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45849
|
+
accept: 'application/json',
|
|
45850
|
+
};
|
|
45851
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
45852
|
+
}
|
|
45853
|
+
createRendition(paramsOrFirst, ...rest) {
|
|
45854
|
+
let params;
|
|
45855
|
+
if (paramsOrFirst &&
|
|
45856
|
+
typeof paramsOrFirst === 'object' &&
|
|
45857
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45858
|
+
params = (paramsOrFirst || {});
|
|
45859
|
+
}
|
|
45860
|
+
else {
|
|
45861
|
+
params = {
|
|
45862
|
+
videoId: paramsOrFirst,
|
|
45863
|
+
profileId: rest[0],
|
|
45864
|
+
output: rest[1],
|
|
45865
|
+
};
|
|
45866
|
+
}
|
|
45867
|
+
const videoId = params.videoId;
|
|
45868
|
+
const profileId = params.profileId;
|
|
45869
|
+
const output = params.output;
|
|
45870
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45871
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45872
|
+
}
|
|
45873
|
+
if (typeof profileId === 'undefined') {
|
|
45874
|
+
throw new AppwriteException('Missing required parameter: "profileId"');
|
|
45875
|
+
}
|
|
45876
|
+
if (typeof output === 'undefined') {
|
|
45877
|
+
throw new AppwriteException('Missing required parameter: "output"');
|
|
45878
|
+
}
|
|
45879
|
+
const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45880
|
+
const apiPayload = {};
|
|
45881
|
+
if (typeof profileId !== 'undefined') {
|
|
45882
|
+
apiPayload['profileId'] = profileId;
|
|
45883
|
+
}
|
|
45884
|
+
if (typeof output !== 'undefined') {
|
|
45885
|
+
apiPayload['output'] = output;
|
|
45886
|
+
}
|
|
45887
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45888
|
+
const apiHeaders = {
|
|
45889
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45890
|
+
'content-type': 'application/json',
|
|
45891
|
+
accept: 'application/json',
|
|
45892
|
+
};
|
|
45893
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
45894
|
+
}
|
|
45895
|
+
getRendition(paramsOrFirst, ...rest) {
|
|
45896
|
+
let params;
|
|
45897
|
+
if (paramsOrFirst &&
|
|
45898
|
+
typeof paramsOrFirst === 'object' &&
|
|
45899
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45900
|
+
params = (paramsOrFirst || {});
|
|
45901
|
+
}
|
|
45902
|
+
else {
|
|
45903
|
+
params = {
|
|
45904
|
+
videoId: paramsOrFirst,
|
|
45905
|
+
renditionId: rest[0],
|
|
45906
|
+
};
|
|
45907
|
+
}
|
|
45908
|
+
const videoId = params.videoId;
|
|
45909
|
+
const renditionId = params.renditionId;
|
|
45910
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45911
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45912
|
+
}
|
|
45913
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
45914
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
45915
|
+
}
|
|
45916
|
+
const apiPath = '/videos/{videoId}/renditions/{renditionId}'
|
|
45917
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45918
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)));
|
|
45919
|
+
const apiPayload = {};
|
|
45920
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45921
|
+
const apiHeaders = {
|
|
45922
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45923
|
+
accept: 'application/json',
|
|
45924
|
+
};
|
|
45925
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
45926
|
+
}
|
|
45927
|
+
deleteRendition(paramsOrFirst, ...rest) {
|
|
45928
|
+
let params;
|
|
45929
|
+
if (paramsOrFirst &&
|
|
45930
|
+
typeof paramsOrFirst === 'object' &&
|
|
45931
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45932
|
+
params = (paramsOrFirst || {});
|
|
45933
|
+
}
|
|
45934
|
+
else {
|
|
45935
|
+
params = {
|
|
45936
|
+
videoId: paramsOrFirst,
|
|
45937
|
+
renditionId: rest[0],
|
|
45938
|
+
};
|
|
45939
|
+
}
|
|
45940
|
+
const videoId = params.videoId;
|
|
45941
|
+
const renditionId = params.renditionId;
|
|
45942
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45943
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45944
|
+
}
|
|
45945
|
+
if (typeof renditionId === 'undefined' || renditionId === '') {
|
|
45946
|
+
throw new AppwriteException('Missing required parameter: "renditionId"');
|
|
45947
|
+
}
|
|
45948
|
+
const apiPath = '/videos/{videoId}/renditions/{renditionId}'
|
|
45949
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
45950
|
+
.replace('{renditionId}', encodeURIComponent(String(renditionId)));
|
|
45951
|
+
const apiPayload = {};
|
|
45952
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45953
|
+
const apiHeaders = {
|
|
45954
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45955
|
+
'content-type': 'application/json',
|
|
45956
|
+
accept: 'application/json',
|
|
45957
|
+
};
|
|
45958
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
45959
|
+
}
|
|
45960
|
+
createSource(paramsOrFirst) {
|
|
45961
|
+
let params;
|
|
45962
|
+
if (paramsOrFirst &&
|
|
45963
|
+
typeof paramsOrFirst === 'object' &&
|
|
45964
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45965
|
+
params = (paramsOrFirst || {});
|
|
45966
|
+
}
|
|
45967
|
+
else {
|
|
45968
|
+
params = {
|
|
45969
|
+
videoId: paramsOrFirst,
|
|
45970
|
+
};
|
|
45971
|
+
}
|
|
45972
|
+
const videoId = params.videoId;
|
|
45973
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
45974
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
45975
|
+
}
|
|
45976
|
+
const apiPath = '/videos/{videoId}/source'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
45977
|
+
const apiPayload = {};
|
|
45978
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45979
|
+
const apiHeaders = {
|
|
45980
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
45981
|
+
'content-type': 'application/json',
|
|
45982
|
+
accept: 'application/json',
|
|
45983
|
+
};
|
|
45984
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
45985
|
+
}
|
|
45986
|
+
listSubtitles(paramsOrFirst) {
|
|
45987
|
+
let params;
|
|
45988
|
+
if (paramsOrFirst &&
|
|
45989
|
+
typeof paramsOrFirst === 'object' &&
|
|
45990
|
+
!Array.isArray(paramsOrFirst)) {
|
|
45991
|
+
params = (paramsOrFirst || {});
|
|
45992
|
+
}
|
|
45993
|
+
else {
|
|
45994
|
+
params = {
|
|
45995
|
+
videoId: paramsOrFirst,
|
|
45996
|
+
};
|
|
45997
|
+
}
|
|
45998
|
+
const videoId = params.videoId;
|
|
45999
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
46000
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
46001
|
+
}
|
|
46002
|
+
const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
46003
|
+
const apiPayload = {};
|
|
46004
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46005
|
+
const apiHeaders = {
|
|
46006
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46007
|
+
accept: 'application/json',
|
|
46008
|
+
};
|
|
46009
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
46010
|
+
}
|
|
46011
|
+
createSubtitle(paramsOrFirst, ...rest) {
|
|
46012
|
+
let params;
|
|
46013
|
+
if (paramsOrFirst &&
|
|
46014
|
+
typeof paramsOrFirst === 'object' &&
|
|
46015
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46016
|
+
params = (paramsOrFirst || {});
|
|
46017
|
+
}
|
|
46018
|
+
else {
|
|
46019
|
+
params = {
|
|
46020
|
+
videoId: paramsOrFirst,
|
|
46021
|
+
bucketId: rest[0],
|
|
46022
|
+
fileId: rest[1],
|
|
46023
|
+
name: rest[2],
|
|
46024
|
+
code: rest[3],
|
|
46025
|
+
xdefault: rest[4],
|
|
46026
|
+
};
|
|
46027
|
+
}
|
|
46028
|
+
const videoId = params.videoId;
|
|
46029
|
+
const bucketId = params.bucketId;
|
|
46030
|
+
const fileId = params.fileId;
|
|
46031
|
+
const name = params.name;
|
|
46032
|
+
const code = params.code;
|
|
46033
|
+
const xdefault = params.xdefault;
|
|
46034
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
46035
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
46036
|
+
}
|
|
46037
|
+
if (typeof bucketId === 'undefined') {
|
|
46038
|
+
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
46039
|
+
}
|
|
46040
|
+
if (typeof fileId === 'undefined') {
|
|
46041
|
+
throw new AppwriteException('Missing required parameter: "fileId"');
|
|
46042
|
+
}
|
|
46043
|
+
if (typeof name === 'undefined') {
|
|
46044
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
46045
|
+
}
|
|
46046
|
+
if (typeof code === 'undefined') {
|
|
46047
|
+
throw new AppwriteException('Missing required parameter: "code"');
|
|
46048
|
+
}
|
|
46049
|
+
const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
46050
|
+
const apiPayload = {};
|
|
46051
|
+
if (typeof bucketId !== 'undefined') {
|
|
46052
|
+
apiPayload['bucketId'] = bucketId;
|
|
46053
|
+
}
|
|
46054
|
+
if (typeof fileId !== 'undefined') {
|
|
46055
|
+
apiPayload['fileId'] = fileId;
|
|
46056
|
+
}
|
|
46057
|
+
if (typeof name !== 'undefined') {
|
|
46058
|
+
apiPayload['name'] = name;
|
|
46059
|
+
}
|
|
46060
|
+
if (typeof code !== 'undefined') {
|
|
46061
|
+
apiPayload['code'] = code;
|
|
46062
|
+
}
|
|
46063
|
+
if (typeof xdefault !== 'undefined') {
|
|
46064
|
+
apiPayload['default'] = xdefault;
|
|
46065
|
+
}
|
|
46066
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46067
|
+
const apiHeaders = {
|
|
46068
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46069
|
+
'content-type': 'application/json',
|
|
46070
|
+
accept: 'application/json',
|
|
46071
|
+
};
|
|
46072
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
46073
|
+
}
|
|
46074
|
+
updateSubtitle(paramsOrFirst, ...rest) {
|
|
46075
|
+
let params;
|
|
46076
|
+
if (paramsOrFirst &&
|
|
46077
|
+
typeof paramsOrFirst === 'object' &&
|
|
46078
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46079
|
+
params = (paramsOrFirst || {});
|
|
46080
|
+
}
|
|
46081
|
+
else {
|
|
46082
|
+
params = {
|
|
46083
|
+
videoId: paramsOrFirst,
|
|
46084
|
+
subtitleId: rest[0],
|
|
46085
|
+
bucketId: rest[1],
|
|
46086
|
+
fileId: rest[2],
|
|
46087
|
+
name: rest[3],
|
|
46088
|
+
code: rest[4],
|
|
46089
|
+
xdefault: rest[5],
|
|
46090
|
+
};
|
|
46091
|
+
}
|
|
46092
|
+
const videoId = params.videoId;
|
|
46093
|
+
const subtitleId = params.subtitleId;
|
|
46094
|
+
const bucketId = params.bucketId;
|
|
46095
|
+
const fileId = params.fileId;
|
|
46096
|
+
const name = params.name;
|
|
46097
|
+
const code = params.code;
|
|
46098
|
+
const xdefault = params.xdefault;
|
|
46099
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
46100
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
46101
|
+
}
|
|
46102
|
+
if (typeof subtitleId === 'undefined' || subtitleId === '') {
|
|
46103
|
+
throw new AppwriteException('Missing required parameter: "subtitleId"');
|
|
46104
|
+
}
|
|
46105
|
+
const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
|
|
46106
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
46107
|
+
.replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
|
|
46108
|
+
const apiPayload = {};
|
|
46109
|
+
if (typeof bucketId !== 'undefined') {
|
|
46110
|
+
apiPayload['bucketId'] = bucketId;
|
|
46111
|
+
}
|
|
46112
|
+
if (typeof fileId !== 'undefined') {
|
|
46113
|
+
apiPayload['fileId'] = fileId;
|
|
46114
|
+
}
|
|
46115
|
+
if (typeof name !== 'undefined') {
|
|
46116
|
+
apiPayload['name'] = name;
|
|
46117
|
+
}
|
|
46118
|
+
if (typeof code !== 'undefined') {
|
|
46119
|
+
apiPayload['code'] = code;
|
|
46120
|
+
}
|
|
46121
|
+
if (typeof xdefault !== 'undefined') {
|
|
46122
|
+
apiPayload['default'] = xdefault;
|
|
46123
|
+
}
|
|
46124
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46125
|
+
const apiHeaders = {
|
|
46126
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46127
|
+
'content-type': 'application/json',
|
|
46128
|
+
accept: 'application/json',
|
|
46129
|
+
};
|
|
46130
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
46131
|
+
}
|
|
46132
|
+
deleteSubtitle(paramsOrFirst, ...rest) {
|
|
46133
|
+
let params;
|
|
46134
|
+
if (paramsOrFirst &&
|
|
46135
|
+
typeof paramsOrFirst === 'object' &&
|
|
46136
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46137
|
+
params = (paramsOrFirst || {});
|
|
46138
|
+
}
|
|
46139
|
+
else {
|
|
46140
|
+
params = {
|
|
46141
|
+
videoId: paramsOrFirst,
|
|
46142
|
+
subtitleId: rest[0],
|
|
46143
|
+
};
|
|
46144
|
+
}
|
|
46145
|
+
const videoId = params.videoId;
|
|
46146
|
+
const subtitleId = params.subtitleId;
|
|
46147
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
46148
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
46149
|
+
}
|
|
46150
|
+
if (typeof subtitleId === 'undefined' || subtitleId === '') {
|
|
46151
|
+
throw new AppwriteException('Missing required parameter: "subtitleId"');
|
|
46152
|
+
}
|
|
46153
|
+
const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
|
|
46154
|
+
.replace('{videoId}', encodeURIComponent(String(videoId)))
|
|
46155
|
+
.replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
|
|
46156
|
+
const apiPayload = {};
|
|
46157
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46158
|
+
const apiHeaders = {
|
|
46159
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46160
|
+
'content-type': 'application/json',
|
|
46161
|
+
accept: 'application/json',
|
|
46162
|
+
};
|
|
46163
|
+
return this.client.call('delete', uri, apiHeaders, apiPayload);
|
|
46164
|
+
}
|
|
46165
|
+
getTimeline(paramsOrFirst) {
|
|
46166
|
+
let params;
|
|
46167
|
+
if (paramsOrFirst &&
|
|
46168
|
+
typeof paramsOrFirst === 'object' &&
|
|
46169
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46170
|
+
params = (paramsOrFirst || {});
|
|
46171
|
+
}
|
|
46172
|
+
else {
|
|
46173
|
+
params = {
|
|
46174
|
+
videoId: paramsOrFirst,
|
|
46175
|
+
};
|
|
46176
|
+
}
|
|
46177
|
+
const videoId = params.videoId;
|
|
46178
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
46179
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
46180
|
+
}
|
|
46181
|
+
const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
46182
|
+
const apiPayload = {};
|
|
46183
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46184
|
+
const apiHeaders = {
|
|
46185
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46186
|
+
accept: 'text/plain',
|
|
46187
|
+
};
|
|
46188
|
+
return this.client.call('get', uri, apiHeaders, apiPayload, 'text');
|
|
46189
|
+
}
|
|
46190
|
+
createTimeline(paramsOrFirst) {
|
|
46191
|
+
let params;
|
|
46192
|
+
if (paramsOrFirst &&
|
|
46193
|
+
typeof paramsOrFirst === 'object' &&
|
|
46194
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46195
|
+
params = (paramsOrFirst || {});
|
|
46196
|
+
}
|
|
46197
|
+
else {
|
|
46198
|
+
params = {
|
|
46199
|
+
videoId: paramsOrFirst,
|
|
46200
|
+
};
|
|
46201
|
+
}
|
|
46202
|
+
const videoId = params.videoId;
|
|
46203
|
+
if (typeof videoId === 'undefined' || videoId === '') {
|
|
46204
|
+
throw new AppwriteException('Missing required parameter: "videoId"');
|
|
46205
|
+
}
|
|
46206
|
+
const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
|
|
46207
|
+
const apiPayload = {};
|
|
46208
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46209
|
+
const apiHeaders = {
|
|
46210
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46211
|
+
'content-type': 'application/json',
|
|
46212
|
+
accept: 'application/json',
|
|
46213
|
+
};
|
|
46214
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
46215
|
+
}
|
|
46216
|
+
}
|
|
46217
|
+
|
|
46218
|
+
class Waf {
|
|
46219
|
+
constructor(client) {
|
|
46220
|
+
this.client = client;
|
|
46221
|
+
}
|
|
46222
|
+
listRules(paramsOrFirst, ...rest) {
|
|
46223
|
+
let params;
|
|
46224
|
+
if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
|
|
46225
|
+
(paramsOrFirst &&
|
|
46226
|
+
typeof paramsOrFirst === 'object' &&
|
|
46227
|
+
!Array.isArray(paramsOrFirst))) {
|
|
46228
|
+
params = (paramsOrFirst || {});
|
|
46229
|
+
}
|
|
46230
|
+
else {
|
|
46231
|
+
params = {
|
|
46232
|
+
queries: paramsOrFirst,
|
|
46233
|
+
search: rest[0],
|
|
46234
|
+
total: rest[1],
|
|
46235
|
+
};
|
|
46236
|
+
}
|
|
46237
|
+
const queries = params.queries;
|
|
46238
|
+
const search = params.search;
|
|
46239
|
+
const total = params.total;
|
|
46240
|
+
const apiPath = '/waf/rules';
|
|
46241
|
+
const apiPayload = {};
|
|
46242
|
+
if (typeof queries !== 'undefined') {
|
|
46243
|
+
apiPayload['queries'] = queries;
|
|
46244
|
+
}
|
|
46245
|
+
if (typeof search !== 'undefined') {
|
|
46246
|
+
apiPayload['search'] = search;
|
|
46247
|
+
}
|
|
46248
|
+
if (typeof total !== 'undefined') {
|
|
46249
|
+
apiPayload['total'] = total;
|
|
46250
|
+
}
|
|
46251
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46252
|
+
const apiHeaders = {
|
|
46253
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46254
|
+
accept: 'application/json',
|
|
46255
|
+
};
|
|
46256
|
+
return this.client.call('get', uri, apiHeaders, apiPayload);
|
|
46257
|
+
}
|
|
46258
|
+
createBypassRule(paramsOrFirst, ...rest) {
|
|
46259
|
+
let params;
|
|
46260
|
+
if (paramsOrFirst &&
|
|
46261
|
+
typeof paramsOrFirst === 'object' &&
|
|
46262
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46263
|
+
params = (paramsOrFirst || {});
|
|
46264
|
+
}
|
|
46265
|
+
else {
|
|
46266
|
+
params = {
|
|
46267
|
+
ruleId: paramsOrFirst,
|
|
46268
|
+
resourceType: rest[0],
|
|
46269
|
+
name: rest[1],
|
|
46270
|
+
resourceId: rest[2],
|
|
46271
|
+
description: rest[3],
|
|
46272
|
+
priority: rest[4],
|
|
46273
|
+
enabled: rest[5],
|
|
46274
|
+
conditions: rest[6],
|
|
46275
|
+
};
|
|
46276
|
+
}
|
|
46277
|
+
const ruleId = params.ruleId;
|
|
46278
|
+
const resourceType = params.resourceType;
|
|
46279
|
+
const name = params.name;
|
|
46280
|
+
const resourceId = params.resourceId;
|
|
46281
|
+
const description = params.description;
|
|
46282
|
+
const priority = params.priority;
|
|
46283
|
+
const enabled = params.enabled;
|
|
46284
|
+
const conditions = params.conditions;
|
|
46285
|
+
if (typeof ruleId === 'undefined') {
|
|
46286
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
46287
|
+
}
|
|
46288
|
+
if (typeof resourceType === 'undefined') {
|
|
46289
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
46290
|
+
}
|
|
46291
|
+
if (typeof name === 'undefined') {
|
|
46292
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
46293
|
+
}
|
|
46294
|
+
const apiPath = '/waf/rules/bypass';
|
|
46295
|
+
const apiPayload = {};
|
|
46296
|
+
if (typeof ruleId !== 'undefined') {
|
|
46297
|
+
apiPayload['ruleId'] = ruleId;
|
|
46298
|
+
}
|
|
46299
|
+
if (typeof resourceType !== 'undefined') {
|
|
46300
|
+
apiPayload['resourceType'] = resourceType;
|
|
46301
|
+
}
|
|
46302
|
+
if (typeof resourceId !== 'undefined') {
|
|
46303
|
+
apiPayload['resourceId'] = resourceId;
|
|
46304
|
+
}
|
|
46305
|
+
if (typeof name !== 'undefined') {
|
|
46306
|
+
apiPayload['name'] = name;
|
|
46307
|
+
}
|
|
46308
|
+
if (typeof description !== 'undefined') {
|
|
46309
|
+
apiPayload['description'] = description;
|
|
46310
|
+
}
|
|
46311
|
+
if (typeof priority !== 'undefined') {
|
|
46312
|
+
apiPayload['priority'] = priority;
|
|
46313
|
+
}
|
|
46314
|
+
if (typeof enabled !== 'undefined') {
|
|
46315
|
+
apiPayload['enabled'] = enabled;
|
|
46316
|
+
}
|
|
46317
|
+
if (typeof conditions !== 'undefined') {
|
|
46318
|
+
apiPayload['conditions'] = conditions;
|
|
46319
|
+
}
|
|
46320
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46321
|
+
const apiHeaders = {
|
|
46322
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46323
|
+
'content-type': 'application/json',
|
|
46324
|
+
accept: 'application/json',
|
|
46325
|
+
};
|
|
46326
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
46327
|
+
}
|
|
46328
|
+
updateBypassRule(paramsOrFirst, ...rest) {
|
|
46329
|
+
let params;
|
|
46330
|
+
if (paramsOrFirst &&
|
|
46331
|
+
typeof paramsOrFirst === 'object' &&
|
|
46332
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46333
|
+
params = (paramsOrFirst || {});
|
|
46334
|
+
}
|
|
46335
|
+
else {
|
|
46336
|
+
params = {
|
|
46337
|
+
ruleId: paramsOrFirst,
|
|
46338
|
+
resourceType: rest[0],
|
|
46339
|
+
resourceId: rest[1],
|
|
46340
|
+
name: rest[2],
|
|
46341
|
+
description: rest[3],
|
|
46342
|
+
priority: rest[4],
|
|
46343
|
+
enabled: rest[5],
|
|
46344
|
+
conditions: rest[6],
|
|
46345
|
+
};
|
|
46346
|
+
}
|
|
46347
|
+
const ruleId = params.ruleId;
|
|
46348
|
+
const resourceType = params.resourceType;
|
|
46349
|
+
const resourceId = params.resourceId;
|
|
46350
|
+
const name = params.name;
|
|
46351
|
+
const description = params.description;
|
|
46352
|
+
const priority = params.priority;
|
|
46353
|
+
const enabled = params.enabled;
|
|
46354
|
+
const conditions = params.conditions;
|
|
46355
|
+
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
46356
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
46357
|
+
}
|
|
46358
|
+
const apiPath = '/waf/rules/bypass/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
|
|
46359
|
+
const apiPayload = {};
|
|
46360
|
+
if (typeof resourceType !== 'undefined') {
|
|
46361
|
+
apiPayload['resourceType'] = resourceType;
|
|
46362
|
+
}
|
|
46363
|
+
if (typeof resourceId !== 'undefined') {
|
|
46364
|
+
apiPayload['resourceId'] = resourceId;
|
|
46365
|
+
}
|
|
46366
|
+
if (typeof name !== 'undefined') {
|
|
46367
|
+
apiPayload['name'] = name;
|
|
46368
|
+
}
|
|
46369
|
+
if (typeof description !== 'undefined') {
|
|
46370
|
+
apiPayload['description'] = description;
|
|
46371
|
+
}
|
|
46372
|
+
if (typeof priority !== 'undefined') {
|
|
46373
|
+
apiPayload['priority'] = priority;
|
|
46374
|
+
}
|
|
46375
|
+
if (typeof enabled !== 'undefined') {
|
|
46376
|
+
apiPayload['enabled'] = enabled;
|
|
46377
|
+
}
|
|
46378
|
+
if (typeof conditions !== 'undefined') {
|
|
46379
|
+
apiPayload['conditions'] = conditions;
|
|
46380
|
+
}
|
|
46381
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46382
|
+
const apiHeaders = {
|
|
46383
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46384
|
+
'content-type': 'application/json',
|
|
46385
|
+
accept: 'application/json',
|
|
46386
|
+
};
|
|
46387
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
46388
|
+
}
|
|
46389
|
+
createChallengeRule(paramsOrFirst, ...rest) {
|
|
46390
|
+
let params;
|
|
46391
|
+
if (paramsOrFirst &&
|
|
46392
|
+
typeof paramsOrFirst === 'object' &&
|
|
46393
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46394
|
+
params = (paramsOrFirst || {});
|
|
46395
|
+
}
|
|
46396
|
+
else {
|
|
46397
|
+
params = {
|
|
46398
|
+
ruleId: paramsOrFirst,
|
|
46399
|
+
resourceType: rest[0],
|
|
46400
|
+
name: rest[1],
|
|
46401
|
+
resourceId: rest[2],
|
|
46402
|
+
description: rest[3],
|
|
46403
|
+
challengeType: rest[4],
|
|
46404
|
+
priority: rest[5],
|
|
46405
|
+
enabled: rest[6],
|
|
46406
|
+
conditions: rest[7],
|
|
46407
|
+
difficulty: rest[8],
|
|
46408
|
+
ttl: rest[9],
|
|
46409
|
+
};
|
|
46410
|
+
}
|
|
46411
|
+
const ruleId = params.ruleId;
|
|
46412
|
+
const resourceType = params.resourceType;
|
|
46413
|
+
const name = params.name;
|
|
46414
|
+
const resourceId = params.resourceId;
|
|
46415
|
+
const description = params.description;
|
|
46416
|
+
const challengeType = params.challengeType;
|
|
46417
|
+
const priority = params.priority;
|
|
46418
|
+
const enabled = params.enabled;
|
|
46419
|
+
const conditions = params.conditions;
|
|
46420
|
+
const difficulty = params.difficulty;
|
|
46421
|
+
const ttl = params.ttl;
|
|
46422
|
+
if (typeof ruleId === 'undefined') {
|
|
46423
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
46424
|
+
}
|
|
46425
|
+
if (typeof resourceType === 'undefined') {
|
|
46426
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
46427
|
+
}
|
|
46428
|
+
if (typeof name === 'undefined') {
|
|
46429
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
46430
|
+
}
|
|
46431
|
+
const apiPath = '/waf/rules/challenge';
|
|
46432
|
+
const apiPayload = {};
|
|
46433
|
+
if (typeof ruleId !== 'undefined') {
|
|
46434
|
+
apiPayload['ruleId'] = ruleId;
|
|
46435
|
+
}
|
|
46436
|
+
if (typeof resourceType !== 'undefined') {
|
|
46437
|
+
apiPayload['resourceType'] = resourceType;
|
|
46438
|
+
}
|
|
46439
|
+
if (typeof resourceId !== 'undefined') {
|
|
46440
|
+
apiPayload['resourceId'] = resourceId;
|
|
46441
|
+
}
|
|
46442
|
+
if (typeof name !== 'undefined') {
|
|
46443
|
+
apiPayload['name'] = name;
|
|
46444
|
+
}
|
|
46445
|
+
if (typeof description !== 'undefined') {
|
|
46446
|
+
apiPayload['description'] = description;
|
|
46447
|
+
}
|
|
46448
|
+
if (typeof challengeType !== 'undefined') {
|
|
46449
|
+
apiPayload['challengeType'] = challengeType;
|
|
46450
|
+
}
|
|
46451
|
+
if (typeof priority !== 'undefined') {
|
|
46452
|
+
apiPayload['priority'] = priority;
|
|
46453
|
+
}
|
|
46454
|
+
if (typeof enabled !== 'undefined') {
|
|
46455
|
+
apiPayload['enabled'] = enabled;
|
|
46456
|
+
}
|
|
46457
|
+
if (typeof conditions !== 'undefined') {
|
|
46458
|
+
apiPayload['conditions'] = conditions;
|
|
46459
|
+
}
|
|
46460
|
+
if (typeof difficulty !== 'undefined') {
|
|
46461
|
+
apiPayload['difficulty'] = difficulty;
|
|
46462
|
+
}
|
|
46463
|
+
if (typeof ttl !== 'undefined') {
|
|
46464
|
+
apiPayload['ttl'] = ttl;
|
|
46465
|
+
}
|
|
46466
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46467
|
+
const apiHeaders = {
|
|
46468
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46469
|
+
'content-type': 'application/json',
|
|
46470
|
+
accept: 'application/json',
|
|
46471
|
+
};
|
|
46472
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
46473
|
+
}
|
|
46474
|
+
updateChallengeRule(paramsOrFirst, ...rest) {
|
|
46475
|
+
let params;
|
|
46476
|
+
if (paramsOrFirst &&
|
|
46477
|
+
typeof paramsOrFirst === 'object' &&
|
|
46478
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46479
|
+
params = (paramsOrFirst || {});
|
|
46480
|
+
}
|
|
46481
|
+
else {
|
|
46482
|
+
params = {
|
|
46483
|
+
ruleId: paramsOrFirst,
|
|
46484
|
+
resourceType: rest[0],
|
|
46485
|
+
resourceId: rest[1],
|
|
46486
|
+
name: rest[2],
|
|
46487
|
+
description: rest[3],
|
|
46488
|
+
challengeType: rest[4],
|
|
46489
|
+
priority: rest[5],
|
|
46490
|
+
enabled: rest[6],
|
|
46491
|
+
conditions: rest[7],
|
|
46492
|
+
difficulty: rest[8],
|
|
46493
|
+
ttl: rest[9],
|
|
46494
|
+
};
|
|
46495
|
+
}
|
|
46496
|
+
const ruleId = params.ruleId;
|
|
46497
|
+
const resourceType = params.resourceType;
|
|
46498
|
+
const resourceId = params.resourceId;
|
|
46499
|
+
const name = params.name;
|
|
46500
|
+
const description = params.description;
|
|
46501
|
+
const challengeType = params.challengeType;
|
|
46502
|
+
const priority = params.priority;
|
|
46503
|
+
const enabled = params.enabled;
|
|
46504
|
+
const conditions = params.conditions;
|
|
46505
|
+
const difficulty = params.difficulty;
|
|
46506
|
+
const ttl = params.ttl;
|
|
46507
|
+
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
46508
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
46509
|
+
}
|
|
46510
|
+
const apiPath = '/waf/rules/challenge/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
|
|
46511
|
+
const apiPayload = {};
|
|
46512
|
+
if (typeof resourceType !== 'undefined') {
|
|
46513
|
+
apiPayload['resourceType'] = resourceType;
|
|
46514
|
+
}
|
|
46515
|
+
if (typeof resourceId !== 'undefined') {
|
|
46516
|
+
apiPayload['resourceId'] = resourceId;
|
|
46517
|
+
}
|
|
46518
|
+
if (typeof name !== 'undefined') {
|
|
46519
|
+
apiPayload['name'] = name;
|
|
46520
|
+
}
|
|
46521
|
+
if (typeof description !== 'undefined') {
|
|
46522
|
+
apiPayload['description'] = description;
|
|
46523
|
+
}
|
|
46524
|
+
if (typeof challengeType !== 'undefined') {
|
|
46525
|
+
apiPayload['challengeType'] = challengeType;
|
|
46526
|
+
}
|
|
46527
|
+
if (typeof priority !== 'undefined') {
|
|
46528
|
+
apiPayload['priority'] = priority;
|
|
46529
|
+
}
|
|
46530
|
+
if (typeof enabled !== 'undefined') {
|
|
46531
|
+
apiPayload['enabled'] = enabled;
|
|
46532
|
+
}
|
|
46533
|
+
if (typeof conditions !== 'undefined') {
|
|
46534
|
+
apiPayload['conditions'] = conditions;
|
|
46535
|
+
}
|
|
46536
|
+
if (typeof difficulty !== 'undefined') {
|
|
46537
|
+
apiPayload['difficulty'] = difficulty;
|
|
46538
|
+
}
|
|
46539
|
+
if (typeof ttl !== 'undefined') {
|
|
46540
|
+
apiPayload['ttl'] = ttl;
|
|
46541
|
+
}
|
|
46542
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46543
|
+
const apiHeaders = {
|
|
46544
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46545
|
+
'content-type': 'application/json',
|
|
46546
|
+
accept: 'application/json',
|
|
46547
|
+
};
|
|
46548
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
46549
|
+
}
|
|
46550
|
+
createDenyRule(paramsOrFirst, ...rest) {
|
|
46551
|
+
let params;
|
|
46552
|
+
if (paramsOrFirst &&
|
|
46553
|
+
typeof paramsOrFirst === 'object' &&
|
|
46554
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46555
|
+
params = (paramsOrFirst || {});
|
|
46556
|
+
}
|
|
46557
|
+
else {
|
|
46558
|
+
params = {
|
|
46559
|
+
ruleId: paramsOrFirst,
|
|
46560
|
+
resourceType: rest[0],
|
|
46561
|
+
name: rest[1],
|
|
46562
|
+
resourceId: rest[2],
|
|
46563
|
+
description: rest[3],
|
|
46564
|
+
priority: rest[4],
|
|
46565
|
+
enabled: rest[5],
|
|
46566
|
+
conditions: rest[6],
|
|
46567
|
+
};
|
|
46568
|
+
}
|
|
46569
|
+
const ruleId = params.ruleId;
|
|
46570
|
+
const resourceType = params.resourceType;
|
|
46571
|
+
const name = params.name;
|
|
46572
|
+
const resourceId = params.resourceId;
|
|
46573
|
+
const description = params.description;
|
|
46574
|
+
const priority = params.priority;
|
|
46575
|
+
const enabled = params.enabled;
|
|
46576
|
+
const conditions = params.conditions;
|
|
46577
|
+
if (typeof ruleId === 'undefined') {
|
|
46578
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
46579
|
+
}
|
|
46580
|
+
if (typeof resourceType === 'undefined') {
|
|
46581
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
46582
|
+
}
|
|
46583
|
+
if (typeof name === 'undefined') {
|
|
46584
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
46585
|
+
}
|
|
46586
|
+
const apiPath = '/waf/rules/deny';
|
|
46587
|
+
const apiPayload = {};
|
|
46588
|
+
if (typeof ruleId !== 'undefined') {
|
|
46589
|
+
apiPayload['ruleId'] = ruleId;
|
|
46590
|
+
}
|
|
46591
|
+
if (typeof resourceType !== 'undefined') {
|
|
46592
|
+
apiPayload['resourceType'] = resourceType;
|
|
46593
|
+
}
|
|
46594
|
+
if (typeof resourceId !== 'undefined') {
|
|
46595
|
+
apiPayload['resourceId'] = resourceId;
|
|
46596
|
+
}
|
|
46597
|
+
if (typeof name !== 'undefined') {
|
|
46598
|
+
apiPayload['name'] = name;
|
|
46599
|
+
}
|
|
46600
|
+
if (typeof description !== 'undefined') {
|
|
46601
|
+
apiPayload['description'] = description;
|
|
46602
|
+
}
|
|
46603
|
+
if (typeof priority !== 'undefined') {
|
|
46604
|
+
apiPayload['priority'] = priority;
|
|
46605
|
+
}
|
|
46606
|
+
if (typeof enabled !== 'undefined') {
|
|
46607
|
+
apiPayload['enabled'] = enabled;
|
|
46608
|
+
}
|
|
46609
|
+
if (typeof conditions !== 'undefined') {
|
|
46610
|
+
apiPayload['conditions'] = conditions;
|
|
46611
|
+
}
|
|
46612
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46613
|
+
const apiHeaders = {
|
|
46614
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46615
|
+
'content-type': 'application/json',
|
|
46616
|
+
accept: 'application/json',
|
|
46617
|
+
};
|
|
46618
|
+
return this.client.call('post', uri, apiHeaders, apiPayload);
|
|
46619
|
+
}
|
|
46620
|
+
updateDenyRule(paramsOrFirst, ...rest) {
|
|
46621
|
+
let params;
|
|
46622
|
+
if (paramsOrFirst &&
|
|
46623
|
+
typeof paramsOrFirst === 'object' &&
|
|
46624
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46625
|
+
params = (paramsOrFirst || {});
|
|
46626
|
+
}
|
|
46627
|
+
else {
|
|
46628
|
+
params = {
|
|
46629
|
+
ruleId: paramsOrFirst,
|
|
46630
|
+
resourceType: rest[0],
|
|
46631
|
+
resourceId: rest[1],
|
|
46632
|
+
name: rest[2],
|
|
46633
|
+
description: rest[3],
|
|
46634
|
+
priority: rest[4],
|
|
46635
|
+
enabled: rest[5],
|
|
46636
|
+
conditions: rest[6],
|
|
46637
|
+
};
|
|
46638
|
+
}
|
|
46639
|
+
const ruleId = params.ruleId;
|
|
46640
|
+
const resourceType = params.resourceType;
|
|
46641
|
+
const resourceId = params.resourceId;
|
|
46642
|
+
const name = params.name;
|
|
46643
|
+
const description = params.description;
|
|
46644
|
+
const priority = params.priority;
|
|
46645
|
+
const enabled = params.enabled;
|
|
46646
|
+
const conditions = params.conditions;
|
|
46647
|
+
if (typeof ruleId === 'undefined' || ruleId === '') {
|
|
46648
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
46649
|
+
}
|
|
46650
|
+
const apiPath = '/waf/rules/deny/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
|
|
46651
|
+
const apiPayload = {};
|
|
46652
|
+
if (typeof resourceType !== 'undefined') {
|
|
46653
|
+
apiPayload['resourceType'] = resourceType;
|
|
46654
|
+
}
|
|
46655
|
+
if (typeof resourceId !== 'undefined') {
|
|
46656
|
+
apiPayload['resourceId'] = resourceId;
|
|
46657
|
+
}
|
|
46658
|
+
if (typeof name !== 'undefined') {
|
|
46659
|
+
apiPayload['name'] = name;
|
|
46660
|
+
}
|
|
46661
|
+
if (typeof description !== 'undefined') {
|
|
46662
|
+
apiPayload['description'] = description;
|
|
46663
|
+
}
|
|
46664
|
+
if (typeof priority !== 'undefined') {
|
|
46665
|
+
apiPayload['priority'] = priority;
|
|
46666
|
+
}
|
|
46667
|
+
if (typeof enabled !== 'undefined') {
|
|
46668
|
+
apiPayload['enabled'] = enabled;
|
|
46669
|
+
}
|
|
46670
|
+
if (typeof conditions !== 'undefined') {
|
|
46671
|
+
apiPayload['conditions'] = conditions;
|
|
46672
|
+
}
|
|
46673
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
46674
|
+
const apiHeaders = {
|
|
46675
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
46676
|
+
'content-type': 'application/json',
|
|
46677
|
+
accept: 'application/json',
|
|
46678
|
+
};
|
|
46679
|
+
return this.client.call('patch', uri, apiHeaders, apiPayload);
|
|
46680
|
+
}
|
|
46681
|
+
createRateLimitRule(paramsOrFirst, ...rest) {
|
|
46682
|
+
let params;
|
|
46683
|
+
if (paramsOrFirst &&
|
|
46684
|
+
typeof paramsOrFirst === 'object' &&
|
|
46685
|
+
!Array.isArray(paramsOrFirst)) {
|
|
46686
|
+
params = (paramsOrFirst || {});
|
|
46687
|
+
}
|
|
46688
|
+
else {
|
|
46689
|
+
params = {
|
|
46690
|
+
ruleId: paramsOrFirst,
|
|
46691
|
+
resourceType: rest[0],
|
|
46692
|
+
name: rest[1],
|
|
46693
|
+
limit: rest[2],
|
|
46694
|
+
interval: rest[3],
|
|
46695
|
+
resourceId: rest[4],
|
|
46696
|
+
description: rest[5],
|
|
46697
|
+
key: rest[6],
|
|
46698
|
+
strategy: rest[7],
|
|
46699
|
+
maxBucketSize: rest[8],
|
|
46700
|
+
priority: rest[9],
|
|
46701
|
+
enabled: rest[10],
|
|
46702
|
+
conditions: rest[11],
|
|
46703
|
+
};
|
|
46704
|
+
}
|
|
46705
|
+
const ruleId = params.ruleId;
|
|
46706
|
+
const resourceType = params.resourceType;
|
|
46707
|
+
const name = params.name;
|
|
46708
|
+
const limit = params.limit;
|
|
46709
|
+
const interval = params.interval;
|
|
46710
|
+
const resourceId = params.resourceId;
|
|
46711
|
+
const description = params.description;
|
|
46712
|
+
const key = params.key;
|
|
46713
|
+
const strategy = params.strategy;
|
|
46714
|
+
const maxBucketSize = params.maxBucketSize;
|
|
46715
|
+
const priority = params.priority;
|
|
46716
|
+
const enabled = params.enabled;
|
|
46717
|
+
const conditions = params.conditions;
|
|
46718
|
+
if (typeof ruleId === 'undefined') {
|
|
46719
|
+
throw new AppwriteException('Missing required parameter: "ruleId"');
|
|
46720
|
+
}
|
|
46721
|
+
if (typeof resourceType === 'undefined') {
|
|
46722
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
46723
|
+
}
|
|
46724
|
+
if (typeof name === 'undefined') {
|
|
46725
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
46726
|
+
}
|
|
46727
|
+
if (typeof limit === 'undefined') {
|
|
46728
|
+
throw new AppwriteException('Missing required parameter: "limit"');
|
|
46729
|
+
}
|
|
46730
|
+
if (typeof interval === 'undefined') {
|
|
46731
|
+
throw new AppwriteException('Missing required parameter: "interval"');
|
|
46732
|
+
}
|
|
46733
|
+
const apiPath = '/waf/rules/rate-limit';
|
|
46734
|
+
const apiPayload = {};
|
|
46735
|
+
if (typeof ruleId !== 'undefined') {
|
|
46736
|
+
apiPayload['ruleId'] = ruleId;
|
|
46737
|
+
}
|
|
46738
|
+
if (typeof resourceType !== 'undefined') {
|
|
46739
|
+
apiPayload['resourceType'] = resourceType;
|
|
46740
|
+
}
|
|
46741
|
+
if (typeof resourceId !== 'undefined') {
|
|
46742
|
+
apiPayload['resourceId'] = resourceId;
|
|
46743
|
+
}
|
|
46744
|
+
if (typeof name !== 'undefined') {
|
|
46745
|
+
apiPayload['name'] = name;
|
|
46746
|
+
}
|
|
46747
|
+
if (typeof description !== 'undefined') {
|
|
46748
|
+
apiPayload['description'] = description;
|
|
44774
46749
|
}
|
|
44775
46750
|
if (typeof limit !== 'undefined') {
|
|
44776
46751
|
apiPayload['limit'] = limit;
|
|
@@ -46002,9 +47977,8 @@ const RECONNECT_PERIOD_MS = 2000;
|
|
|
46002
47977
|
* );
|
|
46003
47978
|
* // sub.update({ background: true }); sub.unsubscribe();
|
|
46004
47979
|
*/
|
|
46005
|
-
class Push
|
|
47980
|
+
class Push {
|
|
46006
47981
|
constructor(client) {
|
|
46007
|
-
super(client);
|
|
46008
47982
|
this.mqtt = null;
|
|
46009
47983
|
this.connecting = null;
|
|
46010
47984
|
this.Buffer = null;
|
|
@@ -46034,6 +48008,7 @@ class Push extends Service {
|
|
|
46034
48008
|
this.connectedKey = '';
|
|
46035
48009
|
this.connectionEpoch = 0;
|
|
46036
48010
|
this.subscriptions = new Map();
|
|
48011
|
+
this.client = client;
|
|
46037
48012
|
}
|
|
46038
48013
|
// The broker subscription for a filter uses the highest QoS any local subscription on
|
|
46039
48014
|
// it wants, so a QoS-0 subscription never downgrades a QoS-1 one sharing the filter.
|
|
@@ -46773,6 +48748,670 @@ function matches(filter, topic) {
|
|
|
46773
48748
|
return filterParts.length === topicParts.length;
|
|
46774
48749
|
}
|
|
46775
48750
|
|
|
48751
|
+
/**
|
|
48752
|
+
* Analytics auto-tracking helpers.
|
|
48753
|
+
*
|
|
48754
|
+
* These are hand-written companions to the generated `Analytics` service.
|
|
48755
|
+
* The generated service exposes `createEvent(params)` for arbitrary events;
|
|
48756
|
+
* this module wires up common auto-tracking behaviours (pageviews, outbound
|
|
48757
|
+
* links, downloads, scroll depth, active engagement) on top of it.
|
|
48758
|
+
*
|
|
48759
|
+
* The tracking helpers accept a plain event-emitter function so they do not
|
|
48760
|
+
* hard-couple to the generated `Analytics` class. The emitter adapts this
|
|
48761
|
+
* module's option shape to `createEvent`: `url` is required there, and `props`
|
|
48762
|
+
* is a flat alternating key/value list rather than an object.
|
|
48763
|
+
*
|
|
48764
|
+
* ```ts
|
|
48765
|
+
* const analytics = new Analytics(client);
|
|
48766
|
+
* const tracking = new AnalyticsTracking(
|
|
48767
|
+
* (name, options) => analytics.createEvent({
|
|
48768
|
+
* propertyId: options?.propertyId ?? '<PROPERTY_ID>',
|
|
48769
|
+
* name,
|
|
48770
|
+
* url: options?.url ?? window.location.href,
|
|
48771
|
+
* referrer: options?.referrer,
|
|
48772
|
+
* scrollDepth: options?.scrollDepth,
|
|
48773
|
+
* engagementTime: options?.engagementTime,
|
|
48774
|
+
* props: Object.entries(options?.props ?? {}).flatMap(
|
|
48775
|
+
* ([key, value]) => [key, String(value)],
|
|
48776
|
+
* ),
|
|
48777
|
+
* }),
|
|
48778
|
+
* { propertyId: '<PROPERTY_ID>' }
|
|
48779
|
+
* );
|
|
48780
|
+
* tracking.enableAllAutoTracking();
|
|
48781
|
+
* ```
|
|
48782
|
+
*
|
|
48783
|
+
* `propertyId` is optional: when set it is merged into the options of every
|
|
48784
|
+
* emitted event, so an emitter that forwards `options.propertyId` (as above)
|
|
48785
|
+
* picks it up instead of every caller hand-rolling it into the closure.
|
|
48786
|
+
* Per-event `propertyId` always wins over the configured default.
|
|
48787
|
+
*
|
|
48788
|
+
* All helpers respect `navigator.doNotTrack === '1'` by default; opt out with
|
|
48789
|
+
* `respectDoNotTrack: false` in the constructor options.
|
|
48790
|
+
*
|
|
48791
|
+
* Engagement time follows Plausible's model: rather than one total at unload,
|
|
48792
|
+
* a delta is emitted at every natural checkpoint of the visit (tab hidden, SPA
|
|
48793
|
+
* route change, unload). See `enableAutoEngagementTime` for details.
|
|
48794
|
+
*
|
|
48795
|
+
* Auto-emitted event names follow `snake_case` + lowercase (`pageview`,
|
|
48796
|
+
* `outbound_link`, `file_download`, `screen_view`, etc.). Any prop keys use
|
|
48797
|
+
* camelCase to match the endpoint's parameter naming. Callers can pass any
|
|
48798
|
+
* custom event name; the auto-track methods only own the events they emit
|
|
48799
|
+
* themselves.
|
|
48800
|
+
*/
|
|
48801
|
+
const DEFAULT_DOWNLOAD_EXTENSIONS = [
|
|
48802
|
+
'pdf',
|
|
48803
|
+
'zip',
|
|
48804
|
+
'rar',
|
|
48805
|
+
'7z',
|
|
48806
|
+
'tar',
|
|
48807
|
+
'gz',
|
|
48808
|
+
'csv',
|
|
48809
|
+
'tsv',
|
|
48810
|
+
'xls',
|
|
48811
|
+
'xlsx',
|
|
48812
|
+
'doc',
|
|
48813
|
+
'docx',
|
|
48814
|
+
'ppt',
|
|
48815
|
+
'pptx',
|
|
48816
|
+
'dmg',
|
|
48817
|
+
'exe',
|
|
48818
|
+
'msi',
|
|
48819
|
+
'pkg',
|
|
48820
|
+
'deb',
|
|
48821
|
+
'rpm',
|
|
48822
|
+
'apk',
|
|
48823
|
+
'mp3',
|
|
48824
|
+
'wav',
|
|
48825
|
+
'flac',
|
|
48826
|
+
'mp4',
|
|
48827
|
+
'mov',
|
|
48828
|
+
'avi',
|
|
48829
|
+
'mkv',
|
|
48830
|
+
'webm',
|
|
48831
|
+
];
|
|
48832
|
+
/**
|
|
48833
|
+
* Two-part public suffixes common enough to matter for outbound-link detection.
|
|
48834
|
+
* See `rootDomain()` for why this is a short list rather than the Public Suffix
|
|
48835
|
+
* List.
|
|
48836
|
+
*/
|
|
48837
|
+
const MULTI_PART_SUFFIXES = new Set([
|
|
48838
|
+
'co.uk',
|
|
48839
|
+
'org.uk',
|
|
48840
|
+
'ac.uk',
|
|
48841
|
+
'gov.uk',
|
|
48842
|
+
'me.uk',
|
|
48843
|
+
'net.uk',
|
|
48844
|
+
'sch.uk',
|
|
48845
|
+
'co.jp',
|
|
48846
|
+
'ne.jp',
|
|
48847
|
+
'or.jp',
|
|
48848
|
+
'ac.jp',
|
|
48849
|
+
'go.jp',
|
|
48850
|
+
'com.au',
|
|
48851
|
+
'net.au',
|
|
48852
|
+
'org.au',
|
|
48853
|
+
'edu.au',
|
|
48854
|
+
'gov.au',
|
|
48855
|
+
'com.br',
|
|
48856
|
+
'net.br',
|
|
48857
|
+
'org.br',
|
|
48858
|
+
'com.cn',
|
|
48859
|
+
'net.cn',
|
|
48860
|
+
'org.cn',
|
|
48861
|
+
'gov.cn',
|
|
48862
|
+
'co.in',
|
|
48863
|
+
'net.in',
|
|
48864
|
+
'org.in',
|
|
48865
|
+
'co.nz',
|
|
48866
|
+
'net.nz',
|
|
48867
|
+
'org.nz',
|
|
48868
|
+
'co.za',
|
|
48869
|
+
'org.za',
|
|
48870
|
+
'com.mx',
|
|
48871
|
+
'com.ar',
|
|
48872
|
+
'com.co',
|
|
48873
|
+
'com.pe',
|
|
48874
|
+
'com.tr',
|
|
48875
|
+
'com.tw',
|
|
48876
|
+
'com.sg',
|
|
48877
|
+
'com.hk',
|
|
48878
|
+
'com.my',
|
|
48879
|
+
'com.ph',
|
|
48880
|
+
'com.vn',
|
|
48881
|
+
'co.kr',
|
|
48882
|
+
'co.il',
|
|
48883
|
+
'co.id',
|
|
48884
|
+
'co.th',
|
|
48885
|
+
'com.ua',
|
|
48886
|
+
'com.pl',
|
|
48887
|
+
'com.es',
|
|
48888
|
+
]);
|
|
48889
|
+
const SCROLL_DEPTH_THROTTLE_MS = 200;
|
|
48890
|
+
class AnalyticsTracking {
|
|
48891
|
+
constructor(emit, options = {}) {
|
|
48892
|
+
this.pageviewCleanups = [];
|
|
48893
|
+
this.scrollCleanups = [];
|
|
48894
|
+
this.engagementCleanups = [];
|
|
48895
|
+
this.maxScrollDepth = 0;
|
|
48896
|
+
this.scrollTicking = false;
|
|
48897
|
+
this.lastScrollReport = 0;
|
|
48898
|
+
this.engagementStart = 0;
|
|
48899
|
+
this.engagementAccumulatedMs = 0;
|
|
48900
|
+
this.engagementActive = false;
|
|
48901
|
+
this.emit = emit;
|
|
48902
|
+
this.respectDoNotTrack = options.respectDoNotTrack !== false;
|
|
48903
|
+
this.propertyId = options.propertyId;
|
|
48904
|
+
}
|
|
48905
|
+
/**
|
|
48906
|
+
* Enable the opinionated default auto-tracking set: pageviews, outbound
|
|
48907
|
+
* links, scroll depth and active engagement time. Downloads must be opted
|
|
48908
|
+
* into separately via `enableAutoDownloadTracking()` because the extension
|
|
48909
|
+
* list is application-specific.
|
|
48910
|
+
*/
|
|
48911
|
+
enableAllAutoTracking() {
|
|
48912
|
+
this.enableAutoPageviews();
|
|
48913
|
+
this.enableAutoOutboundTracking();
|
|
48914
|
+
this.enableAutoScrollDepth();
|
|
48915
|
+
this.enableAutoEngagementTime();
|
|
48916
|
+
}
|
|
48917
|
+
/**
|
|
48918
|
+
* Track an event manually. Respects the DNT setting and swallows emitter
|
|
48919
|
+
* exceptions so tracking failures never surface to the host page.
|
|
48920
|
+
*/
|
|
48921
|
+
track(name, options) {
|
|
48922
|
+
if (!this.canTrack()) {
|
|
48923
|
+
return;
|
|
48924
|
+
}
|
|
48925
|
+
try {
|
|
48926
|
+
this.emit(name, this.withPropertyId(options));
|
|
48927
|
+
}
|
|
48928
|
+
catch (error) {
|
|
48929
|
+
console.warn('AnalyticsTracking: emitter threw', error);
|
|
48930
|
+
}
|
|
48931
|
+
}
|
|
48932
|
+
/**
|
|
48933
|
+
* Convenience wrapper for pageview-shaped events.
|
|
48934
|
+
*/
|
|
48935
|
+
pageview(url, referrer) {
|
|
48936
|
+
this.track('pageview', {
|
|
48937
|
+
url: url !== null && url !== void 0 ? url : this.currentPageUrl(),
|
|
48938
|
+
referrer: referrer !== null && referrer !== void 0 ? referrer : (typeof document !== 'undefined'
|
|
48939
|
+
? document.referrer
|
|
48940
|
+
: undefined),
|
|
48941
|
+
});
|
|
48942
|
+
}
|
|
48943
|
+
/**
|
|
48944
|
+
* Enable SPA-aware pageview tracking. Fires an initial pageview on
|
|
48945
|
+
* enable, then again on every `pushState`, `replaceState`, `popstate`
|
|
48946
|
+
* or hashchange. Idempotent — repeat calls no-op.
|
|
48947
|
+
*/
|
|
48948
|
+
enableAutoPageviews() {
|
|
48949
|
+
if (this.pageviewCleanups.length > 0) {
|
|
48950
|
+
return;
|
|
48951
|
+
}
|
|
48952
|
+
if (typeof window === 'undefined' || typeof history === 'undefined') {
|
|
48953
|
+
return;
|
|
48954
|
+
}
|
|
48955
|
+
this.currentPath = this.currentPageUrl();
|
|
48956
|
+
this.pageview();
|
|
48957
|
+
const handleNavigation = () => {
|
|
48958
|
+
const nextPath = this.currentPageUrl();
|
|
48959
|
+
if (nextPath === this.currentPath) {
|
|
48960
|
+
return;
|
|
48961
|
+
}
|
|
48962
|
+
const previous = this.currentPath;
|
|
48963
|
+
this.currentPath = nextPath;
|
|
48964
|
+
this.flushScrollDepth(previous);
|
|
48965
|
+
this.flushEngagement(previous);
|
|
48966
|
+
this.pageview(nextPath);
|
|
48967
|
+
// flushEngagement no longer auto-restarts the timer (see its
|
|
48968
|
+
// implementation note re: bfcache). SPA navigation stays on the
|
|
48969
|
+
// same document, so restart engagement tracking for the new
|
|
48970
|
+
// route as long as the tab is visible.
|
|
48971
|
+
if (this.engagementCleanups.length > 0 &&
|
|
48972
|
+
(typeof document === 'undefined' ||
|
|
48973
|
+
document.visibilityState !== 'hidden')) {
|
|
48974
|
+
this.startEngagement();
|
|
48975
|
+
}
|
|
48976
|
+
};
|
|
48977
|
+
const originalPushState = history.pushState.bind(history);
|
|
48978
|
+
const originalReplaceState = history.replaceState.bind(history);
|
|
48979
|
+
// Our wrappers stay reachable after cleanup whenever another library
|
|
48980
|
+
// patched on top of ours, so they have to be switchable off rather than
|
|
48981
|
+
// merely unreferenced.
|
|
48982
|
+
let patchActive = true;
|
|
48983
|
+
const patchedPushState = (data, unused, url) => {
|
|
48984
|
+
originalPushState(data, unused, url);
|
|
48985
|
+
if (patchActive) {
|
|
48986
|
+
handleNavigation();
|
|
48987
|
+
}
|
|
48988
|
+
};
|
|
48989
|
+
const patchedReplaceState = (data, unused, url) => {
|
|
48990
|
+
originalReplaceState(data, unused, url);
|
|
48991
|
+
if (patchActive) {
|
|
48992
|
+
handleNavigation();
|
|
48993
|
+
}
|
|
48994
|
+
};
|
|
48995
|
+
history.pushState = patchedPushState;
|
|
48996
|
+
history.replaceState = patchedReplaceState;
|
|
48997
|
+
const popstateHandler = () => handleNavigation();
|
|
48998
|
+
const hashchangeHandler = () => handleNavigation();
|
|
48999
|
+
window.addEventListener('popstate', popstateHandler);
|
|
49000
|
+
window.addEventListener('hashchange', hashchangeHandler);
|
|
49001
|
+
this.pageviewCleanups.push(() => {
|
|
49002
|
+
// Only unwind our own patch. A router (Next.js App Router, React
|
|
49003
|
+
// Router, …) that patched these after us owns the current value,
|
|
49004
|
+
// and assigning our saved reference back would silently throw its
|
|
49005
|
+
// wrapper away. In that case ours stays in the chain, which is why
|
|
49006
|
+
// `patchActive` exists: the wrapper keeps delegating to the original
|
|
49007
|
+
// but stops reporting.
|
|
49008
|
+
patchActive = false;
|
|
49009
|
+
if (history.pushState === patchedPushState) {
|
|
49010
|
+
history.pushState = originalPushState;
|
|
49011
|
+
}
|
|
49012
|
+
if (history.replaceState === patchedReplaceState) {
|
|
49013
|
+
history.replaceState = originalReplaceState;
|
|
49014
|
+
}
|
|
49015
|
+
window.removeEventListener('popstate', popstateHandler);
|
|
49016
|
+
window.removeEventListener('hashchange', hashchangeHandler);
|
|
49017
|
+
});
|
|
49018
|
+
}
|
|
49019
|
+
/**
|
|
49020
|
+
* Disable auto-pageview tracking installed by `enableAutoPageviews`.
|
|
49021
|
+
* Safe to call when auto-pageviews were never enabled.
|
|
49022
|
+
*/
|
|
49023
|
+
disableAutoPageviews() {
|
|
49024
|
+
for (const cleanup of this.pageviewCleanups) {
|
|
49025
|
+
cleanup();
|
|
49026
|
+
}
|
|
49027
|
+
this.pageviewCleanups = [];
|
|
49028
|
+
}
|
|
49029
|
+
/**
|
|
49030
|
+
* Enable click-based outbound link tracking. Detects anchor clicks that
|
|
49031
|
+
* navigate to a different origin and fires an `outbound_link` event
|
|
49032
|
+
* (with `hostname` and `href` props) before the browser navigates.
|
|
49033
|
+
*/
|
|
49034
|
+
enableAutoOutboundTracking(options = {}) {
|
|
49035
|
+
if (this.outboundCleanup) {
|
|
49036
|
+
return;
|
|
49037
|
+
}
|
|
49038
|
+
if (typeof document === 'undefined') {
|
|
49039
|
+
return;
|
|
49040
|
+
}
|
|
49041
|
+
const includeSubdomains = options.includeSubdomains === true;
|
|
49042
|
+
const clickHandler = (event) => {
|
|
49043
|
+
const anchor = this.findAnchor(event.target);
|
|
49044
|
+
if (!anchor || !anchor.href) {
|
|
49045
|
+
return;
|
|
49046
|
+
}
|
|
49047
|
+
const target = this.parseUrl(anchor.href);
|
|
49048
|
+
if (!target || !this.isExternal(target, includeSubdomains)) {
|
|
49049
|
+
return;
|
|
49050
|
+
}
|
|
49051
|
+
this.track('outbound_link', {
|
|
49052
|
+
url: target.href,
|
|
49053
|
+
props: { hostname: target.hostname, href: target.href },
|
|
49054
|
+
});
|
|
49055
|
+
};
|
|
49056
|
+
document.addEventListener('click', clickHandler, { capture: true });
|
|
49057
|
+
this.outboundCleanup = () => document.removeEventListener('click', clickHandler, {
|
|
49058
|
+
capture: true,
|
|
49059
|
+
});
|
|
49060
|
+
}
|
|
49061
|
+
/**
|
|
49062
|
+
* Disable outbound-link tracking installed by `enableAutoOutboundTracking`.
|
|
49063
|
+
* Safe to call when auto-outbound was never enabled.
|
|
49064
|
+
*/
|
|
49065
|
+
disableAutoOutboundTracking() {
|
|
49066
|
+
if (this.outboundCleanup) {
|
|
49067
|
+
this.outboundCleanup();
|
|
49068
|
+
this.outboundCleanup = undefined;
|
|
49069
|
+
}
|
|
49070
|
+
}
|
|
49071
|
+
/**
|
|
49072
|
+
* Enable click-based download tracking. Detects anchor clicks that point
|
|
49073
|
+
* at a file whose extension appears in the configured list and fires a
|
|
49074
|
+
* `file_download` event with `filename`, `extension` and `href` props.
|
|
49075
|
+
*/
|
|
49076
|
+
enableAutoDownloadTracking(options = {}) {
|
|
49077
|
+
var _a;
|
|
49078
|
+
if (this.downloadCleanup) {
|
|
49079
|
+
return;
|
|
49080
|
+
}
|
|
49081
|
+
if (typeof document === 'undefined') {
|
|
49082
|
+
return;
|
|
49083
|
+
}
|
|
49084
|
+
const extensions = ((_a = options.extensions) !== null && _a !== void 0 ? _a : DEFAULT_DOWNLOAD_EXTENSIONS).map((ext) => ext.toLowerCase().replace(/^\./, ''));
|
|
49085
|
+
const extensionSet = new Set(extensions);
|
|
49086
|
+
const clickHandler = (event) => {
|
|
49087
|
+
var _a, _b;
|
|
49088
|
+
const anchor = this.findAnchor(event.target);
|
|
49089
|
+
if (!anchor || !anchor.href) {
|
|
49090
|
+
return;
|
|
49091
|
+
}
|
|
49092
|
+
const url = this.parseUrl(anchor.href);
|
|
49093
|
+
if (!url) {
|
|
49094
|
+
return;
|
|
49095
|
+
}
|
|
49096
|
+
const filename = (_a = url.pathname.split('/').pop()) !== null && _a !== void 0 ? _a : '';
|
|
49097
|
+
const extension = filename.includes('.')
|
|
49098
|
+
? (_b = filename.split('.').pop()) === null || _b === void 0 ? void 0 : _b.toLowerCase()
|
|
49099
|
+
: undefined;
|
|
49100
|
+
if (!extension || !extensionSet.has(extension)) {
|
|
49101
|
+
return;
|
|
49102
|
+
}
|
|
49103
|
+
this.track('file_download', {
|
|
49104
|
+
url: url.href,
|
|
49105
|
+
props: { filename, extension, href: url.href },
|
|
49106
|
+
});
|
|
49107
|
+
};
|
|
49108
|
+
document.addEventListener('click', clickHandler, { capture: true });
|
|
49109
|
+
this.downloadCleanup = () => document.removeEventListener('click', clickHandler, {
|
|
49110
|
+
capture: true,
|
|
49111
|
+
});
|
|
49112
|
+
}
|
|
49113
|
+
/**
|
|
49114
|
+
* Disable file-download tracking installed by `enableAutoDownloadTracking`.
|
|
49115
|
+
* Safe to call when auto-download was never enabled.
|
|
49116
|
+
*/
|
|
49117
|
+
disableAutoDownloadTracking() {
|
|
49118
|
+
if (this.downloadCleanup) {
|
|
49119
|
+
this.downloadCleanup();
|
|
49120
|
+
this.downloadCleanup = undefined;
|
|
49121
|
+
}
|
|
49122
|
+
}
|
|
49123
|
+
/**
|
|
49124
|
+
* Enable passive scroll-depth tracking. Records the maximum percent of the
|
|
49125
|
+
* document scrolled and reports it on `beforeunload` and on SPA route
|
|
49126
|
+
* changes. Uses a throttled passive listener so it is safe on hot paths.
|
|
49127
|
+
*/
|
|
49128
|
+
enableAutoScrollDepth() {
|
|
49129
|
+
if (this.scrollCleanups.length > 0) {
|
|
49130
|
+
return;
|
|
49131
|
+
}
|
|
49132
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
49133
|
+
return;
|
|
49134
|
+
}
|
|
49135
|
+
this.maxScrollDepth = 0;
|
|
49136
|
+
this.lastScrollReport = 0;
|
|
49137
|
+
const scrollHandler = () => {
|
|
49138
|
+
if (this.scrollTicking) {
|
|
49139
|
+
return;
|
|
49140
|
+
}
|
|
49141
|
+
this.scrollTicking = true;
|
|
49142
|
+
window.requestAnimationFrame(() => {
|
|
49143
|
+
const now = Date.now();
|
|
49144
|
+
if (now - this.lastScrollReport < SCROLL_DEPTH_THROTTLE_MS) {
|
|
49145
|
+
this.scrollTicking = false;
|
|
49146
|
+
return;
|
|
49147
|
+
}
|
|
49148
|
+
this.lastScrollReport = now;
|
|
49149
|
+
const depth = this.computeScrollDepth();
|
|
49150
|
+
if (depth > this.maxScrollDepth) {
|
|
49151
|
+
this.maxScrollDepth = depth;
|
|
49152
|
+
}
|
|
49153
|
+
this.scrollTicking = false;
|
|
49154
|
+
});
|
|
49155
|
+
};
|
|
49156
|
+
const unloadHandler = () => {
|
|
49157
|
+
this.flushScrollDepth(this.currentPageUrl());
|
|
49158
|
+
};
|
|
49159
|
+
window.addEventListener('scroll', scrollHandler, { passive: true });
|
|
49160
|
+
window.addEventListener('beforeunload', unloadHandler);
|
|
49161
|
+
window.addEventListener('pagehide', unloadHandler);
|
|
49162
|
+
this.scrollCleanups.push(() => {
|
|
49163
|
+
window.removeEventListener('scroll', scrollHandler);
|
|
49164
|
+
window.removeEventListener('beforeunload', unloadHandler);
|
|
49165
|
+
window.removeEventListener('pagehide', unloadHandler);
|
|
49166
|
+
});
|
|
49167
|
+
}
|
|
49168
|
+
/**
|
|
49169
|
+
* Disable scroll-depth tracking installed by `enableAutoScrollDepth`. Safe
|
|
49170
|
+
* to call when auto-scroll-depth was never enabled. Any accumulated depth
|
|
49171
|
+
* for the current page is dropped.
|
|
49172
|
+
*/
|
|
49173
|
+
disableAutoScrollDepth() {
|
|
49174
|
+
for (const cleanup of this.scrollCleanups) {
|
|
49175
|
+
cleanup();
|
|
49176
|
+
}
|
|
49177
|
+
this.scrollCleanups = [];
|
|
49178
|
+
this.maxScrollDepth = 0;
|
|
49179
|
+
this.scrollTicking = false;
|
|
49180
|
+
this.lastScrollReport = 0;
|
|
49181
|
+
}
|
|
49182
|
+
/**
|
|
49183
|
+
* Enable active engagement-time tracking. Counts time the tab is visible
|
|
49184
|
+
* and uses `visibilitychange` to exclude background time.
|
|
49185
|
+
*
|
|
49186
|
+
* Delivery follows Plausible's model rather than a single total at the
|
|
49187
|
+
* end of the visit: an `engagement_time` event is emitted at every natural
|
|
49188
|
+
* checkpoint — the tab going hidden, an SPA route change, and finally
|
|
49189
|
+
* `beforeunload`/`pagehide`. Unload is kept only as a best-effort last
|
|
49190
|
+
* flush; it is the least reliable moment to send anything (browsers
|
|
49191
|
+
* routinely cancel in-flight requests there, and `sendBeacon` cannot set
|
|
49192
|
+
* the `X-Appwrite-Project` header the endpoint requires), so it must never
|
|
49193
|
+
* be the only delivery.
|
|
49194
|
+
*
|
|
49195
|
+
* Each event carries a **delta** — the seconds accrued since the previous
|
|
49196
|
+
* flush, not a running total — so the values are additive per session and
|
|
49197
|
+
* a lost event costs only its own slice.
|
|
49198
|
+
*
|
|
49199
|
+
* There is deliberately no periodic ping. The cadence is driven by
|
|
49200
|
+
* navigation and tab switches, so request volume tracks what the visitor
|
|
49201
|
+
* actually does instead of multiplying with time on page.
|
|
49202
|
+
*/
|
|
49203
|
+
enableAutoEngagementTime() {
|
|
49204
|
+
if (this.engagementCleanups.length > 0) {
|
|
49205
|
+
return;
|
|
49206
|
+
}
|
|
49207
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
49208
|
+
return;
|
|
49209
|
+
}
|
|
49210
|
+
this.engagementAccumulatedMs = 0;
|
|
49211
|
+
// Do not start the clock for a tab that is already hidden (prerender,
|
|
49212
|
+
// background tab restore); `visibilitychange` starts it when it is
|
|
49213
|
+
// actually looked at.
|
|
49214
|
+
if (document.visibilityState !== 'hidden') {
|
|
49215
|
+
this.startEngagement();
|
|
49216
|
+
}
|
|
49217
|
+
const visibilityHandler = () => {
|
|
49218
|
+
if (document.visibilityState === 'hidden') {
|
|
49219
|
+
// Flush, don't just pause. The page is still fully alive here,
|
|
49220
|
+
// which makes this the most reliable delivery point in the
|
|
49221
|
+
// whole visit — and it is the same moment Plausible reports on.
|
|
49222
|
+
this.flushEngagement(this.currentPageUrl());
|
|
49223
|
+
}
|
|
49224
|
+
else if (document.visibilityState === 'visible') {
|
|
49225
|
+
this.startEngagement();
|
|
49226
|
+
}
|
|
49227
|
+
};
|
|
49228
|
+
const unloadHandler = () => {
|
|
49229
|
+
this.flushEngagement(this.currentPageUrl());
|
|
49230
|
+
};
|
|
49231
|
+
const pageshowHandler = (event) => {
|
|
49232
|
+
// When the page is restored from the back-forward cache the
|
|
49233
|
+
// engagement timer is in a stopped state (flushEngagement paused
|
|
49234
|
+
// it on pagehide and does not auto-restart). Kick off a fresh
|
|
49235
|
+
// engagementStart so bfcache dwell time is not billed as
|
|
49236
|
+
// engagement.
|
|
49237
|
+
if (event.persisted) {
|
|
49238
|
+
this.startEngagement();
|
|
49239
|
+
}
|
|
49240
|
+
};
|
|
49241
|
+
document.addEventListener('visibilitychange', visibilityHandler);
|
|
49242
|
+
window.addEventListener('beforeunload', unloadHandler);
|
|
49243
|
+
window.addEventListener('pagehide', unloadHandler);
|
|
49244
|
+
window.addEventListener('pageshow', pageshowHandler);
|
|
49245
|
+
this.engagementCleanups.push(() => {
|
|
49246
|
+
document.removeEventListener('visibilitychange', visibilityHandler);
|
|
49247
|
+
window.removeEventListener('beforeunload', unloadHandler);
|
|
49248
|
+
window.removeEventListener('pagehide', unloadHandler);
|
|
49249
|
+
window.removeEventListener('pageshow', pageshowHandler);
|
|
49250
|
+
});
|
|
49251
|
+
}
|
|
49252
|
+
/**
|
|
49253
|
+
* Disable engagement-time tracking installed by `enableAutoEngagementTime`.
|
|
49254
|
+
* Safe to call when auto-engagement was never enabled. Any accumulated
|
|
49255
|
+
* engagement time is dropped without being emitted.
|
|
49256
|
+
*/
|
|
49257
|
+
disableAutoEngagementTime() {
|
|
49258
|
+
for (const cleanup of this.engagementCleanups) {
|
|
49259
|
+
cleanup();
|
|
49260
|
+
}
|
|
49261
|
+
this.engagementCleanups = [];
|
|
49262
|
+
this.engagementActive = false;
|
|
49263
|
+
this.engagementAccumulatedMs = 0;
|
|
49264
|
+
this.engagementStart = 0;
|
|
49265
|
+
}
|
|
49266
|
+
/**
|
|
49267
|
+
* Merge the configured `propertyId` into an event's options. Returns the
|
|
49268
|
+
* caller's object untouched when no default is configured (or the event
|
|
49269
|
+
* already carries one), so emitters written against the pre-`propertyId`
|
|
49270
|
+
* shape keep receiving exactly what they received before.
|
|
49271
|
+
*/
|
|
49272
|
+
withPropertyId(options) {
|
|
49273
|
+
if (this.propertyId === undefined ||
|
|
49274
|
+
(options === null || options === void 0 ? void 0 : options.propertyId) !== undefined) {
|
|
49275
|
+
return options;
|
|
49276
|
+
}
|
|
49277
|
+
return Object.assign(Object.assign({}, (options !== null && options !== void 0 ? options : {})), { propertyId: this.propertyId });
|
|
49278
|
+
}
|
|
49279
|
+
canTrack() {
|
|
49280
|
+
if (!this.respectDoNotTrack) {
|
|
49281
|
+
return true;
|
|
49282
|
+
}
|
|
49283
|
+
if (typeof navigator === 'undefined') {
|
|
49284
|
+
return true;
|
|
49285
|
+
}
|
|
49286
|
+
return navigator.doNotTrack !== '1';
|
|
49287
|
+
}
|
|
49288
|
+
currentPageUrl() {
|
|
49289
|
+
if (typeof window === 'undefined' || !window.location) {
|
|
49290
|
+
return '';
|
|
49291
|
+
}
|
|
49292
|
+
return window.location.href;
|
|
49293
|
+
}
|
|
49294
|
+
findAnchor(target) {
|
|
49295
|
+
let node = target;
|
|
49296
|
+
while (node) {
|
|
49297
|
+
if (node.tagName === 'A') {
|
|
49298
|
+
return node;
|
|
49299
|
+
}
|
|
49300
|
+
node = node.parentNode;
|
|
49301
|
+
}
|
|
49302
|
+
return null;
|
|
49303
|
+
}
|
|
49304
|
+
parseUrl(href) {
|
|
49305
|
+
try {
|
|
49306
|
+
return new URL(href, window.location.href);
|
|
49307
|
+
}
|
|
49308
|
+
catch (_a) {
|
|
49309
|
+
return null;
|
|
49310
|
+
}
|
|
49311
|
+
}
|
|
49312
|
+
isExternal(target, includeSubdomains) {
|
|
49313
|
+
if (target.protocol !== 'http:' && target.protocol !== 'https:') {
|
|
49314
|
+
return false;
|
|
49315
|
+
}
|
|
49316
|
+
if (target.hostname === window.location.hostname) {
|
|
49317
|
+
return false;
|
|
49318
|
+
}
|
|
49319
|
+
if (includeSubdomains) {
|
|
49320
|
+
return true;
|
|
49321
|
+
}
|
|
49322
|
+
const root = this.rootDomain(window.location.hostname);
|
|
49323
|
+
return this.rootDomain(target.hostname) !== root;
|
|
49324
|
+
}
|
|
49325
|
+
rootDomain(hostname) {
|
|
49326
|
+
const parts = hostname.split('.');
|
|
49327
|
+
if (parts.length <= 2) {
|
|
49328
|
+
return hostname;
|
|
49329
|
+
}
|
|
49330
|
+
// Taking the last two labels is wrong wherever the registry sells names
|
|
49331
|
+
// one level down: `shop.example.co.uk` and `google.co.uk` both reduce to
|
|
49332
|
+
// `co.uk`, so every outbound click between two `.co.uk` sites looks
|
|
49333
|
+
// internal and is dropped. Take three labels after a known two-part
|
|
49334
|
+
// suffix instead.
|
|
49335
|
+
//
|
|
49336
|
+
// This is a heuristic, not the Public Suffix List — the full list is
|
|
49337
|
+
// orders of magnitude larger than this whole file, and a tracking
|
|
49338
|
+
// snippet cannot carry it. Sites on a suffix that is missing here can
|
|
49339
|
+
// pass `includeSubdomains: true` to treat every other host as outbound.
|
|
49340
|
+
const suffix = parts.slice(-2).join('.');
|
|
49341
|
+
if (parts.length > 2 && MULTI_PART_SUFFIXES.has(suffix)) {
|
|
49342
|
+
return parts.slice(-3).join('.');
|
|
49343
|
+
}
|
|
49344
|
+
return suffix;
|
|
49345
|
+
}
|
|
49346
|
+
computeScrollDepth() {
|
|
49347
|
+
const scrollTop = window.scrollY || document.documentElement.scrollTop;
|
|
49348
|
+
const viewport = window.innerHeight || document.documentElement.clientHeight;
|
|
49349
|
+
const total = document.documentElement.scrollHeight;
|
|
49350
|
+
if (total <= viewport) {
|
|
49351
|
+
return 100;
|
|
49352
|
+
}
|
|
49353
|
+
const depth = Math.round(((scrollTop + viewport) / total) * 100);
|
|
49354
|
+
return Math.max(0, Math.min(100, depth));
|
|
49355
|
+
}
|
|
49356
|
+
flushScrollDepth(url) {
|
|
49357
|
+
if (this.scrollCleanups.length === 0) {
|
|
49358
|
+
return;
|
|
49359
|
+
}
|
|
49360
|
+
if (this.maxScrollDepth <= 0) {
|
|
49361
|
+
return;
|
|
49362
|
+
}
|
|
49363
|
+
this.track('scroll_depth', {
|
|
49364
|
+
url,
|
|
49365
|
+
scrollDepth: this.maxScrollDepth,
|
|
49366
|
+
});
|
|
49367
|
+
this.maxScrollDepth = 0;
|
|
49368
|
+
}
|
|
49369
|
+
startEngagement() {
|
|
49370
|
+
if (this.engagementActive) {
|
|
49371
|
+
return;
|
|
49372
|
+
}
|
|
49373
|
+
this.engagementActive = true;
|
|
49374
|
+
this.engagementStart = Date.now();
|
|
49375
|
+
}
|
|
49376
|
+
pauseEngagement() {
|
|
49377
|
+
if (!this.engagementActive) {
|
|
49378
|
+
return;
|
|
49379
|
+
}
|
|
49380
|
+
this.engagementActive = false;
|
|
49381
|
+
this.engagementAccumulatedMs += Date.now() - this.engagementStart;
|
|
49382
|
+
}
|
|
49383
|
+
flushEngagement(url) {
|
|
49384
|
+
if (this.engagementCleanups.length === 0) {
|
|
49385
|
+
return;
|
|
49386
|
+
}
|
|
49387
|
+
this.pauseEngagement();
|
|
49388
|
+
// Deltas, not a running total: emit only what accrued since the last
|
|
49389
|
+
// flush. `floor` plus keeping the sub-second remainder in the
|
|
49390
|
+
// accumulator is what makes repeated flushes safe — nothing is emitted
|
|
49391
|
+
// twice, and a visit chopped into many short segments does not lose a
|
|
49392
|
+
// fraction of a second to rounding on every one of them.
|
|
49393
|
+
const seconds = Math.floor(this.engagementAccumulatedMs / 1000);
|
|
49394
|
+
if (seconds > 0) {
|
|
49395
|
+
// Deduct before emitting so a synchronous emitter that re-enters
|
|
49396
|
+
// (or throws) can never bill the same seconds again.
|
|
49397
|
+
this.engagementAccumulatedMs -= seconds * 1000;
|
|
49398
|
+
this.track('engagement_time', {
|
|
49399
|
+
url,
|
|
49400
|
+
engagementTime: seconds,
|
|
49401
|
+
});
|
|
49402
|
+
}
|
|
49403
|
+
// NOTE: intentionally do NOT call startEngagement() here. flushEngagement
|
|
49404
|
+
// runs on `pagehide`, which is also the last hook before the browser
|
|
49405
|
+
// may freeze the page into the back-forward cache. Auto-restarting
|
|
49406
|
+
// would snapshot engagementStart just before the freeze; the next
|
|
49407
|
+
// pauseEngagement (after bfcache restore) would then bill the entire
|
|
49408
|
+
// bfcache dwell as active engagement. Restart is driven by explicit
|
|
49409
|
+
// resume signals: `pageshow` (with `persisted === true`),
|
|
49410
|
+
// `visibilitychange` back to visible, or the SPA navigation flow in
|
|
49411
|
+
// `enableAutoPageviews`.
|
|
49412
|
+
}
|
|
49413
|
+
}
|
|
49414
|
+
|
|
46776
49415
|
/**
|
|
46777
49416
|
* Helper class to generate permission strings for resources.
|
|
46778
49417
|
*/
|
|
@@ -47479,6 +50118,68 @@ exports.OAuthProvider = void 0;
|
|
|
47479
50118
|
OAuthProvider["Zoom"] = "zoom";
|
|
47480
50119
|
})(exports.OAuthProvider || (exports.OAuthProvider = {}));
|
|
47481
50120
|
|
|
50121
|
+
exports.PlatformResourceType = void 0;
|
|
50122
|
+
(function (PlatformResourceType) {
|
|
50123
|
+
PlatformResourceType["Projects"] = "projects";
|
|
50124
|
+
PlatformResourceType["Organizations"] = "organizations";
|
|
50125
|
+
PlatformResourceType["Users"] = "users";
|
|
50126
|
+
PlatformResourceType["Memberships"] = "memberships";
|
|
50127
|
+
PlatformResourceType["Rules"] = "rules";
|
|
50128
|
+
PlatformResourceType["Keys"] = "keys";
|
|
50129
|
+
PlatformResourceType["Platforms"] = "platforms";
|
|
50130
|
+
PlatformResourceType["Webhooks"] = "webhooks";
|
|
50131
|
+
PlatformResourceType["Certificates"] = "certificates";
|
|
50132
|
+
})(exports.PlatformResourceType || (exports.PlatformResourceType = {}));
|
|
50133
|
+
|
|
50134
|
+
exports.ProjectResourceType = void 0;
|
|
50135
|
+
(function (ProjectResourceType) {
|
|
50136
|
+
ProjectResourceType["Users"] = "users";
|
|
50137
|
+
ProjectResourceType["Teams"] = "teams";
|
|
50138
|
+
ProjectResourceType["Memberships"] = "memberships";
|
|
50139
|
+
ProjectResourceType["Databases"] = "databases";
|
|
50140
|
+
ProjectResourceType["Buckets"] = "buckets";
|
|
50141
|
+
ProjectResourceType["Functions"] = "functions";
|
|
50142
|
+
ProjectResourceType["Sites"] = "sites";
|
|
50143
|
+
ProjectResourceType["Deployments"] = "deployments";
|
|
50144
|
+
ProjectResourceType["Topics"] = "topics";
|
|
50145
|
+
ProjectResourceType["Providers"] = "providers";
|
|
50146
|
+
ProjectResourceType["Messages"] = "messages";
|
|
50147
|
+
})(exports.ProjectResourceType || (exports.ProjectResourceType = {}));
|
|
50148
|
+
|
|
50149
|
+
exports.AnalyticsInterval = void 0;
|
|
50150
|
+
(function (AnalyticsInterval) {
|
|
50151
|
+
AnalyticsInterval["OneHour"] = "1h";
|
|
50152
|
+
AnalyticsInterval["OneDay"] = "1d";
|
|
50153
|
+
AnalyticsInterval["OneWeek"] = "1w";
|
|
50154
|
+
AnalyticsInterval["OneMonth"] = "1m";
|
|
50155
|
+
})(exports.AnalyticsInterval || (exports.AnalyticsInterval = {}));
|
|
50156
|
+
|
|
50157
|
+
exports.AnalyticsDimension = void 0;
|
|
50158
|
+
(function (AnalyticsDimension) {
|
|
50159
|
+
AnalyticsDimension["Country"] = "country";
|
|
50160
|
+
AnalyticsDimension["Region"] = "region";
|
|
50161
|
+
AnalyticsDimension["City"] = "city";
|
|
50162
|
+
AnalyticsDimension["Browser"] = "browser";
|
|
50163
|
+
AnalyticsDimension["OperatingSystem"] = "operatingSystem";
|
|
50164
|
+
AnalyticsDimension["Device"] = "device";
|
|
50165
|
+
AnalyticsDimension["ScreenSize"] = "screenSize";
|
|
50166
|
+
AnalyticsDimension["ReferrerSource"] = "referrerSource";
|
|
50167
|
+
AnalyticsDimension["Channel"] = "channel";
|
|
50168
|
+
AnalyticsDimension["UtmSource"] = "utmSource";
|
|
50169
|
+
AnalyticsDimension["UtmMedium"] = "utmMedium";
|
|
50170
|
+
AnalyticsDimension["UtmCampaign"] = "utmCampaign";
|
|
50171
|
+
AnalyticsDimension["UtmContent"] = "utmContent";
|
|
50172
|
+
AnalyticsDimension["UtmTerm"] = "utmTerm";
|
|
50173
|
+
AnalyticsDimension["Page"] = "page";
|
|
50174
|
+
AnalyticsDimension["Hostname"] = "hostname";
|
|
50175
|
+
AnalyticsDimension["EntryPage"] = "entryPage";
|
|
50176
|
+
AnalyticsDimension["ExitPage"] = "exitPage";
|
|
50177
|
+
AnalyticsDimension["TrafficType"] = "trafficType";
|
|
50178
|
+
AnalyticsDimension["BotName"] = "botName";
|
|
50179
|
+
AnalyticsDimension["BotCategory"] = "botCategory";
|
|
50180
|
+
AnalyticsDimension["EventName"] = "eventName";
|
|
50181
|
+
})(exports.AnalyticsDimension || (exports.AnalyticsDimension = {}));
|
|
50182
|
+
|
|
47482
50183
|
exports.Browser = void 0;
|
|
47483
50184
|
(function (Browser) {
|
|
47484
50185
|
Browser["AvantBrowser"] = "aa";
|
|
@@ -48294,6 +50995,14 @@ exports.QuerySuggestionResource = void 0;
|
|
|
48294
50995
|
QuerySuggestionResource["ResourceTokens"] = "resourcetokens";
|
|
48295
50996
|
QuerySuggestionResource["Transactions"] = "transactions";
|
|
48296
50997
|
QuerySuggestionResource["TransactionLogs"] = "transactionlogs";
|
|
50998
|
+
QuerySuggestionResource["Videos"] = "videos";
|
|
50999
|
+
QuerySuggestionResource["VideosPreviews"] = "videos_previews";
|
|
51000
|
+
QuerySuggestionResource["VideosRenditions"] = "videos_renditions";
|
|
51001
|
+
QuerySuggestionResource["VideosRenditionsSegments"] = "videos_renditions_segments";
|
|
51002
|
+
QuerySuggestionResource["VideosProfiles"] = "videos_profiles";
|
|
51003
|
+
QuerySuggestionResource["VideosSubtitles"] = "videos_subtitles";
|
|
51004
|
+
QuerySuggestionResource["VideosSubtitlesSegments"] = "videos_subtitles_segments";
|
|
51005
|
+
QuerySuggestionResource["AnalyticsProperties"] = "analyticsproperties";
|
|
48297
51006
|
QuerySuggestionResource["DedicatedDatabases"] = "dedicateddatabases";
|
|
48298
51007
|
QuerySuggestionResource["DedicatedDatabaseConfigs"] = "dedicateddatabaseconfigs";
|
|
48299
51008
|
QuerySuggestionResource["DedicatedDatabaseRuntimes"] = "dedicateddatabaseruntimes";
|
|
@@ -48716,6 +51425,8 @@ exports.ProjectKeyScopes = void 0;
|
|
|
48716
51425
|
ProjectKeyScopes["ReportsWrite"] = "reports.write";
|
|
48717
51426
|
ProjectKeyScopes["PresencesRead"] = "presences.read";
|
|
48718
51427
|
ProjectKeyScopes["PresencesWrite"] = "presences.write";
|
|
51428
|
+
ProjectKeyScopes["VideosRead"] = "videos.read";
|
|
51429
|
+
ProjectKeyScopes["VideosWrite"] = "videos.write";
|
|
48719
51430
|
ProjectKeyScopes["DedicatedDatabasesExecute"] = "dedicatedDatabases.execute";
|
|
48720
51431
|
ProjectKeyScopes["BackupsPoliciesRead"] = "backups.policies.read";
|
|
48721
51432
|
ProjectKeyScopes["BackupsPoliciesWrite"] = "backups.policies.write";
|
|
@@ -48734,6 +51445,8 @@ exports.ProjectKeyScopes = void 0;
|
|
|
48734
51445
|
ProjectKeyScopes["Oauth2Read"] = "oauth2.read";
|
|
48735
51446
|
ProjectKeyScopes["Oauth2Write"] = "oauth2.write";
|
|
48736
51447
|
ProjectKeyScopes["Oauth2Introspect"] = "oauth2.introspect";
|
|
51448
|
+
ProjectKeyScopes["AnalyticsRead"] = "analytics.read";
|
|
51449
|
+
ProjectKeyScopes["AnalyticsWrite"] = "analytics.write";
|
|
48737
51450
|
})(exports.ProjectKeyScopes || (exports.ProjectKeyScopes = {}));
|
|
48738
51451
|
|
|
48739
51452
|
exports.FunctionTemplateUseCase = void 0;
|
|
@@ -48983,6 +51696,7 @@ exports.ProjectAuthMethodId = void 0;
|
|
|
48983
51696
|
ProjectAuthMethodId["Invites"] = "invites";
|
|
48984
51697
|
ProjectAuthMethodId["Jwt"] = "jwt";
|
|
48985
51698
|
ProjectAuthMethodId["Phone"] = "phone";
|
|
51699
|
+
ProjectAuthMethodId["Passkey"] = "passkey";
|
|
48986
51700
|
})(exports.ProjectAuthMethodId || (exports.ProjectAuthMethodId = {}));
|
|
48987
51701
|
|
|
48988
51702
|
exports.ProjectOAuth2Auth0Prompt = void 0;
|
|
@@ -49124,6 +51838,7 @@ exports.ProjectPolicyId = void 0;
|
|
|
49124
51838
|
ProjectPolicyId["Denydisposableemail"] = "deny-disposable-email";
|
|
49125
51839
|
ProjectPolicyId["Denyfreeemail"] = "deny-free-email";
|
|
49126
51840
|
ProjectPolicyId["Denycorporateemail"] = "deny-corporate-email";
|
|
51841
|
+
ProjectPolicyId["Passkey"] = "passkey";
|
|
49127
51842
|
})(exports.ProjectPolicyId || (exports.ProjectPolicyId = {}));
|
|
49128
51843
|
|
|
49129
51844
|
exports.ProjectProtocolId = void 0;
|
|
@@ -49368,6 +52083,9 @@ exports.TablesDBIndexType = void 0;
|
|
|
49368
52083
|
|
|
49369
52084
|
exports.UsageEventMetric = void 0;
|
|
49370
52085
|
(function (UsageEventMetric) {
|
|
52086
|
+
UsageEventMetric["AnalyticsEvents"] = "analytics.events";
|
|
52087
|
+
UsageEventMetric["AnalyticsPageviews"] = "analytics.pageviews";
|
|
52088
|
+
UsageEventMetric["AnalyticsBotsEvents"] = "analytics.bots.events";
|
|
49371
52089
|
UsageEventMetric["NetworkRequests"] = "network.requests";
|
|
49372
52090
|
UsageEventMetric["NetworkInbound"] = "network.inbound";
|
|
49373
52091
|
UsageEventMetric["NetworkOutbound"] = "network.outbound";
|
|
@@ -49485,6 +52203,7 @@ exports.UsageOrderDirection = void 0;
|
|
|
49485
52203
|
|
|
49486
52204
|
exports.UsageGaugeMetric = void 0;
|
|
49487
52205
|
(function (UsageGaugeMetric) {
|
|
52206
|
+
UsageGaugeMetric["AnalyticsProperties"] = "analytics.properties";
|
|
49488
52207
|
UsageGaugeMetric["Teams"] = "teams";
|
|
49489
52208
|
UsageGaugeMetric["Users"] = "users";
|
|
49490
52209
|
UsageGaugeMetric["Messages"] = "messages";
|
|
@@ -49582,6 +52301,24 @@ exports.VectorsDBIndexType = void 0;
|
|
|
49582
52301
|
VectorsDBIndexType["Unique"] = "unique";
|
|
49583
52302
|
})(exports.VectorsDBIndexType || (exports.VectorsDBIndexType = {}));
|
|
49584
52303
|
|
|
52304
|
+
exports.VideoOutput = void 0;
|
|
52305
|
+
(function (VideoOutput) {
|
|
52306
|
+
VideoOutput["Hls"] = "hls";
|
|
52307
|
+
VideoOutput["Dash"] = "dash";
|
|
52308
|
+
VideoOutput["Cmaf"] = "cmaf";
|
|
52309
|
+
})(exports.VideoOutput || (exports.VideoOutput = {}));
|
|
52310
|
+
|
|
52311
|
+
exports.VideoRenditionStatus = void 0;
|
|
52312
|
+
(function (VideoRenditionStatus) {
|
|
52313
|
+
VideoRenditionStatus["Pending"] = "pending";
|
|
52314
|
+
VideoRenditionStatus["Started"] = "started";
|
|
52315
|
+
VideoRenditionStatus["Ended"] = "ended";
|
|
52316
|
+
VideoRenditionStatus["Uploading"] = "uploading";
|
|
52317
|
+
VideoRenditionStatus["Ready"] = "ready";
|
|
52318
|
+
VideoRenditionStatus["Error"] = "error";
|
|
52319
|
+
VideoRenditionStatus["Aborted"] = "aborted";
|
|
52320
|
+
})(exports.VideoRenditionStatus || (exports.VideoRenditionStatus = {}));
|
|
52321
|
+
|
|
49585
52322
|
exports.DatabaseType = void 0;
|
|
49586
52323
|
(function (DatabaseType) {
|
|
49587
52324
|
DatabaseType["Legacy"] = "legacy";
|
|
@@ -49760,6 +52497,7 @@ exports.ProxyRuleDeploymentResourceType = void 0;
|
|
|
49760
52497
|
(function (ProxyRuleDeploymentResourceType) {
|
|
49761
52498
|
ProxyRuleDeploymentResourceType["Function"] = "function";
|
|
49762
52499
|
ProxyRuleDeploymentResourceType["Site"] = "site";
|
|
52500
|
+
ProxyRuleDeploymentResourceType["DedicatedDatabase"] = "dedicatedDatabase";
|
|
49763
52501
|
})(exports.ProxyRuleDeploymentResourceType || (exports.ProxyRuleDeploymentResourceType = {}));
|
|
49764
52502
|
|
|
49765
52503
|
exports.ProxyRuleStatus = void 0;
|
|
@@ -49817,8 +52555,11 @@ exports.WafRuleAction = void 0;
|
|
|
49817
52555
|
|
|
49818
52556
|
exports.Account = Account;
|
|
49819
52557
|
exports.Activities = Activities;
|
|
52558
|
+
exports.Admin = Admin;
|
|
49820
52559
|
exports.Advisor = Advisor;
|
|
49821
52560
|
exports.Affiliates = Affiliates;
|
|
52561
|
+
exports.Analytics = Analytics;
|
|
52562
|
+
exports.AnalyticsTracking = AnalyticsTracking;
|
|
49822
52563
|
exports.Apps = Apps;
|
|
49823
52564
|
exports.AppwriteException = AppwriteException;
|
|
49824
52565
|
exports.Assistant = Assistant;
|
|
@@ -49867,6 +52608,7 @@ exports.Usage = Usage;
|
|
|
49867
52608
|
exports.Users = Users;
|
|
49868
52609
|
exports.Vcs = Vcs;
|
|
49869
52610
|
exports.VectorsDB = VectorsDB;
|
|
52611
|
+
exports.Videos = Videos;
|
|
49870
52612
|
exports.Waf = Waf;
|
|
49871
52613
|
exports.Webhooks = Webhooks;
|
|
49872
52614
|
//# sourceMappingURL=sdk.js.map
|