@appsemble/utils 0.37.6 → 0.38.1

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.37.6/config/assets/logo.svg) Appsemble Utilities
1
+ # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.38.1/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.37.6/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.37.6)
6
+ [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.38.1/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.38.1)
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.37.6/LICENSE.md) ©
29
+ [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.38.1/LICENSE.md) ©
30
30
  [Appsemble](https://appsemble.com)
@@ -15,6 +15,7 @@ export const cli = {
15
15
  'blocks:write': 'Register and update blocks, and publish new block versions.',
16
16
  'blocks:delete': 'Delete specific block versions.',
17
17
  'organizations:write': 'Create and manage organizations.',
18
+ 'organizations:delete': 'Delete organizations.',
18
19
  'resources:read': 'Read app resources on behalf of a user.',
19
20
  'resources:write': 'Modify app resources on behalf of a user.',
20
21
  'assets:write': 'Create app assets on behalf of a user.',
@@ -1,5 +1,38 @@
1
1
  export const pathItems = {
2
2
  parameters: [{ $ref: '#/components/parameters/appId' }],
3
+ put: {
4
+ tags: ['main', 'app', 'resource'],
5
+ description: 'Atomically replace all seed resources and demo resource copies. Indexed references use $resourceType with a zero-based offset into that resource type.',
6
+ operationId: 'replaceAppSeedResources',
7
+ requestBody: {
8
+ required: true,
9
+ content: {
10
+ 'application/json': {
11
+ schema: {
12
+ type: 'object',
13
+ additionalProperties: {
14
+ type: 'array',
15
+ items: { type: 'object', additionalProperties: true },
16
+ },
17
+ },
18
+ },
19
+ },
20
+ },
21
+ responses: {
22
+ 200: {
23
+ description: 'The published resource IDs, grouped by resource type.',
24
+ content: {
25
+ 'application/json': {
26
+ schema: {
27
+ type: 'object',
28
+ additionalProperties: { type: 'array', items: { type: 'integer' } },
29
+ },
30
+ },
31
+ },
32
+ },
33
+ },
34
+ security: [{ studio: [] }, { cli: ['resources:write'] }],
35
+ },
3
36
  delete: {
4
37
  tags: ['main', 'app', 'resource'],
5
38
  description: 'Delete all app seed resources.',
@@ -9,7 +42,7 @@ export const pathItems = {
9
42
  description: 'The app resources have been deleted successfully.',
10
43
  },
11
44
  },
12
- security: [{ cli: ['resources:write'] }, {}],
45
+ security: [{ studio: [] }, { cli: ['resources:write'] }],
13
46
  },
14
47
  };
15
48
  //# sourceMappingURL=resources.js.map
@@ -83,7 +83,7 @@ export const pathItems = {
83
83
  description: 'successfully deleted organization',
84
84
  },
85
85
  },
86
- security: [{ studio: [] }, {}],
86
+ security: [{ studio: [] }, { cli: ['organizations:delete'] }],
87
87
  },
88
88
  };
89
89
  //# sourceMappingURL=organizationId.js.map
package/appMessages.js CHANGED
@@ -106,9 +106,12 @@ export function extractAppMessages(app, onBlock) {
106
106
  }
107
107
  }
108
108
  if (page.type === 'loop') {
109
- messages.app[`${prefix}.steps.first`] = 'first';
109
+ Object.assign(messages.messageIds, findMessageIds(page.start?.name), findMessageIds(page.end?.name));
110
+ messages.app[`${prefix}.steps.first`] =
111
+ (typeof page.start?.name === 'string' ? page.start.name : '') || 'first';
110
112
  messages.app[`${prefix}.steps`] = 'step';
111
- messages.app[`${prefix}.steps.last`] = 'last';
113
+ messages.app[`${prefix}.steps.last`] =
114
+ (typeof page.end?.name === 'string' ? page.end.name : '') || 'last';
112
115
  }
113
116
  },
114
117
  });
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * All known OAuth2 scopes for client credentials.
3
3
  */
4
- export declare const scopes: readonly ["apps:export", "apps:write", "apps:delete", "blocks:write", "blocks:delete", "organizations:write", "resources:read", "resources:write", "assets:write", "groups:read", "groups:write"];
4
+ export declare const scopes: readonly ["apps:export", "apps:write", "apps:delete", "blocks:write", "blocks:delete", "organizations:write", "organizations:delete", "resources:read", "resources:write", "assets:write", "groups:read", "groups:write"];
5
5
  export declare const appOAuth2Scopes: {
6
6
  readonly email: "Read the user email address.";
7
7
  readonly openid: "Login the user to the requesting app using OpenID.";
@@ -8,6 +8,7 @@ export const scopes = [
8
8
  'blocks:write',
9
9
  'blocks:delete',
10
10
  'organizations:write',
11
+ 'organizations:delete',
11
12
  'resources:read',
12
13
  'resources:write',
13
14
  'assets:write',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appsemble/utils",
3
- "version": "0.37.6",
3
+ "version": "0.38.1",
4
4
  "description": "Utility functions used in Appsemble internally",
5
5
  "keywords": [
6
6
  "app",
@@ -39,8 +39,8 @@
39
39
  "test": "vitest"
40
40
  },
41
41
  "dependencies": {
42
- "@appsemble/lang-sdk": "0.37.6",
43
- "@appsemble/types": "0.37.6",
42
+ "@appsemble/lang-sdk": "0.38.1",
43
+ "@appsemble/types": "0.38.1",
44
44
  "@fortawesome/fontawesome-common-types": "^6.0.0",
45
45
  "axios": "^1.0.0",
46
46
  "langmap": "^0.0.16",
@@ -52,7 +52,7 @@
52
52
  "@types/langmap": "0.0.3",
53
53
  "bulma": "=0.9.4",
54
54
  "koas-core": "0.7.0",
55
- "vitest": "4.1.10"
55
+ "vitest": "4.1.11"
56
56
  },
57
57
  "engines": {
58
58
  "node": ">=24"