@appsemble/utils 0.30.14-test.5 → 0.32.1-test.14
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/allActions.js +5 -3
- package/api/components/parameters/$orderby.js +2 -2
- package/api/components/parameters/index.d.ts +2 -1
- package/api/components/parameters/index.js +2 -1
- package/api/components/parameters/webhookName.d.ts +2 -0
- package/api/components/parameters/webhookName.js +10 -0
- package/api/components/parameters/webhookSecretId.d.ts +2 -0
- package/api/components/parameters/webhookSecretId.js +8 -0
- package/api/components/schemas/ActionDefinition.js +3 -0
- package/api/components/schemas/App.js +8 -0
- package/api/components/schemas/AppDefinition.js +6 -0
- package/api/components/schemas/AppLayoutDefinition.js +8 -0
- package/api/components/schemas/AppServiceSecret.js +5 -0
- package/api/components/schemas/AppWebhookSecret.d.ts +2 -0
- package/api/components/schemas/AppWebhookSecret.js +25 -0
- package/api/components/schemas/DialogOkActionDefinition.js +1 -1
- package/api/components/schemas/FilterParametersDefinition.d.ts +2 -0
- package/api/components/schemas/FilterParametersDefinition.js +15 -0
- package/api/components/schemas/FlowCancelActionDefinition.js +1 -1
- package/api/components/schemas/FlowFinishActionDefinition.js +1 -1
- package/api/components/schemas/GroupMemberDeleteActionDefinition.js +1 -1
- package/api/components/schemas/ResourceDefinition.js +5 -0
- package/api/components/schemas/ResourceDeleteAllActionDefinition.d.ts +1 -0
- package/api/components/schemas/ResourceDeleteAllActionDefinition.js +21 -0
- package/api/components/schemas/ResourceDeleteBulkActionDefinition.d.ts +1 -0
- package/api/components/schemas/ResourceDeleteBulkActionDefinition.js +18 -0
- package/api/components/schemas/ResourceGetActionDefinition.js +3 -0
- package/api/components/schemas/ResourcePatchActionDefinition.js +3 -0
- package/api/components/schemas/ResourceSubscriptionStatusActionDefinition.js +1 -0
- package/api/components/schemas/ResourceSubscriptionSubscribeActionDefinition.js +1 -0
- package/api/components/schemas/ResourceSubscriptionToggleActionDefinition.js +1 -0
- package/api/components/schemas/ResourceSubscriptionUnsubscribeActionDefinition.js +1 -0
- package/api/components/schemas/ResourceUpdatePositionsActionDefinition.d.ts +1 -0
- package/api/components/schemas/ResourceUpdatePositionsActionDefinition.js +21 -0
- package/api/components/schemas/SecurityCronDefinition.d.ts +2 -0
- package/api/components/schemas/SecurityCronDefinition.js +26 -0
- package/api/components/schemas/SecurityDefinition.js +1 -0
- package/api/components/schemas/StorageSubtractActionDefinition.js +2 -2
- package/api/components/schemas/StorageWriteActionDefinition.js +4 -0
- package/api/components/schemas/Training.js +2 -25
- package/api/components/schemas/TrainingCompleted.d.ts +2 -0
- package/api/components/schemas/TrainingCompleted.js +17 -0
- package/api/components/schemas/WebhookDefinition.d.ts +2 -0
- package/api/components/schemas/WebhookDefinition.js +17 -0
- package/api/components/schemas/index.d.ts +8 -1
- package/api/components/schemas/index.js +8 -1
- package/api/components/schemas/utils.js +1 -1
- package/api/components/securitySchemes/index.d.ts +1 -0
- package/api/components/securitySchemes/index.js +1 -0
- package/api/components/securitySchemes/webhook.d.ts +2 -0
- package/api/components/securitySchemes/webhook.js +6 -0
- package/api/paths/apps/appId/resources/resourceType/resourceId/positions.js +54 -0
- package/api/paths/apps/appId/secrets/webhook/secretId.js +61 -0
- package/api/paths/apps/appId/secrets/webhook.js +44 -0
- package/api/paths/apps/appId/webhooks/webhookName.js +35 -0
- package/api/paths/apps/appId.js +6 -0
- package/api/paths/auth/email/patchPassword.js +30 -0
- package/api/paths/index.d.ts +7 -5
- package/api/paths/index.js +16 -12
- package/api/paths/trainings/completeTraining.js +18 -0
- package/api/paths/trainings/completedTrainings.d.ts +2 -0
- package/api/paths/trainings/completedTrainings.js +21 -0
- package/api/paths/trainings/trainingIds.d.ts +2 -0
- package/api/paths/trainings/trainingIds.js +20 -0
- package/api/tags/index.js +4 -4
- package/appMessages.js +1 -1
- package/assets.js +1 -1
- package/authorization.d.ts +1 -1
- package/authorization.js +1 -1
- package/blockUtils.d.ts +1 -1
- package/blockUtils.js +1 -0
- package/convertToCsv.js +2 -0
- package/examples.js +214 -4
- package/formatRequestAction.js +2 -2
- package/has.d.ts +1 -1
- package/has.js +1 -1
- package/i18n.js +6 -8
- package/ics.js +1 -1
- package/iterApp.js +3 -3
- package/jsonschema.js +16 -3
- package/package.json +15 -11
- package/reference-schemas/actions/appMember.d.ts +2 -0
- package/reference-schemas/actions/appMember.js +21 -0
- package/reference-schemas/actions/flow.d.ts +2 -0
- package/reference-schemas/actions/flow.js +13 -0
- package/reference-schemas/actions/group.d.ts +2 -0
- package/reference-schemas/actions/group.js +13 -0
- package/reference-schemas/actions/index.d.ts +7 -0
- package/reference-schemas/actions/index.js +8 -0
- package/reference-schemas/actions/link.d.ts +2 -0
- package/reference-schemas/actions/link.js +9 -0
- package/reference-schemas/actions/miscellaneous.d.ts +2 -0
- package/reference-schemas/actions/miscellaneous.js +41 -0
- package/reference-schemas/actions/resources.d.ts +2 -0
- package/reference-schemas/actions/resources.js +19 -0
- package/reference-schemas/actions/storage.d.ts +2 -0
- package/reference-schemas/actions/storage.js +15 -0
- package/reference-schemas/remappers/conditionals.js +39 -0
- package/reference-schemas/remappers/data.js +26 -2
- package/reference-schemas/remappers/index.d.ts +1 -0
- package/reference-schemas/remappers/index.js +1 -0
- package/reference-schemas/remappers/objects.js +32 -0
- package/reference-schemas/remappers/odata.d.ts +2 -0
- package/reference-schemas/remappers/odata.js +95 -0
- package/reference-schemas/remappers/strings.js +33 -0
- package/reference-schemas/remappers/unsorted.js +9 -0
- package/remap.d.ts +2 -0
- package/remap.js +192 -15
- package/serializeResource.d.ts +7 -0
- package/serializeResource.js +7 -0
- package/serverActions.d.ts +1 -1
- package/serverActions.js +2 -0
- package/theme.js +5 -1
- package/validateStyle.js +2 -0
- package/validation.js +52 -16
- package/api/components/parameters/trainingBlockId.d.ts +0 -2
- package/api/components/parameters/trainingBlockId.js +0 -8
- package/api/components/schemas/TrainingBlock.d.ts +0 -2
- package/api/components/schemas/TrainingBlock.js +0 -38
- package/api/components/securitySchemes/cli.test.d.ts +0 -1
- package/api/components/securitySchemes/cli.test.js +0 -7
- package/api/index.test.d.ts +0 -1
- package/api/index.test.js +0 -180
- package/api/paths/trainingBlocks/trainingBlockId.js +0 -41
- package/api/paths/trainings/trainingId/blocks.js +0 -51
- package/api/paths/trainings/trainingId/users/current.js +0 -62
- package/api/paths/trainings/trainingId/users.js +0 -25
- package/api/paths/trainings/trainingId.js +0 -85
- package/api/paths/trainings.js +0 -44
- package/appMessages.test.d.ts +0 -1
- package/appMessages.test.js +0 -409
- package/blockUtils.test.d.ts +0 -1
- package/blockUtils.test.js +0 -77
- package/constants/patterns.test.d.ts +0 -1
- package/constants/patterns.test.js +0 -83
- package/convertToCsv.test.d.ts +0 -1
- package/convertToCsv.test.js +0 -55
- package/has.test.d.ts +0 -1
- package/has.test.js +0 -17
- package/i18n.test.d.ts +0 -1
- package/i18n.test.js +0 -76
- package/iterApp.test.d.ts +0 -1
- package/iterApp.test.js +0 -439
- package/jsonschema.test.d.ts +0 -1
- package/jsonschema.test.js +0 -256
- package/mapValues.test.d.ts +0 -1
- package/mapValues.test.js +0 -16
- package/miscellaneous.test.d.ts +0 -1
- package/miscellaneous.test.js +0 -87
- package/normalize.test.d.ts +0 -1
- package/normalize.test.js +0 -23
- package/objectCache.test.d.ts +0 -1
- package/objectCache.test.js +0 -20
- package/prefix.test.d.ts +0 -1
- package/prefix.test.js +0 -11
- package/remap.test.d.ts +0 -1
- package/remap.test.js +0 -1387
- package/string.test.d.ts +0 -1
- package/string.test.js +0 -27
- package/theme.test.d.ts +0 -1
- package/theme.test.js +0 -91
- package/validateStyle.test.d.ts +0 -1
- package/validateStyle.test.js +0 -13
- package/validation.test.d.ts +0 -1
- package/validation.test.js +0 -3121
- /package/api/paths/{trainingBlocks/trainingBlockId.d.ts → apps/appId/resources/resourceType/resourceId/positions.d.ts} +0 -0
- /package/api/paths/{trainings/trainingId.d.ts → apps/appId/secrets/webhook/secretId.d.ts} +0 -0
- /package/api/paths/{trainings.d.ts → apps/appId/secrets/webhook.d.ts} +0 -0
- /package/api/paths/{trainings/trainingId/blocks.d.ts → apps/appId/webhooks/webhookName.d.ts} +0 -0
- /package/api/paths/{trainings/trainingId/users.d.ts → auth/email/patchPassword.d.ts} +0 -0
- /package/api/paths/trainings/{trainingId/users/current.d.ts → completeTraining.d.ts} +0 -0
package/string.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/string.test.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import { camelToHyphen, decodeJSONRef, toUpperCase } from './string.js';
|
|
3
|
-
describe('camelToHyphen', () => {
|
|
4
|
-
it('should convert camel case to hyphenated', () => {
|
|
5
|
-
const result = camelToHyphen('iAmAString');
|
|
6
|
-
expect(result).toBe('i-am-a-string');
|
|
7
|
-
});
|
|
8
|
-
});
|
|
9
|
-
describe('toUpperCase', () => {
|
|
10
|
-
it('should convert a string to upper case', () => {
|
|
11
|
-
expect(toUpperCase('hello')).toBe('HELLO');
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
describe('decodeJSONRef', () => {
|
|
15
|
-
const tests = [
|
|
16
|
-
['foo~1bar', 'foo/bar'],
|
|
17
|
-
['foo~0bar', 'foo~bar'],
|
|
18
|
-
['foo~0~1bar', 'foo~/bar'],
|
|
19
|
-
['foo~1~0bar', 'foo/~bar'],
|
|
20
|
-
['Record%3Cstring%2Cnumber%3E', 'Record<string,number>'],
|
|
21
|
-
];
|
|
22
|
-
it.each(tests)('%s → %s', (unescaped, escaped) => {
|
|
23
|
-
const result = decodeJSONRef(unescaped);
|
|
24
|
-
expect(result).toBe(escaped);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
//# sourceMappingURL=string.test.js.map
|
package/theme.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/theme.test.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import bulmaPkg from 'bulma/package.json';
|
|
2
|
-
import { describe, expect, it } from 'vitest';
|
|
3
|
-
import { createThemeURL, mergeThemes } from './theme.js';
|
|
4
|
-
describe('mergeThemes', () => {
|
|
5
|
-
it('should use the base theme as default', () => {
|
|
6
|
-
const result = mergeThemes({ primaryColor: '#123456', successColor: '#789abc' });
|
|
7
|
-
expect(result).toStrictEqual({
|
|
8
|
-
dangerColor: '#ff2800',
|
|
9
|
-
font: {
|
|
10
|
-
family: 'Open Sans',
|
|
11
|
-
source: 'google',
|
|
12
|
-
},
|
|
13
|
-
infoColor: '#a7d0ff',
|
|
14
|
-
linkColor: '#0440ad',
|
|
15
|
-
primaryColor: '#123456',
|
|
16
|
-
splashColor: '#ffffff',
|
|
17
|
-
successColor: '#789abc',
|
|
18
|
-
themeColor: '#ffffff',
|
|
19
|
-
tileLayer: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
|
20
|
-
warningColor: '#fed719',
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
it('should fill in the default font source', () => {
|
|
24
|
-
const result = mergeThemes({ font: { family: 'Lato' } });
|
|
25
|
-
expect(result).toStrictEqual({
|
|
26
|
-
dangerColor: '#ff2800',
|
|
27
|
-
font: {
|
|
28
|
-
family: 'Lato',
|
|
29
|
-
source: 'google',
|
|
30
|
-
},
|
|
31
|
-
infoColor: '#a7d0ff',
|
|
32
|
-
linkColor: '#0440ad',
|
|
33
|
-
primaryColor: '#5393ff',
|
|
34
|
-
splashColor: '#ffffff',
|
|
35
|
-
successColor: '#1fd25b',
|
|
36
|
-
themeColor: '#ffffff',
|
|
37
|
-
tileLayer: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
|
38
|
-
warningColor: '#fed719',
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
it('should combine multiple themes', () => {
|
|
42
|
-
const result = mergeThemes({ primaryColor: '#123456', successColor: '#789abc' }, { successColor: '#abcdef' });
|
|
43
|
-
expect(result).toStrictEqual({
|
|
44
|
-
dangerColor: '#ff2800',
|
|
45
|
-
font: {
|
|
46
|
-
family: 'Open Sans',
|
|
47
|
-
source: 'google',
|
|
48
|
-
},
|
|
49
|
-
infoColor: '#a7d0ff',
|
|
50
|
-
linkColor: '#0440ad',
|
|
51
|
-
primaryColor: '#123456',
|
|
52
|
-
splashColor: '#ffffff',
|
|
53
|
-
successColor: '#abcdef',
|
|
54
|
-
themeColor: '#ffffff',
|
|
55
|
-
tileLayer: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
|
56
|
-
warningColor: '#fed719',
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
describe('createThemeURL', () => {
|
|
61
|
-
it('should create the URL of a theme including correct query parameters and bulma version', () => {
|
|
62
|
-
const result = createThemeURL({
|
|
63
|
-
dangerColor: '#ff2800',
|
|
64
|
-
font: {
|
|
65
|
-
family: 'Open Sans',
|
|
66
|
-
source: 'google',
|
|
67
|
-
},
|
|
68
|
-
infoColor: '#a7d0ff',
|
|
69
|
-
linkColor: '#0440ad',
|
|
70
|
-
primaryColor: '#123456',
|
|
71
|
-
splashColor: '#ffffff',
|
|
72
|
-
successColor: '#abcdef',
|
|
73
|
-
themeColor: '#ffffff',
|
|
74
|
-
tileLayer: 'https://example.com',
|
|
75
|
-
warningColor: '#fed719',
|
|
76
|
-
});
|
|
77
|
-
expect(result).toBe(`/bulma/${bulmaPkg.version}/bulma.min.css` +
|
|
78
|
-
'?dangerColor=%23ff2800' +
|
|
79
|
-
'&fontFamily=Open+Sans' +
|
|
80
|
-
'&fontSource=google' +
|
|
81
|
-
'&infoColor=%23a7d0ff' +
|
|
82
|
-
'&linkColor=%230440ad' +
|
|
83
|
-
'&primaryColor=%23123456' +
|
|
84
|
-
'&splashColor=%23ffffff' +
|
|
85
|
-
'&successColor=%23abcdef' +
|
|
86
|
-
'&themeColor=%23ffffff' +
|
|
87
|
-
'&tileLayer=https%3A%2F%2Fexample.com' +
|
|
88
|
-
'&warningColor=%23fed719');
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
//# sourceMappingURL=theme.test.js.map
|
package/validateStyle.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/validateStyle.test.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import { StyleValidationError, validateStyle } from './validateStyle.js';
|
|
3
|
-
describe('validateStyle', () => {
|
|
4
|
-
it('should validate correct CSS', () => {
|
|
5
|
-
const css = 'body { background-color: red; }';
|
|
6
|
-
const validatedCss = validateStyle(css);
|
|
7
|
-
expect(validatedCss).toStrictEqual(css);
|
|
8
|
-
});
|
|
9
|
-
it('should throw a CssValidationError when validating incorrect CSS', () => {
|
|
10
|
-
expect(() => validateStyle("this isn't valid")).toThrow(StyleValidationError);
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=validateStyle.test.js.map
|
package/validation.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|