@appsemble/utils 0.20.34 → 0.20.35

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,10 +1,10 @@
1
- # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.20.34/config/assets/logo.svg) Appsemble Utilities
1
+ # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.20.35/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.20.34/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.20.34)
7
- [![Code coverage](https://codecov.io/gl/appsemble/appsemble/branch/0.20.34/graph/badge.svg)](https://codecov.io/gl/appsemble/appsemble)
6
+ [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.20.35/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.20.35)
7
+ [![Code coverage](https://codecov.io/gl/appsemble/appsemble/branch/0.20.35/graph/badge.svg)](https://codecov.io/gl/appsemble/appsemble)
8
8
  [![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://prettier.io)
9
9
 
10
10
  ## Installation
@@ -21,5 +21,5 @@ not guaranteed.
21
21
 
22
22
  ## License
23
23
 
24
- [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.20.34/LICENSE.md) ©
24
+ [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.20.35/LICENSE.md) ©
25
25
  [Appsemble](https://appsemble.com)
@@ -56,6 +56,7 @@ export const ActionDefinition = {
56
56
  { $ref: '#/components/schemas/ResourceSubscriptionToggleActionDefinition' },
57
57
  { $ref: '#/components/schemas/ResourceSubscriptionUnsubscribeActionDefinition' },
58
58
  { $ref: '#/components/schemas/ResourceUpdateActionDefinition' },
59
+ { $ref: '#/components/schemas/ResourcePatchActionDefinition' },
59
60
  { $ref: '#/components/schemas/ShareActionDefinition' },
60
61
  { $ref: '#/components/schemas/StaticActionDefinition' },
61
62
  { $ref: '#/components/schemas/StorageAppendActionDefinition' },
@@ -13,6 +13,10 @@ The actions are run in parallel.
13
13
 
14
14
  If the input is not an array, the action will be applied to the input instead.`,
15
15
  },
16
+ serial: {
17
+ description: 'Runs the action in series instead of parallel',
18
+ type: 'boolean',
19
+ },
16
20
  do: {
17
21
  description: 'This action is called for each item in the input array.',
18
22
  $ref: '#/components/schemas/ActionDefinition',
@@ -91,7 +91,27 @@ If the input is not an array an empty array is returned.`,
91
91
  },
92
92
  'date.parse': {
93
93
  type: 'string',
94
- description: 'Convert a string to a date using a given format.',
94
+ description: `Convert a string to a date using a given format.
95
+
96
+ For example:
97
+ \`\`\`yaml
98
+ - static: 02/11/2014 # The date string to parse
99
+ - date.parse: MM/dd/yyyy # The given format to parse the date with
100
+ # => Tue Feb 11 2014 00:00:00
101
+ \`\`\`
102
+
103
+ See [date-fns](https://date-fns.org/v2.29.3/docs/parse) for the supported formats.
104
+
105
+ Leaving the format empty will try to parse the date using the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
106
+ For example:
107
+ \`\`\`yaml
108
+ date.parse:
109
+ - static: 2014-02-11T11:30:30 # The date string to parse
110
+ - date.parse: '' # The given format to parse the date with
111
+ # => Tue Feb 11 2014 11:30:30
112
+ \`\`\`
113
+
114
+ `,
95
115
  },
96
116
  equals: {
97
117
  type: 'array',
@@ -0,0 +1 @@
1
+ export declare const ResourcePatchActionDefinition: import("openapi-types").OpenAPIV3.SchemaObject;
@@ -0,0 +1,18 @@
1
+ import { RequestActionDefinition } from './RequestActionDefinition.js';
2
+ import { extendJSONSchema } from './utils.js';
3
+ export const ResourcePatchActionDefinition = extendJSONSchema(RequestActionDefinition, {
4
+ type: 'object',
5
+ additionalProperties: false,
6
+ required: ['type', 'resource'],
7
+ properties: {
8
+ type: {
9
+ enum: ['resource.patch'],
10
+ description: 'Patch a resource.',
11
+ },
12
+ resource: {
13
+ type: 'string',
14
+ description: 'The type of the resource to patch.',
15
+ },
16
+ },
17
+ }, ['url']);
18
+ //# sourceMappingURL=ResourcePatchActionDefinition.js.map
@@ -80,6 +80,7 @@ export * from './ResourceSubscriptionSubscribeActionDefinition.js';
80
80
  export * from './ResourceSubscriptionToggleActionDefinition.js';
81
81
  export * from './ResourceSubscriptionUnsubscribeActionDefinition.js';
82
82
  export * from './ResourceUpdateActionDefinition.js';
83
+ export * from './ResourcePatchActionDefinition.js';
83
84
  export * from './ResourceViewDefinition.js';
84
85
  export * from './SecurityDefaultDefinition.js';
85
86
  export * from './SecurityDefinition.js';
@@ -80,6 +80,7 @@ export * from './ResourceSubscriptionSubscribeActionDefinition.js';
80
80
  export * from './ResourceSubscriptionToggleActionDefinition.js';
81
81
  export * from './ResourceSubscriptionUnsubscribeActionDefinition.js';
82
82
  export * from './ResourceUpdateActionDefinition.js';
83
+ export * from './ResourcePatchActionDefinition.js';
83
84
  export * from './ResourceViewDefinition.js';
84
85
  export * from './SecurityDefaultDefinition.js';
85
86
  export * from './SecurityDefinition.js';
@@ -257,6 +257,22 @@ export const paths = {
257
257
  },
258
258
  security: [{ studio: [] }, { app: ['resources:manage'] }, { cli: ['resources:write'] }, {}],
259
259
  },
260
+ patch: {
261
+ tags: ['resource'],
262
+ description: 'Patch an existing app resource.',
263
+ operationId: 'patchResource',
264
+ requestBody: {
265
+ required: true,
266
+ $ref: '#/components/requestBodies/resource',
267
+ },
268
+ responses: {
269
+ 200: {
270
+ description: 'The patched resource.',
271
+ $ref: '#/components/responses/resource',
272
+ },
273
+ },
274
+ security: [{ studio: [] }, { app: ['resources:manage'] }, { cli: ['resources:write'] }, {}],
275
+ },
260
276
  delete: {
261
277
  tags: ['resource'],
262
278
  description: 'Delete an existing app resource.',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appsemble/utils",
3
- "version": "0.20.34",
3
+ "version": "0.20.35",
4
4
  "description": "Utility functions used in Appsemble internally",
5
5
  "keywords": [
6
6
  "app",
@@ -31,7 +31,7 @@
31
31
  "test": "NODE_OPTIONS=--experimental-vm-modules jest"
32
32
  },
33
33
  "dependencies": {
34
- "@appsemble/types": "0.20.34",
34
+ "@appsemble/types": "0.20.35",
35
35
  "axios": "^1.0.0",
36
36
  "cron-parser": "^4.0.0",
37
37
  "date-fns": "^2.0.0",