@appsemble/utils 0.21.2 → 0.21.3
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/paths/appQuotas.d.ts +2 -0
- package/api/paths/appQuotas.js +38 -0
- package/api/paths/index.js +2 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +8 -2
- package/reference-schemas/remappers/conditionals.js +84 -5
- package/reference-schemas/remappers/data.js +46 -1
- package/reference-schemas/remappers/dates.js +72 -3
- package/reference-schemas/remappers/randoms.js +51 -4
- package/reference-schemas/remappers/unsorted.js +189 -4
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.21.3)
|
|
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.21.
|
|
29
|
+
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.21.3/LICENSE.md) ©
|
|
30
30
|
[Appsemble](https://appsemble.com)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export const paths = {
|
|
2
|
+
'/api/apps/{appId}/quotas/email': {
|
|
3
|
+
get: {
|
|
4
|
+
tags: ['app'],
|
|
5
|
+
operationId: 'getAppEmailQuota',
|
|
6
|
+
parameters: [{ $ref: '#/components/parameters/appId' }],
|
|
7
|
+
security: [{ studio: [] }, {}],
|
|
8
|
+
responses: {
|
|
9
|
+
200: {
|
|
10
|
+
description: 'Email quota for an app',
|
|
11
|
+
content: {
|
|
12
|
+
'application/json': {
|
|
13
|
+
schema: {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
used: {
|
|
17
|
+
type: 'number',
|
|
18
|
+
description: 'Number of emails sent today',
|
|
19
|
+
},
|
|
20
|
+
limit: {
|
|
21
|
+
type: 'number',
|
|
22
|
+
description: 'Maximum number of emails that can be sent today',
|
|
23
|
+
},
|
|
24
|
+
reset: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
format: 'date-time',
|
|
27
|
+
description: 'Date and time when the quota resets',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=appQuotas.js.map
|
package/api/paths/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { paths as action } from './action.js';
|
|
2
2
|
import { paths as translations } from './appMessages.js';
|
|
3
3
|
import { paths as appOAuth2Secrets } from './appOAuth2Secrets.js';
|
|
4
|
+
import { paths as appQuotas } from './appQuotas.js';
|
|
4
5
|
import { paths as apps } from './apps.js';
|
|
5
6
|
import { paths as appSamlSecrets } from './appSamlSecrets.js';
|
|
6
7
|
import { paths as scimEndpoints } from './appScimEndpoints.js';
|
|
@@ -30,6 +31,7 @@ export const paths = {
|
|
|
30
31
|
...scimEndpoints,
|
|
31
32
|
...appsembleMessages,
|
|
32
33
|
...appSSLSecrets,
|
|
34
|
+
...appQuotas,
|
|
33
35
|
...assets,
|
|
34
36
|
...blocks,
|
|
35
37
|
...emails,
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -23,6 +23,7 @@ export * from './string.js';
|
|
|
23
23
|
export * from './theme.js';
|
|
24
24
|
export * from './langmap.js';
|
|
25
25
|
export * from './i18n.js';
|
|
26
|
+
export * from './serverActions.js';
|
|
26
27
|
export * from './validation.js';
|
|
27
28
|
export * from './convertToCsv.js';
|
|
28
29
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appsemble/utils",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.3",
|
|
4
4
|
"description": "Utility functions used in Appsemble internally",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -21,6 +21,12 @@
|
|
|
21
21
|
"author": "Appsemble <info@appsemble.com> (https://appsemble.com)",
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"type": "module",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": [
|
|
26
|
+
"./index.js",
|
|
27
|
+
"./index.ts"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
24
30
|
"files": [
|
|
25
31
|
"**/*.d.ts",
|
|
26
32
|
"**/*.js",
|
|
@@ -31,7 +37,7 @@
|
|
|
31
37
|
"test": "vitest"
|
|
32
38
|
},
|
|
33
39
|
"dependencies": {
|
|
34
|
-
"@appsemble/types": "0.21.
|
|
40
|
+
"@appsemble/types": "0.21.3",
|
|
35
41
|
"axios": "^1.0.0",
|
|
36
42
|
"cron-parser": "^4.0.0",
|
|
37
43
|
"date-fns": "^2.0.0",
|
|
@@ -3,7 +3,28 @@ export const conditionalRemappers = {
|
|
|
3
3
|
type: 'object',
|
|
4
4
|
description: `Check if condition results in a truthy value.
|
|
5
5
|
|
|
6
|
-
Returns value of then if condition is truthy, otherwise it returns the value of else
|
|
6
|
+
Returns value of \`then\` if condition is truthy, otherwise it returns the value of \`else\`.
|
|
7
|
+
|
|
8
|
+
For example:
|
|
9
|
+
|
|
10
|
+
\`\`\`yaml
|
|
11
|
+
if:
|
|
12
|
+
condition: { equals: [{ prop: inputValue }, 4] }
|
|
13
|
+
then:
|
|
14
|
+
static: You guessed right!
|
|
15
|
+
else:
|
|
16
|
+
static: You guessed wrong!
|
|
17
|
+
\`\`\`
|
|
18
|
+
|
|
19
|
+
If the \`inputValue\` is \`4\`, it goes to the \`then\` remapper and returns:
|
|
20
|
+
\`\`\`
|
|
21
|
+
You guessed right!
|
|
22
|
+
\`\`\`
|
|
23
|
+
|
|
24
|
+
If the \`inputValue\` is something other than \`4\`, it goes to the \`else\` remapper and returns:
|
|
25
|
+
\`\`\`
|
|
26
|
+
You guessed wrong!
|
|
27
|
+
\`\`\`
|
|
7
28
|
`,
|
|
8
29
|
additionalProperties: false,
|
|
9
30
|
required: ['condition', 'then', 'else'],
|
|
@@ -30,13 +51,35 @@ Returns value of then if condition is truthy, otherwise it returns the value of
|
|
|
30
51
|
description: `Compare all computed remapper values against each other.
|
|
31
52
|
|
|
32
53
|
Returns \`true\` if all entries are equal, otherwise \`false\`.
|
|
54
|
+
|
|
55
|
+
In the following example, if the \`inputValue\` and \`expectedValue\` are of the same value, the
|
|
56
|
+
condition will return \`true\` and the \`then\` remapper will fire.
|
|
57
|
+
|
|
58
|
+
\`\`\`yaml
|
|
59
|
+
condition:
|
|
60
|
+
equals:
|
|
61
|
+
- prop: inputValue
|
|
62
|
+
- prop: expectedValue
|
|
63
|
+
\`\`\`
|
|
33
64
|
`,
|
|
34
65
|
},
|
|
35
66
|
gt: {
|
|
36
67
|
type: 'array',
|
|
37
|
-
description:
|
|
68
|
+
description: `**(gt = Greater than)**
|
|
69
|
+
|
|
70
|
+
Compare the first computed remapper value with the second computed remapper value.
|
|
71
|
+
|
|
72
|
+
Returns \`true\` if the first entry is greater than the second entry.
|
|
73
|
+
|
|
74
|
+
For example, if \`stock\` is more than 5 here, it returns \`true\`.
|
|
38
75
|
|
|
39
|
-
|
|
76
|
+
\`\`\`yaml
|
|
77
|
+
condition:
|
|
78
|
+
gt:
|
|
79
|
+
- prop: stock
|
|
80
|
+
- 5
|
|
81
|
+
\`\`\`
|
|
82
|
+
`,
|
|
40
83
|
minItems: 2,
|
|
41
84
|
maxItems: 2,
|
|
42
85
|
items: {
|
|
@@ -45,9 +88,21 @@ Returns \`true\` if the first entry is greater than the second entry.`,
|
|
|
45
88
|
},
|
|
46
89
|
lt: {
|
|
47
90
|
type: 'array',
|
|
48
|
-
description:
|
|
91
|
+
description: `**(lt = Lesser than)
|
|
92
|
+
|
|
93
|
+
Compare the first computed remapper value with the second computed remapper value.
|
|
94
|
+
|
|
95
|
+
Returns \`true\` if the first entry is lesser than the second entry.
|
|
49
96
|
|
|
50
|
-
|
|
97
|
+
For example, if \`stock\` is less than 5 here, it returns \`true\`.
|
|
98
|
+
|
|
99
|
+
\`\`\`yaml
|
|
100
|
+
condition:
|
|
101
|
+
lt:
|
|
102
|
+
- prop: stock
|
|
103
|
+
- 5
|
|
104
|
+
\`\`\`
|
|
105
|
+
`,
|
|
51
106
|
minItems: 2,
|
|
52
107
|
maxItems: 2,
|
|
53
108
|
items: {
|
|
@@ -64,6 +119,15 @@ Returns \`true\` if the first entry is lesser than the second entry.`,
|
|
|
64
119
|
Returns \`false\` if all entries are equal to the first entry, otherwise \`true\`.
|
|
65
120
|
|
|
66
121
|
If only one remapper or none is passed, the remapper value gets computed and then inverted.
|
|
122
|
+
|
|
123
|
+
If \`number\` in the following example is something other than 4, the condition returns \`true\`.
|
|
124
|
+
|
|
125
|
+
\`\`\`yaml
|
|
126
|
+
condition:
|
|
127
|
+
not:
|
|
128
|
+
- prop: number
|
|
129
|
+
- 4
|
|
130
|
+
\`\`\`
|
|
67
131
|
`,
|
|
68
132
|
},
|
|
69
133
|
match: {
|
|
@@ -71,6 +135,21 @@ If only one remapper or none is passed, the remapper value gets computed and the
|
|
|
71
135
|
description: `Check if any case results in a truthy value.
|
|
72
136
|
|
|
73
137
|
Returns the value of the first case where the condition equals true, otherwise returns null.
|
|
138
|
+
|
|
139
|
+
In the following example, let's say the \`Gem\` is a "Ruby". The match remapper then returns
|
|
140
|
+
\`value: 75\`.
|
|
141
|
+
|
|
142
|
+
\`\`\`yaml
|
|
143
|
+
match:
|
|
144
|
+
- case: { equals: [{ prop: Gem }, Diamond] }
|
|
145
|
+
value: 100
|
|
146
|
+
- case: { equals: [{ prop: Gem }, Ruby] }
|
|
147
|
+
value: 75
|
|
148
|
+
- case: { equals: [{ prop: Gem }, Gold] }
|
|
149
|
+
value: 50
|
|
150
|
+
- case: { equals: [{ prop: Gem }, Sapphire] }
|
|
151
|
+
value: 25
|
|
152
|
+
\`\`\`
|
|
74
153
|
`,
|
|
75
154
|
items: {
|
|
76
155
|
type: 'object',
|
|
@@ -4,6 +4,40 @@ export const dataRemappers = {
|
|
|
4
4
|
description: `Get the current array.map’s index or length.
|
|
5
5
|
|
|
6
6
|
Returns nothing when not in the context of \`array.map’s\`.
|
|
7
|
+
|
|
8
|
+
For example:
|
|
9
|
+
|
|
10
|
+
Input:
|
|
11
|
+
\`\`\`json
|
|
12
|
+
["a", "b", "c"]
|
|
13
|
+
\`\`\`
|
|
14
|
+
|
|
15
|
+
This remapper definition maps through the input array and creates an object with the length of the
|
|
16
|
+
array and the current index of the loop:
|
|
17
|
+
\`\`\`yaml
|
|
18
|
+
array.map:
|
|
19
|
+
object.from:
|
|
20
|
+
length: { array: length }
|
|
21
|
+
index: { array: index }
|
|
22
|
+
\`\`\`
|
|
23
|
+
|
|
24
|
+
Result:
|
|
25
|
+
\`\`\`json
|
|
26
|
+
[
|
|
27
|
+
{
|
|
28
|
+
"index": 0,
|
|
29
|
+
"length": 3
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"index": 1,
|
|
33
|
+
"length": 3
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"index": 2,
|
|
37
|
+
"length": 3
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
\`\`\`
|
|
7
41
|
`,
|
|
8
42
|
},
|
|
9
43
|
app: {
|
|
@@ -260,7 +294,18 @@ Result:
|
|
|
260
294
|
`,
|
|
261
295
|
},
|
|
262
296
|
static: {
|
|
263
|
-
description:
|
|
297
|
+
description: `Create a static value
|
|
298
|
+
|
|
299
|
+
\`\`\`yaml
|
|
300
|
+
static: Hello!
|
|
301
|
+
\`\`\`
|
|
302
|
+
|
|
303
|
+
Returns the following string:
|
|
304
|
+
|
|
305
|
+
\`\`\`
|
|
306
|
+
Hello!
|
|
307
|
+
\`\`\`
|
|
308
|
+
`,
|
|
264
309
|
},
|
|
265
310
|
translate: {
|
|
266
311
|
type: 'string',
|
|
@@ -1,15 +1,84 @@
|
|
|
1
1
|
export const dateRemappers = {
|
|
2
2
|
'date.add': {
|
|
3
3
|
type: 'string',
|
|
4
|
-
description:
|
|
4
|
+
description: `Adds a specified date value to the provided date.
|
|
5
|
+
|
|
6
|
+
The value to add should be specified according to the
|
|
7
|
+
[parse-duration](https://www.npmjs.com/package/parse-duration) API. If you want to add a day to a
|
|
8
|
+
date for example, the syntax would be \`date.add: 1d\`.
|
|
9
|
+
|
|
10
|
+
Full list of supported unit types:
|
|
11
|
+
- nanoseconds (ns)
|
|
12
|
+
- microseconds (μs)
|
|
13
|
+
- milliseconds (ms)
|
|
14
|
+
- seconds (s, sec)
|
|
15
|
+
- minutes (m, min)
|
|
16
|
+
- hours (h, hr)
|
|
17
|
+
- days (d)
|
|
18
|
+
- weeks (w, wk)
|
|
19
|
+
- months
|
|
20
|
+
- years (y, yr)
|
|
21
|
+
|
|
22
|
+
For example:
|
|
23
|
+
|
|
24
|
+
Date now:
|
|
25
|
+
\`\`\`json
|
|
26
|
+
2023-06-30T14:50:19.601Z
|
|
27
|
+
\`\`\`
|
|
28
|
+
|
|
29
|
+
Remapper definition:
|
|
30
|
+
\`\`\`yaml
|
|
31
|
+
[{ date.now: null }, { date.add: 1w } , { date.format: null }]
|
|
32
|
+
\`\`\`
|
|
33
|
+
|
|
34
|
+
Result:
|
|
35
|
+
\`\`\`json
|
|
36
|
+
2023-07-07T14:50:19.601Z
|
|
37
|
+
\`\`\`
|
|
38
|
+
|
|
39
|
+
`,
|
|
5
40
|
},
|
|
6
41
|
'date.format': {
|
|
7
42
|
enum: [null],
|
|
8
|
-
description:
|
|
43
|
+
description: `Format a date according to the RFC3339 format.
|
|
44
|
+
|
|
45
|
+
Here is an example of a RFC3339 complicit date:
|
|
46
|
+
\`2002-10-02T15:00:00Z\`
|
|
47
|
+
|
|
48
|
+
In an app definition, it’s best to use this when you want to display a date in a specific format.
|
|
49
|
+
For example, if your app has a form with a Datepicker field the incoming data will be formatted
|
|
50
|
+
as a simple date format. If you want to format it tot he RFC3339 format, you can use this remapper.
|
|
51
|
+
|
|
52
|
+
When you submit a form with a DateField, the internal output looks like this:
|
|
53
|
+
|
|
54
|
+
\`\`\`js
|
|
55
|
+
2023-07-03
|
|
56
|
+
\`\`\`
|
|
57
|
+
|
|
58
|
+
You can then format the date so that it uses the RFC3339 format.
|
|
59
|
+
|
|
60
|
+
\`\`\`yaml
|
|
61
|
+
date.format: null
|
|
62
|
+
\`\`\`
|
|
63
|
+
|
|
64
|
+
Result:
|
|
65
|
+
\`\`\`js
|
|
66
|
+
"2023-07-03T09:09:50.000Z"
|
|
67
|
+
\`\`\`
|
|
68
|
+
`,
|
|
9
69
|
},
|
|
10
70
|
'date.now': {
|
|
11
71
|
enum: [null],
|
|
12
|
-
description:
|
|
72
|
+
description: `Returns the current date as a JavaScript Date object.
|
|
73
|
+
\`\`\`yaml
|
|
74
|
+
date.now: null
|
|
75
|
+
\`\`\`
|
|
76
|
+
|
|
77
|
+
Result:
|
|
78
|
+
\`\`\`js
|
|
79
|
+
"Mon Jul 03 2023 11:47:18 GMT+0200 (Midden-Europese zomertijd)"
|
|
80
|
+
\`\`\`
|
|
81
|
+
`,
|
|
13
82
|
},
|
|
14
83
|
'date.parse': {
|
|
15
84
|
type: 'string',
|
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
export const randomRemappers = {
|
|
2
2
|
'random.choice': {
|
|
3
3
|
enum: [null],
|
|
4
|
-
description:
|
|
4
|
+
description: `Pick and return a random entry from an array. If the input is not an array, the input is returned as-is.
|
|
5
|
+
For example:
|
|
6
|
+
|
|
7
|
+
If you input the following array:
|
|
8
|
+
\`\`\`json
|
|
9
|
+
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
|
10
|
+
\`\`\`
|
|
11
|
+
|
|
12
|
+
\`\`\`yaml
|
|
13
|
+
random.choice: null
|
|
14
|
+
\`\`\`
|
|
15
|
+
|
|
16
|
+
The result could return any one of these numbers.
|
|
17
|
+
|
|
18
|
+
You can also combine different data types in this array and have it work in the same way. If mixed in
|
|
19
|
+
strings, the result could be either one of the provided numbers or one of the provided strings.
|
|
20
|
+
|
|
21
|
+
\`\`\`json
|
|
22
|
+
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, "Peter", "Patrick", "Michael", "Harry"]
|
|
23
|
+
\`\`\`
|
|
24
|
+
`,
|
|
5
25
|
},
|
|
6
26
|
'random.integer': {
|
|
7
27
|
type: 'array',
|
|
@@ -10,7 +30,16 @@ export const randomRemappers = {
|
|
|
10
30
|
items: {
|
|
11
31
|
type: 'integer',
|
|
12
32
|
},
|
|
13
|
-
description:
|
|
33
|
+
description: `Pick and return a random integer between the provided lowest and highest values.
|
|
34
|
+
For example:
|
|
35
|
+
\`\`\`yaml
|
|
36
|
+
random.integer:
|
|
37
|
+
- 0
|
|
38
|
+
- 1000
|
|
39
|
+
\`\`\`
|
|
40
|
+
|
|
41
|
+
Returns a random integer between 0 and 1000.
|
|
42
|
+
`,
|
|
14
43
|
},
|
|
15
44
|
'random.float': {
|
|
16
45
|
type: 'array',
|
|
@@ -19,7 +48,16 @@ export const randomRemappers = {
|
|
|
19
48
|
items: {
|
|
20
49
|
type: 'number',
|
|
21
50
|
},
|
|
22
|
-
description:
|
|
51
|
+
description: `Pick and return a random float value between the provided lowest and highest values.
|
|
52
|
+
For example:
|
|
53
|
+
\`\`\`yaml
|
|
54
|
+
random.float:
|
|
55
|
+
- 0
|
|
56
|
+
- 1
|
|
57
|
+
\`\`\`
|
|
58
|
+
|
|
59
|
+
Returns a random float value between 0 and 1.
|
|
60
|
+
`,
|
|
23
61
|
},
|
|
24
62
|
'random.string': {
|
|
25
63
|
type: 'object',
|
|
@@ -29,7 +67,16 @@ export const randomRemappers = {
|
|
|
29
67
|
choice: { type: 'string', minLength: 1 },
|
|
30
68
|
length: { type: 'integer', minimum: 1 },
|
|
31
69
|
},
|
|
32
|
-
description:
|
|
70
|
+
description: `Pick and return a random string from a given length using characters from a given input string defined in \`choice\`.
|
|
71
|
+
For example:
|
|
72
|
+
\`\`\`yaml
|
|
73
|
+
random.string:
|
|
74
|
+
choice: abcdefghijklmnopqrstuvwxyz0123456789
|
|
75
|
+
length: 6
|
|
76
|
+
\`\`\`
|
|
77
|
+
|
|
78
|
+
Returns a randomized string that is 6 characters long and consists of any characters in the \`choice\` field, like: \`g8ajss9\`.
|
|
79
|
+
`,
|
|
33
80
|
},
|
|
34
81
|
};
|
|
35
82
|
//# sourceMappingURL=randoms.js.map
|
|
@@ -1,7 +1,47 @@
|
|
|
1
1
|
export const unsortedRemappers = {
|
|
2
2
|
ics: {
|
|
3
3
|
type: 'object',
|
|
4
|
-
description:
|
|
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.
|
|
6
|
+
|
|
7
|
+
For example, the following input:
|
|
8
|
+
\`\`\`yaml
|
|
9
|
+
ics:
|
|
10
|
+
coordinates
|
|
11
|
+
object.from:
|
|
12
|
+
latitude: 38.897700545442646
|
|
13
|
+
longitude: -77.03655660152435
|
|
14
|
+
description: "Sprint planning meeting"
|
|
15
|
+
duration: 1d
|
|
16
|
+
end: 2023-07-19
|
|
17
|
+
location: The Oval Office.
|
|
18
|
+
start: 2023-07-18
|
|
19
|
+
title: Important Meeting
|
|
20
|
+
url: https://google.nl
|
|
21
|
+
\`\`\`
|
|
22
|
+
|
|
23
|
+
Creates the following ICS-formatted object:
|
|
24
|
+
\`\`\`
|
|
25
|
+
BEGIN:VCALENDAR
|
|
26
|
+
VERSION:2.0
|
|
27
|
+
CALSCALE:GREGORIAN
|
|
28
|
+
PRODID:http://remappers.appsemble.localhost:9999
|
|
29
|
+
METHOD:PUBLISH
|
|
30
|
+
X-PUBLISHED-TTL:PT1H
|
|
31
|
+
BEGIN:VEVENT
|
|
32
|
+
UID:b8TsbczhfpIxPM-3lNHQz
|
|
33
|
+
SUMMARY:Important Meeting
|
|
34
|
+
DTSTAMP:20230703T102029Z
|
|
35
|
+
DTSTART:20230717T220000Z
|
|
36
|
+
DTEND:20230718T220000Z
|
|
37
|
+
DESCRIPTION:Sprint planning meeting
|
|
38
|
+
URL:https://google.nl
|
|
39
|
+
GEO:38.897700545442646;-77.03655123710632
|
|
40
|
+
LOCATION:The Oval Office.
|
|
41
|
+
END:VEVENT
|
|
42
|
+
END:VCALENDAR
|
|
43
|
+
\`\`\`
|
|
44
|
+
`,
|
|
5
45
|
additionalProperties: false,
|
|
6
46
|
required: ['start', 'title'],
|
|
7
47
|
properties: {
|
|
@@ -43,7 +83,51 @@ export const unsortedRemappers = {
|
|
|
43
83
|
},
|
|
44
84
|
},
|
|
45
85
|
'null.strip': {
|
|
46
|
-
description:
|
|
86
|
+
description: `Strip all null, undefined, and empty array values from an object or array.
|
|
87
|
+
For example, with the following input value:
|
|
88
|
+
\`\`\`json
|
|
89
|
+
[0, 4, null, null, "Peter", 0.4234, null]
|
|
90
|
+
\`\`\`
|
|
91
|
+
\`\`\`yaml
|
|
92
|
+
null.strip: null
|
|
93
|
+
\`\`\`
|
|
94
|
+
|
|
95
|
+
The null values will be removed, leaving a dense array:
|
|
96
|
+
\`\`\`json
|
|
97
|
+
[0, 4, "Peter", 0.4234]
|
|
98
|
+
\`\`\`
|
|
99
|
+
|
|
100
|
+
Instead of giving it \`null\` as option, you can also provide a \`depth\` property to specify how
|
|
101
|
+
deep to recurse into the object or array to remove null values.
|
|
102
|
+
|
|
103
|
+
For example, with the following input:
|
|
104
|
+
\`\`\`json
|
|
105
|
+
{
|
|
106
|
+
0: [0, null, "Peter"],
|
|
107
|
+
1: {
|
|
108
|
+
"array1": [4, null, 0.4234, null]
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
\`\`\`
|
|
112
|
+
|
|
113
|
+
You can specify to which degree of depth you want the null values to be removed.
|
|
114
|
+
With this remapper definition:
|
|
115
|
+
\`\`\`yaml
|
|
116
|
+
null.strip:
|
|
117
|
+
depth: 2
|
|
118
|
+
\`\`\`
|
|
119
|
+
|
|
120
|
+
It will only check two objects in for any null values. That means only the first array within the
|
|
121
|
+
object will be checked. The result looks like this:
|
|
122
|
+
\`\`\`json
|
|
123
|
+
{
|
|
124
|
+
0: [0, "Peter"],
|
|
125
|
+
1: {
|
|
126
|
+
"array1": [4, null, 0.4234, null]
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
\`\`\`
|
|
130
|
+
`,
|
|
47
131
|
anyOf: [
|
|
48
132
|
{ enum: [null] },
|
|
49
133
|
{
|
|
@@ -63,9 +147,110 @@ export const unsortedRemappers = {
|
|
|
63
147
|
},
|
|
64
148
|
log: {
|
|
65
149
|
enum: ['info', 'warn', 'error'],
|
|
66
|
-
description: `Logs
|
|
150
|
+
description: `Logs in the browser's console and returns the incoming data and the remapper function's context.
|
|
151
|
+
|
|
152
|
+
The context contains relevant info about the app, like the URL and locale, but also contains the
|
|
153
|
+
remapper’s history.
|
|
154
|
+
|
|
155
|
+
The options represent the level of logging that will show in the console.
|
|
67
156
|
|
|
68
|
-
The
|
|
157
|
+
- \`input\`: The input data going into this remapper,
|
|
158
|
+
- \`context\`:
|
|
159
|
+
- \`root\`: The input data going into this remapper,
|
|
160
|
+
- \`appId\`: ID of the application,
|
|
161
|
+
- \`url\`: Absolute URL of the page where the remapper was fired,
|
|
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)),
|
|
165
|
+
- \`context\`:
|
|
166
|
+
- \`history\`: Complete list of this remapper’s history (See [history remapper](./history))
|
|
167
|
+
- \`history\`: Complete list of this remapper’s history (See [history remapper](./history))
|
|
168
|
+
- \`locale\`: The user’s locale,
|
|
169
|
+
- \`stepRef\`: In a loop page, gives the properties from the loop’s current data index (See [step remapper](./data#step))
|
|
170
|
+
|
|
171
|
+
For example:
|
|
172
|
+
|
|
173
|
+
\`\`\`json
|
|
174
|
+
{
|
|
175
|
+
"input": {
|
|
176
|
+
"name": "Peter",
|
|
177
|
+
"age": 49,
|
|
178
|
+
"birthday": "07-08-2023"
|
|
179
|
+
},
|
|
180
|
+
"context": {
|
|
181
|
+
"root": {
|
|
182
|
+
"name": "Peter",
|
|
183
|
+
"age": 49,
|
|
184
|
+
"birthday": "07-08-2023"
|
|
185
|
+
},
|
|
186
|
+
"appId": 49,
|
|
187
|
+
"url": "http://remappers.appsemble.localhost:9999/en/other",
|
|
188
|
+
"appUrl": "http://remappers.appsemble.localhost:9999",
|
|
189
|
+
"pageData": {
|
|
190
|
+
"triedAppsemble": false
|
|
191
|
+
},
|
|
192
|
+
"userInfo": {
|
|
193
|
+
"email": "example@hotmail.com",
|
|
194
|
+
"email_verified": true,
|
|
195
|
+
"name": "Example User 1",
|
|
196
|
+
"picture": "https://www.gravatar.com/avatar/f46b82357ce29bcd1099915946cda468?s=128&d=mp",
|
|
197
|
+
"sub": "0000-0000-0000-0000",
|
|
198
|
+
"locale": "en",
|
|
199
|
+
"zoneinfo": "Europe/Amsterdam"
|
|
200
|
+
},
|
|
201
|
+
"context": {
|
|
202
|
+
"history": [
|
|
203
|
+
[
|
|
204
|
+
0,
|
|
205
|
+
4,
|
|
206
|
+
null,
|
|
207
|
+
null,
|
|
208
|
+
"Peter",
|
|
209
|
+
0.4234,
|
|
210
|
+
null
|
|
211
|
+
],
|
|
212
|
+
{
|
|
213
|
+
"name": "Peter",
|
|
214
|
+
"age": 49
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"name": "Peter",
|
|
218
|
+
"age": 49,
|
|
219
|
+
"birthday": "07-08-2023"
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
},
|
|
223
|
+
"history": [
|
|
224
|
+
[
|
|
225
|
+
0,
|
|
226
|
+
4,
|
|
227
|
+
null,
|
|
228
|
+
null,
|
|
229
|
+
"Peter",
|
|
230
|
+
0.4234,
|
|
231
|
+
null
|
|
232
|
+
],
|
|
233
|
+
{
|
|
234
|
+
"name": "Peter",
|
|
235
|
+
"age": 49
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"name": "Peter",
|
|
239
|
+
"age": 49,
|
|
240
|
+
"birthday": "07-08-2023"
|
|
241
|
+
}
|
|
242
|
+
],
|
|
243
|
+
"locale": "en",
|
|
244
|
+
"stepRef": {
|
|
245
|
+
"current": {
|
|
246
|
+
"answerType": "multiple choice",
|
|
247
|
+
"question": "How much do you enjoy working here?"
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
\`\`\`
|
|
253
|
+
`,
|
|
69
254
|
},
|
|
70
255
|
};
|
|
71
256
|
//# sourceMappingURL=unsorted.js.map
|