@lowdefy/engine 3.23.1 → 4.0.0-alpha.1
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.js +221 -310
- package/dist/Blocks.js +577 -607
- package/dist/Events.js +120 -162
- package/dist/Requests.js +110 -144
- package/dist/State.js +55 -81
- package/dist/actions/CallMethod.js +20 -39
- package/dist/actions/JsAction.js +50 -72
- package/dist/actions/Link.js +22 -33
- package/dist/actions/Login.js +3 -28
- package/dist/actions/Logout.js +3 -27
- package/dist/actions/Message.js +9 -22
- package/dist/actions/Request.js +21 -63
- package/dist/actions/Reset.js +6 -20
- package/dist/actions/ResetValidation.js +18 -31
- package/dist/actions/ScrollTo.js +8 -34
- package/dist/actions/SetGlobal.js +18 -30
- package/dist/actions/SetState.js +18 -30
- package/dist/actions/Throw.js +25 -52
- package/dist/actions/Validate.js +20 -34
- package/dist/actions/Wait.js +21 -32
- package/dist/actions/index.js +31 -57
- package/dist/createLink.js +29 -59
- package/dist/getBlockMatcher.js +46 -58
- package/dist/getContext.js +100 -142
- package/dist/getFieldValues.js +18 -32
- package/dist/index.js +9 -70
- package/package.json +12 -13
- package/dist/makeContextId.js +0 -44
package/dist/getBlockMatcher.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _helpers = require("@lowdefy/helpers");
|
|
9
|
-
|
|
10
1
|
/*
|
|
11
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
12
3
|
|
|
@@ -21,55 +12,52 @@ var _helpers = require("@lowdefy/helpers");
|
|
|
21
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
13
|
See the License for the specific language governing permissions and
|
|
23
14
|
limitations under the License.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (_helpers.type.isArray(testParams) || _helpers.type.isBoolean(testParams)) {
|
|
36
|
-
testParams = {
|
|
37
|
-
blockIds: testParams
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (!_helpers.type.isObject(testParams)) {
|
|
42
|
-
throw new Error('Invalid validate params.');
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (_helpers.type.isString(testParams.blockIds)) {
|
|
46
|
-
testParams.blockIds = [testParams.blockIds];
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (_helpers.type.isString(testParams.regex)) {
|
|
50
|
-
testParams.regex = [testParams.regex];
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (_helpers.type.isArray(testParams.regex)) {
|
|
54
|
-
testParams.regex = testParams.regex.map(regex => new RegExp(regex));
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return id => {
|
|
58
|
-
if (testParams.blockIds === true || _helpers.type.isArray(testParams.blockIds) && testParams.blockIds.includes(id)) {
|
|
59
|
-
return true;
|
|
15
|
+
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
+
const getBlockMatcher = (params)=>{
|
|
17
|
+
let testParams = params;
|
|
18
|
+
if (type.isNone(testParams)) return ()=>true
|
|
19
|
+
;
|
|
20
|
+
if (type.isString(testParams)) {
|
|
21
|
+
testParams = {
|
|
22
|
+
blockIds: [
|
|
23
|
+
testParams
|
|
24
|
+
]
|
|
25
|
+
};
|
|
60
26
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return true;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
27
|
+
if (type.isArray(testParams) || type.isBoolean(testParams)) {
|
|
28
|
+
testParams = {
|
|
29
|
+
blockIds: testParams
|
|
30
|
+
};
|
|
68
31
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
32
|
+
if (!type.isObject(testParams)) {
|
|
33
|
+
throw new Error('Invalid validate params.');
|
|
34
|
+
}
|
|
35
|
+
if (type.isString(testParams.blockIds)) {
|
|
36
|
+
testParams.blockIds = [
|
|
37
|
+
testParams.blockIds
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
if (type.isString(testParams.regex)) {
|
|
41
|
+
testParams.regex = [
|
|
42
|
+
testParams.regex
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
if (type.isArray(testParams.regex)) {
|
|
46
|
+
testParams.regex = testParams.regex.map((regex)=>new RegExp(regex)
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
return (id)=>{
|
|
50
|
+
if (testParams.blockIds === true || type.isArray(testParams.blockIds) && testParams.blockIds.includes(id)) {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
if (type.isArray(testParams.regex)) {
|
|
54
|
+
for (const regex of testParams.regex){
|
|
55
|
+
if (regex.test(id)) {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
};
|
|
72
62
|
};
|
|
73
|
-
|
|
74
|
-
var _default = getBlockMatcher;
|
|
75
|
-
exports.default = _default;
|
|
63
|
+
export default getBlockMatcher;
|
package/dist/getContext.js
CHANGED
|
@@ -1,151 +1,109 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} = _ref;
|
|
44
|
-
return {
|
|
45
|
-
areas,
|
|
46
|
-
blockId,
|
|
47
|
-
blocks,
|
|
48
|
-
events,
|
|
49
|
-
field,
|
|
50
|
-
id,
|
|
51
|
-
layout,
|
|
52
|
-
meta,
|
|
53
|
-
operators,
|
|
54
|
-
pageId,
|
|
55
|
-
properties,
|
|
56
|
-
requests,
|
|
57
|
-
required,
|
|
58
|
-
style,
|
|
59
|
-
type,
|
|
60
|
-
validate,
|
|
61
|
-
visible
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
var getContext = /*#__PURE__*/function () {
|
|
66
|
-
var _ref3 = _asyncToGenerator(function* (_ref2) {
|
|
67
|
-
var {
|
|
68
|
-
block,
|
|
69
|
-
contextId,
|
|
70
|
-
lowdefy
|
|
71
|
-
} = _ref2;
|
|
72
|
-
|
|
73
|
-
if (lowdefy.contexts[contextId]) {
|
|
74
|
-
lowdefy.contexts[contextId].update();
|
|
75
|
-
return lowdefy.contexts[contextId];
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2021 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 { WebParser } from '@lowdefy/operators';
|
|
16
|
+
import Actions from './Actions.js';
|
|
17
|
+
import Blocks from './Blocks.js';
|
|
18
|
+
import Requests from './Requests.js';
|
|
19
|
+
import State from './State.js';
|
|
20
|
+
const blockData = ({ areas , blockId , blocks , events , field , id , layout , meta , operators , pageId , properties , requests , required , style , type , validate , visible , })=>({
|
|
21
|
+
areas,
|
|
22
|
+
blockId,
|
|
23
|
+
blocks,
|
|
24
|
+
events,
|
|
25
|
+
field,
|
|
26
|
+
id,
|
|
27
|
+
layout,
|
|
28
|
+
meta,
|
|
29
|
+
operators,
|
|
30
|
+
pageId,
|
|
31
|
+
properties,
|
|
32
|
+
requests,
|
|
33
|
+
required,
|
|
34
|
+
style,
|
|
35
|
+
type,
|
|
36
|
+
validate,
|
|
37
|
+
visible
|
|
38
|
+
})
|
|
39
|
+
;
|
|
40
|
+
async function getContext({ config , lowdefy }) {
|
|
41
|
+
if (!config) {
|
|
42
|
+
throw new Error('A page must be provided to get context.');
|
|
76
43
|
}
|
|
77
|
-
|
|
78
|
-
if (
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (!lowdefy.inputs[contextId]) {
|
|
84
|
-
lowdefy.inputs[contextId] = {};
|
|
44
|
+
const { id } = config;
|
|
45
|
+
if (lowdefy.contexts[id]) {
|
|
46
|
+
lowdefy.contexts[id]._internal.update();
|
|
47
|
+
return lowdefy.contexts[id];
|
|
85
48
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
49
|
+
if (!lowdefy.inputs[id]) {
|
|
50
|
+
lowdefy.inputs[id] = {
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
const operatorsSet = new Set([
|
|
54
|
+
...config.operators,
|
|
55
|
+
'_not',
|
|
56
|
+
'_type'
|
|
57
|
+
]);
|
|
58
|
+
const ctx = {
|
|
59
|
+
id: id,
|
|
60
|
+
pageId: config.pageId,
|
|
61
|
+
eventLog: [],
|
|
62
|
+
requests: {
|
|
63
|
+
},
|
|
64
|
+
state: {
|
|
65
|
+
},
|
|
66
|
+
_internal: {
|
|
67
|
+
lowdefy,
|
|
68
|
+
operators: [
|
|
69
|
+
...operatorsSet
|
|
70
|
+
],
|
|
71
|
+
rootBlock: blockData(config),
|
|
72
|
+
update: ()=>{
|
|
73
|
+
}
|
|
74
|
+
}
|
|
102
75
|
};
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
contexts: lowdefy.contexts
|
|
76
|
+
const _internal = ctx._internal;
|
|
77
|
+
_internal.parser = new WebParser({
|
|
78
|
+
context: ctx
|
|
107
79
|
});
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
80
|
+
await _internal.parser.init();
|
|
81
|
+
_internal.State = new State(ctx);
|
|
82
|
+
_internal.Actions = new Actions(ctx);
|
|
83
|
+
_internal.Requests = new Requests(ctx);
|
|
84
|
+
_internal.RootBlocks = new Blocks({
|
|
85
|
+
areas: {
|
|
86
|
+
root: {
|
|
87
|
+
blocks: [
|
|
88
|
+
_internal.rootBlock
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
context: ctx
|
|
119
93
|
});
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
ctx.RootBlocks.update();
|
|
124
|
-
[...ctx.updateListeners].forEach(listenId => {
|
|
125
|
-
// Will loop infinitely if update is called on self
|
|
126
|
-
if (!lowdefy.contexts[listenId] || listenId === contextId) {
|
|
127
|
-
ctx.updateListeners.delete(listenId);
|
|
128
|
-
} else {
|
|
129
|
-
lowdefy.contexts[listenId].update();
|
|
130
|
-
}
|
|
131
|
-
});
|
|
94
|
+
_internal.RootBlocks.init();
|
|
95
|
+
_internal.update = ()=>{
|
|
96
|
+
_internal.RootBlocks.update();
|
|
132
97
|
};
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
name: 'onInit'
|
|
98
|
+
await _internal.RootBlocks.map[ctx.id].triggerEvent({
|
|
99
|
+
name: 'onInit'
|
|
136
100
|
});
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
101
|
+
_internal.update();
|
|
102
|
+
_internal.State.freezeState();
|
|
103
|
+
_internal.RootBlocks.map[ctx.id].triggerEvent({
|
|
104
|
+
name: 'onInitAsync'
|
|
141
105
|
});
|
|
106
|
+
lowdefy.contexts[id] = ctx;
|
|
142
107
|
return ctx;
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
return function getContext(_x) {
|
|
146
|
-
return _ref3.apply(this, arguments);
|
|
147
|
-
};
|
|
148
|
-
}();
|
|
149
|
-
|
|
150
|
-
var _default = getContext;
|
|
151
|
-
exports.default = _default;
|
|
108
|
+
}
|
|
109
|
+
export default getContext;
|
package/dist/getFieldValues.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _helpers = require("@lowdefy/helpers");
|
|
9
|
-
|
|
10
1
|
/*
|
|
11
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
12
3
|
|
|
@@ -21,29 +12,24 @@ var _helpers = require("@lowdefy/helpers");
|
|
|
21
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
13
|
See the License for the specific language governing permissions and
|
|
23
14
|
limitations under the License.
|
|
24
|
-
*/
|
|
25
|
-
function getFieldValues(operatorName) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
15
|
+
*/ import { serializer } from '@lowdefy/helpers';
|
|
16
|
+
function getFieldValues(operatorName, ...args) {
|
|
17
|
+
const result = new Set();
|
|
18
|
+
function reviver(key, value) {
|
|
19
|
+
if (key === operatorName) {
|
|
20
|
+
result.add(value);
|
|
21
|
+
}
|
|
22
|
+
return value;
|
|
31
23
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
[...args].forEach(element => {
|
|
41
|
-
_helpers.serializer.deserializeFromString(_helpers.serializer.serializeToString(element), {
|
|
42
|
-
reviver
|
|
24
|
+
[
|
|
25
|
+
...args
|
|
26
|
+
].forEach((element)=>{
|
|
27
|
+
serializer.deserializeFromString(serializer.serializeToString(element), {
|
|
28
|
+
reviver
|
|
29
|
+
});
|
|
43
30
|
});
|
|
44
|
-
|
|
45
|
-
|
|
31
|
+
return [
|
|
32
|
+
...result
|
|
33
|
+
];
|
|
46
34
|
}
|
|
47
|
-
|
|
48
|
-
var _default = getFieldValues;
|
|
49
|
-
exports.default = _default;
|
|
35
|
+
export default getFieldValues;
|
package/dist/index.js
CHANGED
|
@@ -1,70 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "Actions", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _Actions.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "Events", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _Events.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "Blocks", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _Blocks.default;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "createLink", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _createLink.default;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "makeContextId", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function get() {
|
|
33
|
-
return _makeContextId.default;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "Requests", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function get() {
|
|
39
|
-
return _Requests.default;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
Object.defineProperty(exports, "State", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function get() {
|
|
45
|
-
return _State.default;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
exports.default = void 0;
|
|
49
|
-
|
|
50
|
-
var _Actions = _interopRequireDefault(require("./Actions"));
|
|
51
|
-
|
|
52
|
-
var _Events = _interopRequireDefault(require("./Events"));
|
|
53
|
-
|
|
54
|
-
var _Blocks = _interopRequireDefault(require("./Blocks"));
|
|
55
|
-
|
|
56
|
-
var _createLink = _interopRequireDefault(require("./createLink"));
|
|
57
|
-
|
|
58
|
-
var _makeContextId = _interopRequireDefault(require("./makeContextId"));
|
|
59
|
-
|
|
60
|
-
var _Requests = _interopRequireDefault(require("./Requests"));
|
|
61
|
-
|
|
62
|
-
var _State = _interopRequireDefault(require("./State"));
|
|
63
|
-
|
|
64
|
-
var _getContext = _interopRequireDefault(require("./getContext"));
|
|
65
|
-
|
|
66
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
67
|
-
|
|
68
1
|
/*
|
|
69
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
70
3
|
|
|
@@ -79,6 +12,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
79
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
80
13
|
See the License for the specific language governing permissions and
|
|
81
14
|
limitations under the License.
|
|
82
|
-
*/
|
|
83
|
-
|
|
84
|
-
|
|
15
|
+
*/ import Actions from './Actions.js';
|
|
16
|
+
import Events from './Events.js';
|
|
17
|
+
import Blocks from './Blocks.js';
|
|
18
|
+
import createLink from './createLink.js';
|
|
19
|
+
import Requests from './Requests.js';
|
|
20
|
+
import State from './State.js';
|
|
21
|
+
import getContext from './getContext.js';
|
|
22
|
+
export { Actions, Events, Blocks, createLink, Requests, State };
|
|
23
|
+
export default getContext;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/engine",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.1",
|
|
4
4
|
"licence": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -24,32 +24,31 @@
|
|
|
24
24
|
"type": "git",
|
|
25
25
|
"url": "https://github.com/lowdefy/lowdefy.git"
|
|
26
26
|
},
|
|
27
|
-
"
|
|
27
|
+
"type": "module",
|
|
28
|
+
"exports": "./dist/index.js",
|
|
28
29
|
"files": [
|
|
29
30
|
"dist/*"
|
|
30
31
|
],
|
|
31
32
|
"scripts": {
|
|
32
|
-
"build": "
|
|
33
|
+
"build": "yarn swc",
|
|
33
34
|
"clean": "rm -rf dist",
|
|
34
35
|
"prepare": "yarn build",
|
|
36
|
+
"swc": "swc src --out-dir dist --config-file ../../.swcrc --delete-dir-on-start",
|
|
35
37
|
"test:watch": "jest --coverage --watch",
|
|
36
38
|
"test": "jest --coverage"
|
|
37
39
|
},
|
|
38
40
|
"dependencies": {
|
|
39
|
-
"@lowdefy/helpers": "
|
|
40
|
-
"@lowdefy/operators": "
|
|
41
|
-
"graphql": "15.5.0",
|
|
42
|
-
"graphql-tag": "2.12.4"
|
|
41
|
+
"@lowdefy/helpers": "4.0.0-alpha.1",
|
|
42
|
+
"@lowdefy/operators": "4.0.0-alpha.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@
|
|
46
|
-
"@
|
|
47
|
-
"@
|
|
48
|
-
"
|
|
49
|
-
"jest": "26.6.3"
|
|
45
|
+
"@swc/cli": "0.1.52",
|
|
46
|
+
"@swc/core": "1.2.112",
|
|
47
|
+
"@swc/jest": "0.2.9",
|
|
48
|
+
"jest": "27.3.1"
|
|
50
49
|
},
|
|
51
50
|
"publishConfig": {
|
|
52
51
|
"access": "public"
|
|
53
52
|
},
|
|
54
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "c97a8fa6b5a641e7d50df09f5601a9c586eeb65a"
|
|
55
54
|
}
|
package/dist/makeContextId.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _helpers = require("@lowdefy/helpers");
|
|
9
|
-
|
|
10
|
-
/*
|
|
11
|
-
Copyright 2020-2021 Lowdefy, Inc
|
|
12
|
-
|
|
13
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
-
you may not use this file except in compliance with the License.
|
|
15
|
-
You may obtain a copy of the License at
|
|
16
|
-
|
|
17
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
-
|
|
19
|
-
Unless required by applicable law or agreed to in writing, software
|
|
20
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
-
See the License for the specific language governing permissions and
|
|
23
|
-
limitations under the License.
|
|
24
|
-
*/
|
|
25
|
-
function makeContextId(_ref) {
|
|
26
|
-
var {
|
|
27
|
-
blockId,
|
|
28
|
-
pageId,
|
|
29
|
-
urlQuery = {}
|
|
30
|
-
} = _ref;
|
|
31
|
-
|
|
32
|
-
if (!_helpers.type.isString(blockId)) {
|
|
33
|
-
throw new Error("Expected string for parameter blockId, received ".concat(blockId));
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (!_helpers.type.isString(pageId)) {
|
|
37
|
-
throw new Error("Expected string for parameter pageId, received ".concat(pageId));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return "".concat(pageId, ":").concat(blockId, ":").concat(_helpers.serializer.serializeToString(urlQuery));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
var _default = makeContextId;
|
|
44
|
-
exports.default = _default;
|