@appsemble/utils 0.29.5 → 0.29.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 +3 -3
- package/api/components/schemas/SecurityDefaultDefinition.js +1 -1
- package/api/paths/containerLogs.d.ts +2 -0
- package/api/paths/containerLogs.js +38 -0
- package/api/paths/index.js +2 -0
- package/package.json +2 -2
- package/reference-schemas/remappers/data.js +6 -6
- package/reference-schemas/remappers/unsorted.js +5 -5
- package/remap.js +3 -1
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#  Appsemble Utilities
|
|
2
2
|
|
|
3
3
|
> Internal utility functions used across multiple Appsemble projects.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@appsemble/utils)
|
|
6
|
-
[](https://gitlab.com/appsemble/appsemble/-/releases/0.29.6)
|
|
7
7
|
[](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.29.
|
|
29
|
+
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.29.6/LICENSE.md) ©
|
|
30
30
|
[Appsemble](https://appsemble.com)
|
|
@@ -14,7 +14,7 @@ The following values are allowed:
|
|
|
14
14
|
- \`organization\`: Every authenticated user gets the default role if they are in the same organization as the app.
|
|
15
15
|
- \`invite\`: The user has to manually get a role assigned.
|
|
16
16
|
|
|
17
|
-
> **Important**: When [OAuth2](../
|
|
17
|
+
> **Important**: When [OAuth2](../02-guides/oauth2) or [SAML2.0](../02-guides/saml) is used in the
|
|
18
18
|
> app, you must set the policy to \`everyone\`. This will specifically allow every configured
|
|
19
19
|
> authentication method on the secrets page to be used as login method. If you do not want other
|
|
20
20
|
> Appsemble user accounts to be able to log in, you must \`disable\` the \`appsemble login\` options
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export const paths = {
|
|
2
|
+
'/api/containers/{appId}/logs/{container}': {
|
|
3
|
+
get: {
|
|
4
|
+
tags: ['container'],
|
|
5
|
+
description: 'Retrieve the logs related to a companion container',
|
|
6
|
+
operationId: 'getContainerLogs',
|
|
7
|
+
parameters: [
|
|
8
|
+
{
|
|
9
|
+
name: 'appId',
|
|
10
|
+
schema: { type: 'number' },
|
|
11
|
+
description: 'Id of the app which defines the companion container',
|
|
12
|
+
in: 'path',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'container',
|
|
16
|
+
schema: { type: 'string' },
|
|
17
|
+
description: 'Name of the companion container to fetch the logs for',
|
|
18
|
+
in: 'path',
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
responses: {
|
|
22
|
+
200: {
|
|
23
|
+
description: 'Logs of the container running in a specific app',
|
|
24
|
+
content: {
|
|
25
|
+
'application/json': {
|
|
26
|
+
schema: {
|
|
27
|
+
type: 'array',
|
|
28
|
+
items: {},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
security: [{ studio: [] }],
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=containerLogs.js.map
|
package/api/paths/index.js
CHANGED
|
@@ -13,6 +13,7 @@ import { paths as appSSLSecrets } from './appSSLSecrets.js';
|
|
|
13
13
|
import { paths as appVariables } from './appVariables.js';
|
|
14
14
|
import { paths as assets } from './assets.js';
|
|
15
15
|
import { paths as blocks } from './blocks.js';
|
|
16
|
+
import { paths as containerLogs } from './containerLogs.js';
|
|
16
17
|
import { paths as emails } from './emails.js';
|
|
17
18
|
import { paths as health } from './health.js';
|
|
18
19
|
import { paths as invite } from './invite.js';
|
|
@@ -55,5 +56,6 @@ export const paths = {
|
|
|
55
56
|
...appServiceSecrets,
|
|
56
57
|
...user,
|
|
57
58
|
...trainings,
|
|
59
|
+
...containerLogs,
|
|
58
60
|
};
|
|
59
61
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appsemble/utils",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.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.29.
|
|
40
|
+
"@appsemble/types": "0.29.6",
|
|
41
41
|
"axios": "^1.0.0",
|
|
42
42
|
"cron-parser": "^4.0.0",
|
|
43
43
|
"date-fns": "^2.0.0",
|
|
@@ -61,7 +61,7 @@ Clicking on the first item would log \`0\`, the second item \`1\` and so on.
|
|
|
61
61
|
},
|
|
62
62
|
history: {
|
|
63
63
|
type: 'integer',
|
|
64
|
-
description: `> **Note:** This remapper is explained more in depth in the [History](/docs/
|
|
64
|
+
description: `> **Note:** This remapper is explained more in depth in the [History](/docs/04-remappers/05-history) page
|
|
65
65
|
|
|
66
66
|
Gives the data at the history entry at the specified history index. The history at specified index
|
|
67
67
|
is the data that is passed to that action.
|
|
@@ -166,7 +166,7 @@ Example:
|
|
|
166
166
|
\`\`\`
|
|
167
167
|
|
|
168
168
|
The page data only works in the context of a flow page. Let’s say you have a
|
|
169
|
-
[“FlowPage”](/docs/reference/app#-flow-page-definition) type with multiple subpages. Whenever you
|
|
169
|
+
[“FlowPage”](/docs/05-reference/app#-flow-page-definition) type with multiple subpages. Whenever you
|
|
170
170
|
navigate to the next page it adds the data from that page to the flow page’s data. The page remapper
|
|
171
171
|
allows you to access this cumulative data.
|
|
172
172
|
|
|
@@ -281,7 +281,7 @@ ${schemaExample('static', { exclude: ['input'] })}
|
|
|
281
281
|
},
|
|
282
282
|
translate: {
|
|
283
283
|
type: 'string',
|
|
284
|
-
description: `> **Note:** This is explained much more in depth at [Translating](/docs/
|
|
284
|
+
description: `> **Note:** This is explained much more in depth at [Translating](/docs/02-guides/translating)
|
|
285
285
|
|
|
286
286
|
This remapper allows you to easily add translations to your app. To make this remapper work, replace
|
|
287
287
|
any static text with \`translate: {name}\`. Then, in your app’s Translations page pick the language
|
|
@@ -366,11 +366,11 @@ Example:
|
|
|
366
366
|
container: {
|
|
367
367
|
type: 'string',
|
|
368
368
|
description: `
|
|
369
|
-
> **Note:** For this remapper to work, the application needs to define a companion container.
|
|
369
|
+
> **Note:** For this remapper to work, the application needs to define a companion container.
|
|
370
370
|
|
|
371
371
|
This remapper provides a short way to access a companion container for the purpose of making http requests.
|
|
372
|
-
When using the 'request' action, the url can be provided by using the 'container' remapper, and providing a string.
|
|
373
|
-
The string should contain the name of the companion container, followed by the API endpoint path.
|
|
372
|
+
When using the 'request' action, the url can be provided by using the 'container' remapper, and providing a string.
|
|
373
|
+
The string should contain the name of the companion container, followed by the API endpoint path.
|
|
374
374
|
|
|
375
375
|
Example:
|
|
376
376
|
\`\`\`yaml
|
|
@@ -2,7 +2,7 @@ export const unsortedRemappers = {
|
|
|
2
2
|
ics: {
|
|
3
3
|
type: 'object',
|
|
4
4
|
description: `Create a calendar event. This event can be downloaded as an \`.ics\` file and
|
|
5
|
-
uploaded to your agenda using the [download](../reference/action#download) action.
|
|
5
|
+
uploaded to your agenda using the [download](../05-reference/action#download) action.
|
|
6
6
|
|
|
7
7
|
For example, the following input:
|
|
8
8
|
\`\`\`yaml
|
|
@@ -160,12 +160,12 @@ The options represent the level of logging that will show in the console.
|
|
|
160
160
|
- \`appId\`: ID of the application,
|
|
161
161
|
- \`url\`: Absolute URL of the page where the remapper was fired,
|
|
162
162
|
- \`appUrl\`: Base URL of the application,
|
|
163
|
-
- \`pageData\`: Current page data of a FlowPage (See [page remapper](./data#page)),
|
|
164
|
-
- \`userInfo\`: User's information if they are logged in (See [user remapper](./data#user)),
|
|
163
|
+
- \`pageData\`: Current page data of a FlowPage (See [page remapper](./04-data#page)),
|
|
164
|
+
- \`userInfo\`: User's information if they are logged in (See [user remapper](./04-data#user)),
|
|
165
165
|
- \`context\`: Internal context
|
|
166
|
-
- \`history\`: Complete list of this remapper’s history (See [history remapper](./history))
|
|
166
|
+
- \`history\`: Complete list of this remapper’s history (See [history remapper](./05-history))
|
|
167
167
|
- \`locale\`: The user’s locale,
|
|
168
|
-
- \`stepRef\`: In a loop page, gives the properties from the loop’s current data index (See [step remapper](./data#step))
|
|
168
|
+
- \`stepRef\`: In a loop page, gives the properties from the loop’s current data index (See [step remapper](./04-data#step))
|
|
169
169
|
|
|
170
170
|
For example:
|
|
171
171
|
|
package/remap.js
CHANGED
|
@@ -416,7 +416,9 @@ const mapperImplementations = {
|
|
|
416
416
|
user: (property, input, context) => { var _a; return (_a = context.userInfo) === null || _a === void 0 ? void 0 : _a[property]; },
|
|
417
417
|
appMember: (property, input, context) => { var _a, _b; return (_b = (_a = context.userInfo) === null || _a === void 0 ? void 0 : _a.appMember) === null || _b === void 0 ? void 0 : _b[property]; },
|
|
418
418
|
container(property, input, context) {
|
|
419
|
-
|
|
419
|
+
// This value is replaced when the request is made
|
|
420
|
+
// By using the value of the release name
|
|
421
|
+
const namespace = 'companion-containers-appsemble';
|
|
420
422
|
const appName = context.appUrl.split('.')[0].replace(/^https?:\/\//, '');
|
|
421
423
|
const endpoint = property.split('/').slice(1).join('/');
|
|
422
424
|
const containerName = `${property.split('/')[0]}-${appName}-${context.appId}`
|