@appwrite.io/console 13.0.0 → 13.2.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 (67) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/sdk.js +5443 -1380
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +5438 -1381
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +5451 -1388
  7. package/package.json +1 -1
  8. package/types/channel.d.ts +8 -3
  9. package/types/client.d.ts +1 -1
  10. package/types/enums/account-key-scopes.d.ts +5 -0
  11. package/types/enums/addon.d.ts +2 -1
  12. package/types/enums/appwrite-migration-resource.d.ts +14 -1
  13. package/types/enums/backup-services.d.ts +1 -0
  14. package/types/enums/{resource-type.d.ts → block-resource-type.d.ts} +2 -6
  15. package/types/enums/{theme.d.ts → browser-theme.d.ts} +1 -1
  16. package/types/enums/build-runtime.d.ts +3 -1
  17. package/types/enums/cache-database.d.ts +5 -0
  18. package/types/enums/cache-target.d.ts +8 -0
  19. package/types/enums/{registration-type.d.ts → domain-registration-type.d.ts} +1 -1
  20. package/types/enums/{filter-type.d.ts → domain-suggestion-type.d.ts} +1 -1
  21. package/types/enums/embedding-model.d.ts +6 -0
  22. package/types/enums/function-template-use-case.d.ts +9 -0
  23. package/types/enums/{name.d.ts → health-queue-name.d.ts} +1 -1
  24. package/types/enums/o-auth-provider.d.ts +1 -3
  25. package/types/enums/organization-key-scopes.d.ts +12 -0
  26. package/types/enums/{auth-method.d.ts → project-auth-method-id.d.ts} +1 -1
  27. package/types/enums/{email-template-type.d.ts → project-email-template-id.d.ts} +1 -1
  28. package/types/enums/{email-template-locale.d.ts → project-email-template-locale.d.ts} +1 -1
  29. package/types/enums/{scopes.d.ts → project-key-scopes.d.ts} +12 -8
  30. package/types/enums/{prompt.d.ts → project-o-auth-2-google-prompt.d.ts} +1 -1
  31. package/types/enums/project-o-auth-provider-id.d.ts +45 -0
  32. package/types/enums/{project-policy.d.ts → project-policy-id.d.ts} +6 -2
  33. package/types/enums/{protocol-id.d.ts → project-protocol-id.d.ts} +1 -1
  34. package/types/enums/{service-id.d.ts → project-service-id.d.ts} +3 -2
  35. package/types/enums/project-smtp-secure.d.ts +4 -0
  36. package/types/enums/query-suggestion-resource.d.ts +13 -1
  37. package/types/enums/runtime.d.ts +3 -1
  38. package/types/enums/schedule-resource-type.d.ts +6 -0
  39. package/types/enums/{use-cases.d.ts → site-template-use-case.d.ts} +3 -8
  40. package/types/enums/status-code.d.ts +4 -4
  41. package/types/index.d.ts +30 -19
  42. package/types/models.d.ts +2610 -1109
  43. package/types/services/account.d.ts +11 -11
  44. package/types/services/advisor.d.ts +123 -0
  45. package/types/services/apps.d.ts +266 -0
  46. package/types/services/avatars.d.ts +5 -5
  47. package/types/services/compute.d.ts +1171 -0
  48. package/types/services/console.d.ts +31 -0
  49. package/types/services/documents-db.d.ts +1 -4
  50. package/types/services/domains.d.ts +216 -216
  51. package/types/services/functions.d.ts +29 -18
  52. package/types/services/health.d.ts +13 -5
  53. package/types/services/manager.d.ts +49 -9
  54. package/types/services/messaging.d.ts +92 -0
  55. package/types/services/organization.d.ts +234 -0
  56. package/types/services/organizations.d.ts +0 -126
  57. package/types/services/presences.d.ts +166 -0
  58. package/types/services/project.d.ts +167 -89
  59. package/types/services/projects.d.ts +5 -154
  60. package/types/services/realtime.d.ts +45 -3
  61. package/types/services/sites.d.ts +22 -11
  62. package/types/services/usage.d.ts +50 -0
  63. package/types/services/vectors-db.d.ts +6 -9
  64. package/types/enums/frameworks.d.ts +0 -17
  65. package/types/enums/model.d.ts +0 -3
  66. package/types/enums/runtimes.d.ts +0 -91
  67. package/types/enums/secure.d.ts +0 -4
@@ -1,159 +1,10 @@
1
1
  import { Client } from '../client';
2
2
  import type { Models } from '../models';
3
- import { Region } from '../enums/region';
4
- import { ResourceType } from '../enums/resource-type';
3
+ import { ScheduleResourceType } from '../enums/schedule-resource-type';
5
4
  import { Status } from '../enums/status';
6
5
  export declare class Projects {
7
6
  client: Client;
8
7
  constructor(client: Client);
9
- /**
10
- * Get a list of all projects. You can use the query params to filter your results.
11
- *
12
- * @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. You may filter on the following attributes: name, teamId, labels, search
13
- * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
14
- * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
15
- * @throws {AppwriteException}
16
- * @returns {Promise<Models.ProjectList>}
17
- */
18
- list(params?: {
19
- queries?: string[];
20
- search?: string;
21
- total?: boolean;
22
- }): Promise<Models.ProjectList>;
23
- /**
24
- * Get a list of all projects. You can use the query params to filter your results.
25
- *
26
- * @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. You may filter on the following attributes: name, teamId, labels, search
27
- * @param {string} search - Search term to filter your list results. Max length: 256 chars.
28
- * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
29
- * @throws {AppwriteException}
30
- * @returns {Promise<Models.ProjectList>}
31
- * @deprecated Use the object parameter style method for a better developer experience.
32
- */
33
- list(queries?: string[], search?: string, total?: boolean): Promise<Models.ProjectList>;
34
- /**
35
- * Create a new project. You can create a maximum of 100 projects per account.
36
- *
37
- * @param {string} params.projectId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars.
38
- * @param {string} params.name - Project name. Max length: 128 chars.
39
- * @param {string} params.teamId - Team unique ID.
40
- * @param {Region} params.region - Project Region.
41
- * @param {string} params.description - Project description. Max length: 256 chars.
42
- * @param {string} params.logo - Project logo.
43
- * @param {string} params.url - Project URL.
44
- * @param {string} params.legalName - Project legal Name. Max length: 256 chars.
45
- * @param {string} params.legalCountry - Project legal Country. Max length: 256 chars.
46
- * @param {string} params.legalState - Project legal State. Max length: 256 chars.
47
- * @param {string} params.legalCity - Project legal City. Max length: 256 chars.
48
- * @param {string} params.legalAddress - Project legal Address. Max length: 256 chars.
49
- * @param {string} params.legalTaxId - Project legal Tax ID. Max length: 256 chars.
50
- * @throws {AppwriteException}
51
- * @returns {Promise<Models.Project>}
52
- */
53
- create(params: {
54
- projectId: string;
55
- name: string;
56
- teamId: string;
57
- region?: Region;
58
- description?: string;
59
- logo?: string;
60
- url?: string;
61
- legalName?: string;
62
- legalCountry?: string;
63
- legalState?: string;
64
- legalCity?: string;
65
- legalAddress?: string;
66
- legalTaxId?: string;
67
- }): Promise<Models.Project>;
68
- /**
69
- * Create a new project. You can create a maximum of 100 projects per account.
70
- *
71
- * @param {string} projectId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars.
72
- * @param {string} name - Project name. Max length: 128 chars.
73
- * @param {string} teamId - Team unique ID.
74
- * @param {Region} region - Project Region.
75
- * @param {string} description - Project description. Max length: 256 chars.
76
- * @param {string} logo - Project logo.
77
- * @param {string} url - Project URL.
78
- * @param {string} legalName - Project legal Name. Max length: 256 chars.
79
- * @param {string} legalCountry - Project legal Country. Max length: 256 chars.
80
- * @param {string} legalState - Project legal State. Max length: 256 chars.
81
- * @param {string} legalCity - Project legal City. Max length: 256 chars.
82
- * @param {string} legalAddress - Project legal Address. Max length: 256 chars.
83
- * @param {string} legalTaxId - Project legal Tax ID. Max length: 256 chars.
84
- * @throws {AppwriteException}
85
- * @returns {Promise<Models.Project>}
86
- * @deprecated Use the object parameter style method for a better developer experience.
87
- */
88
- create(projectId: string, name: string, teamId: string, region?: Region, description?: string, logo?: string, url?: string, legalName?: string, legalCountry?: string, legalState?: string, legalCity?: string, legalAddress?: string, legalTaxId?: string): Promise<Models.Project>;
89
- /**
90
- * Get a project by its unique ID. This endpoint allows you to retrieve the project's details, including its name, description, team, region, and other metadata.
91
- *
92
- * @param {string} params.projectId - Project unique ID.
93
- * @throws {AppwriteException}
94
- * @returns {Promise<Models.Project>}
95
- */
96
- get(params: {
97
- projectId: string;
98
- }): Promise<Models.Project>;
99
- /**
100
- * Get a project by its unique ID. This endpoint allows you to retrieve the project's details, including its name, description, team, region, and other metadata.
101
- *
102
- * @param {string} projectId - Project unique ID.
103
- * @throws {AppwriteException}
104
- * @returns {Promise<Models.Project>}
105
- * @deprecated Use the object parameter style method for a better developer experience.
106
- */
107
- get(projectId: string): Promise<Models.Project>;
108
- /**
109
- * Update a project by its unique ID.
110
- *
111
- * @param {string} params.projectId - Project unique ID.
112
- * @param {string} params.name - Project name. Max length: 128 chars.
113
- * @param {string} params.description - Project description. Max length: 256 chars.
114
- * @param {string} params.logo - Project logo.
115
- * @param {string} params.url - Project URL.
116
- * @param {string} params.legalName - Project legal name. Max length: 256 chars.
117
- * @param {string} params.legalCountry - Project legal country. Max length: 256 chars.
118
- * @param {string} params.legalState - Project legal state. Max length: 256 chars.
119
- * @param {string} params.legalCity - Project legal city. Max length: 256 chars.
120
- * @param {string} params.legalAddress - Project legal address. Max length: 256 chars.
121
- * @param {string} params.legalTaxId - Project legal tax ID. Max length: 256 chars.
122
- * @throws {AppwriteException}
123
- * @returns {Promise<Models.Project>}
124
- */
125
- update(params: {
126
- projectId: string;
127
- name: string;
128
- description?: string;
129
- logo?: string;
130
- url?: string;
131
- legalName?: string;
132
- legalCountry?: string;
133
- legalState?: string;
134
- legalCity?: string;
135
- legalAddress?: string;
136
- legalTaxId?: string;
137
- }): Promise<Models.Project>;
138
- /**
139
- * Update a project by its unique ID.
140
- *
141
- * @param {string} projectId - Project unique ID.
142
- * @param {string} name - Project name. Max length: 128 chars.
143
- * @param {string} description - Project description. Max length: 256 chars.
144
- * @param {string} logo - Project logo.
145
- * @param {string} url - Project URL.
146
- * @param {string} legalName - Project legal name. Max length: 256 chars.
147
- * @param {string} legalCountry - Project legal country. Max length: 256 chars.
148
- * @param {string} legalState - Project legal state. Max length: 256 chars.
149
- * @param {string} legalCity - Project legal city. Max length: 256 chars.
150
- * @param {string} legalAddress - Project legal address. Max length: 256 chars.
151
- * @param {string} legalTaxId - Project legal tax ID. Max length: 256 chars.
152
- * @throws {AppwriteException}
153
- * @returns {Promise<Models.Project>}
154
- * @deprecated Use the object parameter style method for a better developer experience.
155
- */
156
- update(projectId: string, name: string, description?: string, logo?: string, url?: string, legalName?: string, legalCountry?: string, legalState?: string, legalCity?: string, legalAddress?: string, legalTaxId?: string): Promise<Models.Project>;
157
8
  /**
158
9
  * Record console access to a project. This endpoint updates the last accessed timestamp for the project to track console activity.
159
10
  *
@@ -323,7 +174,7 @@ export declare class Projects {
323
174
  * Create a new schedule for a resource.
324
175
  *
325
176
  * @param {string} params.projectId - Project unique ID.
326
- * @param {ResourceType} params.resourceType - The resource type for the schedule. Possible values: function, execution, message, backup.
177
+ * @param {ScheduleResourceType} params.resourceType - The resource type for the schedule. Possible values: function, execution, message, backup.
327
178
  * @param {string} params.resourceId - The resource ID to associate with this schedule.
328
179
  * @param {string} params.schedule - Schedule CRON expression.
329
180
  * @param {boolean} params.active - Whether the schedule is active.
@@ -333,7 +184,7 @@ export declare class Projects {
333
184
  */
334
185
  createSchedule(params: {
335
186
  projectId: string;
336
- resourceType: ResourceType;
187
+ resourceType: ScheduleResourceType;
337
188
  resourceId: string;
338
189
  schedule: string;
339
190
  active?: boolean;
@@ -343,7 +194,7 @@ export declare class Projects {
343
194
  * Create a new schedule for a resource.
344
195
  *
345
196
  * @param {string} projectId - Project unique ID.
346
- * @param {ResourceType} resourceType - The resource type for the schedule. Possible values: function, execution, message, backup.
197
+ * @param {ScheduleResourceType} resourceType - The resource type for the schedule. Possible values: function, execution, message, backup.
347
198
  * @param {string} resourceId - The resource ID to associate with this schedule.
348
199
  * @param {string} schedule - Schedule CRON expression.
349
200
  * @param {boolean} active - Whether the schedule is active.
@@ -352,7 +203,7 @@ export declare class Projects {
352
203
  * @returns {Promise<Models.Schedule>}
353
204
  * @deprecated Use the object parameter style method for a better developer experience.
354
205
  */
355
- createSchedule(projectId: string, resourceType: ResourceType, resourceId: string, schedule: string, active?: boolean, data?: object): Promise<Models.Schedule>;
206
+ createSchedule(projectId: string, resourceType: ScheduleResourceType, resourceId: string, schedule: string, active?: boolean, data?: object): Promise<Models.Schedule>;
356
207
  /**
357
208
  * Get a schedule by its unique ID.
358
209
  *
@@ -42,9 +42,27 @@ export type RealtimeResponseConnected = {
42
42
  user?: object;
43
43
  };
44
44
  export type RealtimeRequest = {
45
- type: 'authentication' | 'subscribe' | 'unsubscribe';
45
+ type: 'authentication' | 'subscribe' | 'unsubscribe' | 'presence';
46
46
  data: any;
47
47
  };
48
+ export type RealtimePresence = {
49
+ $id: string;
50
+ $sequence?: string | number;
51
+ $createdAt: string;
52
+ $updatedAt: string;
53
+ $permissions: string[];
54
+ userInternalId: string;
55
+ userId: string;
56
+ status?: string;
57
+ source: string;
58
+ metadata?: Record<string, any>;
59
+ };
60
+ export type RealtimePresenceCreate = {
61
+ status: string;
62
+ presenceId: string;
63
+ permissions?: string[];
64
+ metadata?: Record<string, any>;
65
+ };
48
66
  export declare enum RealtimeCode {
49
67
  NORMAL_CLOSURE = 1000,
50
68
  POLICY_VIOLATION = 1008,
@@ -55,14 +73,16 @@ export declare class Realtime {
55
73
  private readonly TYPE_EVENT;
56
74
  private readonly TYPE_PONG;
57
75
  private readonly TYPE_CONNECTED;
58
- private readonly TYPE_RESPONSE;
59
76
  private readonly DEBOUNCE_MS;
60
77
  private readonly HEARTBEAT_INTERVAL;
61
78
  private client;
62
79
  private socket?;
63
80
  private activeSubscriptions;
64
81
  private pendingSubscribes;
82
+ private pendingPresence?;
83
+ private appConnected;
65
84
  private heartbeatTimer?;
85
+ private socketCreationPromise?;
66
86
  private subCallDepth;
67
87
  private reconnectAttempts;
68
88
  private connectionId;
@@ -94,7 +114,16 @@ export declare class Realtime {
94
114
  onOpen(callback: () => void): void;
95
115
  private startHeartbeat;
96
116
  private stopHeartbeat;
117
+ /**
118
+ * Idempotent socket opener. Both `subscribe()` and `upsertPresence()` can
119
+ * call this; the single-flight lock (`socketCreationPromise`) guarantees
120
+ * only one `new WebSocket(...)` is ever in flight, so concurrent callers
121
+ * join the same connection attempt instead of opening duplicates.
122
+ *
123
+ * Returns early when a healthy socket is already present.
124
+ */
97
125
  private createSocket;
126
+ private createSocketLocked;
98
127
  private closeSocket;
99
128
  private getTimeout;
100
129
  private sleep;
@@ -147,9 +176,22 @@ export declare class Realtime {
147
176
  * @returns {Promise<RealtimeSubscription>} Subscription object with close method
148
177
  */
149
178
  subscribe<T>(channels: (string | Channel<any> | ActionableChannel | ResolvedChannel)[], callback: (event: RealtimeResponseEvent<T>) => void, queries?: (string | Query)[]): Promise<RealtimeSubscription>;
179
+ /**
180
+ * Fire-and-forget presence upsert. Records the latest payload in state so
181
+ * that — if the WebSocket isn't open yet, or later reconnects — only the
182
+ * most recent presence is automatically (re)sent on the next `connected`
183
+ * event. Repeated calls while the socket is closed collapse to the latest
184
+ * payload (older ones are discarded).
185
+ *
186
+ * Returns a `Promise<void>` for API consistency; the promise resolves as
187
+ * soon as the payload has been stored and the opportunistic send attempted.
188
+ *
189
+ * @param {RealtimePresenceCreate} params - Presence payload (status and presenceId required, permissions/metadata optional)
190
+ */
191
+ upsertPresence(params: RealtimePresenceCreate): Promise<void>;
192
+ private flushPendingPresence;
150
193
  private handleMessage;
151
194
  private handleResponseConnected;
152
195
  private handleResponseError;
153
196
  private handleResponseEvent;
154
- private handleResponseAction;
155
197
  }
@@ -3,8 +3,7 @@ import type { Models } from '../models';
3
3
  import { Framework } from '../enums/framework';
4
4
  import { BuildRuntime } from '../enums/build-runtime';
5
5
  import { Adapter } from '../enums/adapter';
6
- import { Frameworks } from '../enums/frameworks';
7
- import { UseCases } from '../enums/use-cases';
6
+ import { SiteTemplateUseCase } from '../enums/site-template-use-case';
8
7
  import { UsageRange } from '../enums/usage-range';
9
8
  import { TemplateReferenceType } from '../enums/template-reference-type';
10
9
  import { VCSReferenceType } from '../enums/vcs-reference-type';
@@ -58,6 +57,8 @@ export declare class Sites {
58
57
  * @param {string} params.providerBranch - Production branch for the repo linked to the site.
59
58
  * @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
60
59
  * @param {string} params.providerRootDirectory - Path to site code in the linked repo.
60
+ * @param {string[]} params.providerBranches - List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches.
61
+ * @param {string[]} params.providerPaths - List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes.
61
62
  * @param {string} params.buildSpecification - Build specification for the site deployments.
62
63
  * @param {string} params.runtimeSpecification - Runtime specification for the SSR executions.
63
64
  * @param {number} params.deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
@@ -83,6 +84,8 @@ export declare class Sites {
83
84
  providerBranch?: string;
84
85
  providerSilentMode?: boolean;
85
86
  providerRootDirectory?: string;
87
+ providerBranches?: string[];
88
+ providerPaths?: string[];
86
89
  buildSpecification?: string;
87
90
  runtimeSpecification?: string;
88
91
  deploymentRetention?: number;
@@ -108,6 +111,8 @@ export declare class Sites {
108
111
  * @param {string} providerBranch - Production branch for the repo linked to the site.
109
112
  * @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
110
113
  * @param {string} providerRootDirectory - Path to site code in the linked repo.
114
+ * @param {string[]} providerBranches - List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches.
115
+ * @param {string[]} providerPaths - List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes.
111
116
  * @param {string} buildSpecification - Build specification for the site deployments.
112
117
  * @param {string} runtimeSpecification - Runtime specification for the SSR executions.
113
118
  * @param {number} deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
@@ -115,7 +120,7 @@ export declare class Sites {
115
120
  * @returns {Promise<Models.Site>}
116
121
  * @deprecated Use the object parameter style method for a better developer experience.
117
122
  */
118
- create(siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number): Promise<Models.Site>;
123
+ create(siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number): Promise<Models.Site>;
119
124
  /**
120
125
  * Get a list of all frameworks that are currently available on the server instance.
121
126
  *
@@ -133,31 +138,31 @@ export declare class Sites {
133
138
  /**
134
139
  * List available site templates. You can use template details in [createSite](/docs/references/cloud/server-nodejs/sites#create) method.
135
140
  *
136
- * @param {Frameworks[]} params.frameworks - List of frameworks allowed for filtering site templates. Maximum of 100 frameworks are allowed.
137
- * @param {UseCases[]} params.useCases - List of use cases allowed for filtering site templates. Maximum of 100 use cases are allowed.
141
+ * @param {Framework[]} params.frameworks - List of frameworks allowed for filtering site templates. Maximum of 100 frameworks are allowed.
142
+ * @param {SiteTemplateUseCase[]} params.useCases - List of use cases allowed for filtering site templates. Maximum of 100 use cases are allowed.
138
143
  * @param {number} params.limit - Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.
139
144
  * @param {number} params.offset - Offset the list of returned templates. Maximum offset is 5000.
140
145
  * @throws {AppwriteException}
141
146
  * @returns {Promise<Models.TemplateSiteList>}
142
147
  */
143
148
  listTemplates(params?: {
144
- frameworks?: Frameworks[];
145
- useCases?: UseCases[];
149
+ frameworks?: Framework[];
150
+ useCases?: SiteTemplateUseCase[];
146
151
  limit?: number;
147
152
  offset?: number;
148
153
  }): Promise<Models.TemplateSiteList>;
149
154
  /**
150
155
  * List available site templates. You can use template details in [createSite](/docs/references/cloud/server-nodejs/sites#create) method.
151
156
  *
152
- * @param {Frameworks[]} frameworks - List of frameworks allowed for filtering site templates. Maximum of 100 frameworks are allowed.
153
- * @param {UseCases[]} useCases - List of use cases allowed for filtering site templates. Maximum of 100 use cases are allowed.
157
+ * @param {Framework[]} frameworks - List of frameworks allowed for filtering site templates. Maximum of 100 frameworks are allowed.
158
+ * @param {SiteTemplateUseCase[]} useCases - List of use cases allowed for filtering site templates. Maximum of 100 use cases are allowed.
154
159
  * @param {number} limit - Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.
155
160
  * @param {number} offset - Offset the list of returned templates. Maximum offset is 5000.
156
161
  * @throws {AppwriteException}
157
162
  * @returns {Promise<Models.TemplateSiteList>}
158
163
  * @deprecated Use the object parameter style method for a better developer experience.
159
164
  */
160
- listTemplates(frameworks?: Frameworks[], useCases?: UseCases[], limit?: number, offset?: number): Promise<Models.TemplateSiteList>;
165
+ listTemplates(frameworks?: Framework[], useCases?: SiteTemplateUseCase[], limit?: number, offset?: number): Promise<Models.TemplateSiteList>;
161
166
  /**
162
167
  * Get a site template using ID. You can use template details in [createSite](/docs/references/cloud/server-nodejs/sites#create) method.
163
168
  *
@@ -236,6 +241,8 @@ export declare class Sites {
236
241
  * @param {string} params.providerBranch - Production branch for the repo linked to the site.
237
242
  * @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
238
243
  * @param {string} params.providerRootDirectory - Path to site code in the linked repo.
244
+ * @param {string[]} params.providerBranches - List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches.
245
+ * @param {string[]} params.providerPaths - List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes.
239
246
  * @param {string} params.buildSpecification - Build specification for the site deployments.
240
247
  * @param {string} params.runtimeSpecification - Runtime specification for the SSR executions.
241
248
  * @param {number} params.deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
@@ -261,6 +268,8 @@ export declare class Sites {
261
268
  providerBranch?: string;
262
269
  providerSilentMode?: boolean;
263
270
  providerRootDirectory?: string;
271
+ providerBranches?: string[];
272
+ providerPaths?: string[];
264
273
  buildSpecification?: string;
265
274
  runtimeSpecification?: string;
266
275
  deploymentRetention?: number;
@@ -286,6 +295,8 @@ export declare class Sites {
286
295
  * @param {string} providerBranch - Production branch for the repo linked to the site.
287
296
  * @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
288
297
  * @param {string} providerRootDirectory - Path to site code in the linked repo.
298
+ * @param {string[]} providerBranches - List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches.
299
+ * @param {string[]} providerPaths - List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes.
289
300
  * @param {string} buildSpecification - Build specification for the site deployments.
290
301
  * @param {string} runtimeSpecification - Runtime specification for the SSR executions.
291
302
  * @param {number} deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
@@ -293,7 +304,7 @@ export declare class Sites {
293
304
  * @returns {Promise<Models.Site>}
294
305
  * @deprecated Use the object parameter style method for a better developer experience.
295
306
  */
296
- update(siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number): Promise<Models.Site>;
307
+ update(siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number): Promise<Models.Site>;
297
308
  /**
298
309
  * Delete a site by its unique ID.
299
310
  *
@@ -0,0 +1,50 @@
1
+ import { Client } from '../client';
2
+ import type { Models } from '../models';
3
+ export declare class Usage {
4
+ client: Client;
5
+ constructor(client: Client);
6
+ /**
7
+ * Query usage event metrics from the usage database. Returns individual event rows with full metadata. Pass Query objects as JSON strings to filter, paginate, and order results. Supported query methods: equal, greaterThanEqual, lessThanEqual, orderAsc, orderDesc, limit, offset. Supported filter attributes: metric, path, method, status, resource, resourceId, country, userAgent, time (these match the underlying column names — note that the response surfaces `resource` as `resourceType` and `country` as `countryCode`). When no time filter is supplied the endpoint defaults to the last 7 days. Default `limit(100)` is applied if none is given; user-supplied limits are capped at 500. The `total` field is capped at 5000 to keep counts predictable — pass `total=false` to skip the count entirely.
8
+ *
9
+ * @param {string[]} params.queries - Array of query strings as JSON. Supported: equal("metric", [...]), equal("path", [...]), equal("method", [...]), equal("status", [...]), equal("resource", [...]), equal("resourceId", [...]), equal("country", [...]), equal("userAgent", [...]), greaterThanEqual("time", "..."), lessThanEqual("time", "..."), orderAsc("time"), orderDesc("time"), limit(N), offset(N).
10
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
11
+ * @throws {AppwriteException}
12
+ * @returns {Promise<Models.UsageEventList>}
13
+ */
14
+ listEvents(params?: {
15
+ queries?: string[];
16
+ total?: boolean;
17
+ }): Promise<Models.UsageEventList>;
18
+ /**
19
+ * Query usage event metrics from the usage database. Returns individual event rows with full metadata. Pass Query objects as JSON strings to filter, paginate, and order results. Supported query methods: equal, greaterThanEqual, lessThanEqual, orderAsc, orderDesc, limit, offset. Supported filter attributes: metric, path, method, status, resource, resourceId, country, userAgent, time (these match the underlying column names — note that the response surfaces `resource` as `resourceType` and `country` as `countryCode`). When no time filter is supplied the endpoint defaults to the last 7 days. Default `limit(100)` is applied if none is given; user-supplied limits are capped at 500. The `total` field is capped at 5000 to keep counts predictable — pass `total=false` to skip the count entirely.
20
+ *
21
+ * @param {string[]} queries - Array of query strings as JSON. Supported: equal("metric", [...]), equal("path", [...]), equal("method", [...]), equal("status", [...]), equal("resource", [...]), equal("resourceId", [...]), equal("country", [...]), equal("userAgent", [...]), greaterThanEqual("time", "..."), lessThanEqual("time", "..."), orderAsc("time"), orderDesc("time"), limit(N), offset(N).
22
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
23
+ * @throws {AppwriteException}
24
+ * @returns {Promise<Models.UsageEventList>}
25
+ * @deprecated Use the object parameter style method for a better developer experience.
26
+ */
27
+ listEvents(queries?: string[], total?: boolean): Promise<Models.UsageEventList>;
28
+ /**
29
+ * Query usage gauge metrics (point-in-time resource snapshots) from the usage database. Returns individual gauge snapshots with metric, value, timestamp, resourceType, and resourceId. Pass Query objects as JSON strings to filter, paginate, and order results. Supported query methods: equal, greaterThanEqual, lessThanEqual, orderAsc, orderDesc, limit, offset. Supported filter attributes: metric, time. Use `orderDesc("time"), limit(1)` to fetch the most recent snapshot. When no time filter is supplied the endpoint defaults to the last 7 days. Default `limit(100)` is applied if none is given; user-supplied limits are capped at 500. The `total` field is capped at 5000 to keep counts predictable — pass `total=false` to skip the count entirely.
30
+ *
31
+ * @param {string[]} params.queries - Array of query strings as JSON. Supported: equal("metric", [...]), greaterThanEqual("time", "..."), lessThanEqual("time", "..."), orderAsc("time"), orderDesc("time"), limit(N), offset(N).
32
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
33
+ * @throws {AppwriteException}
34
+ * @returns {Promise<Models.UsageGaugeList>}
35
+ */
36
+ listGauges(params?: {
37
+ queries?: string[];
38
+ total?: boolean;
39
+ }): Promise<Models.UsageGaugeList>;
40
+ /**
41
+ * Query usage gauge metrics (point-in-time resource snapshots) from the usage database. Returns individual gauge snapshots with metric, value, timestamp, resourceType, and resourceId. Pass Query objects as JSON strings to filter, paginate, and order results. Supported query methods: equal, greaterThanEqual, lessThanEqual, orderAsc, orderDesc, limit, offset. Supported filter attributes: metric, time. Use `orderDesc("time"), limit(1)` to fetch the most recent snapshot. When no time filter is supplied the endpoint defaults to the last 7 days. Default `limit(100)` is applied if none is given; user-supplied limits are capped at 500. The `total` field is capped at 5000 to keep counts predictable — pass `total=false` to skip the count entirely.
42
+ *
43
+ * @param {string[]} queries - Array of query strings as JSON. Supported: equal("metric", [...]), greaterThanEqual("time", "..."), lessThanEqual("time", "..."), orderAsc("time"), orderDesc("time"), limit(N), offset(N).
44
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
45
+ * @throws {AppwriteException}
46
+ * @returns {Promise<Models.UsageGaugeList>}
47
+ * @deprecated Use the object parameter style method for a better developer experience.
48
+ */
49
+ listGauges(queries?: string[], total?: boolean): Promise<Models.UsageGaugeList>;
50
+ }
@@ -1,6 +1,6 @@
1
1
  import { Client } from '../client';
2
2
  import type { Models } from '../models';
3
- import { Model } from '../enums/model';
3
+ import { EmbeddingModel } from '../enums/embedding-model';
4
4
  import { UsageRange } from '../enums/usage-range';
5
5
  import { VectorsDBIndexType } from '../enums/vectors-db-index-type';
6
6
  import { OrderBy } from '../enums/order-by';
@@ -11,27 +11,24 @@ export declare class VectorsDB {
11
11
  * Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.
12
12
  *
13
13
  * @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. You may filter on the following columns: name
14
- * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
15
14
  * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
16
15
  * @throws {AppwriteException}
17
16
  * @returns {Promise<Models.DatabaseList>}
18
17
  */
19
18
  list(params?: {
20
19
  queries?: string[];
21
- search?: string;
22
20
  total?: boolean;
23
21
  }): Promise<Models.DatabaseList>;
24
22
  /**
25
23
  * Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.
26
24
  *
27
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/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name
28
- * @param {string} search - Search term to filter your list results. Max length: 256 chars.
29
26
  * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
30
27
  * @throws {AppwriteException}
31
28
  * @returns {Promise<Models.DatabaseList>}
32
29
  * @deprecated Use the object parameter style method for a better developer experience.
33
30
  */
34
- list(queries?: string[], search?: string, total?: boolean): Promise<Models.DatabaseList>;
31
+ list(queries?: string[], total?: boolean): Promise<Models.DatabaseList>;
35
32
  /**
36
33
  * Create a new Database.
37
34
  *
@@ -63,24 +60,24 @@ export declare class VectorsDB {
63
60
  * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
64
61
  *
65
62
  * @param {string[]} params.texts - Array of text to generate embeddings.
66
- * @param {Model} params.model - The embedding model to use for generating vector embeddings.
63
+ * @param {EmbeddingModel} params.model - The embedding model to use for generating vector embeddings.
67
64
  * @throws {AppwriteException}
68
65
  * @returns {Promise<Models.EmbeddingList>}
69
66
  */
70
67
  createTextEmbeddings(params: {
71
68
  texts: string[];
72
- model?: Model;
69
+ model?: EmbeddingModel;
73
70
  }): Promise<Models.EmbeddingList>;
74
71
  /**
75
72
  * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
76
73
  *
77
74
  * @param {string[]} texts - Array of text to generate embeddings.
78
- * @param {Model} model - The embedding model to use for generating vector embeddings.
75
+ * @param {EmbeddingModel} model - The embedding model to use for generating vector embeddings.
79
76
  * @throws {AppwriteException}
80
77
  * @returns {Promise<Models.EmbeddingList>}
81
78
  * @deprecated Use the object parameter style method for a better developer experience.
82
79
  */
83
- createTextEmbeddings(texts: string[], model?: Model): Promise<Models.EmbeddingList>;
80
+ createTextEmbeddings(texts: string[], model?: EmbeddingModel): Promise<Models.EmbeddingList>;
84
81
  /**
85
82
  * List transactions across all databases.
86
83
  *
@@ -1,17 +0,0 @@
1
- export declare enum Frameworks {
2
- Analog = "analog",
3
- Angular = "angular",
4
- Nextjs = "nextjs",
5
- React = "react",
6
- Nuxt = "nuxt",
7
- Vue = "vue",
8
- Sveltekit = "sveltekit",
9
- Astro = "astro",
10
- Tanstackstart = "tanstack-start",
11
- Remix = "remix",
12
- Lynx = "lynx",
13
- Flutter = "flutter",
14
- Reactnative = "react-native",
15
- Vite = "vite",
16
- Other = "other"
17
- }
@@ -1,3 +0,0 @@
1
- export declare enum Model {
2
- Embeddinggemma = "embeddinggemma"
3
- }
@@ -1,91 +0,0 @@
1
- export declare enum Runtimes {
2
- Node145 = "node-14.5",
3
- Node160 = "node-16.0",
4
- Node180 = "node-18.0",
5
- Node190 = "node-19.0",
6
- Node200 = "node-20.0",
7
- Node210 = "node-21.0",
8
- Node22 = "node-22",
9
- Node23 = "node-23",
10
- Node24 = "node-24",
11
- Node25 = "node-25",
12
- Php80 = "php-8.0",
13
- Php81 = "php-8.1",
14
- Php82 = "php-8.2",
15
- Php83 = "php-8.3",
16
- Php84 = "php-8.4",
17
- Ruby30 = "ruby-3.0",
18
- Ruby31 = "ruby-3.1",
19
- Ruby32 = "ruby-3.2",
20
- Ruby33 = "ruby-3.3",
21
- Ruby34 = "ruby-3.4",
22
- Ruby40 = "ruby-4.0",
23
- Python38 = "python-3.8",
24
- Python39 = "python-3.9",
25
- Python310 = "python-3.10",
26
- Python311 = "python-3.11",
27
- Python312 = "python-3.12",
28
- Python313 = "python-3.13",
29
- Python314 = "python-3.14",
30
- Pythonml311 = "python-ml-3.11",
31
- Pythonml312 = "python-ml-3.12",
32
- Pythonml313 = "python-ml-3.13",
33
- Deno140 = "deno-1.40",
34
- Deno146 = "deno-1.46",
35
- Deno20 = "deno-2.0",
36
- Deno25 = "deno-2.5",
37
- Deno26 = "deno-2.6",
38
- Dart215 = "dart-2.15",
39
- Dart216 = "dart-2.16",
40
- Dart217 = "dart-2.17",
41
- Dart218 = "dart-2.18",
42
- Dart219 = "dart-2.19",
43
- Dart30 = "dart-3.0",
44
- Dart31 = "dart-3.1",
45
- Dart33 = "dart-3.3",
46
- Dart35 = "dart-3.5",
47
- Dart38 = "dart-3.8",
48
- Dart39 = "dart-3.9",
49
- Dart310 = "dart-3.10",
50
- Dart311 = "dart-3.11",
51
- Dotnet60 = "dotnet-6.0",
52
- Dotnet70 = "dotnet-7.0",
53
- Dotnet80 = "dotnet-8.0",
54
- Dotnet10 = "dotnet-10",
55
- Java80 = "java-8.0",
56
- Java110 = "java-11.0",
57
- Java170 = "java-17.0",
58
- Java180 = "java-18.0",
59
- Java210 = "java-21.0",
60
- Java22 = "java-22",
61
- Java25 = "java-25",
62
- Swift55 = "swift-5.5",
63
- Swift58 = "swift-5.8",
64
- Swift59 = "swift-5.9",
65
- Swift510 = "swift-5.10",
66
- Swift62 = "swift-6.2",
67
- Kotlin16 = "kotlin-1.6",
68
- Kotlin18 = "kotlin-1.8",
69
- Kotlin19 = "kotlin-1.9",
70
- Kotlin20 = "kotlin-2.0",
71
- Kotlin23 = "kotlin-2.3",
72
- Cpp17 = "cpp-17",
73
- Cpp20 = "cpp-20",
74
- Bun10 = "bun-1.0",
75
- Bun11 = "bun-1.1",
76
- Bun12 = "bun-1.2",
77
- Bun13 = "bun-1.3",
78
- Go123 = "go-1.23",
79
- Go124 = "go-1.24",
80
- Go125 = "go-1.25",
81
- Go126 = "go-1.26",
82
- Rust183 = "rust-1.83",
83
- Static1 = "static-1",
84
- Flutter324 = "flutter-3.24",
85
- Flutter327 = "flutter-3.27",
86
- Flutter329 = "flutter-3.29",
87
- Flutter332 = "flutter-3.32",
88
- Flutter335 = "flutter-3.35",
89
- Flutter338 = "flutter-3.38",
90
- Flutter341 = "flutter-3.41"
91
- }
@@ -1,4 +0,0 @@
1
- export declare enum Secure {
2
- Tls = "tls",
3
- Ssl = "ssl"
4
- }