@appwrite.io/console 3.1.0 → 5.0.0
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/CHANGELOG.md +18 -0
- package/README.md +1 -1
- package/dist/cjs/sdk.js +516 -119
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +517 -120
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +516 -119
- package/docs/examples/databases/list-documents.md +2 -1
- package/docs/examples/domains/confirm-purchase.md +16 -0
- package/docs/examples/domains/confirm-transfer-in.md +16 -0
- package/docs/examples/domains/create-purchase.md +1 -1
- package/docs/examples/domains/create-transfer-in.md +18 -0
- package/docs/examples/domains/create-transfer-out.md +16 -0
- package/docs/examples/domains/get-transfer-status.md +15 -0
- package/docs/examples/functions/create.md +3 -1
- package/docs/examples/functions/update.md +3 -1
- package/docs/examples/health/get-console-pausing.md +16 -0
- package/docs/examples/migrations/create-appwrite-migration.md +2 -2
- package/docs/examples/migrations/create-firebase-migration.md +2 -2
- package/docs/examples/migrations/create-n-host-migration.md +2 -2
- package/docs/examples/migrations/create-supabase-migration.md +2 -2
- package/docs/examples/migrations/get-appwrite-report.md +2 -2
- package/docs/examples/migrations/get-firebase-report.md +2 -2
- package/docs/examples/migrations/get-n-host-report.md +2 -2
- package/docs/examples/migrations/get-supabase-report.md +2 -2
- package/docs/examples/projects/update-console-access.md +15 -0
- package/docs/examples/projects/update-status.md +16 -0
- package/docs/examples/sites/create-deployment.md +2 -2
- package/docs/examples/sites/create.md +4 -1
- package/docs/examples/sites/update.md +4 -1
- package/docs/examples/tablesdb/list-rows.md +2 -1
- package/package.json +1 -1
- package/src/channel.ts +19 -15
- package/src/client.ts +5 -1
- package/src/enums/appwrite-migration-resource.ts +25 -0
- package/src/enums/build-runtime.ts +3 -0
- package/src/enums/domain-purchase-payment-status.ts +10 -0
- package/src/enums/domain-transfer-status-status.ts +10 -0
- package/src/enums/firebase-migration-resource.ts +12 -0
- package/src/enums/{resources.ts → n-host-migration-resource.ts} +1 -1
- package/src/enums/runtime.ts +3 -0
- package/src/enums/runtimes.ts +3 -0
- package/src/enums/status.ts +3 -0
- package/src/enums/supabase-migration-resource.ts +13 -0
- package/src/index.ts +7 -1
- package/src/models.ts +209 -7
- package/src/services/account.ts +4 -4
- package/src/services/databases.ts +100 -93
- package/src/services/domains.ts +342 -13
- package/src/services/functions.ts +52 -24
- package/src/services/health.ts +61 -0
- package/src/services/messaging.ts +2 -2
- package/src/services/migrations.ts +68 -65
- package/src/services/organizations.ts +2 -2
- package/src/services/projects.ts +120 -0
- package/src/services/sites.ts +96 -57
- package/src/services/tables-db.ts +14 -7
- package/src/services/teams.ts +4 -4
- package/types/channel.d.ts +9 -9
- package/types/enums/appwrite-migration-resource.d.ts +25 -0
- package/types/enums/build-runtime.d.ts +3 -0
- package/types/enums/domain-purchase-payment-status.d.ts +10 -0
- package/types/enums/domain-transfer-status-status.d.ts +10 -0
- package/types/enums/firebase-migration-resource.d.ts +12 -0
- package/types/enums/{resources.d.ts → n-host-migration-resource.d.ts} +1 -1
- package/types/enums/runtime.d.ts +3 -0
- package/types/enums/runtimes.d.ts +3 -0
- package/types/enums/status.d.ts +3 -0
- package/types/enums/supabase-migration-resource.d.ts +13 -0
- package/types/index.d.ts +7 -1
- package/types/models.d.ts +207 -7
- package/types/services/account.d.ts +2 -2
- package/types/services/databases.d.ts +40 -37
- package/types/services/domains.d.ts +117 -4
- package/types/services/functions.d.ts +20 -8
- package/types/services/health.d.ts +24 -0
- package/types/services/messaging.d.ts +2 -2
- package/types/services/migrations.d.ts +36 -33
- package/types/services/organizations.d.ts +2 -2
- package/types/services/projects.d.ts +46 -0
- package/types/services/sites.d.ts +30 -12
- package/types/services/tables-db.d.ts +4 -1
- package/types/services/teams.d.ts +4 -4
package/src/models.ts
CHANGED
|
@@ -12,6 +12,8 @@ import { ProxyRuleDeploymentResourceType } from "./enums/proxy-rule-deployment-r
|
|
|
12
12
|
import { ProxyRuleStatus } from "./enums/proxy-rule-status"
|
|
13
13
|
import { MessageStatus } from "./enums/message-status"
|
|
14
14
|
import { BillingPlanGroup } from "./enums/billing-plan-group"
|
|
15
|
+
import { DomainPurchasePaymentStatus } from "./enums/domain-purchase-payment-status"
|
|
16
|
+
import { DomainTransferStatusStatus } from "./enums/domain-transfer-status-status"
|
|
15
17
|
|
|
16
18
|
/**
|
|
17
19
|
* Appwrite Models
|
|
@@ -2627,7 +2629,7 @@ export namespace Models {
|
|
|
2627
2629
|
*/
|
|
2628
2630
|
$id: string;
|
|
2629
2631
|
/**
|
|
2630
|
-
* Row
|
|
2632
|
+
* Row sequence ID.
|
|
2631
2633
|
*/
|
|
2632
2634
|
$sequence: number;
|
|
2633
2635
|
/**
|
|
@@ -2666,7 +2668,7 @@ export namespace Models {
|
|
|
2666
2668
|
*/
|
|
2667
2669
|
$id: string;
|
|
2668
2670
|
/**
|
|
2669
|
-
* Document
|
|
2671
|
+
* Document sequence ID.
|
|
2670
2672
|
*/
|
|
2671
2673
|
$sequence: number;
|
|
2672
2674
|
/**
|
|
@@ -3523,6 +3525,10 @@ export namespace Models {
|
|
|
3523
3525
|
* Site framework.
|
|
3524
3526
|
*/
|
|
3525
3527
|
framework: string;
|
|
3528
|
+
/**
|
|
3529
|
+
* How many days to keep the non-active deployments before they will be automatically deleted.
|
|
3530
|
+
*/
|
|
3531
|
+
deploymentRetention: number;
|
|
3526
3532
|
/**
|
|
3527
3533
|
* Site's active deployment ID.
|
|
3528
3534
|
*/
|
|
@@ -3567,6 +3573,10 @@ export namespace Models {
|
|
|
3567
3573
|
* The build command used to build the site.
|
|
3568
3574
|
*/
|
|
3569
3575
|
buildCommand: string;
|
|
3576
|
+
/**
|
|
3577
|
+
* Custom command to use when starting site runtime.
|
|
3578
|
+
*/
|
|
3579
|
+
startCommand: string;
|
|
3570
3580
|
/**
|
|
3571
3581
|
* The directory where the site build output is located.
|
|
3572
3582
|
*/
|
|
@@ -3592,9 +3602,13 @@ export namespace Models {
|
|
|
3592
3602
|
*/
|
|
3593
3603
|
providerSilentMode: boolean;
|
|
3594
3604
|
/**
|
|
3595
|
-
* Machine specification for builds
|
|
3605
|
+
* Machine specification for deployment builds.
|
|
3596
3606
|
*/
|
|
3597
|
-
|
|
3607
|
+
buildSpecification: string;
|
|
3608
|
+
/**
|
|
3609
|
+
* Machine specification for SSR executions.
|
|
3610
|
+
*/
|
|
3611
|
+
runtimeSpecification: string;
|
|
3598
3612
|
/**
|
|
3599
3613
|
* Site build runtime.
|
|
3600
3614
|
*/
|
|
@@ -3749,6 +3763,10 @@ export namespace Models {
|
|
|
3749
3763
|
* Function execution and build runtime.
|
|
3750
3764
|
*/
|
|
3751
3765
|
runtime: string;
|
|
3766
|
+
/**
|
|
3767
|
+
* How many days to keep the non-active deployments before they will be automatically deleted.
|
|
3768
|
+
*/
|
|
3769
|
+
deploymentRetention: number;
|
|
3752
3770
|
/**
|
|
3753
3771
|
* Function's active deployment ID.
|
|
3754
3772
|
*/
|
|
@@ -3822,9 +3840,13 @@ export namespace Models {
|
|
|
3822
3840
|
*/
|
|
3823
3841
|
providerSilentMode: boolean;
|
|
3824
3842
|
/**
|
|
3825
|
-
* Machine specification for builds
|
|
3843
|
+
* Machine specification for deployment builds.
|
|
3826
3844
|
*/
|
|
3827
|
-
|
|
3845
|
+
buildSpecification: string;
|
|
3846
|
+
/**
|
|
3847
|
+
* Machine specification for executions.
|
|
3848
|
+
*/
|
|
3849
|
+
runtimeSpecification: string;
|
|
3828
3850
|
}
|
|
3829
3851
|
|
|
3830
3852
|
/**
|
|
@@ -4015,6 +4037,14 @@ export namespace Models {
|
|
|
4015
4037
|
* VCS (Version Control System) repository's default branch name.
|
|
4016
4038
|
*/
|
|
4017
4039
|
defaultBranch: string;
|
|
4040
|
+
/**
|
|
4041
|
+
* VCS (Version Control System) installation ID.
|
|
4042
|
+
*/
|
|
4043
|
+
providerInstallationId: string;
|
|
4044
|
+
/**
|
|
4045
|
+
* Is VCS (Version Control System) repository authorized for the installation?
|
|
4046
|
+
*/
|
|
4047
|
+
authorized: boolean;
|
|
4018
4048
|
/**
|
|
4019
4049
|
* Last commit date in ISO 8601 format.
|
|
4020
4050
|
*/
|
|
@@ -4053,6 +4083,14 @@ export namespace Models {
|
|
|
4053
4083
|
* VCS (Version Control System) repository's default branch name.
|
|
4054
4084
|
*/
|
|
4055
4085
|
defaultBranch: string;
|
|
4086
|
+
/**
|
|
4087
|
+
* VCS (Version Control System) installation ID.
|
|
4088
|
+
*/
|
|
4089
|
+
providerInstallationId: string;
|
|
4090
|
+
/**
|
|
4091
|
+
* Is VCS (Version Control System) repository authorized for the installation?
|
|
4092
|
+
*/
|
|
4093
|
+
authorized: boolean;
|
|
4056
4094
|
/**
|
|
4057
4095
|
* Last commit date in ISO 8601 format.
|
|
4058
4096
|
*/
|
|
@@ -4095,6 +4133,14 @@ export namespace Models {
|
|
|
4095
4133
|
* VCS (Version Control System) repository's default branch name.
|
|
4096
4134
|
*/
|
|
4097
4135
|
defaultBranch: string;
|
|
4136
|
+
/**
|
|
4137
|
+
* VCS (Version Control System) installation ID.
|
|
4138
|
+
*/
|
|
4139
|
+
providerInstallationId: string;
|
|
4140
|
+
/**
|
|
4141
|
+
* Is VCS (Version Control System) repository authorized for the installation?
|
|
4142
|
+
*/
|
|
4143
|
+
authorized: boolean;
|
|
4098
4144
|
/**
|
|
4099
4145
|
* Last commit date in ISO 8601 format.
|
|
4100
4146
|
*/
|
|
@@ -4753,6 +4799,10 @@ export namespace Models {
|
|
|
4753
4799
|
* Project blocks information
|
|
4754
4800
|
*/
|
|
4755
4801
|
blocks: Block[];
|
|
4802
|
+
/**
|
|
4803
|
+
* Last time the project was accessed via console. Used with plan's projectInactivityDays to determine if project is paused.
|
|
4804
|
+
*/
|
|
4805
|
+
consoleAccessedAt: string;
|
|
4756
4806
|
}
|
|
4757
4807
|
|
|
4758
4808
|
/**
|
|
@@ -6107,6 +6157,22 @@ export namespace Models {
|
|
|
6107
6157
|
* Total aggregated number of image transformations.
|
|
6108
6158
|
*/
|
|
6109
6159
|
imageTransformationsTotal: number;
|
|
6160
|
+
/**
|
|
6161
|
+
* Aggregated number of function executions per period.
|
|
6162
|
+
*/
|
|
6163
|
+
functionsExecutions: Metric[];
|
|
6164
|
+
/**
|
|
6165
|
+
* Total aggregated number of function executions.
|
|
6166
|
+
*/
|
|
6167
|
+
functionsExecutionsTotal: number;
|
|
6168
|
+
/**
|
|
6169
|
+
* Aggregated number of site executions per period.
|
|
6170
|
+
*/
|
|
6171
|
+
sitesExecutions: Metric[];
|
|
6172
|
+
/**
|
|
6173
|
+
* Total aggregated number of site executions.
|
|
6174
|
+
*/
|
|
6175
|
+
sitesExecutionsTotal: number;
|
|
6110
6176
|
/**
|
|
6111
6177
|
* Aggregated stats for total network bandwidth.
|
|
6112
6178
|
*/
|
|
@@ -6131,6 +6197,30 @@ export namespace Models {
|
|
|
6131
6197
|
* Total aggregated number of Imagine credits.
|
|
6132
6198
|
*/
|
|
6133
6199
|
imagineCreditsTotal: number;
|
|
6200
|
+
/**
|
|
6201
|
+
* Current aggregated number of open Realtime connections.
|
|
6202
|
+
*/
|
|
6203
|
+
realtimeConnectionsTotal: number;
|
|
6204
|
+
/**
|
|
6205
|
+
* Total number of Realtime messages sent to clients.
|
|
6206
|
+
*/
|
|
6207
|
+
realtimeMessagesTotal: number;
|
|
6208
|
+
/**
|
|
6209
|
+
* Total consumed Realtime bandwidth (in bytes).
|
|
6210
|
+
*/
|
|
6211
|
+
realtimeBandwidthTotal: number;
|
|
6212
|
+
/**
|
|
6213
|
+
* Aggregated number of open Realtime connections per period.
|
|
6214
|
+
*/
|
|
6215
|
+
realtimeConnections: Metric[];
|
|
6216
|
+
/**
|
|
6217
|
+
* Aggregated number of Realtime messages sent to clients per period.
|
|
6218
|
+
*/
|
|
6219
|
+
realtimeMessages: Metric[];
|
|
6220
|
+
/**
|
|
6221
|
+
* Aggregated consumed Realtime bandwidth (in bytes) per period.
|
|
6222
|
+
*/
|
|
6223
|
+
realtimeBandwidth: Metric[];
|
|
6134
6224
|
}
|
|
6135
6225
|
|
|
6136
6226
|
/**
|
|
@@ -6401,6 +6491,50 @@ export namespace Models {
|
|
|
6401
6491
|
* Comma-separated list of nameservers.
|
|
6402
6492
|
*/
|
|
6403
6493
|
_APP_DOMAINS_NAMESERVERS: string;
|
|
6494
|
+
/**
|
|
6495
|
+
* Database adapter in use.
|
|
6496
|
+
*/
|
|
6497
|
+
_APP_DB_ADAPTER: string;
|
|
6498
|
+
/**
|
|
6499
|
+
* Whether the database adapter supports relationships.
|
|
6500
|
+
*/
|
|
6501
|
+
supportForRelationships: boolean;
|
|
6502
|
+
/**
|
|
6503
|
+
* Whether the database adapter supports operators.
|
|
6504
|
+
*/
|
|
6505
|
+
supportForOperators: boolean;
|
|
6506
|
+
/**
|
|
6507
|
+
* Whether the database adapter supports spatial attributes.
|
|
6508
|
+
*/
|
|
6509
|
+
supportForSpatials: boolean;
|
|
6510
|
+
/**
|
|
6511
|
+
* Whether the database adapter supports spatial indexes on nullable columns.
|
|
6512
|
+
*/
|
|
6513
|
+
supportForSpatialIndexNull: boolean;
|
|
6514
|
+
/**
|
|
6515
|
+
* Whether the database adapter supports fulltext wildcard search.
|
|
6516
|
+
*/
|
|
6517
|
+
supportForFulltextWildcard: boolean;
|
|
6518
|
+
/**
|
|
6519
|
+
* Whether the database adapter supports multiple fulltext indexes per collection.
|
|
6520
|
+
*/
|
|
6521
|
+
supportForMultipleFulltextIndexes: boolean;
|
|
6522
|
+
/**
|
|
6523
|
+
* Whether the database adapter supports resizing attributes.
|
|
6524
|
+
*/
|
|
6525
|
+
supportForAttributeResizing: boolean;
|
|
6526
|
+
/**
|
|
6527
|
+
* Whether the database adapter supports fixed schemas with row width limits.
|
|
6528
|
+
*/
|
|
6529
|
+
supportForSchemas: boolean;
|
|
6530
|
+
/**
|
|
6531
|
+
* Maximum index length supported by the database adapter.
|
|
6532
|
+
*/
|
|
6533
|
+
maxIndexLength: number;
|
|
6534
|
+
/**
|
|
6535
|
+
* Whether the database adapter uses integer sequence IDs.
|
|
6536
|
+
*/
|
|
6537
|
+
supportForIntegerIds: boolean;
|
|
6404
6538
|
}
|
|
6405
6539
|
|
|
6406
6540
|
/**
|
|
@@ -6813,6 +6947,26 @@ export namespace Models {
|
|
|
6813
6947
|
* Number of functions to be migrated.
|
|
6814
6948
|
*/
|
|
6815
6949
|
function: number;
|
|
6950
|
+
/**
|
|
6951
|
+
* Number of sites to be migrated.
|
|
6952
|
+
*/
|
|
6953
|
+
site: number;
|
|
6954
|
+
/**
|
|
6955
|
+
* Number of providers to be migrated.
|
|
6956
|
+
*/
|
|
6957
|
+
provider: number;
|
|
6958
|
+
/**
|
|
6959
|
+
* Number of topics to be migrated.
|
|
6960
|
+
*/
|
|
6961
|
+
topic: number;
|
|
6962
|
+
/**
|
|
6963
|
+
* Number of subscribers to be migrated.
|
|
6964
|
+
*/
|
|
6965
|
+
subscriber: number;
|
|
6966
|
+
/**
|
|
6967
|
+
* Number of messages to be migrated.
|
|
6968
|
+
*/
|
|
6969
|
+
message: number;
|
|
6816
6970
|
/**
|
|
6817
6971
|
* Size of files to be migrated in mb.
|
|
6818
6972
|
*/
|
|
@@ -7355,6 +7509,10 @@ export namespace Models {
|
|
|
7355
7509
|
* Log days
|
|
7356
7510
|
*/
|
|
7357
7511
|
logs: number;
|
|
7512
|
+
/**
|
|
7513
|
+
* Number of days of console inactivity before a project is paused. 0 means pausing is disabled.
|
|
7514
|
+
*/
|
|
7515
|
+
projectInactivityDays: number;
|
|
7358
7516
|
/**
|
|
7359
7517
|
* Alert threshold percentage
|
|
7360
7518
|
*/
|
|
@@ -8570,7 +8728,11 @@ export namespace Models {
|
|
|
8570
8728
|
/**
|
|
8571
8729
|
* Payment status for domain purchase.
|
|
8572
8730
|
*/
|
|
8573
|
-
paymentStatus:
|
|
8731
|
+
paymentStatus: DomainPurchasePaymentStatus;
|
|
8732
|
+
/**
|
|
8733
|
+
* Client secret for payment confirmation. Present only when paymentStatus is pending_confirmation.
|
|
8734
|
+
*/
|
|
8735
|
+
clientSecret: string;
|
|
8574
8736
|
/**
|
|
8575
8737
|
* Nameservers setting. "Appwrite" or empty string.
|
|
8576
8738
|
*/
|
|
@@ -8599,6 +8761,14 @@ export namespace Models {
|
|
|
8599
8761
|
* Dns records
|
|
8600
8762
|
*/
|
|
8601
8763
|
dnsRecords: DnsRecord[];
|
|
8764
|
+
/**
|
|
8765
|
+
* Domain transfer status (e.g., "pending", "completed", "failed").
|
|
8766
|
+
*/
|
|
8767
|
+
transferStatus: string;
|
|
8768
|
+
/**
|
|
8769
|
+
* Retry attempts for the current domain payment flow. Development only.
|
|
8770
|
+
*/
|
|
8771
|
+
attempts: number;
|
|
8602
8772
|
}
|
|
8603
8773
|
|
|
8604
8774
|
/**
|
|
@@ -8855,6 +9025,10 @@ export namespace Models {
|
|
|
8855
9025
|
* Price period in years.
|
|
8856
9026
|
*/
|
|
8857
9027
|
periodYears: number;
|
|
9028
|
+
/**
|
|
9029
|
+
* Whether the domain is a premium domain.
|
|
9030
|
+
*/
|
|
9031
|
+
premium: boolean;
|
|
8858
9032
|
}
|
|
8859
9033
|
|
|
8860
9034
|
/**
|
|
@@ -8879,6 +9053,34 @@ export namespace Models {
|
|
|
8879
9053
|
available: boolean;
|
|
8880
9054
|
}
|
|
8881
9055
|
|
|
9056
|
+
/**
|
|
9057
|
+
* domainTransferOut
|
|
9058
|
+
*/
|
|
9059
|
+
export type DomainTransferOut = {
|
|
9060
|
+
/**
|
|
9061
|
+
* Domain transfer authorization code.
|
|
9062
|
+
*/
|
|
9063
|
+
authCode: string;
|
|
9064
|
+
}
|
|
9065
|
+
|
|
9066
|
+
/**
|
|
9067
|
+
* domainTransferStatus
|
|
9068
|
+
*/
|
|
9069
|
+
export type DomainTransferStatus = {
|
|
9070
|
+
/**
|
|
9071
|
+
* Transfer status.
|
|
9072
|
+
*/
|
|
9073
|
+
status: DomainTransferStatusStatus;
|
|
9074
|
+
/**
|
|
9075
|
+
* Additional transfer status information.
|
|
9076
|
+
*/
|
|
9077
|
+
reason: string;
|
|
9078
|
+
/**
|
|
9079
|
+
* Transfer status timestamp in ISO 8601 format.
|
|
9080
|
+
*/
|
|
9081
|
+
timestamp: string;
|
|
9082
|
+
}
|
|
9083
|
+
|
|
8882
9084
|
/**
|
|
8883
9085
|
* Activity event list
|
|
8884
9086
|
*/
|
package/src/services/account.ts
CHANGED
|
@@ -734,7 +734,7 @@ export class Account {
|
|
|
734
734
|
/**
|
|
735
735
|
* List all invoices tied to an account.
|
|
736
736
|
*
|
|
737
|
-
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, aggregationId, amount, currency, from, to, dueAt, attempts, status, grossAmount
|
|
737
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, aggregationId, type, amount, currency, from, to, dueAt, attempts, status, grossAmount
|
|
738
738
|
* @throws {AppwriteException}
|
|
739
739
|
* @returns {Promise<Models.InvoiceList>}
|
|
740
740
|
*/
|
|
@@ -742,7 +742,7 @@ export class Account {
|
|
|
742
742
|
/**
|
|
743
743
|
* List all invoices tied to an account.
|
|
744
744
|
*
|
|
745
|
-
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, aggregationId, amount, currency, from, to, dueAt, attempts, status, grossAmount
|
|
745
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, aggregationId, type, amount, currency, from, to, dueAt, attempts, status, grossAmount
|
|
746
746
|
* @throws {AppwriteException}
|
|
747
747
|
* @returns {Promise<Models.InvoiceList>}
|
|
748
748
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
@@ -835,7 +835,7 @@ export class Account {
|
|
|
835
835
|
}
|
|
836
836
|
|
|
837
837
|
/**
|
|
838
|
-
* Get a list of all API keys from the current account.
|
|
838
|
+
* Get a list of all API keys from the current account.
|
|
839
839
|
*
|
|
840
840
|
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
841
841
|
* @throws {AppwriteException}
|
|
@@ -843,7 +843,7 @@ export class Account {
|
|
|
843
843
|
*/
|
|
844
844
|
listKeys(params?: { total?: boolean }): Promise<Models.KeyList>;
|
|
845
845
|
/**
|
|
846
|
-
* Get a list of all API keys from the current account.
|
|
846
|
+
* Get a list of all API keys from the current account.
|
|
847
847
|
*
|
|
848
848
|
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
849
849
|
* @throws {AppwriteException}
|
|
@@ -1188,7 +1188,7 @@ export class Databases {
|
|
|
1188
1188
|
*
|
|
1189
1189
|
*
|
|
1190
1190
|
* @param {string} params.databaseId - Database ID.
|
|
1191
|
-
* @param {string} params.collectionId - Collection ID. You can create a new
|
|
1191
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1192
1192
|
* @param {string} params.key - Attribute Key.
|
|
1193
1193
|
* @param {boolean} params.required - Is attribute required?
|
|
1194
1194
|
* @param {boolean} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
@@ -1203,7 +1203,7 @@ export class Databases {
|
|
|
1203
1203
|
*
|
|
1204
1204
|
*
|
|
1205
1205
|
* @param {string} databaseId - Database ID.
|
|
1206
|
-
* @param {string} collectionId - Collection ID. You can create a new
|
|
1206
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1207
1207
|
* @param {string} key - Attribute Key.
|
|
1208
1208
|
* @param {boolean} required - Is attribute required?
|
|
1209
1209
|
* @param {boolean} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
@@ -3660,6 +3660,90 @@ export class Databases {
|
|
|
3660
3660
|
);
|
|
3661
3661
|
}
|
|
3662
3662
|
|
|
3663
|
+
/**
|
|
3664
|
+
* Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
3665
|
+
*
|
|
3666
|
+
*
|
|
3667
|
+
* @param {string} params.databaseId - Database ID.
|
|
3668
|
+
* @param {string} params.collectionId - Collection ID.
|
|
3669
|
+
* @param {string} params.key - Attribute Key.
|
|
3670
|
+
* @param {RelationMutate} params.onDelete - Constraints option
|
|
3671
|
+
* @param {string} params.newKey - New Attribute Key.
|
|
3672
|
+
* @throws {AppwriteException}
|
|
3673
|
+
* @returns {Promise<Models.AttributeRelationship>}
|
|
3674
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRelationshipColumn` instead.
|
|
3675
|
+
*/
|
|
3676
|
+
updateRelationshipAttribute(params: { databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string }): Promise<Models.AttributeRelationship>;
|
|
3677
|
+
/**
|
|
3678
|
+
* Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
3679
|
+
*
|
|
3680
|
+
*
|
|
3681
|
+
* @param {string} databaseId - Database ID.
|
|
3682
|
+
* @param {string} collectionId - Collection ID.
|
|
3683
|
+
* @param {string} key - Attribute Key.
|
|
3684
|
+
* @param {RelationMutate} onDelete - Constraints option
|
|
3685
|
+
* @param {string} newKey - New Attribute Key.
|
|
3686
|
+
* @throws {AppwriteException}
|
|
3687
|
+
* @returns {Promise<Models.AttributeRelationship>}
|
|
3688
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
3689
|
+
*/
|
|
3690
|
+
updateRelationshipAttribute(databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string): Promise<Models.AttributeRelationship>;
|
|
3691
|
+
updateRelationshipAttribute(
|
|
3692
|
+
paramsOrFirst: { databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string } | string,
|
|
3693
|
+
...rest: [(string)?, (string)?, (RelationMutate)?, (string)?]
|
|
3694
|
+
): Promise<Models.AttributeRelationship> {
|
|
3695
|
+
let params: { databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string };
|
|
3696
|
+
|
|
3697
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3698
|
+
params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string };
|
|
3699
|
+
} else {
|
|
3700
|
+
params = {
|
|
3701
|
+
databaseId: paramsOrFirst as string,
|
|
3702
|
+
collectionId: rest[0] as string,
|
|
3703
|
+
key: rest[1] as string,
|
|
3704
|
+
onDelete: rest[2] as RelationMutate,
|
|
3705
|
+
newKey: rest[3] as string
|
|
3706
|
+
};
|
|
3707
|
+
}
|
|
3708
|
+
|
|
3709
|
+
const databaseId = params.databaseId;
|
|
3710
|
+
const collectionId = params.collectionId;
|
|
3711
|
+
const key = params.key;
|
|
3712
|
+
const onDelete = params.onDelete;
|
|
3713
|
+
const newKey = params.newKey;
|
|
3714
|
+
|
|
3715
|
+
if (typeof databaseId === 'undefined') {
|
|
3716
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
3717
|
+
}
|
|
3718
|
+
if (typeof collectionId === 'undefined') {
|
|
3719
|
+
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
3720
|
+
}
|
|
3721
|
+
if (typeof key === 'undefined') {
|
|
3722
|
+
throw new AppwriteException('Missing required parameter: "key"');
|
|
3723
|
+
}
|
|
3724
|
+
|
|
3725
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
3726
|
+
const payload: Payload = {};
|
|
3727
|
+
if (typeof onDelete !== 'undefined') {
|
|
3728
|
+
payload['onDelete'] = onDelete;
|
|
3729
|
+
}
|
|
3730
|
+
if (typeof newKey !== 'undefined') {
|
|
3731
|
+
payload['newKey'] = newKey;
|
|
3732
|
+
}
|
|
3733
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3734
|
+
|
|
3735
|
+
const apiHeaders: { [header: string]: string } = {
|
|
3736
|
+
'content-type': 'application/json',
|
|
3737
|
+
}
|
|
3738
|
+
|
|
3739
|
+
return this.client.call(
|
|
3740
|
+
'patch',
|
|
3741
|
+
uri,
|
|
3742
|
+
apiHeaders,
|
|
3743
|
+
payload
|
|
3744
|
+
);
|
|
3745
|
+
}
|
|
3746
|
+
|
|
3663
3747
|
/**
|
|
3664
3748
|
* Create a string attribute.
|
|
3665
3749
|
*
|
|
@@ -4622,90 +4706,6 @@ export class Databases {
|
|
|
4622
4706
|
);
|
|
4623
4707
|
}
|
|
4624
4708
|
|
|
4625
|
-
/**
|
|
4626
|
-
* Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
4627
|
-
*
|
|
4628
|
-
*
|
|
4629
|
-
* @param {string} params.databaseId - Database ID.
|
|
4630
|
-
* @param {string} params.collectionId - Collection ID.
|
|
4631
|
-
* @param {string} params.key - Attribute Key.
|
|
4632
|
-
* @param {RelationMutate} params.onDelete - Constraints option
|
|
4633
|
-
* @param {string} params.newKey - New Attribute Key.
|
|
4634
|
-
* @throws {AppwriteException}
|
|
4635
|
-
* @returns {Promise<Models.AttributeRelationship>}
|
|
4636
|
-
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRelationshipColumn` instead.
|
|
4637
|
-
*/
|
|
4638
|
-
updateRelationshipAttribute(params: { databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string }): Promise<Models.AttributeRelationship>;
|
|
4639
|
-
/**
|
|
4640
|
-
* Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
4641
|
-
*
|
|
4642
|
-
*
|
|
4643
|
-
* @param {string} databaseId - Database ID.
|
|
4644
|
-
* @param {string} collectionId - Collection ID.
|
|
4645
|
-
* @param {string} key - Attribute Key.
|
|
4646
|
-
* @param {RelationMutate} onDelete - Constraints option
|
|
4647
|
-
* @param {string} newKey - New Attribute Key.
|
|
4648
|
-
* @throws {AppwriteException}
|
|
4649
|
-
* @returns {Promise<Models.AttributeRelationship>}
|
|
4650
|
-
* @deprecated Use the object parameter style method for a better developer experience.
|
|
4651
|
-
*/
|
|
4652
|
-
updateRelationshipAttribute(databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string): Promise<Models.AttributeRelationship>;
|
|
4653
|
-
updateRelationshipAttribute(
|
|
4654
|
-
paramsOrFirst: { databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string } | string,
|
|
4655
|
-
...rest: [(string)?, (string)?, (RelationMutate)?, (string)?]
|
|
4656
|
-
): Promise<Models.AttributeRelationship> {
|
|
4657
|
-
let params: { databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string };
|
|
4658
|
-
|
|
4659
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4660
|
-
params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string };
|
|
4661
|
-
} else {
|
|
4662
|
-
params = {
|
|
4663
|
-
databaseId: paramsOrFirst as string,
|
|
4664
|
-
collectionId: rest[0] as string,
|
|
4665
|
-
key: rest[1] as string,
|
|
4666
|
-
onDelete: rest[2] as RelationMutate,
|
|
4667
|
-
newKey: rest[3] as string
|
|
4668
|
-
};
|
|
4669
|
-
}
|
|
4670
|
-
|
|
4671
|
-
const databaseId = params.databaseId;
|
|
4672
|
-
const collectionId = params.collectionId;
|
|
4673
|
-
const key = params.key;
|
|
4674
|
-
const onDelete = params.onDelete;
|
|
4675
|
-
const newKey = params.newKey;
|
|
4676
|
-
|
|
4677
|
-
if (typeof databaseId === 'undefined') {
|
|
4678
|
-
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
4679
|
-
}
|
|
4680
|
-
if (typeof collectionId === 'undefined') {
|
|
4681
|
-
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
4682
|
-
}
|
|
4683
|
-
if (typeof key === 'undefined') {
|
|
4684
|
-
throw new AppwriteException('Missing required parameter: "key"');
|
|
4685
|
-
}
|
|
4686
|
-
|
|
4687
|
-
const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
|
|
4688
|
-
const payload: Payload = {};
|
|
4689
|
-
if (typeof onDelete !== 'undefined') {
|
|
4690
|
-
payload['onDelete'] = onDelete;
|
|
4691
|
-
}
|
|
4692
|
-
if (typeof newKey !== 'undefined') {
|
|
4693
|
-
payload['newKey'] = newKey;
|
|
4694
|
-
}
|
|
4695
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
4696
|
-
|
|
4697
|
-
const apiHeaders: { [header: string]: string } = {
|
|
4698
|
-
'content-type': 'application/json',
|
|
4699
|
-
}
|
|
4700
|
-
|
|
4701
|
-
return this.client.call(
|
|
4702
|
-
'patch',
|
|
4703
|
-
uri,
|
|
4704
|
-
apiHeaders,
|
|
4705
|
-
payload
|
|
4706
|
-
);
|
|
4707
|
-
}
|
|
4708
|
-
|
|
4709
4709
|
/**
|
|
4710
4710
|
* Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
|
|
4711
4711
|
*
|
|
@@ -4714,11 +4714,12 @@ export class Databases {
|
|
|
4714
4714
|
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
|
|
4715
4715
|
* @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
4716
4716
|
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
4717
|
+
* @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
|
|
4717
4718
|
* @throws {AppwriteException}
|
|
4718
4719
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
4719
4720
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead.
|
|
4720
4721
|
*/
|
|
4721
|
-
listDocuments<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean }): Promise<Models.DocumentList<Document>>;
|
|
4722
|
+
listDocuments<Document extends Models.Document = Models.DefaultDocument>(params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number }): Promise<Models.DocumentList<Document>>;
|
|
4722
4723
|
/**
|
|
4723
4724
|
* Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
|
|
4724
4725
|
*
|
|
@@ -4727,26 +4728,28 @@ export class Databases {
|
|
|
4727
4728
|
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
|
|
4728
4729
|
* @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction.
|
|
4729
4730
|
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
4731
|
+
* @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
|
|
4730
4732
|
* @throws {AppwriteException}
|
|
4731
4733
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
4732
4734
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
4733
4735
|
*/
|
|
4734
|
-
listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean): Promise<Models.DocumentList<Document>>;
|
|
4736
|
+
listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number): Promise<Models.DocumentList<Document>>;
|
|
4735
4737
|
listDocuments<Document extends Models.Document = Models.DefaultDocument>(
|
|
4736
|
-
paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean } | string,
|
|
4737
|
-
...rest: [(string)?, (string[])?, (string)?, (boolean)?]
|
|
4738
|
+
paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number } | string,
|
|
4739
|
+
...rest: [(string)?, (string[])?, (string)?, (boolean)?, (number)?]
|
|
4738
4740
|
): Promise<Models.DocumentList<Document>> {
|
|
4739
|
-
let params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean };
|
|
4741
|
+
let params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number };
|
|
4740
4742
|
|
|
4741
4743
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4742
|
-
params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean };
|
|
4744
|
+
params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number };
|
|
4743
4745
|
} else {
|
|
4744
4746
|
params = {
|
|
4745
4747
|
databaseId: paramsOrFirst as string,
|
|
4746
4748
|
collectionId: rest[0] as string,
|
|
4747
4749
|
queries: rest[1] as string[],
|
|
4748
4750
|
transactionId: rest[2] as string,
|
|
4749
|
-
total: rest[3] as boolean
|
|
4751
|
+
total: rest[3] as boolean,
|
|
4752
|
+
ttl: rest[4] as number
|
|
4750
4753
|
};
|
|
4751
4754
|
}
|
|
4752
4755
|
|
|
@@ -4755,6 +4758,7 @@ export class Databases {
|
|
|
4755
4758
|
const queries = params.queries;
|
|
4756
4759
|
const transactionId = params.transactionId;
|
|
4757
4760
|
const total = params.total;
|
|
4761
|
+
const ttl = params.ttl;
|
|
4758
4762
|
|
|
4759
4763
|
if (typeof databaseId === 'undefined') {
|
|
4760
4764
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -4774,6 +4778,9 @@ export class Databases {
|
|
|
4774
4778
|
if (typeof total !== 'undefined') {
|
|
4775
4779
|
payload['total'] = total;
|
|
4776
4780
|
}
|
|
4781
|
+
if (typeof ttl !== 'undefined') {
|
|
4782
|
+
payload['ttl'] = ttl;
|
|
4783
|
+
}
|
|
4777
4784
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
4778
4785
|
|
|
4779
4786
|
const apiHeaders: { [header: string]: string } = {
|