@appwrite.io/console 0.0.1 → 0.0.2-preview-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.
@@ -0,0 +1,400 @@
1
+ import { Service } from '../service';
2
+ import { Client } from '../client';
3
+ import type { Models } from '../models';
4
+ export declare class Projects extends Service {
5
+ constructor(client: Client);
6
+ /**
7
+ * List Projects
8
+ *
9
+ *
10
+ * @param {string[]} queries
11
+ * @param {string} search
12
+ * @throws {AppwriteException}
13
+ * @returns {Promise}
14
+ */
15
+ list(queries?: string[], search?: string): Promise<Models.ProjectList>;
16
+ /**
17
+ * Create Project
18
+ *
19
+ *
20
+ * @param {string} projectId
21
+ * @param {string} name
22
+ * @param {string} teamId
23
+ * @param {string} region
24
+ * @param {string} description
25
+ * @param {string} logo
26
+ * @param {string} url
27
+ * @param {string} legalName
28
+ * @param {string} legalCountry
29
+ * @param {string} legalState
30
+ * @param {string} legalCity
31
+ * @param {string} legalAddress
32
+ * @param {string} legalTaxId
33
+ * @throws {AppwriteException}
34
+ * @returns {Promise}
35
+ */
36
+ create(projectId: string, name: string, teamId: string, region?: string, description?: string, logo?: string, url?: string, legalName?: string, legalCountry?: string, legalState?: string, legalCity?: string, legalAddress?: string, legalTaxId?: string): Promise<Models.Project>;
37
+ /**
38
+ * Get Project
39
+ *
40
+ *
41
+ * @param {string} projectId
42
+ * @throws {AppwriteException}
43
+ * @returns {Promise}
44
+ */
45
+ get(projectId: string): Promise<Models.Project>;
46
+ /**
47
+ * Update Project
48
+ *
49
+ *
50
+ * @param {string} projectId
51
+ * @param {string} name
52
+ * @param {string} description
53
+ * @param {string} logo
54
+ * @param {string} url
55
+ * @param {string} legalName
56
+ * @param {string} legalCountry
57
+ * @param {string} legalState
58
+ * @param {string} legalCity
59
+ * @param {string} legalAddress
60
+ * @param {string} legalTaxId
61
+ * @throws {AppwriteException}
62
+ * @returns {Promise}
63
+ */
64
+ 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>;
65
+ /**
66
+ * Delete Project
67
+ *
68
+ *
69
+ * @param {string} projectId
70
+ * @param {string} password
71
+ * @throws {AppwriteException}
72
+ * @returns {Promise}
73
+ */
74
+ delete(projectId: string, password: string): Promise<{}>;
75
+ /**
76
+ * Update Project Authentication Duration
77
+ *
78
+ *
79
+ * @param {string} projectId
80
+ * @param {number} duration
81
+ * @throws {AppwriteException}
82
+ * @returns {Promise}
83
+ */
84
+ updateAuthDuration(projectId: string, duration: number): Promise<Models.Project>;
85
+ /**
86
+ * Update Project users limit
87
+ *
88
+ *
89
+ * @param {string} projectId
90
+ * @param {number} limit
91
+ * @throws {AppwriteException}
92
+ * @returns {Promise}
93
+ */
94
+ updateAuthLimit(projectId: string, limit: number): Promise<Models.Project>;
95
+ /**
96
+ * Update Project user sessions limit
97
+ *
98
+ *
99
+ * @param {string} projectId
100
+ * @param {number} limit
101
+ * @throws {AppwriteException}
102
+ * @returns {Promise}
103
+ */
104
+ updateAuthSessionsLimit(projectId: string, limit: number): Promise<Models.Project>;
105
+ /**
106
+ * Update authentication password disctionary status. Use this endpoint to enable or disable the dicitonary check for user password
107
+ *
108
+ *
109
+ * @param {string} projectId
110
+ * @param {boolean} enabled
111
+ * @throws {AppwriteException}
112
+ * @returns {Promise}
113
+ */
114
+ updateAuthPasswordDictionary(projectId: string, enabled: boolean): Promise<Models.Project>;
115
+ /**
116
+ * Update authentication password history. Use this endpoint to set the number of password history to save and 0 to disable password history.
117
+ *
118
+ *
119
+ * @param {string} projectId
120
+ * @param {number} limit
121
+ * @throws {AppwriteException}
122
+ * @returns {Promise}
123
+ */
124
+ updateAuthPasswordHistory(projectId: string, limit: number): Promise<Models.Project>;
125
+ /**
126
+ * Update Project auth method status. Use this endpoint to enable or disable a given auth method for this project.
127
+ *
128
+ *
129
+ * @param {string} projectId
130
+ * @param {string} method
131
+ * @param {boolean} status
132
+ * @throws {AppwriteException}
133
+ * @returns {Promise}
134
+ */
135
+ updateAuthStatus(projectId: string, method: string, status: boolean): Promise<Models.Project>;
136
+ /**
137
+ * List Domains
138
+ *
139
+ *
140
+ * @param {string} projectId
141
+ * @throws {AppwriteException}
142
+ * @returns {Promise}
143
+ */
144
+ listDomains(projectId: string): Promise<Models.DomainList>;
145
+ /**
146
+ * Create Domain
147
+ *
148
+ *
149
+ * @param {string} projectId
150
+ * @param {string} domain
151
+ * @throws {AppwriteException}
152
+ * @returns {Promise}
153
+ */
154
+ createDomain(projectId: string, domain: string): Promise<Models.Domain>;
155
+ /**
156
+ * Get Domain
157
+ *
158
+ *
159
+ * @param {string} projectId
160
+ * @param {string} domainId
161
+ * @throws {AppwriteException}
162
+ * @returns {Promise}
163
+ */
164
+ getDomain(projectId: string, domainId: string): Promise<Models.Domain>;
165
+ /**
166
+ * Delete Domain
167
+ *
168
+ *
169
+ * @param {string} projectId
170
+ * @param {string} domainId
171
+ * @throws {AppwriteException}
172
+ * @returns {Promise}
173
+ */
174
+ deleteDomain(projectId: string, domainId: string): Promise<{}>;
175
+ /**
176
+ * Update Domain Verification Status
177
+ *
178
+ *
179
+ * @param {string} projectId
180
+ * @param {string} domainId
181
+ * @throws {AppwriteException}
182
+ * @returns {Promise}
183
+ */
184
+ updateDomainVerification(projectId: string, domainId: string): Promise<Models.Domain>;
185
+ /**
186
+ * List Keys
187
+ *
188
+ *
189
+ * @param {string} projectId
190
+ * @throws {AppwriteException}
191
+ * @returns {Promise}
192
+ */
193
+ listKeys(projectId: string): Promise<Models.KeyList>;
194
+ /**
195
+ * Create Key
196
+ *
197
+ *
198
+ * @param {string} projectId
199
+ * @param {string} name
200
+ * @param {string[]} scopes
201
+ * @param {string} expire
202
+ * @throws {AppwriteException}
203
+ * @returns {Promise}
204
+ */
205
+ createKey(projectId: string, name: string, scopes: string[], expire?: string): Promise<Models.Key>;
206
+ /**
207
+ * Get Key
208
+ *
209
+ *
210
+ * @param {string} projectId
211
+ * @param {string} keyId
212
+ * @throws {AppwriteException}
213
+ * @returns {Promise}
214
+ */
215
+ getKey(projectId: string, keyId: string): Promise<Models.Key>;
216
+ /**
217
+ * Update Key
218
+ *
219
+ *
220
+ * @param {string} projectId
221
+ * @param {string} keyId
222
+ * @param {string} name
223
+ * @param {string[]} scopes
224
+ * @param {string} expire
225
+ * @throws {AppwriteException}
226
+ * @returns {Promise}
227
+ */
228
+ updateKey(projectId: string, keyId: string, name: string, scopes: string[], expire?: string): Promise<Models.Key>;
229
+ /**
230
+ * Delete Key
231
+ *
232
+ *
233
+ * @param {string} projectId
234
+ * @param {string} keyId
235
+ * @throws {AppwriteException}
236
+ * @returns {Promise}
237
+ */
238
+ deleteKey(projectId: string, keyId: string): Promise<{}>;
239
+ /**
240
+ * Update Project OAuth2
241
+ *
242
+ *
243
+ * @param {string} projectId
244
+ * @param {string} provider
245
+ * @param {string} appId
246
+ * @param {string} secret
247
+ * @param {boolean} enabled
248
+ * @throws {AppwriteException}
249
+ * @returns {Promise}
250
+ */
251
+ updateOAuth2(projectId: string, provider: string, appId?: string, secret?: string, enabled?: boolean): Promise<Models.Project>;
252
+ /**
253
+ * List Platforms
254
+ *
255
+ *
256
+ * @param {string} projectId
257
+ * @throws {AppwriteException}
258
+ * @returns {Promise}
259
+ */
260
+ listPlatforms(projectId: string): Promise<Models.PlatformList>;
261
+ /**
262
+ * Create Platform
263
+ *
264
+ *
265
+ * @param {string} projectId
266
+ * @param {string} type
267
+ * @param {string} name
268
+ * @param {string} key
269
+ * @param {string} store
270
+ * @param {string} hostname
271
+ * @throws {AppwriteException}
272
+ * @returns {Promise}
273
+ */
274
+ createPlatform(projectId: string, type: string, name: string, key?: string, store?: string, hostname?: string): Promise<Models.Platform>;
275
+ /**
276
+ * Get Platform
277
+ *
278
+ *
279
+ * @param {string} projectId
280
+ * @param {string} platformId
281
+ * @throws {AppwriteException}
282
+ * @returns {Promise}
283
+ */
284
+ getPlatform(projectId: string, platformId: string): Promise<Models.Platform>;
285
+ /**
286
+ * Update Platform
287
+ *
288
+ *
289
+ * @param {string} projectId
290
+ * @param {string} platformId
291
+ * @param {string} name
292
+ * @param {string} key
293
+ * @param {string} store
294
+ * @param {string} hostname
295
+ * @throws {AppwriteException}
296
+ * @returns {Promise}
297
+ */
298
+ updatePlatform(projectId: string, platformId: string, name: string, key?: string, store?: string, hostname?: string): Promise<Models.Platform>;
299
+ /**
300
+ * Delete Platform
301
+ *
302
+ *
303
+ * @param {string} projectId
304
+ * @param {string} platformId
305
+ * @throws {AppwriteException}
306
+ * @returns {Promise}
307
+ */
308
+ deletePlatform(projectId: string, platformId: string): Promise<{}>;
309
+ /**
310
+ * Update service status
311
+ *
312
+ *
313
+ * @param {string} projectId
314
+ * @param {string} service
315
+ * @param {boolean} status
316
+ * @throws {AppwriteException}
317
+ * @returns {Promise}
318
+ */
319
+ updateServiceStatus(projectId: string, service: string, status: boolean): Promise<Models.Project>;
320
+ /**
321
+ * Get usage stats for a project
322
+ *
323
+ *
324
+ * @param {string} projectId
325
+ * @param {string} range
326
+ * @throws {AppwriteException}
327
+ * @returns {Promise}
328
+ */
329
+ getUsage(projectId: string, range?: string): Promise<Models.UsageProject>;
330
+ /**
331
+ * List Webhooks
332
+ *
333
+ *
334
+ * @param {string} projectId
335
+ * @throws {AppwriteException}
336
+ * @returns {Promise}
337
+ */
338
+ listWebhooks(projectId: string): Promise<Models.WebhookList>;
339
+ /**
340
+ * Create Webhook
341
+ *
342
+ *
343
+ * @param {string} projectId
344
+ * @param {string} name
345
+ * @param {string[]} events
346
+ * @param {string} url
347
+ * @param {boolean} security
348
+ * @param {string} httpUser
349
+ * @param {string} httpPass
350
+ * @throws {AppwriteException}
351
+ * @returns {Promise}
352
+ */
353
+ createWebhook(projectId: string, name: string, events: string[], url: string, security: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook>;
354
+ /**
355
+ * Get Webhook
356
+ *
357
+ *
358
+ * @param {string} projectId
359
+ * @param {string} webhookId
360
+ * @throws {AppwriteException}
361
+ * @returns {Promise}
362
+ */
363
+ getWebhook(projectId: string, webhookId: string): Promise<Models.Webhook>;
364
+ /**
365
+ * Update Webhook
366
+ *
367
+ *
368
+ * @param {string} projectId
369
+ * @param {string} webhookId
370
+ * @param {string} name
371
+ * @param {string[]} events
372
+ * @param {string} url
373
+ * @param {boolean} security
374
+ * @param {string} httpUser
375
+ * @param {string} httpPass
376
+ * @throws {AppwriteException}
377
+ * @returns {Promise}
378
+ */
379
+ updateWebhook(projectId: string, webhookId: string, name: string, events: string[], url: string, security: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook>;
380
+ /**
381
+ * Delete Webhook
382
+ *
383
+ *
384
+ * @param {string} projectId
385
+ * @param {string} webhookId
386
+ * @throws {AppwriteException}
387
+ * @returns {Promise}
388
+ */
389
+ deleteWebhook(projectId: string, webhookId: string): Promise<{}>;
390
+ /**
391
+ * Update Webhook Signature Key
392
+ *
393
+ *
394
+ * @param {string} projectId
395
+ * @param {string} webhookId
396
+ * @throws {AppwriteException}
397
+ * @returns {Promise}
398
+ */
399
+ updateWebhookSignature(projectId: string, webhookId: string): Promise<Models.Webhook>;
400
+ }
@@ -0,0 +1,229 @@
1
+ import { Service } from '../service';
2
+ import { Client } from '../client';
3
+ import type { Models } from '../models';
4
+ import type { UploadProgress } from '../client';
5
+ export declare class Storage extends Service {
6
+ constructor(client: Client);
7
+ /**
8
+ * List buckets
9
+ *
10
+ * Get a list of all the storage buckets. You can use the query params to
11
+ * filter your results.
12
+ *
13
+ * @param {string[]} queries
14
+ * @param {string} search
15
+ * @throws {AppwriteException}
16
+ * @returns {Promise}
17
+ */
18
+ listBuckets(queries?: string[], search?: string): Promise<Models.BucketList>;
19
+ /**
20
+ * Create bucket
21
+ *
22
+ * Create a new storage bucket.
23
+ *
24
+ * @param {string} bucketId
25
+ * @param {string} name
26
+ * @param {string[]} permissions
27
+ * @param {boolean} fileSecurity
28
+ * @param {boolean} enabled
29
+ * @param {number} maximumFileSize
30
+ * @param {string[]} allowedFileExtensions
31
+ * @param {string} compression
32
+ * @param {boolean} encryption
33
+ * @param {boolean} antivirus
34
+ * @throws {AppwriteException}
35
+ * @returns {Promise}
36
+ */
37
+ createBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: string, encryption?: boolean, antivirus?: boolean): Promise<Models.Bucket>;
38
+ /**
39
+ * Get Bucket
40
+ *
41
+ * Get a storage bucket by its unique ID. This endpoint response returns a
42
+ * JSON object with the storage bucket metadata.
43
+ *
44
+ * @param {string} bucketId
45
+ * @throws {AppwriteException}
46
+ * @returns {Promise}
47
+ */
48
+ getBucket(bucketId: string): Promise<Models.Bucket>;
49
+ /**
50
+ * Update Bucket
51
+ *
52
+ * Update a storage bucket by its unique ID.
53
+ *
54
+ * @param {string} bucketId
55
+ * @param {string} name
56
+ * @param {string[]} permissions
57
+ * @param {boolean} fileSecurity
58
+ * @param {boolean} enabled
59
+ * @param {number} maximumFileSize
60
+ * @param {string[]} allowedFileExtensions
61
+ * @param {string} compression
62
+ * @param {boolean} encryption
63
+ * @param {boolean} antivirus
64
+ * @throws {AppwriteException}
65
+ * @returns {Promise}
66
+ */
67
+ updateBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: string, encryption?: boolean, antivirus?: boolean): Promise<Models.Bucket>;
68
+ /**
69
+ * Delete Bucket
70
+ *
71
+ * Delete a storage bucket by its unique ID.
72
+ *
73
+ * @param {string} bucketId
74
+ * @throws {AppwriteException}
75
+ * @returns {Promise}
76
+ */
77
+ deleteBucket(bucketId: string): Promise<{}>;
78
+ /**
79
+ * List Files
80
+ *
81
+ * Get a list of all the user files. You can use the query params to filter
82
+ * your results.
83
+ *
84
+ * @param {string} bucketId
85
+ * @param {string[]} queries
86
+ * @param {string} search
87
+ * @throws {AppwriteException}
88
+ * @returns {Promise}
89
+ */
90
+ listFiles(bucketId: string, queries?: string[], search?: string): Promise<Models.FileList>;
91
+ /**
92
+ * Create File
93
+ *
94
+ * Create a new file. Before using this route, you should create a new bucket
95
+ * resource using either a [server
96
+ * integration](/docs/server/storage#storageCreateBucket) API or directly from
97
+ * your Appwrite console.
98
+ *
99
+ * Larger files should be uploaded using multiple requests with the
100
+ * [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range)
101
+ * header to send a partial request with a maximum supported chunk of `5MB`.
102
+ * The `content-range` header values should always be in bytes.
103
+ *
104
+ * When the first request is sent, the server will return the **File** object,
105
+ * and the subsequent part request must include the file's **id** in
106
+ * `x-appwrite-id` header to allow the server to know that the partial upload
107
+ * is for the existing file and not for a new one.
108
+ *
109
+ * If you're creating a new file using one of the Appwrite SDKs, all the
110
+ * chunking logic will be managed by the SDK internally.
111
+ *
112
+ *
113
+ * @param {string} bucketId
114
+ * @param {string} fileId
115
+ * @param {File} file
116
+ * @param {string[]} permissions
117
+ * @throws {AppwriteException}
118
+ * @returns {Promise}
119
+ */
120
+ createFile(bucketId: string, fileId: string, file: File, permissions?: string[], onProgress?: (progress: UploadProgress) => void): Promise<Models.File>;
121
+ /**
122
+ * Get File
123
+ *
124
+ * Get a file by its unique ID. This endpoint response returns a JSON object
125
+ * with the file metadata.
126
+ *
127
+ * @param {string} bucketId
128
+ * @param {string} fileId
129
+ * @throws {AppwriteException}
130
+ * @returns {Promise}
131
+ */
132
+ getFile(bucketId: string, fileId: string): Promise<Models.File>;
133
+ /**
134
+ * Update File
135
+ *
136
+ * Update a file by its unique ID. Only users with write permissions have
137
+ * access to update this resource.
138
+ *
139
+ * @param {string} bucketId
140
+ * @param {string} fileId
141
+ * @param {string[]} permissions
142
+ * @throws {AppwriteException}
143
+ * @returns {Promise}
144
+ */
145
+ updateFile(bucketId: string, fileId: string, permissions?: string[]): Promise<Models.File>;
146
+ /**
147
+ * Delete File
148
+ *
149
+ * Delete a file by its unique ID. Only users with write permissions have
150
+ * access to delete this resource.
151
+ *
152
+ * @param {string} bucketId
153
+ * @param {string} fileId
154
+ * @throws {AppwriteException}
155
+ * @returns {Promise}
156
+ */
157
+ deleteFile(bucketId: string, fileId: string): Promise<{}>;
158
+ /**
159
+ * Get File for Download
160
+ *
161
+ * Get a file content by its unique ID. The endpoint response return with a
162
+ * 'Content-Disposition: attachment' header that tells the browser to start
163
+ * downloading the file to user downloads directory.
164
+ *
165
+ * @param {string} bucketId
166
+ * @param {string} fileId
167
+ * @throws {AppwriteException}
168
+ * @returns {URL}
169
+ */
170
+ getFileDownload(bucketId: string, fileId: string): URL;
171
+ /**
172
+ * Get File Preview
173
+ *
174
+ * Get a file preview image. Currently, this method supports preview for image
175
+ * files (jpg, png, and gif), other supported formats, like pdf, docs, slides,
176
+ * and spreadsheets, will return the file icon image. You can also pass query
177
+ * string arguments for cutting and resizing your preview image. Preview is
178
+ * supported only for image files smaller than 10MB.
179
+ *
180
+ * @param {string} bucketId
181
+ * @param {string} fileId
182
+ * @param {number} width
183
+ * @param {number} height
184
+ * @param {string} gravity
185
+ * @param {number} quality
186
+ * @param {number} borderWidth
187
+ * @param {string} borderColor
188
+ * @param {number} borderRadius
189
+ * @param {number} opacity
190
+ * @param {number} rotation
191
+ * @param {string} background
192
+ * @param {string} output
193
+ * @throws {AppwriteException}
194
+ * @returns {URL}
195
+ */
196
+ getFilePreview(bucketId: string, fileId: string, width?: number, height?: number, gravity?: string, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: string): URL;
197
+ /**
198
+ * Get File for View
199
+ *
200
+ * Get a file content by its unique ID. This endpoint is similar to the
201
+ * download method but returns with no 'Content-Disposition: attachment'
202
+ * header.
203
+ *
204
+ * @param {string} bucketId
205
+ * @param {string} fileId
206
+ * @throws {AppwriteException}
207
+ * @returns {URL}
208
+ */
209
+ getFileView(bucketId: string, fileId: string): URL;
210
+ /**
211
+ * Get usage stats for storage
212
+ *
213
+ *
214
+ * @param {string} range
215
+ * @throws {AppwriteException}
216
+ * @returns {Promise}
217
+ */
218
+ getUsage(range?: string): Promise<Models.UsageStorage>;
219
+ /**
220
+ * Get usage stats for a storage bucket
221
+ *
222
+ *
223
+ * @param {string} bucketId
224
+ * @param {string} range
225
+ * @throws {AppwriteException}
226
+ * @returns {Promise}
227
+ */
228
+ getBucketUsage(bucketId: string, range?: string): Promise<Models.UsageBuckets>;
229
+ }