@appsemble/utils 0.22.5 → 0.22.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
- # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.22.5/config/assets/logo.svg) Appsemble Utilities
1
+ # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.22.6/config/assets/logo.svg) Appsemble Utilities
2
2
 
3
3
  > Internal utility functions used across multiple Appsemble projects.
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/@appsemble/utils)](https://www.npmjs.com/package/@appsemble/utils)
6
- [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.22.5/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.22.5)
6
+ [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.22.6/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.22.6)
7
7
  [![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://prettier.io)
8
8
 
9
9
  ## Table of Contents
@@ -26,5 +26,5 @@ not guaranteed.
26
26
 
27
27
  ## License
28
28
 
29
- [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.22.5/LICENSE.md) ©
29
+ [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.22.6/LICENSE.md) ©
30
30
  [Appsemble](https://appsemble.com)
@@ -0,0 +1,2 @@
1
+ import { type OpenAPIV3 } from 'openapi-types';
2
+ export declare const AppCollection: OpenAPIV3.NonArraySchemaObject;
@@ -0,0 +1,62 @@
1
+ export const AppCollection = {
2
+ type: 'object',
3
+ description: 'An app collection',
4
+ additionalProperties: false,
5
+ properties: {
6
+ id: {
7
+ type: 'integer',
8
+ readOnly: true,
9
+ description: 'The unique ID of the app collection.',
10
+ },
11
+ name: {
12
+ type: 'string',
13
+ description: 'The name of the app collection.',
14
+ },
15
+ OrganizationId: {
16
+ type: 'string',
17
+ description: 'The ID of the organization that owns the app collection.',
18
+ },
19
+ OrganizationName: {
20
+ type: 'string',
21
+ description: 'The name of the organization that owns the app collection.',
22
+ },
23
+ visibility: {
24
+ enum: ['private', 'public'],
25
+ description: 'The visibility of the app collection.',
26
+ },
27
+ $expert: {
28
+ type: 'object',
29
+ additionalProperties: false,
30
+ description: 'The app collection’s expert/curator.',
31
+ properties: {
32
+ name: {
33
+ type: 'string',
34
+ description: 'The name of the expert.',
35
+ },
36
+ description: {
37
+ type: 'string',
38
+ description: 'The description of the expert.',
39
+ },
40
+ profileImage: {
41
+ type: 'string',
42
+ description: 'The URL at which the expert’s profile image can be found.',
43
+ },
44
+ },
45
+ },
46
+ headerImage: {
47
+ type: 'string',
48
+ description: 'The URL at which the app collection’s header image can be found.',
49
+ },
50
+ $created: {
51
+ type: 'string',
52
+ format: 'date-time',
53
+ description: 'When the collection was first created as an ISO 8601 formatted string',
54
+ },
55
+ $updated: {
56
+ type: 'string',
57
+ format: 'date-time',
58
+ description: 'When the collection was last updated as an ISO 8601 formatted string',
59
+ },
60
+ },
61
+ };
62
+ //# sourceMappingURL=AppCollection.js.map
@@ -0,0 +1,2 @@
1
+ import { type OpenAPIV3 } from 'openapi-types';
2
+ export declare const AppCollectionDefinition: OpenAPIV3.NonArraySchemaObject;
@@ -0,0 +1,45 @@
1
+ export const AppCollectionDefinition = {
2
+ type: 'object',
3
+ description: 'An app collection',
4
+ additionalProperties: false,
5
+ properties: {
6
+ name: {
7
+ type: 'string',
8
+ description: 'The name of the app collection.',
9
+ minLength: 1,
10
+ maxLength: 30,
11
+ },
12
+ visibility: {
13
+ enum: ['private', 'public'],
14
+ description: 'The visibility of the app collection.',
15
+ },
16
+ expertName: {
17
+ type: 'string',
18
+ description: 'The name of the app collection’s expert/curator.',
19
+ minLength: 1,
20
+ maxLength: 30,
21
+ },
22
+ expertDescription: {
23
+ type: 'string',
24
+ description: 'The description of the app collection’s expert/curator.',
25
+ maxLength: 4000,
26
+ },
27
+ expertProfileImage: {
28
+ type: 'string',
29
+ format: 'binary',
30
+ description: 'The profile image of the app collection’s expert/curator.',
31
+ },
32
+ headerImage: {
33
+ type: 'string',
34
+ format: 'binary',
35
+ description: 'The header image of the app collection.',
36
+ },
37
+ domain: {
38
+ anyOf: [
39
+ { type: 'string', maxLength: 0 },
40
+ { type: 'string', format: 'hostname', maxLength: 253 },
41
+ ],
42
+ },
43
+ },
44
+ };
45
+ //# sourceMappingURL=AppCollectionDefinition.js.map
@@ -1,6 +1,8 @@
1
1
  export * from './ActionDefinition.js';
2
2
  export * from './AnalyticsActionDefinition.js';
3
3
  export * from './App.js';
4
+ export * from './AppCollection.js';
5
+ export * from './AppCollectionDefinition.js';
4
6
  export * from './AppAccount.js';
5
7
  export * from './AppDefinition.js';
6
8
  export * from './AppLayoutDefinition.js';
@@ -1,6 +1,8 @@
1
1
  export * from './ActionDefinition.js';
2
2
  export * from './AnalyticsActionDefinition.js';
3
3
  export * from './App.js';
4
+ export * from './AppCollection.js';
5
+ export * from './AppCollectionDefinition.js';
4
6
  export * from './AppAccount.js';
5
7
  export * from './AppDefinition.js';
6
8
  export * from './AppLayoutDefinition.js';
@@ -0,0 +1,2 @@
1
+ import { type OpenAPIV3 } from 'openapi-types';
2
+ export declare const paths: OpenAPIV3.PathsObject;
@@ -0,0 +1,458 @@
1
+ export const paths = {
2
+ '/api/organizations/{organizationId}/appCollections': {
3
+ get: {
4
+ tags: ['appCollection'],
5
+ description: 'Get a list of app collections for an organization',
6
+ operationId: 'queryOrganizationCollections',
7
+ parameters: [
8
+ {
9
+ name: 'organizationId',
10
+ in: 'path',
11
+ description: 'The id of the organization',
12
+ required: true,
13
+ schema: {
14
+ $ref: '#/components/schemas/Organization/properties/id',
15
+ },
16
+ },
17
+ ],
18
+ responses: {
19
+ 200: {
20
+ description: 'A list of app collections',
21
+ content: {
22
+ 'application/json': {
23
+ schema: {
24
+ type: 'array',
25
+ items: {
26
+ $ref: '#/components/schemas/AppCollection',
27
+ },
28
+ },
29
+ },
30
+ },
31
+ },
32
+ },
33
+ security: [{ studio: [] }, {}],
34
+ },
35
+ post: {
36
+ tags: ['appCollection'],
37
+ description: 'Create an app collection',
38
+ operationId: 'createCollection',
39
+ parameters: [
40
+ {
41
+ name: 'organizationId',
42
+ in: 'path',
43
+ description: 'The id of the organization to create the app collection in',
44
+ required: true,
45
+ schema: {
46
+ $ref: '#/components/schemas/Organization/properties/id',
47
+ },
48
+ },
49
+ ],
50
+ requestBody: {
51
+ description: 'The app collection to create',
52
+ required: true,
53
+ content: {
54
+ 'multipart/form-data': {
55
+ schema: {
56
+ allOf: [
57
+ { $ref: '#/components/schemas/AppCollectionDefinition' },
58
+ { required: ['name', 'expertName', 'expertProfileImage', 'headerImage'] },
59
+ ],
60
+ },
61
+ encoding: {
62
+ expertProfileImage: {
63
+ contentType: 'image/png,image/jpeg,image/tiff,image/webp',
64
+ },
65
+ headerImage: {
66
+ contentType: 'image/png,image/jpeg,image/tiff,image/webp',
67
+ },
68
+ },
69
+ },
70
+ },
71
+ },
72
+ responses: {
73
+ 201: {
74
+ description: 'The created app collection',
75
+ content: {
76
+ 'application/json': {
77
+ schema: {
78
+ $ref: '#/components/schemas/AppCollection',
79
+ },
80
+ },
81
+ },
82
+ },
83
+ },
84
+ security: [{ studio: [] }],
85
+ },
86
+ },
87
+ '/api/appCollections': {
88
+ get: {
89
+ tags: ['appCollection'],
90
+ description: 'Get a list of app collections',
91
+ operationId: 'queryCollections',
92
+ responses: {
93
+ 200: {
94
+ description: 'A list of app collections',
95
+ content: {
96
+ 'application/json': {
97
+ schema: {
98
+ type: 'array',
99
+ items: {
100
+ $ref: '#/components/schemas/AppCollection',
101
+ },
102
+ },
103
+ },
104
+ },
105
+ },
106
+ },
107
+ security: [{ studio: [] }, {}],
108
+ },
109
+ },
110
+ '/api/appCollections/{appCollectionId}': {
111
+ get: {
112
+ tags: ['appCollection'],
113
+ description: 'Get an app collection',
114
+ operationId: 'getCollection',
115
+ parameters: [
116
+ {
117
+ name: 'appCollectionId',
118
+ in: 'path',
119
+ description: 'The id of the app collection',
120
+ required: true,
121
+ schema: {
122
+ $ref: '#/components/schemas/AppCollection/properties/id',
123
+ },
124
+ },
125
+ ],
126
+ responses: {
127
+ 200: {
128
+ description: 'An app collection',
129
+ content: {
130
+ 'application/json': {
131
+ schema: {
132
+ $ref: '#/components/schemas/AppCollection',
133
+ },
134
+ },
135
+ },
136
+ },
137
+ },
138
+ security: [{ studio: [] }, {}],
139
+ },
140
+ patch: {
141
+ tags: ['appCollection'],
142
+ description: 'Update an app collection',
143
+ operationId: 'updateCollection',
144
+ parameters: [
145
+ {
146
+ name: 'appCollectionId',
147
+ in: 'path',
148
+ description: 'The id of the app collection',
149
+ required: true,
150
+ schema: {
151
+ $ref: '#/components/schemas/AppCollection/properties/id',
152
+ },
153
+ },
154
+ ],
155
+ requestBody: {
156
+ description: 'The app collection to update',
157
+ required: true,
158
+ content: {
159
+ 'multipart/form-data': {
160
+ schema: {
161
+ $ref: '#/components/schemas/AppCollectionDefinition',
162
+ },
163
+ encoding: {
164
+ expertProfileImage: {
165
+ contentType: 'image/png,image/jpeg,image/tiff,image/webp',
166
+ },
167
+ headerImage: {
168
+ contentType: 'image/png,image/jpeg,image/tiff,image/webp',
169
+ },
170
+ },
171
+ },
172
+ },
173
+ },
174
+ responses: {
175
+ 200: {
176
+ description: 'The updated app collection',
177
+ content: {
178
+ 'application/json': {
179
+ schema: {
180
+ $ref: '#/components/schemas/AppCollection',
181
+ },
182
+ },
183
+ },
184
+ },
185
+ },
186
+ security: [{ studio: [] }],
187
+ },
188
+ delete: {
189
+ tags: ['appCollection'],
190
+ description: 'Delete an app collection',
191
+ operationId: 'deleteCollection',
192
+ parameters: [
193
+ {
194
+ name: 'appCollectionId',
195
+ in: 'path',
196
+ description: 'The id of the app collection',
197
+ required: true,
198
+ schema: {
199
+ $ref: '#/components/schemas/AppCollection/properties/id',
200
+ },
201
+ },
202
+ ],
203
+ responses: {
204
+ 204: {
205
+ description: 'The app collection was deleted',
206
+ },
207
+ },
208
+ security: [{ studio: [] }],
209
+ },
210
+ },
211
+ '/api/appCollections/{appCollectionId}/headerImage': {
212
+ get: {
213
+ tags: ['appCollection'],
214
+ description: 'Get an app collection’s header image',
215
+ operationId: 'getCollectionHeaderImage',
216
+ parameters: [
217
+ {
218
+ name: 'appCollectionId',
219
+ in: 'path',
220
+ description: 'The id of the app collection',
221
+ required: true,
222
+ schema: {
223
+ $ref: '#/components/schemas/AppCollection/properties/id',
224
+ },
225
+ },
226
+ ],
227
+ responses: {
228
+ 200: {
229
+ description: 'The app collection’s header image',
230
+ content: {
231
+ 'image/png': {},
232
+ 'image/jpeg': {},
233
+ 'image/tiff': {},
234
+ 'image/webp': {},
235
+ },
236
+ },
237
+ },
238
+ security: [{ studio: [] }, {}],
239
+ },
240
+ },
241
+ '/api/appCollections/{appCollectionId}/expert/profileImage': {
242
+ get: {
243
+ tags: ['appCollection'],
244
+ description: 'Get an app collection’s expert’s profile image',
245
+ operationId: 'getCollectionExpertProfileImage',
246
+ parameters: [
247
+ {
248
+ name: 'appCollectionId',
249
+ in: 'path',
250
+ description: 'The id of the app collection',
251
+ required: true,
252
+ schema: {
253
+ $ref: '#/components/schemas/AppCollection/properties/id',
254
+ },
255
+ },
256
+ ],
257
+ responses: {
258
+ 200: {
259
+ description: 'The app collection’s expert’s profile image',
260
+ content: {
261
+ 'image/png': {},
262
+ 'image/jpeg': {},
263
+ 'image/tiff': {},
264
+ 'image/webp': {},
265
+ },
266
+ },
267
+ },
268
+ security: [{ studio: [] }, {}],
269
+ },
270
+ },
271
+ '/api/appCollections/{appCollectionId}/apps': {
272
+ get: {
273
+ tags: ['appCollection'],
274
+ description: 'Get a list of apps in an app collection',
275
+ operationId: 'queryCollectionApps',
276
+ parameters: [
277
+ {
278
+ name: 'appCollectionId',
279
+ in: 'path',
280
+ description: 'The id of the app collection',
281
+ required: true,
282
+ schema: {
283
+ $ref: '#/components/schemas/AppCollection/properties/id',
284
+ },
285
+ },
286
+ ],
287
+ responses: {
288
+ 200: {
289
+ description: 'A list of apps',
290
+ content: {
291
+ 'application/json': {
292
+ schema: {
293
+ type: 'array',
294
+ items: {
295
+ allOf: [
296
+ { $ref: '#/components/schemas/App' },
297
+ {
298
+ type: 'object',
299
+ properties: {
300
+ pinned: {
301
+ type: 'string',
302
+ format: 'date-time',
303
+ nullable: true,
304
+ },
305
+ },
306
+ },
307
+ ],
308
+ },
309
+ },
310
+ },
311
+ },
312
+ },
313
+ },
314
+ security: [{ studio: [] }, {}],
315
+ },
316
+ post: {
317
+ tags: ['appCollection'],
318
+ description: 'Add an app to an app collection',
319
+ operationId: 'addAppToCollection',
320
+ parameters: [
321
+ {
322
+ name: 'appCollectionId',
323
+ in: 'path',
324
+ description: 'The id of the app collection',
325
+ required: true,
326
+ schema: {
327
+ $ref: '#/components/schemas/AppCollection/properties/id',
328
+ },
329
+ },
330
+ ],
331
+ requestBody: {
332
+ description: 'The app to add to the app collection',
333
+ required: true,
334
+ content: {
335
+ 'application/json': {
336
+ schema: {
337
+ type: 'object',
338
+ properties: {
339
+ AppId: {
340
+ $ref: '#/components/schemas/App/properties/id',
341
+ },
342
+ },
343
+ },
344
+ },
345
+ },
346
+ },
347
+ responses: {
348
+ 204: {
349
+ description: 'The app was added to the app collection',
350
+ },
351
+ },
352
+ security: [{ studio: [] }],
353
+ },
354
+ },
355
+ '/api/appCollections/{appCollectionId}/apps/{appId}': {
356
+ delete: {
357
+ tags: ['appCollection'],
358
+ description: 'Remove an app from an app collection',
359
+ operationId: 'removeAppFromCollection',
360
+ parameters: [
361
+ {
362
+ name: 'appCollectionId',
363
+ in: 'path',
364
+ description: 'The id of the app collection',
365
+ required: true,
366
+ schema: {
367
+ $ref: '#/components/schemas/AppCollection/properties/id',
368
+ },
369
+ },
370
+ {
371
+ name: 'appId',
372
+ in: 'path',
373
+ description: 'The id of the app',
374
+ required: true,
375
+ schema: {
376
+ $ref: '#/components/schemas/AppCollection/properties/id',
377
+ },
378
+ },
379
+ ],
380
+ responses: {
381
+ 204: {
382
+ description: 'The app was removed from the app collection',
383
+ },
384
+ },
385
+ security: [{ studio: [] }],
386
+ },
387
+ },
388
+ '/api/appCollections/{appCollectionId}/apps/{appId}/pinned': {
389
+ post: {
390
+ tags: ['appCollection'],
391
+ description: 'Pin an app to an app collection',
392
+ operationId: 'pinAppToCollection',
393
+ parameters: [
394
+ {
395
+ name: 'appCollectionId',
396
+ in: 'path',
397
+ description: 'The id of the app collection to pin the app to',
398
+ required: true,
399
+ schema: { $ref: '#/components/schemas/AppCollection/properties/id' },
400
+ },
401
+ {
402
+ name: 'appId',
403
+ in: 'path',
404
+ description: 'The id of the app to pin',
405
+ required: true,
406
+ schema: { $ref: '#/components/schemas/App/properties/id' },
407
+ },
408
+ ],
409
+ responses: {
410
+ 200: {
411
+ description: 'The app was pinned to the app collection',
412
+ content: {
413
+ 'application/json': {
414
+ schema: {
415
+ type: 'object',
416
+ properties: {
417
+ pinned: {
418
+ type: 'string',
419
+ format: 'date-time',
420
+ },
421
+ },
422
+ },
423
+ },
424
+ },
425
+ },
426
+ },
427
+ security: [{ studio: [] }],
428
+ },
429
+ delete: {
430
+ tags: ['appCollection'],
431
+ description: 'Unpin an app from an app collection',
432
+ operationId: 'unpinAppFromCollection',
433
+ parameters: [
434
+ {
435
+ name: 'appCollectionId',
436
+ in: 'path',
437
+ description: 'The id of the app collection to unpin the app from',
438
+ required: true,
439
+ schema: { $ref: '#/components/schemas/AppCollection/properties/id' },
440
+ },
441
+ {
442
+ name: 'appId',
443
+ in: 'path',
444
+ description: 'The id of the app to unpin',
445
+ required: true,
446
+ schema: { $ref: '#/components/schemas/App/properties/id' },
447
+ },
448
+ ],
449
+ responses: {
450
+ 204: {
451
+ description: 'The app was unpinned from the app collection',
452
+ },
453
+ },
454
+ security: [{ studio: [] }],
455
+ },
456
+ },
457
+ };
458
+ //# sourceMappingURL=appCollections.js.map
@@ -1,4 +1,5 @@
1
1
  import { paths as action } from './action.js';
2
+ import { paths as appCollections } from './appCollections.js';
2
3
  import { paths as translations } from './appMessages.js';
3
4
  import { paths as appOAuth2Secrets } from './appOAuth2Secrets.js';
4
5
  import { paths as appQuotas } from './appQuotas.js';
@@ -31,6 +32,7 @@ export const paths = {
31
32
  ...scimEndpoints,
32
33
  ...appsembleMessages,
33
34
  ...appSSLSecrets,
35
+ ...appCollections,
34
36
  ...appQuotas,
35
37
  ...assets,
36
38
  ...blocks,
@@ -82,5 +82,17 @@ export declare enum Permission {
82
82
  /**
83
83
  * The permission to view the list of members in an organization.
84
84
  */
85
- ViewMembers = 19
85
+ ViewMembers = 19,
86
+ /**
87
+ * The permission to create collections.
88
+ */
89
+ CreateCollections = 20,
90
+ /**
91
+ * The permission to delete collections.
92
+ */
93
+ DeleteCollections = 21,
94
+ /**
95
+ * The permission to edit collections.
96
+ */
97
+ EditCollections = 22
86
98
  }
@@ -84,5 +84,17 @@ export var Permission;
84
84
  * The permission to view the list of members in an organization.
85
85
  */
86
86
  Permission[Permission["ViewMembers"] = 19] = "ViewMembers";
87
+ /**
88
+ * The permission to create collections.
89
+ */
90
+ Permission[Permission["CreateCollections"] = 20] = "CreateCollections";
91
+ /**
92
+ * The permission to delete collections.
93
+ */
94
+ Permission[Permission["DeleteCollections"] = 21] = "DeleteCollections";
95
+ /**
96
+ * The permission to edit collections.
97
+ */
98
+ Permission[Permission["EditCollections"] = 22] = "EditCollections";
87
99
  })(Permission || (Permission = {}));
88
100
  //# sourceMappingURL=Permission.js.map
@@ -29,6 +29,9 @@ const Owner = [
29
29
  Permission.DeleteOrganization,
30
30
  Permission.ManageMembers,
31
31
  Permission.ManageRoles,
32
+ Permission.CreateCollections,
33
+ Permission.DeleteCollections,
34
+ Permission.EditCollections,
32
35
  ];
33
36
  export const roles = {
34
37
  Member: member,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appsemble/utils",
3
- "version": "0.22.5",
3
+ "version": "0.22.6",
4
4
  "description": "Utility functions used in Appsemble internally",
5
5
  "keywords": [
6
6
  "app",
@@ -37,7 +37,7 @@
37
37
  "test": "vitest"
38
38
  },
39
39
  "dependencies": {
40
- "@appsemble/types": "0.22.5",
40
+ "@appsemble/types": "0.22.6",
41
41
  "axios": "^1.0.0",
42
42
  "cron-parser": "^4.0.0",
43
43
  "date-fns": "^2.0.0",