@appwrite.io/console 7.0.0 → 8.1.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.
Files changed (150) hide show
  1. package/.github/workflows/publish.yml +1 -1
  2. package/CHANGELOG.md +30 -6
  3. package/README.md +2 -2
  4. package/dist/cjs/sdk.js +222 -303
  5. package/docs/examples/databases/create-index.md +2 -2
  6. package/docs/examples/domains/create-purchase.md +2 -1
  7. package/docs/examples/domains/create-transfer-in.md +2 -1
  8. package/docs/examples/domains/update-auto-renewal.md +16 -0
  9. package/docs/examples/project/create-variable.md +1 -0
  10. package/docs/examples/project/list-variables.md +4 -1
  11. package/docs/examples/project/update-variable.md +1 -1
  12. package/docs/examples/tablesdb/create-index.md +2 -2
  13. package/docs/examples/users/update-impersonator.md +16 -0
  14. package/package.json +7 -7
  15. package/rollup.config.js +2 -1
  16. package/src/client.ts +61 -1
  17. package/src/enums/appwrite-migration-resource.ts +2 -0
  18. package/src/enums/backup-services.ts +3 -0
  19. package/src/enums/build-runtime.ts +0 -86
  20. package/src/enums/database-type.ts +2 -0
  21. package/src/enums/databases-index-type.ts +6 -0
  22. package/src/enums/runtime.ts +0 -86
  23. package/src/enums/runtimes.ts +0 -86
  24. package/src/enums/scopes.ts +13 -2
  25. package/src/enums/{index-type.ts → tables-db-index-type.ts} +1 -1
  26. package/src/enums/template-reference-type.ts +1 -1
  27. package/src/enums/use-cases.ts +7 -2
  28. package/src/index.ts +2 -1
  29. package/src/models.ts +172 -4
  30. package/src/services/databases.ts +10 -10
  31. package/src/services/domains.ts +103 -26
  32. package/src/services/project.ts +76 -33
  33. package/src/services/tables-db.ts +10 -10
  34. package/src/services/users.ts +67 -2
  35. package/src/services/vcs.ts +10 -10
  36. package/dist/cjs/sdk.js.map +0 -1
  37. package/dist/esm/sdk.js +0 -29782
  38. package/dist/esm/sdk.js.map +0 -1
  39. package/dist/iife/sdk.js +0 -33583
  40. package/types/channel.d.ts +0 -74
  41. package/types/client.d.ts +0 -260
  42. package/types/enums/adapter.d.ts +0 -4
  43. package/types/enums/api-service.d.ts +0 -15
  44. package/types/enums/api.d.ts +0 -5
  45. package/types/enums/appwrite-migration-resource.d.ts +0 -25
  46. package/types/enums/attribute-status.d.ts +0 -7
  47. package/types/enums/auth-method.d.ts +0 -9
  48. package/types/enums/authentication-factor.d.ts +0 -6
  49. package/types/enums/authenticator-type.d.ts +0 -3
  50. package/types/enums/backup-services.d.ts +0 -5
  51. package/types/enums/billing-plan-group.d.ts +0 -5
  52. package/types/enums/browser-permission.d.ts +0 -22
  53. package/types/enums/browser.d.ts +0 -16
  54. package/types/enums/build-runtime.d.ts +0 -174
  55. package/types/enums/column-status.d.ts +0 -7
  56. package/types/enums/compression.d.ts +0 -5
  57. package/types/enums/console-resource-type.d.ts +0 -3
  58. package/types/enums/credit-card.d.ts +0 -19
  59. package/types/enums/database-type.d.ts +0 -4
  60. package/types/enums/deployment-download-type.d.ts +0 -4
  61. package/types/enums/deployment-status.d.ts +0 -8
  62. package/types/enums/domain-purchase-status.d.ts +0 -6
  63. package/types/enums/domain-transfer-status-enum.d.ts +0 -10
  64. package/types/enums/email-template-locale.d.ts +0 -133
  65. package/types/enums/email-template-type.d.ts +0 -9
  66. package/types/enums/execution-method.d.ts +0 -9
  67. package/types/enums/execution-status.d.ts +0 -7
  68. package/types/enums/execution-trigger.d.ts +0 -5
  69. package/types/enums/filter-type.d.ts +0 -4
  70. package/types/enums/firebase-migration-resource.d.ts +0 -12
  71. package/types/enums/flag.d.ts +0 -197
  72. package/types/enums/framework.d.ts +0 -17
  73. package/types/enums/frameworks.d.ts +0 -17
  74. package/types/enums/health-antivirus-status.d.ts +0 -5
  75. package/types/enums/health-check-status.d.ts +0 -4
  76. package/types/enums/image-format.d.ts +0 -9
  77. package/types/enums/image-gravity.d.ts +0 -11
  78. package/types/enums/index-status.d.ts +0 -7
  79. package/types/enums/index-type.d.ts +0 -6
  80. package/types/enums/message-priority.d.ts +0 -4
  81. package/types/enums/message-status.d.ts +0 -7
  82. package/types/enums/messaging-provider-type.d.ts +0 -5
  83. package/types/enums/n-host-migration-resource.d.ts +0 -13
  84. package/types/enums/name.d.ts +0 -15
  85. package/types/enums/o-auth-provider.d.ts +0 -41
  86. package/types/enums/order-by.d.ts +0 -4
  87. package/types/enums/password-hash.d.ts +0 -13
  88. package/types/enums/platform-type.d.ts +0 -17
  89. package/types/enums/platform.d.ts +0 -4
  90. package/types/enums/project-usage-range.d.ts +0 -4
  91. package/types/enums/proxy-resource-type.d.ts +0 -4
  92. package/types/enums/proxy-rule-deployment-resource-type.d.ts +0 -4
  93. package/types/enums/proxy-rule-status.d.ts +0 -6
  94. package/types/enums/region.d.ts +0 -8
  95. package/types/enums/registration-type.d.ts +0 -6
  96. package/types/enums/relation-mutate.d.ts +0 -5
  97. package/types/enums/relationship-type.d.ts +0 -6
  98. package/types/enums/resource-type.d.ts +0 -6
  99. package/types/enums/runtime.d.ts +0 -174
  100. package/types/enums/runtimes.d.ts +0 -174
  101. package/types/enums/scopes.d.ts +0 -70
  102. package/types/enums/sms-template-locale.d.ts +0 -133
  103. package/types/enums/sms-template-type.d.ts +0 -6
  104. package/types/enums/smtp-encryption.d.ts +0 -5
  105. package/types/enums/smtp-secure.d.ts +0 -4
  106. package/types/enums/status-code.d.ts +0 -6
  107. package/types/enums/status.d.ts +0 -3
  108. package/types/enums/supabase-migration-resource.d.ts +0 -13
  109. package/types/enums/template-reference-type.d.ts +0 -5
  110. package/types/enums/theme.d.ts +0 -4
  111. package/types/enums/timezone.d.ts +0 -421
  112. package/types/enums/usage-range.d.ts +0 -5
  113. package/types/enums/use-cases.d.ts +0 -11
  114. package/types/enums/vcs-detection-type.d.ts +0 -4
  115. package/types/enums/vcs-reference-type.d.ts +0 -5
  116. package/types/id.d.ts +0 -20
  117. package/types/index.d.ts +0 -117
  118. package/types/models.d.ts +0 -9071
  119. package/types/operator.d.ts +0 -180
  120. package/types/permission.d.ts +0 -43
  121. package/types/query.d.ts +0 -442
  122. package/types/role.d.ts +0 -70
  123. package/types/service.d.ts +0 -11
  124. package/types/services/account.d.ts +0 -1536
  125. package/types/services/activities.d.ts +0 -46
  126. package/types/services/assistant.d.ts +0 -24
  127. package/types/services/avatars.d.ts +0 -320
  128. package/types/services/backups.d.ts +0 -277
  129. package/types/services/console.d.ts +0 -248
  130. package/types/services/databases.d.ts +0 -2435
  131. package/types/services/domains.d.ts +0 -1499
  132. package/types/services/functions.d.ts +0 -842
  133. package/types/services/graphql.d.ts +0 -43
  134. package/types/services/health.d.ts +0 -475
  135. package/types/services/locale.d.ts +0 -64
  136. package/types/services/messaging.d.ts +0 -1989
  137. package/types/services/migrations.d.ts +0 -417
  138. package/types/services/organizations.d.ts +0 -1009
  139. package/types/services/project.d.ts +0 -130
  140. package/types/services/projects.d.ts +0 -1626
  141. package/types/services/proxy.d.ts +0 -190
  142. package/types/services/realtime.d.ts +0 -134
  143. package/types/services/sites.d.ts +0 -800
  144. package/types/services/storage.d.ts +0 -467
  145. package/types/services/tables-db.d.ts +0 -2352
  146. package/types/services/teams.d.ts +0 -366
  147. package/types/services/tokens.d.ts +0 -119
  148. package/types/services/users.d.ts +0 -1184
  149. package/types/services/vcs.d.ts +0 -252
  150. package/types/services/webhooks.d.ts +0 -165
@@ -1,190 +0,0 @@
1
- import { Client } from '../client';
2
- import type { Models } from '../models';
3
- import { StatusCode } from '../enums/status-code';
4
- import { ProxyResourceType } from '../enums/proxy-resource-type';
5
- export declare class Proxy {
6
- client: Client;
7
- constructor(client: Client);
8
- /**
9
- * Get a list of all the proxy rules. You can use the query params to filter your results.
10
- *
11
- * @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: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch
12
- * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
13
- * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
14
- * @throws {AppwriteException}
15
- * @returns {Promise<Models.ProxyRuleList>}
16
- */
17
- listRules(params?: {
18
- queries?: string[];
19
- search?: string;
20
- total?: boolean;
21
- }): Promise<Models.ProxyRuleList>;
22
- /**
23
- * Get a list of all the proxy rules. You can use the query params to filter your results.
24
- *
25
- * @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: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch
26
- * @param {string} search - Search term to filter your list results. Max length: 256 chars.
27
- * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
28
- * @throws {AppwriteException}
29
- * @returns {Promise<Models.ProxyRuleList>}
30
- * @deprecated Use the object parameter style method for a better developer experience.
31
- */
32
- listRules(queries?: string[], search?: string, total?: boolean): Promise<Models.ProxyRuleList>;
33
- /**
34
- * Create a new proxy rule for serving Appwrite's API on custom domain.
35
- *
36
- * @param {string} params.domain - Domain name.
37
- * @throws {AppwriteException}
38
- * @returns {Promise<Models.ProxyRule>}
39
- */
40
- createAPIRule(params: {
41
- domain: string;
42
- }): Promise<Models.ProxyRule>;
43
- /**
44
- * Create a new proxy rule for serving Appwrite's API on custom domain.
45
- *
46
- * @param {string} domain - Domain name.
47
- * @throws {AppwriteException}
48
- * @returns {Promise<Models.ProxyRule>}
49
- * @deprecated Use the object parameter style method for a better developer experience.
50
- */
51
- createAPIRule(domain: string): Promise<Models.ProxyRule>;
52
- /**
53
- * Create a new proxy rule for executing Appwrite Function on custom domain.
54
- *
55
- * @param {string} params.domain - Domain name.
56
- * @param {string} params.functionId - ID of function to be executed.
57
- * @param {string} params.branch - Name of VCS branch to deploy changes automatically
58
- * @throws {AppwriteException}
59
- * @returns {Promise<Models.ProxyRule>}
60
- */
61
- createFunctionRule(params: {
62
- domain: string;
63
- functionId: string;
64
- branch?: string;
65
- }): Promise<Models.ProxyRule>;
66
- /**
67
- * Create a new proxy rule for executing Appwrite Function on custom domain.
68
- *
69
- * @param {string} domain - Domain name.
70
- * @param {string} functionId - ID of function to be executed.
71
- * @param {string} branch - Name of VCS branch to deploy changes automatically
72
- * @throws {AppwriteException}
73
- * @returns {Promise<Models.ProxyRule>}
74
- * @deprecated Use the object parameter style method for a better developer experience.
75
- */
76
- createFunctionRule(domain: string, functionId: string, branch?: string): Promise<Models.ProxyRule>;
77
- /**
78
- * Create a new proxy rule for to redirect from custom domain to another domain.
79
- *
80
- * @param {string} params.domain - Domain name.
81
- * @param {string} params.url - Target URL of redirection
82
- * @param {StatusCode} params.statusCode - Status code of redirection
83
- * @param {string} params.resourceId - ID of parent resource.
84
- * @param {ProxyResourceType} params.resourceType - Type of parent resource.
85
- * @throws {AppwriteException}
86
- * @returns {Promise<Models.ProxyRule>}
87
- */
88
- createRedirectRule(params: {
89
- domain: string;
90
- url: string;
91
- statusCode: StatusCode;
92
- resourceId: string;
93
- resourceType: ProxyResourceType;
94
- }): Promise<Models.ProxyRule>;
95
- /**
96
- * Create a new proxy rule for to redirect from custom domain to another domain.
97
- *
98
- * @param {string} domain - Domain name.
99
- * @param {string} url - Target URL of redirection
100
- * @param {StatusCode} statusCode - Status code of redirection
101
- * @param {string} resourceId - ID of parent resource.
102
- * @param {ProxyResourceType} resourceType - Type of parent resource.
103
- * @throws {AppwriteException}
104
- * @returns {Promise<Models.ProxyRule>}
105
- * @deprecated Use the object parameter style method for a better developer experience.
106
- */
107
- createRedirectRule(domain: string, url: string, statusCode: StatusCode, resourceId: string, resourceType: ProxyResourceType): Promise<Models.ProxyRule>;
108
- /**
109
- * Create a new proxy rule for serving Appwrite Site on custom domain.
110
- *
111
- * @param {string} params.domain - Domain name.
112
- * @param {string} params.siteId - ID of site to be executed.
113
- * @param {string} params.branch - Name of VCS branch to deploy changes automatically
114
- * @throws {AppwriteException}
115
- * @returns {Promise<Models.ProxyRule>}
116
- */
117
- createSiteRule(params: {
118
- domain: string;
119
- siteId: string;
120
- branch?: string;
121
- }): Promise<Models.ProxyRule>;
122
- /**
123
- * Create a new proxy rule for serving Appwrite Site on custom domain.
124
- *
125
- * @param {string} domain - Domain name.
126
- * @param {string} siteId - ID of site to be executed.
127
- * @param {string} branch - Name of VCS branch to deploy changes automatically
128
- * @throws {AppwriteException}
129
- * @returns {Promise<Models.ProxyRule>}
130
- * @deprecated Use the object parameter style method for a better developer experience.
131
- */
132
- createSiteRule(domain: string, siteId: string, branch?: string): Promise<Models.ProxyRule>;
133
- /**
134
- * Get a proxy rule by its unique ID.
135
- *
136
- * @param {string} params.ruleId - Rule ID.
137
- * @throws {AppwriteException}
138
- * @returns {Promise<Models.ProxyRule>}
139
- */
140
- getRule(params: {
141
- ruleId: string;
142
- }): Promise<Models.ProxyRule>;
143
- /**
144
- * Get a proxy rule by its unique ID.
145
- *
146
- * @param {string} ruleId - Rule ID.
147
- * @throws {AppwriteException}
148
- * @returns {Promise<Models.ProxyRule>}
149
- * @deprecated Use the object parameter style method for a better developer experience.
150
- */
151
- getRule(ruleId: string): Promise<Models.ProxyRule>;
152
- /**
153
- * Delete a proxy rule by its unique ID.
154
- *
155
- * @param {string} params.ruleId - Rule ID.
156
- * @throws {AppwriteException}
157
- * @returns {Promise<{}>}
158
- */
159
- deleteRule(params: {
160
- ruleId: string;
161
- }): Promise<{}>;
162
- /**
163
- * Delete a proxy rule by its unique ID.
164
- *
165
- * @param {string} ruleId - Rule ID.
166
- * @throws {AppwriteException}
167
- * @returns {Promise<{}>}
168
- * @deprecated Use the object parameter style method for a better developer experience.
169
- */
170
- deleteRule(ruleId: string): Promise<{}>;
171
- /**
172
- * Retry getting verification process of a proxy rule. This endpoint triggers domain verification by checking DNS records (CNAME) against the configured target domain. If verification is successful, a TLS certificate will be automatically provisioned for the domain.
173
- *
174
- * @param {string} params.ruleId - Rule ID.
175
- * @throws {AppwriteException}
176
- * @returns {Promise<Models.ProxyRule>}
177
- */
178
- updateRuleVerification(params: {
179
- ruleId: string;
180
- }): Promise<Models.ProxyRule>;
181
- /**
182
- * Retry getting verification process of a proxy rule. This endpoint triggers domain verification by checking DNS records (CNAME) against the configured target domain. If verification is successful, a TLS certificate will be automatically provisioned for the domain.
183
- *
184
- * @param {string} ruleId - Rule ID.
185
- * @throws {AppwriteException}
186
- * @returns {Promise<Models.ProxyRule>}
187
- * @deprecated Use the object parameter style method for a better developer experience.
188
- */
189
- updateRuleVerification(ruleId: string): Promise<Models.ProxyRule>;
190
- }
@@ -1,134 +0,0 @@
1
- import { Client } from '../client';
2
- import { Channel, ActionableChannel, ResolvedChannel } from '../channel';
3
- import { Query } from '../query';
4
- export declare type RealtimeSubscription = {
5
- close: () => Promise<void>;
6
- };
7
- export declare type RealtimeCallback<T = any> = {
8
- channels: Set<string>;
9
- queries: string[];
10
- callback: (event: RealtimeResponseEvent<T>) => void;
11
- };
12
- export declare type RealtimeResponse = {
13
- type: string;
14
- data?: any;
15
- };
16
- export declare type RealtimeResponseEvent<T = any> = {
17
- events: string[];
18
- channels: string[];
19
- timestamp: string;
20
- payload: T;
21
- subscriptions: string[];
22
- };
23
- export declare type RealtimeResponseConnected = {
24
- channels: string[];
25
- user?: object;
26
- subscriptions?: {
27
- [slot: string]: string;
28
- };
29
- };
30
- export declare type RealtimeRequest = {
31
- type: 'authentication';
32
- data: {
33
- session: string;
34
- };
35
- };
36
- export declare enum RealtimeCode {
37
- NORMAL_CLOSURE = 1000,
38
- POLICY_VIOLATION = 1008,
39
- UNKNOWN_ERROR = -1
40
- }
41
- export declare class Realtime {
42
- private readonly TYPE_ERROR;
43
- private readonly TYPE_EVENT;
44
- private readonly TYPE_PONG;
45
- private readonly TYPE_CONNECTED;
46
- private readonly DEBOUNCE_MS;
47
- private readonly HEARTBEAT_INTERVAL;
48
- private client;
49
- private socket?;
50
- private activeSubscriptions;
51
- private slotToSubscriptionId;
52
- private subscriptionIdToSlot;
53
- private heartbeatTimer?;
54
- private subCallDepth;
55
- private reconnectAttempts;
56
- private subscriptionsCounter;
57
- private connectionId;
58
- private reconnect;
59
- private onErrorCallbacks;
60
- private onCloseCallbacks;
61
- private onOpenCallbacks;
62
- constructor(client: Client);
63
- /**
64
- * Register a callback function to be called when an error occurs
65
- *
66
- * @param {Function} callback - Callback function to handle errors
67
- * @returns {void}
68
- */
69
- onError(callback: (error?: Error, statusCode?: number) => void): void;
70
- /**
71
- * Register a callback function to be called when the connection closes
72
- *
73
- * @param {Function} callback - Callback function to handle connection close
74
- * @returns {void}
75
- */
76
- onClose(callback: () => void): void;
77
- /**
78
- * Register a callback function to be called when the connection opens
79
- *
80
- * @param {Function} callback - Callback function to handle connection open
81
- * @returns {void}
82
- */
83
- onOpen(callback: () => void): void;
84
- private startHeartbeat;
85
- private stopHeartbeat;
86
- private createSocket;
87
- private closeSocket;
88
- private getTimeout;
89
- private sleep;
90
- /**
91
- * Convert a channel value to a string
92
- *
93
- * @private
94
- * @param {string | Channel<any> | ActionableChannel | ResolvedChannel} channel - Channel value (string or Channel builder instance)
95
- * @returns {string} Channel string representation
96
- */
97
- private channelToString;
98
- /**
99
- * Subscribe to a single channel
100
- *
101
- * @param {string | Channel<any> | ActionableChannel | ResolvedChannel} channel - Channel name to subscribe to (string or Channel builder instance)
102
- * @param {Function} callback - Callback function to handle events
103
- * @returns {Promise<RealtimeSubscription>} Subscription object with close method
104
- */
105
- subscribe(channel: string | Channel<any> | ActionableChannel | ResolvedChannel, callback: (event: RealtimeResponseEvent<any>) => void, queries?: (string | Query)[]): Promise<RealtimeSubscription>;
106
- /**
107
- * Subscribe to multiple channels
108
- *
109
- * @param {(string | Channel<any> | ActionableChannel | ResolvedChannel)[]} channels - Array of channel names to subscribe to (strings or Channel builder instances)
110
- * @param {Function} callback - Callback function to handle events
111
- * @returns {Promise<RealtimeSubscription>} Subscription object with close method
112
- */
113
- subscribe(channels: (string | Channel<any> | ActionableChannel | ResolvedChannel)[], callback: (event: RealtimeResponseEvent<any>) => void, queries?: (string | Query)[]): Promise<RealtimeSubscription>;
114
- /**
115
- * Subscribe to a single channel with typed payload
116
- *
117
- * @param {string | Channel<any> | ActionableChannel | ResolvedChannel} channel - Channel name to subscribe to (string or Channel builder instance)
118
- * @param {Function} callback - Callback function to handle events with typed payload
119
- * @returns {Promise<RealtimeSubscription>} Subscription object with close method
120
- */
121
- subscribe<T>(channel: string | Channel<any> | ActionableChannel | ResolvedChannel, callback: (event: RealtimeResponseEvent<T>) => void, queries?: (string | Query)[]): Promise<RealtimeSubscription>;
122
- /**
123
- * Subscribe to multiple channels with typed payload
124
- *
125
- * @param {(string | Channel<any> | ActionableChannel | ResolvedChannel)[]} channels - Array of channel names to subscribe to (strings or Channel builder instances)
126
- * @param {Function} callback - Callback function to handle events with typed payload
127
- * @returns {Promise<RealtimeSubscription>} Subscription object with close method
128
- */
129
- subscribe<T>(channels: (string | Channel<any> | ActionableChannel | ResolvedChannel)[], callback: (event: RealtimeResponseEvent<T>) => void, queries?: (string | Query)[]): Promise<RealtimeSubscription>;
130
- private handleMessage;
131
- private handleResponseConnected;
132
- private handleResponseError;
133
- private handleResponseEvent;
134
- }