@appwrite.io/console 1.5.2 → 1.6.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 (53) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/sdk.js +7673 -9723
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +7673 -9723
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +7673 -9723
  7. package/docs/examples/organizations/validate-invoice.md +14 -0
  8. package/package.json +1 -1
  9. package/src/client.ts +21 -4
  10. package/src/enums/o-auth-provider.ts +1 -0
  11. package/src/models.ts +118 -6
  12. package/src/services/account.ts +126 -430
  13. package/src/services/assistant.ts +2 -7
  14. package/src/services/avatars.ts +7 -21
  15. package/src/services/backups.ts +24 -84
  16. package/src/services/console.ts +14 -49
  17. package/src/services/databases.ts +96 -336
  18. package/src/services/functions.ts +55 -192
  19. package/src/services/graphql.ts +4 -14
  20. package/src/services/health.ts +50 -175
  21. package/src/services/locale.ts +16 -56
  22. package/src/services/messaging.ts +92 -322
  23. package/src/services/migrations.ts +24 -84
  24. package/src/services/organizations.ts +86 -196
  25. package/src/services/project.ts +12 -42
  26. package/src/services/projects.ts +92 -322
  27. package/src/services/proxy.ts +10 -35
  28. package/src/services/storage.ts +27 -93
  29. package/src/services/teams.ts +28 -98
  30. package/src/services/users.ts +86 -301
  31. package/src/services/vcs.ts +20 -70
  32. package/types/enums/o-auth-provider.d.ts +1 -0
  33. package/types/models.d.ts +118 -6
  34. package/types/services/account.d.ts +4 -128
  35. package/types/services/assistant.d.ts +0 -2
  36. package/types/services/avatars.d.ts +0 -14
  37. package/types/services/backups.d.ts +0 -24
  38. package/types/services/console.d.ts +0 -14
  39. package/types/services/databases.d.ts +0 -96
  40. package/types/services/functions.d.ts +0 -56
  41. package/types/services/graphql.d.ts +0 -4
  42. package/types/services/health.d.ts +0 -50
  43. package/types/services/locale.d.ts +0 -16
  44. package/types/services/messaging.d.ts +0 -92
  45. package/types/services/migrations.d.ts +0 -24
  46. package/types/services/organizations.d.ts +11 -58
  47. package/types/services/project.d.ts +0 -12
  48. package/types/services/projects.d.ts +0 -92
  49. package/types/services/proxy.d.ts +0 -10
  50. package/types/services/storage.d.ts +0 -30
  51. package/types/services/teams.d.ts +0 -28
  52. package/types/services/users.d.ts +0 -86
  53. package/types/services/vcs.d.ts +0 -20
@@ -11,8 +11,6 @@ export class Project {
11
11
  }
12
12
 
13
13
  /**
14
- * Get project usage stats
15
- *
16
14
  * Get comprehensive usage statistics for your project. View metrics including network requests, bandwidth, storage, function executions, database usage, and user activity. Specify a time range with startDate and endDate, and optionally set the data granularity with period (1h or 1d). The response includes both total counts and detailed breakdowns by resource, along with historical data over the specified period.
17
15
  *
18
16
  * @param {string} startDate
@@ -21,7 +19,7 @@ export class Project {
21
19
  * @throws {AppwriteException}
22
20
  * @returns {Promise<Models.UsageProject>}
23
21
  */
24
- async getUsage(startDate: string, endDate: string, period?: ProjectUsageRange): Promise<Models.UsageProject> {
22
+ getUsage(startDate: string, endDate: string, period?: ProjectUsageRange): Promise<Models.UsageProject> {
25
23
  if (typeof startDate === 'undefined') {
26
24
  throw new AppwriteException('Missing required parameter: "startDate"');
27
25
  }
@@ -45,10 +43,7 @@ export class Project {
45
43
  'content-type': 'application/json',
46
44
  }
47
45
 
48
- payload['project'] = this.client.config.project;
49
-
50
-
51
- return await this.client.call(
46
+ return this.client.call(
52
47
  'get',
53
48
  uri,
54
49
  apiHeaders,
@@ -56,14 +51,12 @@ export class Project {
56
51
  );
57
52
  }
58
53
  /**
59
- * List variables
60
- *
61
54
  * Get a list of all project variables. These variables will be accessible in all Appwrite Functions at runtime.
62
55
  *
63
56
  * @throws {AppwriteException}
64
57
  * @returns {Promise<Models.VariableList>}
65
58
  */
66
- async listVariables(): Promise<Models.VariableList> {
59
+ listVariables(): Promise<Models.VariableList> {
67
60
  const apiPath = '/project/variables';
68
61
  const payload: Payload = {};
69
62
  const uri = new URL(this.client.config.endpoint + apiPath);
@@ -72,10 +65,7 @@ export class Project {
72
65
  'content-type': 'application/json',
73
66
  }
74
67
 
75
- payload['project'] = this.client.config.project;
76
-
77
-
78
- return await this.client.call(
68
+ return this.client.call(
79
69
  'get',
80
70
  uri,
81
71
  apiHeaders,
@@ -83,8 +73,6 @@ export class Project {
83
73
  );
84
74
  }
85
75
  /**
86
- * Create variable
87
- *
88
76
  * Create a new project variable. This variable will be accessible in all Appwrite Functions at runtime.
89
77
  *
90
78
  * @param {string} key
@@ -92,7 +80,7 @@ export class Project {
92
80
  * @throws {AppwriteException}
93
81
  * @returns {Promise<Models.Variable>}
94
82
  */
95
- async createVariable(key: string, value: string): Promise<Models.Variable> {
83
+ createVariable(key: string, value: string): Promise<Models.Variable> {
96
84
  if (typeof key === 'undefined') {
97
85
  throw new AppwriteException('Missing required parameter: "key"');
98
86
  }
@@ -113,10 +101,7 @@ export class Project {
113
101
  'content-type': 'application/json',
114
102
  }
115
103
 
116
- payload['project'] = this.client.config.project;
117
-
118
-
119
- return await this.client.call(
104
+ return this.client.call(
120
105
  'post',
121
106
  uri,
122
107
  apiHeaders,
@@ -124,15 +109,13 @@ export class Project {
124
109
  );
125
110
  }
126
111
  /**
127
- * Get variable
128
- *
129
112
  * Get a project variable by its unique ID.
130
113
  *
131
114
  * @param {string} variableId
132
115
  * @throws {AppwriteException}
133
116
  * @returns {Promise<Models.Variable>}
134
117
  */
135
- async getVariable(variableId: string): Promise<Models.Variable> {
118
+ getVariable(variableId: string): Promise<Models.Variable> {
136
119
  if (typeof variableId === 'undefined') {
137
120
  throw new AppwriteException('Missing required parameter: "variableId"');
138
121
  }
@@ -144,10 +127,7 @@ export class Project {
144
127
  'content-type': 'application/json',
145
128
  }
146
129
 
147
- payload['project'] = this.client.config.project;
148
-
149
-
150
- return await this.client.call(
130
+ return this.client.call(
151
131
  'get',
152
132
  uri,
153
133
  apiHeaders,
@@ -155,8 +135,6 @@ export class Project {
155
135
  );
156
136
  }
157
137
  /**
158
- * Update variable
159
- *
160
138
  * Update project variable by its unique ID. This variable will be accessible in all Appwrite Functions at runtime.
161
139
  *
162
140
  * @param {string} variableId
@@ -165,7 +143,7 @@ export class Project {
165
143
  * @throws {AppwriteException}
166
144
  * @returns {Promise<Models.Variable>}
167
145
  */
168
- async updateVariable(variableId: string, key: string, value?: string): Promise<Models.Variable> {
146
+ updateVariable(variableId: string, key: string, value?: string): Promise<Models.Variable> {
169
147
  if (typeof variableId === 'undefined') {
170
148
  throw new AppwriteException('Missing required parameter: "variableId"');
171
149
  }
@@ -186,10 +164,7 @@ export class Project {
186
164
  'content-type': 'application/json',
187
165
  }
188
166
 
189
- payload['project'] = this.client.config.project;
190
-
191
-
192
- return await this.client.call(
167
+ return this.client.call(
193
168
  'put',
194
169
  uri,
195
170
  apiHeaders,
@@ -197,15 +172,13 @@ export class Project {
197
172
  );
198
173
  }
199
174
  /**
200
- * Delete variable
201
- *
202
175
  * Delete a project variable by its unique ID.
203
176
  *
204
177
  * @param {string} variableId
205
178
  * @throws {AppwriteException}
206
179
  * @returns {Promise<{}>}
207
180
  */
208
- async deleteVariable(variableId: string): Promise<{}> {
181
+ deleteVariable(variableId: string): Promise<{}> {
209
182
  if (typeof variableId === 'undefined') {
210
183
  throw new AppwriteException('Missing required parameter: "variableId"');
211
184
  }
@@ -217,10 +190,7 @@ export class Project {
217
190
  'content-type': 'application/json',
218
191
  }
219
192
 
220
- payload['project'] = this.client.config.project;
221
-
222
-
223
- return await this.client.call(
193
+ return this.client.call(
224
194
  'delete',
225
195
  uri,
226
196
  apiHeaders,