@microtronics/studio-cli 0.61.0 → 0.63.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.
@@ -1,541 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DDE_Core = void 0;
4
- var DDE_Core;
5
- (function (DDE_Core) {
6
- let DDEContainerName;
7
- (function (DDEContainerName) {
8
- /** @description low frequent - from device to server */
9
- DDEContainerName["state"] = "state";
10
- /** @description high frequent - from device to server */
11
- DDEContainerName["result"] = "result";
12
- /** @description aloha - from device to server */
13
- DDEContainerName["aloha"] = "aloha";
14
- /** @description volatile - from device to server */
15
- DDEContainerName["volatile"] = "volatile";
16
- /** @description low frequent - from server to device */
17
- DDEContainerName["setting"] = "setting";
18
- /** @description high frequent - from server to device */
19
- DDEContainerName["command"] = "command";
20
- /** @description server only */
21
- DDEContainerName["storage"] = "storage";
22
- /** @description server only */
23
- DDEContainerName["relations"] = "relations";
24
- })(DDEContainerName = DDE_Core.DDEContainerName || (DDE_Core.DDEContainerName = {}));
25
- let ContainerName;
26
- (function (ContainerName) {
27
- ContainerName["configA"] = "configA";
28
- ContainerName["configB"] = "configB";
29
- ContainerName["configC"] = "configC";
30
- ContainerName["config0"] = "config0";
31
- ContainerName["config1"] = "config1";
32
- ContainerName["config2"] = "config2";
33
- ContainerName["config3"] = "config3";
34
- ContainerName["config4"] = "config4";
35
- ContainerName["config5"] = "config5";
36
- ContainerName["config6"] = "config6";
37
- ContainerName["config7"] = "config7";
38
- ContainerName["config8"] = "config8";
39
- ContainerName["config9"] = "config9";
40
- ContainerName["histdata0"] = "histdata0";
41
- ContainerName["histdata1"] = "histdata1";
42
- ContainerName["histdata2"] = "histdata2";
43
- ContainerName["histdata3"] = "histdata3";
44
- ContainerName["histdata4"] = "histdata4";
45
- ContainerName["histdata5"] = "histdata5";
46
- ContainerName["histdata6"] = "histdata6";
47
- ContainerName["histdata7"] = "histdata7";
48
- ContainerName["histdata8"] = "histdata8";
49
- ContainerName["histdata9"] = "histdata9";
50
- ContainerName["aloha"] = "aloha";
51
- ContainerName["alerts"] = "alerts";
52
- ContainerName["applog"] = "applog";
53
- })(ContainerName = DDE_Core.ContainerName || (DDE_Core.ContainerName = {}));
54
- let ContainerType;
55
- (function (ContainerType) {
56
- /**
57
- * @description config0 - 9
58
- */
59
- ContainerType["cx"] = "cx";
60
- /**
61
- * @description histdata0 - 9
62
- */
63
- ContainerType["hx"] = "hx";
64
- /**
65
- * @description configA - B
66
- */
67
- ContainerType["cb"] = "cb";
68
- ContainerType["aloha"] = "aloha";
69
- ContainerType["applog"] = "applog";
70
- })(ContainerType = DDE_Core.ContainerType || (DDE_Core.ContainerType = {}));
71
- let TransferDirection;
72
- (function (TransferDirection) {
73
- TransferDirection["up"] = "up";
74
- TransferDirection["down"] = "down";
75
- TransferDirection["upPlus"] = "up+";
76
- TransferDirection["downPlus"] = "down+";
77
- TransferDirection["none"] = "none";
78
- TransferDirection["backendOnly"] = "backend-only";
79
- TransferDirection["deviceOnly"] = "device-only";
80
- TransferDirection["both"] = "both";
81
- TransferDirection["bothPlus"] = "both+";
82
- /** @deprecated replaced with backendOnly*/
83
- TransferDirection["noneBackend"] = "none-be";
84
- })(TransferDirection = DDE_Core.TransferDirection || (DDE_Core.TransferDirection = {}));
85
- function CONTAINER_DEF_DLO_CID_BASE(containerType, xmit) {
86
- // eslint-disable-next-line sonarjs/no-duplicate-string
87
- if (containerType === ContainerType.cx && ![TransferDirection.backendOnly].includes(xmit)) {
88
- return 'DDE_CID_CONFIG';
89
- }
90
- if (containerType === ContainerType.hx) {
91
- return 'DDE_CID_HISTDATA';
92
- }
93
- if (containerType === ContainerType.aloha) {
94
- return 'DDE_CID_ALOHA';
95
- }
96
- return null;
97
- }
98
- DDE_Core.CONTAINER_DEF_DLO_CID_BASE = CONTAINER_DEF_DLO_CID_BASE;
99
- const _CX_XMITS = [
100
- TransferDirection.up,
101
- TransferDirection.upPlus,
102
- TransferDirection.down,
103
- TransferDirection.downPlus,
104
- TransferDirection.both,
105
- TransferDirection.none,
106
- TransferDirection.bothPlus,
107
- TransferDirection.backendOnly,
108
- TransferDirection.deviceOnly
109
- ];
110
- const _HX_XMITS = [TransferDirection.up, TransferDirection.upPlus, TransferDirection.backendOnly];
111
- DDE_Core.CONTAINER_DEFS = {
112
- configA: { ctype: ContainerType.cb, cnum: 'a', alias: '', flds: 'field', xmits: [TransferDirection.backendOnly] },
113
- configB: { ctype: ContainerType.cb, cnum: 'b', alias: '', flds: 'field', xmits: [TransferDirection.backendOnly] },
114
- configC: { ctype: ContainerType.cb, cnum: 'c', alias: '', flds: 'field', xmits: [TransferDirection.backendOnly] },
115
- config0: { ctype: ContainerType.cx, cnum: 0, alias: '', flds: 'field', xmits: _CX_XMITS },
116
- config1: { ctype: ContainerType.cx, cnum: 1, alias: '', flds: 'field', xmits: _CX_XMITS },
117
- config2: { ctype: ContainerType.cx, cnum: 2, alias: '', flds: 'field', xmits: _CX_XMITS },
118
- config3: { ctype: ContainerType.cx, cnum: 3, alias: '', flds: 'field', xmits: _CX_XMITS },
119
- config4: { ctype: ContainerType.cx, cnum: 4, alias: '', flds: 'field', xmits: _CX_XMITS },
120
- config5: { ctype: ContainerType.cx, cnum: 5, alias: '', flds: 'field', xmits: _CX_XMITS },
121
- config6: { ctype: ContainerType.cx, cnum: 6, alias: '', flds: 'field', xmits: _CX_XMITS },
122
- config7: { ctype: ContainerType.cx, cnum: 7, alias: '', flds: 'field', xmits: _CX_XMITS },
123
- config8: { ctype: ContainerType.cx, cnum: 8, alias: '', flds: 'field', xmits: _CX_XMITS },
124
- config9: { ctype: ContainerType.cx, cnum: 9, alias: '', flds: 'field', xmits: _CX_XMITS },
125
- histdata0: { ctype: ContainerType.hx, cnum: 0, alias: '', flds: 'ch', xmits: _HX_XMITS },
126
- histdata1: { ctype: ContainerType.hx, cnum: 1, alias: '', flds: 'ch', xmits: _HX_XMITS },
127
- histdata2: { ctype: ContainerType.hx, cnum: 2, alias: '', flds: 'ch', xmits: _HX_XMITS },
128
- histdata3: { ctype: ContainerType.hx, cnum: 3, alias: '', flds: 'ch', xmits: _HX_XMITS },
129
- histdata4: { ctype: ContainerType.hx, cnum: 4, alias: '', flds: 'ch', xmits: _HX_XMITS },
130
- histdata5: { ctype: ContainerType.hx, cnum: 5, alias: '', flds: 'ch', xmits: _HX_XMITS },
131
- histdata6: { ctype: ContainerType.hx, cnum: 6, alias: '', flds: 'ch', xmits: _HX_XMITS },
132
- histdata7: { ctype: ContainerType.hx, cnum: 7, alias: '', flds: 'ch', xmits: _HX_XMITS },
133
- histdata8: { ctype: ContainerType.hx, cnum: 8, alias: '', flds: 'ch', xmits: _HX_XMITS },
134
- histdata9: { ctype: ContainerType.hx, cnum: 9, alias: '', flds: 'ch', xmits: _HX_XMITS },
135
- aloha: {
136
- ctype: ContainerType.aloha,
137
- cnum: undefined,
138
- alias: ContainerType.aloha,
139
- flds: null,
140
- xmits: [TransferDirection.up, TransferDirection.upPlus]
141
- },
142
- alerts: { ctype: undefined, cnum: undefined, alias: 'alerts', flds: null, xmits: [TransferDirection.up] },
143
- applog: {
144
- ctype: ContainerType.applog,
145
- cnum: undefined,
146
- alias: ContainerType.applog,
147
- flds: null,
148
- xmits: [TransferDirection.upPlus]
149
- }
150
- };
151
- DDE_Core.HISTDATA_CONTAINER = [
152
- ContainerName.histdata0,
153
- ContainerName.histdata1,
154
- ContainerName.histdata2,
155
- ContainerName.histdata3,
156
- ContainerName.histdata4,
157
- ContainerName.histdata5,
158
- ContainerName.histdata6,
159
- ContainerName.histdata7,
160
- ContainerName.histdata8,
161
- ContainerName.histdata9
162
- ];
163
- DDE_Core.CONFIG_CONTAINER = [
164
- ContainerName.config0,
165
- ContainerName.config1,
166
- ContainerName.config2,
167
- ContainerName.config3,
168
- ContainerName.config4,
169
- ContainerName.config5,
170
- ContainerName.config6,
171
- ContainerName.config7,
172
- ContainerName.config8,
173
- ContainerName.config9
174
- ];
175
- DDE_Core.SERVER_CONTAINER = [ContainerName.configA, ContainerName.configB, ContainerName.configC];
176
- // check if the given string is a relation to an app container or library container
177
- DDE_Core.regexRelation = /^(@[a-zA-Z_][a-zA-Z0-9_]*\.[a-zA-Z_][a-zA-Z0-9_]*(\[[^\]]+\])?(\.[a-zA-Z_][a-zA-Z0-9_]*)*|lib:[a-zA-Z0-9_-]+@[a-zA-Z_][a-zA-Z0-9_]*\.[a-zA-Z_][a-zA-Z0-9_]*(\[[^\]]+\])?(\.[a-zA-Z_][a-zA-Z0-9_]*)*)$/;
178
- const STRING_TYPES = ['astring', 'nstring', 'cstring', 'wstring', 'ustring'];
179
- const NUMBER_TYPES = [
180
- 'int8',
181
- 'int16',
182
- 'int32',
183
- 'int64',
184
- 'uint8',
185
- 'uint16',
186
- 'uint32',
187
- 'float16',
188
- 'float32',
189
- 'float64'
190
- ];
191
- /**
192
- * Defines what fields allow relations and the allowed target field type.
193
- */
194
- DDE_Core.allowedRelationTypes = {
195
- title: STRING_TYPES,
196
- unit: STRING_TYPES,
197
- chartMinimum: NUMBER_TYPES,
198
- chartMaximum: NUMBER_TYPES,
199
- scale: NUMBER_TYPES,
200
- offset: NUMBER_TYPES,
201
- decimalPlaces: ['uint8', 'uint16', 'uint32', 'int8', 'int16', 'int32', 'int64'],
202
- channelMode: ['uint8', 'uint16', 'uint32'],
203
- chartAlarmLow: NUMBER_TYPES,
204
- chartAlarmHigh: NUMBER_TYPES,
205
- chartWarningLow: NUMBER_TYPES,
206
- chartWarningHigh: NUMBER_TYPES,
207
- chartHysteresis: NUMBER_TYPES,
208
- chartTriggerThreshold: NUMBER_TYPES,
209
- chartTriggerRelation: NUMBER_TYPES,
210
- chartSetPoint: NUMBER_TYPES
211
- };
212
- /**
213
- * Parse the given value and resolve any container relation
214
- * @param attribute
215
- * @param field
216
- * @param ddeMap
217
- */
218
- function parseXMLValueWithRelation(attribute, field, ddeMap) {
219
- /* @ts-ignore */
220
- const currentAttributeValue = field[attribute];
221
- if (currentAttributeValue === undefined) {
222
- return undefined;
223
- }
224
- // resolve relation:
225
- if (DDE_Core.regexRelation.exec(`${currentAttributeValue}`)) {
226
- const isSetPoint = attribute === 'chartSetPoint';
227
- const [root, ...containerFields] = currentAttributeValue.split('.');
228
- const [, /*libraryRelation*/ containerTitle] = root.split('@'); //remove the @
229
- const realContainer = Object.values(ddeMap.containers).find(container => container.title === containerTitle);
230
- const containerField = containerFields.join('.');
231
- const delimeter = isSetPoint ? ';' : '%';
232
- let xmlString = (isSetPoint ? '' : '%') + (realContainer?.name || containerTitle) + delimeter;
233
- // handle array referenced field with automatic index
234
- xmlString = xmlString + `${containerField}`;
235
- // add setpoint related 'actual_output_value_x' to string
236
- if (isSetPoint) {
237
- const valueIndex = ddeMap.setPointList[field.name];
238
- xmlString = xmlString + `;actual_output_value_${valueIndex}`;
239
- }
240
- return xmlString;
241
- }
242
- else {
243
- return currentAttributeValue;
244
- }
245
- }
246
- DDE_Core.parseXMLValueWithRelation = parseXMLValueWithRelation;
247
- function parseXMLBitmask(field) {
248
- const { bitmask } = field;
249
- if (!bitmask) {
250
- return undefined;
251
- }
252
- let xmlBitmask = `$`;
253
- // trim all whitespaces from the bitmask
254
- const sourceBitmask = bitmask.replaceAll(' ', '');
255
- // bitmask is hex
256
- if (bitmask.startsWith('0x')) {
257
- xmlBitmask += sourceBitmask.substring(2);
258
- }
259
- else if (sourceBitmask.startsWith('0b')) {
260
- // allow setting bitmask as binary value
261
- const binaryString = sourceBitmask.substring(2).replaceAll(' ', '');
262
- xmlBitmask += parseInt(binaryString, 2).toString(16).toUpperCase();
263
- }
264
- return xmlBitmask;
265
- }
266
- DDE_Core.parseXMLBitmask = parseXMLBitmask;
267
- function parseXMLDefaultValue(field) {
268
- if (field.type === 'binary') {
269
- // remove the leading 0x prefix
270
- return field.defaultValue.substring(2);
271
- }
272
- return field.defaultValue === 'NaN' ? 'NAN' : field.defaultValue;
273
- }
274
- DDE_Core.parseXMLDefaultValue = parseXMLDefaultValue;
275
- DDE_Core.TDEF_NUMBER = {
276
- xmlOut(xml, jsonField, ddeMap) {
277
- // retain complex decpl values which may contain a field reference and not only a number
278
- xml.decpl = parseXMLValueWithRelation('decimalPlaces', jsonField, ddeMap);
279
- if (xml.decpl === undefined) {
280
- xml.decpl = 0;
281
- }
282
- xml.vscale = parseXMLValueWithRelation('scale', jsonField, ddeMap);
283
- xml.vofs = parseXMLValueWithRelation('offset', jsonField, ddeMap);
284
- xml.min = parseXMLValueWithRelation('chartMinimum', jsonField, ddeMap);
285
- xml.max = parseXMLValueWithRelation('chartMaximum', jsonField, ddeMap);
286
- }
287
- };
288
- const TDEF_STRING = {
289
- isBlob: 1,
290
- xmlOut(xml, fieldDefinition) {
291
- xml.max = fieldDefinition.byteSize;
292
- }
293
- };
294
- const TDEF_STAMP = {
295
- xmlOut(xml /*fdef: DDEJsonField*/) {
296
- // currently only utc available
297
- xml.decpl = -1; // stamp/4/8 requires decpl:-1 !
298
- xml.param0 = 'local'; //fdef._utc ? 'local' : '';
299
- xml.units = 'UTC'; //fdef._utc ? 'UTC' : 'Local time';
300
- }
301
- };
302
- DDE_Core.TYPE_DEFS = {
303
- u8: {
304
- dde: 'uint8',
305
- dim: 1,
306
- len: 1,
307
- ...DDE_Core.TDEF_NUMBER,
308
- rdef: 1,
309
- xml: { type: 'u8' },
310
- pwn: { rwfunc: 'u8', htype: 's32', printf: '%d' },
311
- openApi: { type: 'number', minimum: 0 }
312
- },
313
- u16: {
314
- dde: 'uint16',
315
- dim: 1,
316
- len: 2,
317
- ...DDE_Core.TDEF_NUMBER,
318
- rdef: 1,
319
- xml: { type: 'u16' },
320
- pwn: { rwfunc: 'u16', htype: 's32', printf: '%d' },
321
- openApi: { type: 'number', minimum: 0 }
322
- },
323
- u32: {
324
- dde: 'uint32',
325
- dim: 1,
326
- len: 4,
327
- ...DDE_Core.TDEF_NUMBER,
328
- rdef: 1,
329
- xml: { type: 'u32' },
330
- pwn: { rwfunc: 'u32', htype: 's32', printf: '%d' },
331
- openApi: { type: 'number', minimum: 0 }
332
- },
333
- // u64 - does not exist / not supported by backend
334
- s8: {
335
- dde: 'int8',
336
- dim: 1,
337
- len: 1,
338
- ...DDE_Core.TDEF_NUMBER,
339
- rdef: 1,
340
- xml: { type: 's8' },
341
- pwn: { rwfunc: 's8', htype: 's32', printf: '%d' },
342
- openApi: { type: 'number' }
343
- },
344
- s16: {
345
- dde: 'int16',
346
- dim: 1,
347
- len: 2,
348
- ...DDE_Core.TDEF_NUMBER,
349
- rdef: 1,
350
- xml: { type: 's16' },
351
- pwn: { rwfunc: 's16', htype: 's32', printf: '%d' },
352
- openApi: { type: 'number' }
353
- },
354
- s32: {
355
- dde: 'int32',
356
- dim: 1,
357
- len: 4,
358
- ...DDE_Core.TDEF_NUMBER,
359
- rdef: 1,
360
- xml: { type: 's32' },
361
- pwn: { rwfunc: 's32', printf: '%d' },
362
- openApi: { type: 'number' }
363
- },
364
- s64: {
365
- dde: 'int64',
366
- dim: 0,
367
- len: 8,
368
- ...DDE_Core.TDEF_NUMBER,
369
- rdef: 1,
370
- xml: { type: 's64' },
371
- pwn: { rwfunc: 's64', rwp: '%n{%l}', htype: '{%l}', printf: '%d' },
372
- openApi: { type: 'number' }
373
- },
374
- f16: {
375
- dde: 'float16',
376
- dim: 1,
377
- len: 2,
378
- ...DDE_Core.TDEF_NUMBER,
379
- rdef: 1,
380
- xml: { type: 'floatm16' },
381
- pwn: { rwfunc: 'f16', rwp: 'Float:%n', htype: 'f32', printf: '%f' },
382
- openApi: { type: 'number' }
383
- },
384
- f32: {
385
- dde: 'float32',
386
- dim: 1,
387
- len: 4,
388
- ...DDE_Core.TDEF_NUMBER,
389
- rdef: 1,
390
- xml: { type: 'f32' },
391
- pwn: { rwfunc: 'f32', rwp: 'Float:%n', printf: '%f' },
392
- openApi: { type: 'number' }
393
- },
394
- f64: {
395
- dde: 'float64',
396
- dim: 0,
397
- len: 8,
398
- ...DDE_Core.TDEF_NUMBER,
399
- rdef: 0,
400
- xml: { type: 'f64' },
401
- pwn: { rwfunc: 'f64', rwp: '%n{%l}', htype: '{%l}', printf: '%f' },
402
- openApi: { type: 'number' }
403
- },
404
- stamp32: {
405
- dde: 'stamp32',
406
- dim: 1,
407
- len: 4,
408
- ...TDEF_STAMP,
409
- rdef: 0,
410
- xml: { type: 'stamp4' },
411
- pwn: { rwfunc: 'stamp32', printf: '%s', printfFormat: 'stampToISOString' },
412
- openApi: { type: 'string', format: 'YYYYMMDDhhmmssSSS', description: 'UTC' }
413
- },
414
- stamp40: {
415
- dde: 'stamp40',
416
- dim: 0,
417
- len: 5,
418
- ...TDEF_STAMP,
419
- rdef: 0,
420
- xml: { type: 'stamp' },
421
- pwn: { rwfunc: 'stamp40', rwp: '%n{%l}', htype: '{%l}', printf: '%s', printfFormat: 'stampToISOString' },
422
- openApi: { type: 'string', format: 'YYYYMMDDhhmmssSSS', description: 'UTC' }
423
- },
424
- bin: {
425
- dde: 'binary',
426
- dim: 0,
427
- ...TDEF_STRING,
428
- rdef: 0,
429
- lenUnits: 'byte',
430
- xml: { type: 'string', editmask: '%HEX%' },
431
- pwn: { rwfunc: 'bin', rwlen: 1, rwp: '%n{%l}', htype: '{%l}', printf: null, printfFormat: 'memtostr' },
432
- openApi: { type: 'string', description: 'HEX string' }
433
- },
434
- astr: {
435
- dde: 'astring',
436
- dim: 0,
437
- ...TDEF_STRING,
438
- rdef: 1,
439
- lenUnits: 'char',
440
- xml: { type: 'string', param1: 'nocodepage' },
441
- pwn: { rwfunc: 'astr', rwlen: 1, rwp: '%n{%l+1}', htype: '{%l+1}', printf: '%s' },
442
- openApi: { type: 'string' }
443
- },
444
- nstr: {
445
- dde: 'nstring',
446
- dim: 0,
447
- ...TDEF_STRING,
448
- rdef: 1,
449
- lenUnits: 'byte',
450
- xml: { type: 'string' },
451
- pwn: { rwfunc: 'nstr', rwlen: 1, rwp: '%n{%l+1}', htype: '{%l+1}', printf: '%s' },
452
- openApi: { type: 'string' }
453
- },
454
- wstr: {
455
- dde: 'wstring',
456
- dim: 0,
457
- ...TDEF_STRING,
458
- rdef: 1,
459
- lenUnits: 'byte',
460
- xml: { type: 'string' },
461
- pwn: { rwfunc: 'wstr', rwlen: 1, rwp: '%n[%l+1]', htype: '[%l+1]', printf: '%s' },
462
- openApi: { type: 'string' }
463
- },
464
- ustr: {
465
- dde: 'ustring',
466
- dim: 0,
467
- ...TDEF_STRING,
468
- rdef: 0,
469
- lenUnits: 'byte',
470
- xml: { type: 'string' },
471
- pwn: { rwfunc: 'ustr', rwlen: 1, rwp: '%n{%l+1}', htype: '{%l+1}', printf: '%s' },
472
- openApi: { type: 'string' }
473
- },
474
- cstr: {
475
- dde: 'cstring',
476
- dim: 0,
477
- ...TDEF_STRING,
478
- rdef: 1,
479
- lenUnits: 'char',
480
- xml: { type: 'string', editmask: '%HEX%' },
481
- pwn: { rwfunc: 'cstr', rwlen: 1, rwp: '%n{%l+1}', htype: '{%l+1}', printf: '%s' },
482
- openApi: { type: 'string' }
483
- },
484
- // ^^^
485
- // +1: consider terminating zero for string buffer allocations
486
- _siteref: {
487
- dim: 0,
488
- len: 80,
489
- rdef: 0,
490
- xml: { type: 'string', max: '80', editmask: '%QUERY%all_sites;-name;!id;class;name;%EMPTY%' },
491
- pwn: { rwfunc: 'astr', rwlen: 1, rwp: '%n{%l+1}', htype: '{%l+1}' },
492
- js: { rwfunc: 'String' }
493
- }
494
- };
495
- DDE_Core.fieldTypeDefinitions = {
496
- uint8: DDE_Core.TYPE_DEFS.u8,
497
- uint16: DDE_Core.TYPE_DEFS.u16,
498
- uint32: DDE_Core.TYPE_DEFS.u32,
499
- int8: DDE_Core.TYPE_DEFS.s8,
500
- int16: DDE_Core.TYPE_DEFS.s16,
501
- int32: DDE_Core.TYPE_DEFS.s32,
502
- int64: DDE_Core.TYPE_DEFS.s64,
503
- float16: DDE_Core.TYPE_DEFS.f16,
504
- float32: DDE_Core.TYPE_DEFS.f32,
505
- float64: DDE_Core.TYPE_DEFS.f64,
506
- stamp32: DDE_Core.TYPE_DEFS.stamp32,
507
- stamp40: DDE_Core.TYPE_DEFS.stamp40,
508
- binary: DDE_Core.TYPE_DEFS.bin,
509
- astring: DDE_Core.TYPE_DEFS.astr,
510
- nstring: DDE_Core.TYPE_DEFS.nstr,
511
- wstring: DDE_Core.TYPE_DEFS.wstr,
512
- ustring: DDE_Core.TYPE_DEFS.ustr,
513
- cstring: DDE_Core.TYPE_DEFS.cstr
514
- };
515
- const reservedFieldNames = [
516
- '_id',
517
- 'id',
518
- '_stamp',
519
- 'stamp',
520
- 'tag',
521
- '_uid',
522
- 'customer_id',
523
- 'site_id',
524
- '_rec_flags__',
525
- 'applog'
526
- ];
527
- function checkForReservedFieldName(fieldName) {
528
- const name = fieldName.toLowerCase();
529
- return reservedFieldNames.includes(name) || /^field\d+$/.test(name) || /^ch\d+$/.test(name);
530
- }
531
- DDE_Core.checkForReservedFieldName = checkForReservedFieldName;
532
- /**
533
- * Validates if the given container has fields defined within the app's dde
534
- * @param container
535
- */
536
- function hasContainerAppFields(container) {
537
- return !!container.fields.find(field => field.library === null && field.type !== 'shadow');
538
- }
539
- DDE_Core.hasContainerAppFields = hasContainerAppFields;
540
- })(DDE_Core || (exports.DDE_Core = DDE_Core = {}));
541
- //# sourceMappingURL=coreDefinitions.js.map