scjson 0.2.1 → 0.3.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/README.md +189 -3
- package/bin/scjson.js +1 -1
- package/dist/browser.cjs +12 -0
- package/dist/browser.d.cts +2 -0
- package/dist/browser.d.mts +6 -0
- package/dist/browser.mjs +12 -0
- package/dist/converters.d.ts +191 -0
- package/dist/converters.js +1133 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +236 -0
- package/{types → dist}/scjsonProps.d.ts +92 -226
- package/dist/scjsonProps.js +309 -0
- package/package.json +31 -56
- package/scjson.schema.json +160 -13
- package/browser.cjs +0 -243
- package/browser.mjs +0 -92
- package/index.js +0 -243
- package/scjsonProps.ts +0 -721
- package/tests/cli.test.js +0 -172
- package/types/scjson-browser.d.ts +0 -25
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Agent Name: ts-props
|
|
4
|
+
*
|
|
5
|
+
* Part of the scjson project.
|
|
6
|
+
* Developed by Softoboros Technology Inc.
|
|
7
|
+
* Licensed under the BSD 1-Clause License.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.TransitionTypeDatatypeProps = exports.defaultTransition = exports.defaultState = exports.defaultSend = exports.defaultScxml = exports.defaultScript = exports.defaultRaise = exports.defaultParam = exports.defaultParallel = exports.defaultOnexit = exports.defaultOnentry = exports.defaultLog = exports.defaultInvoke = exports.defaultInitial = exports.defaultIf = exports.HistoryTypeDatatypeProps = exports.defaultHistory = exports.defaultForeach = exports.defaultFinalize = exports.defaultFinal = exports.ExmodeDatatypeProps = exports.defaultElseif = exports.defaultElse = exports.defaultDonedata = exports.defaultDatamodel = exports.defaultData = exports.defaultContent = exports.defaultCancel = exports.BooleanDatatypeProps = exports.BindingDatatypeProps = exports.AssignTypeDatatypeProps = exports.defaultAssign = void 0;
|
|
11
|
+
const defaultAssign = () => ({
|
|
12
|
+
location: "",
|
|
13
|
+
expr: null,
|
|
14
|
+
typeValue: exports.AssignTypeDatatypeProps.Replacechildren,
|
|
15
|
+
attr: null,
|
|
16
|
+
otherAttributes: {},
|
|
17
|
+
content: [],
|
|
18
|
+
});
|
|
19
|
+
exports.defaultAssign = defaultAssign;
|
|
20
|
+
exports.AssignTypeDatatypeProps = {
|
|
21
|
+
Addattribute: "addattribute",
|
|
22
|
+
Delete: "delete",
|
|
23
|
+
Firstchild: "firstchild",
|
|
24
|
+
Lastchild: "lastchild",
|
|
25
|
+
Nextsibling: "nextsibling",
|
|
26
|
+
Previoussibling: "previoussibling",
|
|
27
|
+
Replace: "replace",
|
|
28
|
+
Replacechildren: "replacechildren",
|
|
29
|
+
};
|
|
30
|
+
exports.BindingDatatypeProps = {
|
|
31
|
+
Early: "early",
|
|
32
|
+
Late: "late",
|
|
33
|
+
};
|
|
34
|
+
exports.BooleanDatatypeProps = {
|
|
35
|
+
False: "false",
|
|
36
|
+
True: "true",
|
|
37
|
+
};
|
|
38
|
+
const defaultCancel = () => ({
|
|
39
|
+
otherElement: [],
|
|
40
|
+
sendid: null,
|
|
41
|
+
sendidexpr: null,
|
|
42
|
+
otherAttributes: {},
|
|
43
|
+
});
|
|
44
|
+
exports.defaultCancel = defaultCancel;
|
|
45
|
+
const defaultContent = () => ({
|
|
46
|
+
content: null,
|
|
47
|
+
expr: null,
|
|
48
|
+
otherAttributes: {},
|
|
49
|
+
});
|
|
50
|
+
exports.defaultContent = defaultContent;
|
|
51
|
+
const defaultData = () => ({
|
|
52
|
+
id: "",
|
|
53
|
+
src: null,
|
|
54
|
+
expr: null,
|
|
55
|
+
otherAttributes: {},
|
|
56
|
+
content: [],
|
|
57
|
+
});
|
|
58
|
+
exports.defaultData = defaultData;
|
|
59
|
+
const defaultDatamodel = () => ({
|
|
60
|
+
data: [],
|
|
61
|
+
otherElement: [],
|
|
62
|
+
otherAttributes: {},
|
|
63
|
+
});
|
|
64
|
+
exports.defaultDatamodel = defaultDatamodel;
|
|
65
|
+
const defaultDonedata = () => ({
|
|
66
|
+
content: null,
|
|
67
|
+
param: [],
|
|
68
|
+
otherAttributes: {},
|
|
69
|
+
});
|
|
70
|
+
exports.defaultDonedata = defaultDonedata;
|
|
71
|
+
const defaultElse = () => ({
|
|
72
|
+
otherAttributes: {},
|
|
73
|
+
});
|
|
74
|
+
exports.defaultElse = defaultElse;
|
|
75
|
+
const defaultElseif = () => ({
|
|
76
|
+
cond: "",
|
|
77
|
+
otherAttributes: {},
|
|
78
|
+
});
|
|
79
|
+
exports.defaultElseif = defaultElseif;
|
|
80
|
+
exports.ExmodeDatatypeProps = {
|
|
81
|
+
Lax: "lax",
|
|
82
|
+
Strict: "strict",
|
|
83
|
+
};
|
|
84
|
+
const defaultFinal = () => ({
|
|
85
|
+
onentry: [],
|
|
86
|
+
onexit: [],
|
|
87
|
+
donedata: [],
|
|
88
|
+
otherElement: [],
|
|
89
|
+
id: null,
|
|
90
|
+
otherAttributes: {},
|
|
91
|
+
});
|
|
92
|
+
exports.defaultFinal = defaultFinal;
|
|
93
|
+
const defaultFinalize = () => ({
|
|
94
|
+
otherElement: [],
|
|
95
|
+
raiseValue: [],
|
|
96
|
+
ifValue: [],
|
|
97
|
+
foreach: [],
|
|
98
|
+
send: [],
|
|
99
|
+
script: [],
|
|
100
|
+
assign: [],
|
|
101
|
+
log: [],
|
|
102
|
+
cancel: [],
|
|
103
|
+
otherAttributes: {},
|
|
104
|
+
});
|
|
105
|
+
exports.defaultFinalize = defaultFinalize;
|
|
106
|
+
const defaultForeach = () => ({
|
|
107
|
+
otherElement: [],
|
|
108
|
+
raiseValue: [],
|
|
109
|
+
ifValue: [],
|
|
110
|
+
foreach: [],
|
|
111
|
+
send: [],
|
|
112
|
+
script: [],
|
|
113
|
+
assign: [],
|
|
114
|
+
log: [],
|
|
115
|
+
cancel: [],
|
|
116
|
+
array: "",
|
|
117
|
+
item: "",
|
|
118
|
+
index: null,
|
|
119
|
+
otherAttributes: {},
|
|
120
|
+
});
|
|
121
|
+
exports.defaultForeach = defaultForeach;
|
|
122
|
+
const defaultHistory = () => ({
|
|
123
|
+
otherElement: [],
|
|
124
|
+
transition: (0, exports.defaultTransition)(),
|
|
125
|
+
id: null,
|
|
126
|
+
typeValue: null,
|
|
127
|
+
otherAttributes: {},
|
|
128
|
+
});
|
|
129
|
+
exports.defaultHistory = defaultHistory;
|
|
130
|
+
exports.HistoryTypeDatatypeProps = {
|
|
131
|
+
Deep: "deep",
|
|
132
|
+
Shallow: "shallow",
|
|
133
|
+
};
|
|
134
|
+
const defaultIf = () => ({
|
|
135
|
+
otherElement: [],
|
|
136
|
+
raiseValue: [],
|
|
137
|
+
ifValue: [],
|
|
138
|
+
foreach: [],
|
|
139
|
+
send: [],
|
|
140
|
+
script: [],
|
|
141
|
+
assign: [],
|
|
142
|
+
log: [],
|
|
143
|
+
cancel: [],
|
|
144
|
+
elseif: null,
|
|
145
|
+
elseValue: null,
|
|
146
|
+
cond: "",
|
|
147
|
+
otherAttributes: {},
|
|
148
|
+
});
|
|
149
|
+
exports.defaultIf = defaultIf;
|
|
150
|
+
const defaultInitial = () => ({
|
|
151
|
+
otherElement: [],
|
|
152
|
+
transition: (0, exports.defaultTransition)(),
|
|
153
|
+
otherAttributes: {},
|
|
154
|
+
});
|
|
155
|
+
exports.defaultInitial = defaultInitial;
|
|
156
|
+
const defaultInvoke = () => ({
|
|
157
|
+
content: [],
|
|
158
|
+
param: [],
|
|
159
|
+
finalize: [],
|
|
160
|
+
otherElement: [],
|
|
161
|
+
typeValue: "scxml",
|
|
162
|
+
typeexpr: null,
|
|
163
|
+
src: null,
|
|
164
|
+
srcexpr: null,
|
|
165
|
+
id: null,
|
|
166
|
+
idlocation: null,
|
|
167
|
+
namelist: null,
|
|
168
|
+
autoforward: exports.BooleanDatatypeProps.False,
|
|
169
|
+
otherAttributes: {},
|
|
170
|
+
});
|
|
171
|
+
exports.defaultInvoke = defaultInvoke;
|
|
172
|
+
const defaultLog = () => ({
|
|
173
|
+
otherElement: [],
|
|
174
|
+
label: null,
|
|
175
|
+
expr: null,
|
|
176
|
+
otherAttributes: {},
|
|
177
|
+
});
|
|
178
|
+
exports.defaultLog = defaultLog;
|
|
179
|
+
const defaultOnentry = () => ({
|
|
180
|
+
otherElement: [],
|
|
181
|
+
raiseValue: [],
|
|
182
|
+
ifValue: [],
|
|
183
|
+
foreach: [],
|
|
184
|
+
send: [],
|
|
185
|
+
script: [],
|
|
186
|
+
assign: [],
|
|
187
|
+
log: [],
|
|
188
|
+
cancel: [],
|
|
189
|
+
otherAttributes: {},
|
|
190
|
+
});
|
|
191
|
+
exports.defaultOnentry = defaultOnentry;
|
|
192
|
+
const defaultOnexit = () => ({
|
|
193
|
+
otherElement: [],
|
|
194
|
+
raiseValue: [],
|
|
195
|
+
ifValue: [],
|
|
196
|
+
foreach: [],
|
|
197
|
+
send: [],
|
|
198
|
+
script: [],
|
|
199
|
+
assign: [],
|
|
200
|
+
log: [],
|
|
201
|
+
cancel: [],
|
|
202
|
+
otherAttributes: {},
|
|
203
|
+
});
|
|
204
|
+
exports.defaultOnexit = defaultOnexit;
|
|
205
|
+
const defaultParallel = () => ({
|
|
206
|
+
onentry: [],
|
|
207
|
+
onexit: [],
|
|
208
|
+
transition: [],
|
|
209
|
+
state: [],
|
|
210
|
+
parallel: [],
|
|
211
|
+
history: [],
|
|
212
|
+
datamodel: [],
|
|
213
|
+
invoke: [],
|
|
214
|
+
otherElement: [],
|
|
215
|
+
id: null,
|
|
216
|
+
otherAttributes: {},
|
|
217
|
+
});
|
|
218
|
+
exports.defaultParallel = defaultParallel;
|
|
219
|
+
const defaultParam = () => ({
|
|
220
|
+
otherElement: [],
|
|
221
|
+
name: "",
|
|
222
|
+
expr: null,
|
|
223
|
+
location: null,
|
|
224
|
+
otherAttributes: {},
|
|
225
|
+
});
|
|
226
|
+
exports.defaultParam = defaultParam;
|
|
227
|
+
const defaultRaise = () => ({
|
|
228
|
+
event: "",
|
|
229
|
+
otherAttributes: {},
|
|
230
|
+
});
|
|
231
|
+
exports.defaultRaise = defaultRaise;
|
|
232
|
+
const defaultScript = () => ({
|
|
233
|
+
src: null,
|
|
234
|
+
otherAttributes: {},
|
|
235
|
+
content: [],
|
|
236
|
+
});
|
|
237
|
+
exports.defaultScript = defaultScript;
|
|
238
|
+
const defaultScxml = () => ({
|
|
239
|
+
state: [],
|
|
240
|
+
parallel: [],
|
|
241
|
+
final: [],
|
|
242
|
+
datamodel: [],
|
|
243
|
+
script: [],
|
|
244
|
+
otherElement: [],
|
|
245
|
+
initial: [],
|
|
246
|
+
name: null,
|
|
247
|
+
version: 1.0,
|
|
248
|
+
datamodelAttribute: "null",
|
|
249
|
+
binding: null,
|
|
250
|
+
exmode: null,
|
|
251
|
+
otherAttributes: {},
|
|
252
|
+
});
|
|
253
|
+
exports.defaultScxml = defaultScxml;
|
|
254
|
+
const defaultSend = () => ({
|
|
255
|
+
content: [],
|
|
256
|
+
param: [],
|
|
257
|
+
otherElement: [],
|
|
258
|
+
event: null,
|
|
259
|
+
eventexpr: null,
|
|
260
|
+
target: null,
|
|
261
|
+
targetexpr: null,
|
|
262
|
+
typeValue: "scxml",
|
|
263
|
+
typeexpr: null,
|
|
264
|
+
id: null,
|
|
265
|
+
idlocation: null,
|
|
266
|
+
delay: "0s",
|
|
267
|
+
delayexpr: null,
|
|
268
|
+
namelist: null,
|
|
269
|
+
otherAttributes: {},
|
|
270
|
+
});
|
|
271
|
+
exports.defaultSend = defaultSend;
|
|
272
|
+
const defaultState = () => ({
|
|
273
|
+
onentry: [],
|
|
274
|
+
onexit: [],
|
|
275
|
+
transition: [],
|
|
276
|
+
initial: [],
|
|
277
|
+
state: [],
|
|
278
|
+
parallel: [],
|
|
279
|
+
final: [],
|
|
280
|
+
history: [],
|
|
281
|
+
datamodel: [],
|
|
282
|
+
invoke: [],
|
|
283
|
+
otherElement: [],
|
|
284
|
+
id: null,
|
|
285
|
+
initialAttribute: [],
|
|
286
|
+
otherAttributes: {},
|
|
287
|
+
});
|
|
288
|
+
exports.defaultState = defaultState;
|
|
289
|
+
const defaultTransition = () => ({
|
|
290
|
+
otherElement: [],
|
|
291
|
+
raiseValue: [],
|
|
292
|
+
ifValue: [],
|
|
293
|
+
foreach: [],
|
|
294
|
+
send: [],
|
|
295
|
+
script: [],
|
|
296
|
+
assign: [],
|
|
297
|
+
log: [],
|
|
298
|
+
cancel: [],
|
|
299
|
+
event: null,
|
|
300
|
+
cond: null,
|
|
301
|
+
target: [],
|
|
302
|
+
typeValue: null,
|
|
303
|
+
otherAttributes: {},
|
|
304
|
+
});
|
|
305
|
+
exports.defaultTransition = defaultTransition;
|
|
306
|
+
exports.TransitionTypeDatatypeProps = {
|
|
307
|
+
External: "external",
|
|
308
|
+
Internal: "internal",
|
|
309
|
+
};
|
package/package.json
CHANGED
|
@@ -1,74 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scjson",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "A JSON-based serialization of SCXML (State Chart XML)
|
|
5
|
-
"keywords": [
|
|
6
|
-
"scjson",
|
|
7
|
-
"scxml",
|
|
8
|
-
"state-machine",
|
|
9
|
-
"conversion",
|
|
10
|
-
"json",
|
|
11
|
-
"cli",
|
|
12
|
-
"xml"
|
|
13
|
-
],
|
|
14
|
-
"homepage": "https://github.com/SoftOboros/scjson/tree/main/js",
|
|
15
|
-
"bugs": {
|
|
16
|
-
"url": "https://github.com/SoftOboros/scjson/issues"
|
|
17
|
-
},
|
|
18
|
-
"license": "BSD-1-Clause",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "A JSON-based serialization of SCXML (State Chart XML).",
|
|
19
5
|
"author": "Softoboros Technology Inc. <ira@softoboros.com>",
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
"bin": {
|
|
25
|
-
"scjson": "bin/scjson.js"
|
|
26
|
-
},
|
|
27
|
-
"engines": {
|
|
28
|
-
"node": ">=18"
|
|
29
|
-
},
|
|
30
|
-
"main": "index.js",
|
|
31
|
-
"type": "commonjs",
|
|
6
|
+
"license": "BSD-1-Clause",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
32
9
|
"exports": {
|
|
33
|
-
".":
|
|
34
|
-
|
|
10
|
+
".": {
|
|
11
|
+
"require": "./dist/index.js",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
},
|
|
15
|
+
"./props": {
|
|
16
|
+
"require": "./dist/scjsonProps.js",
|
|
17
|
+
"import": "./dist/scjsonProps.js",
|
|
18
|
+
"types": "./dist/scjsonProps.d.ts"
|
|
19
|
+
},
|
|
20
|
+
"./converters": {
|
|
21
|
+
"require": "./dist/converters.js",
|
|
22
|
+
"import": "./dist/converters.js",
|
|
23
|
+
"types": "./dist/converters.d.ts"
|
|
24
|
+
},
|
|
35
25
|
"./browser": {
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
"typesVersions": {
|
|
41
|
-
"*": {
|
|
42
|
-
"browser": [
|
|
43
|
-
"/types/scjson-browser.d.ts"
|
|
44
|
-
],
|
|
45
|
-
"props": [
|
|
46
|
-
"/types/scjsonProps.d.ts"
|
|
47
|
-
]
|
|
48
|
-
|
|
26
|
+
"require": "./dist/browser.cjs",
|
|
27
|
+
"import": "./dist/browser.mjs",
|
|
28
|
+
"types": "./dist/browser.d.ts"
|
|
49
29
|
}
|
|
50
30
|
},
|
|
51
|
-
"types": "types/*",
|
|
52
31
|
"files": [
|
|
32
|
+
"dist/",
|
|
53
33
|
"bin/",
|
|
54
|
-
"index.js",
|
|
55
|
-
"browser.mjs",
|
|
56
|
-
"browser.cjs",
|
|
57
|
-
"scjsonProps.ts",
|
|
58
|
-
"types/scjson-browser.d.ts",
|
|
59
|
-
"types/scjsonProps.d.ts",
|
|
60
|
-
"tests/",
|
|
61
34
|
"scjson.schema.json",
|
|
62
35
|
"README.md",
|
|
63
36
|
"LEGAL.md",
|
|
64
37
|
"LICENSE"
|
|
65
38
|
],
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
"publishConfig": {
|
|
69
|
-
"access": "public"
|
|
39
|
+
"bin": {
|
|
40
|
+
"scjson": "bin/scjson.js"
|
|
70
41
|
},
|
|
71
42
|
"scripts": {
|
|
43
|
+
"build": "tsc",
|
|
72
44
|
"test": "jest",
|
|
73
45
|
"lint": "eslint"
|
|
74
46
|
},
|
|
@@ -79,7 +51,10 @@
|
|
|
79
51
|
"fast-xml-parser": "^5.2.5"
|
|
80
52
|
},
|
|
81
53
|
"devDependencies": {
|
|
54
|
+
"@babel/parser": "^7.28.0",
|
|
55
|
+
"@babel/types": "^7.28.2",
|
|
82
56
|
"jest": "^30.0.4",
|
|
83
|
-
"typescript": "^5.8.3"
|
|
57
|
+
"typescript": "^5.8.3",
|
|
58
|
+
"undici-types": "^7.12.0"
|
|
84
59
|
}
|
|
85
60
|
}
|