@lowdefy/actions-core 5.6.0 → 6.0.0
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/dist/actions/Link/schema.js +8 -0
- package/dist/actions/Publish/Publish.js +25 -0
- package/dist/actions/Publish/schema.js +31 -0
- package/dist/actions/Subscribe/Subscribe.js +25 -0
- package/dist/actions/Subscribe/schema.js +38 -0
- package/dist/actions/Unsubscribe/Unsubscribe.js +25 -0
- package/dist/actions/Unsubscribe/schema.js +38 -0
- package/dist/actions.js +3 -0
- package/dist/schemas.js +3 -0
- package/dist/types.js +3 -0
- package/package.json +6 -6
|
@@ -29,6 +29,14 @@ export default {
|
|
|
29
29
|
input: {
|
|
30
30
|
type: 'object',
|
|
31
31
|
description: 'Input to pass to the linked page.'
|
|
32
|
+
},
|
|
33
|
+
replace: {
|
|
34
|
+
type: 'boolean',
|
|
35
|
+
description: 'Replace the current history entry instead of pushing a new one.'
|
|
36
|
+
},
|
|
37
|
+
scroll: {
|
|
38
|
+
type: 'boolean',
|
|
39
|
+
description: 'Scroll to the top of the page after navigating. Defaults to true.'
|
|
32
40
|
}
|
|
33
41
|
}
|
|
34
42
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
+
function Publish({ methods: { publish }, params }) {
|
|
17
|
+
if (!type.isObject(params) || !type.isString(params.websocketId)) {
|
|
18
|
+
throw new Error('Publish requires a "websocketId" property.');
|
|
19
|
+
}
|
|
20
|
+
return publish({
|
|
21
|
+
payload: params.payload,
|
|
22
|
+
websocketId: params.websocketId
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export default Publish;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ export default {
|
|
16
|
+
type: 'object',
|
|
17
|
+
params: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
description: 'Publish a message to a websocket channel.',
|
|
20
|
+
properties: {
|
|
21
|
+
websocketId: {
|
|
22
|
+
type: 'string'
|
|
23
|
+
},
|
|
24
|
+
payload: {}
|
|
25
|
+
},
|
|
26
|
+
required: [
|
|
27
|
+
'websocketId'
|
|
28
|
+
],
|
|
29
|
+
additionalProperties: false
|
|
30
|
+
}
|
|
31
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
+
function Subscribe({ methods: { subscribe }, params }) {
|
|
17
|
+
const websocketId = type.isObject(params) ? params.websocketId : params;
|
|
18
|
+
if (!type.isString(websocketId)) {
|
|
19
|
+
throw new Error('Subscribe requires a "websocketId" property.');
|
|
20
|
+
}
|
|
21
|
+
return subscribe({
|
|
22
|
+
websocketId
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export default Subscribe;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ export default {
|
|
16
|
+
type: 'object',
|
|
17
|
+
params: {
|
|
18
|
+
anyOf: [
|
|
19
|
+
{
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: 'The websocket id to subscribe to.'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
type: 'object',
|
|
25
|
+
properties: {
|
|
26
|
+
websocketId: {
|
|
27
|
+
type: 'string'
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
required: [
|
|
31
|
+
'websocketId'
|
|
32
|
+
],
|
|
33
|
+
additionalProperties: false
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
description: 'Subscribe to a websocket channel.'
|
|
37
|
+
}
|
|
38
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
+
function Unsubscribe({ methods: { unsubscribe }, params }) {
|
|
17
|
+
const websocketId = type.isObject(params) ? params.websocketId : params;
|
|
18
|
+
if (!type.isString(websocketId)) {
|
|
19
|
+
throw new Error('Unsubscribe requires a "websocketId" property.');
|
|
20
|
+
}
|
|
21
|
+
return unsubscribe({
|
|
22
|
+
websocketId
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export default Unsubscribe;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ export default {
|
|
16
|
+
type: 'object',
|
|
17
|
+
params: {
|
|
18
|
+
anyOf: [
|
|
19
|
+
{
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: 'The websocket id to unsubscribe from.'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
type: 'object',
|
|
25
|
+
properties: {
|
|
26
|
+
websocketId: {
|
|
27
|
+
type: 'string'
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
required: [
|
|
31
|
+
'websocketId'
|
|
32
|
+
],
|
|
33
|
+
additionalProperties: false
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
description: 'Unsubscribe from a websocket channel.'
|
|
37
|
+
}
|
|
38
|
+
};
|
package/dist/actions.js
CHANGED
|
@@ -21,6 +21,7 @@ export { default as GeolocationCurrentPosition } from './actions/GeolocationCurr
|
|
|
21
21
|
export { default as Link } from './actions/Link/Link.js';
|
|
22
22
|
export { default as Login } from './actions/Login/Login.js';
|
|
23
23
|
export { default as Logout } from './actions/Logout/Logout.js';
|
|
24
|
+
export { default as Publish } from './actions/Publish/Publish.js';
|
|
24
25
|
export { default as Request } from './actions/Request/Request.js';
|
|
25
26
|
export { default as Reset } from './actions/Reset/Reset.js';
|
|
26
27
|
export { default as ResetValidation } from './actions/ResetValidation/ResetValidation.js';
|
|
@@ -30,7 +31,9 @@ export { default as SetFocus } from './actions/SetFocus/SetFocus.js';
|
|
|
30
31
|
export { default as SetGlobal } from './actions/SetGlobal/SetGlobal.js';
|
|
31
32
|
export { default as SetLocale } from './actions/SetLocale/SetLocale.js';
|
|
32
33
|
export { default as SetState } from './actions/SetState/SetState.js';
|
|
34
|
+
export { default as Subscribe } from './actions/Subscribe/Subscribe.js';
|
|
33
35
|
export { default as Throw } from './actions/Throw/Throw.js';
|
|
36
|
+
export { default as Unsubscribe } from './actions/Unsubscribe/Unsubscribe.js';
|
|
34
37
|
export { default as UpdateSession } from './actions/UpdateSession/UpdateSession.js';
|
|
35
38
|
export { default as Validate } from './actions/Validate/Validate.js';
|
|
36
39
|
export { default as Wait } from './actions/Wait/Wait.js';
|
package/dist/schemas.js
CHANGED
|
@@ -21,6 +21,7 @@ export { default as GeolocationCurrentPosition } from './actions/GeolocationCurr
|
|
|
21
21
|
export { default as Link } from './actions/Link/schema.js';
|
|
22
22
|
export { default as Login } from './actions/Login/schema.js';
|
|
23
23
|
export { default as Logout } from './actions/Logout/schema.js';
|
|
24
|
+
export { default as Publish } from './actions/Publish/schema.js';
|
|
24
25
|
export { default as Request } from './actions/Request/schema.js';
|
|
25
26
|
export { default as Reset } from './actions/Reset/schema.js';
|
|
26
27
|
export { default as ResetValidation } from './actions/ResetValidation/schema.js';
|
|
@@ -30,7 +31,9 @@ export { default as SetFocus } from './actions/SetFocus/schema.js';
|
|
|
30
31
|
export { default as SetGlobal } from './actions/SetGlobal/schema.js';
|
|
31
32
|
export { default as SetLocale } from './actions/SetLocale/schema.js';
|
|
32
33
|
export { default as SetState } from './actions/SetState/schema.js';
|
|
34
|
+
export { default as Subscribe } from './actions/Subscribe/schema.js';
|
|
33
35
|
export { default as Throw } from './actions/Throw/schema.js';
|
|
36
|
+
export { default as Unsubscribe } from './actions/Unsubscribe/schema.js';
|
|
34
37
|
export { default as UpdateSession } from './actions/UpdateSession/schema.js';
|
|
35
38
|
export { default as Validate } from './actions/Validate/schema.js';
|
|
36
39
|
export { default as Wait } from './actions/Wait/schema.js';
|
package/dist/types.js
CHANGED
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
'Link',
|
|
24
24
|
'Login',
|
|
25
25
|
'Logout',
|
|
26
|
+
'Publish',
|
|
26
27
|
'Request',
|
|
27
28
|
'Reset',
|
|
28
29
|
'ResetValidation',
|
|
@@ -32,7 +33,9 @@
|
|
|
32
33
|
'SetGlobal',
|
|
33
34
|
'SetLocale',
|
|
34
35
|
'SetState',
|
|
36
|
+
'Subscribe',
|
|
35
37
|
'Throw',
|
|
38
|
+
'Unsubscribe',
|
|
36
39
|
'UpdateSession',
|
|
37
40
|
'Validate',
|
|
38
41
|
'Wait'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/actions-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
"dist/*"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@lowdefy/errors": "
|
|
48
|
-
"@lowdefy/helpers": "
|
|
47
|
+
"@lowdefy/errors": "6.0.0",
|
|
48
|
+
"@lowdefy/helpers": "6.0.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@jest/globals": "28.1.3",
|
|
52
|
-
"@lowdefy/node-utils": "
|
|
53
|
-
"@swc/cli": "0.8.
|
|
54
|
-
"@swc/core": "1.15.
|
|
52
|
+
"@lowdefy/node-utils": "6.0.0",
|
|
53
|
+
"@swc/cli": "0.8.1",
|
|
54
|
+
"@swc/core": "1.15.32",
|
|
55
55
|
"@swc/jest": "0.2.39",
|
|
56
56
|
"jest": "28.1.3",
|
|
57
57
|
"jest-environment-jsdom": "28.1.3"
|