@zenstackhq/language 3.5.6 → 3.6.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.
Files changed (45) hide show
  1. package/dist/ast-Clidp86c.cjs +1465 -0
  2. package/dist/ast-Clidp86c.cjs.map +1 -0
  3. package/dist/ast-DEfhnj8j.mjs +765 -0
  4. package/dist/ast-DEfhnj8j.mjs.map +1 -0
  5. package/dist/ast-DQDdBZQ3.d.mts +525 -0
  6. package/dist/ast-W2h6Qtfk.d.cts +525 -0
  7. package/dist/ast.cjs +130 -1432
  8. package/dist/ast.cjs.map +1 -1
  9. package/dist/ast.d.cts +2 -541
  10. package/dist/ast.d.mts +2 -0
  11. package/dist/ast.mjs +20 -0
  12. package/dist/ast.mjs.map +1 -0
  13. package/dist/factory.cjs +754 -2030
  14. package/dist/factory.cjs.map +1 -1
  15. package/dist/factory.d.cts +220 -215
  16. package/dist/factory.d.mts +289 -0
  17. package/dist/factory.mjs +778 -0
  18. package/dist/factory.mjs.map +1 -0
  19. package/dist/index.cjs +2691 -5454
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +104 -103
  22. package/dist/index.d.mts +170 -0
  23. package/dist/index.mjs +6925 -0
  24. package/dist/index.mjs.map +1 -0
  25. package/dist/utils-BB6L7ug2.mjs +529 -0
  26. package/dist/utils-BB6L7ug2.mjs.map +1 -0
  27. package/dist/utils-CfXGZkv7.cjs +842 -0
  28. package/dist/utils-CfXGZkv7.cjs.map +1 -0
  29. package/dist/utils.cjs +47 -1650
  30. package/dist/utils.d.cts +101 -10
  31. package/dist/{utils.d.ts → utils.d.mts} +101 -10
  32. package/dist/utils.mjs +2 -0
  33. package/package.json +16 -15
  34. package/dist/ast.d.ts +0 -541
  35. package/dist/ast.js +0 -1288
  36. package/dist/ast.js.map +0 -1
  37. package/dist/factory.d.ts +0 -284
  38. package/dist/factory.js +0 -2020
  39. package/dist/factory.js.map +0 -1
  40. package/dist/index.d.ts +0 -169
  41. package/dist/index.js +0 -9656
  42. package/dist/index.js.map +0 -1
  43. package/dist/utils.cjs.map +0 -1
  44. package/dist/utils.js +0 -1572
  45. package/dist/utils.js.map +0 -1
package/dist/factory.cjs CHANGED
@@ -1,2087 +1,811 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
-
31
- // src/factory/index.ts
32
- var factory_exports = {};
33
- __export(factory_exports, {
34
- ArgumentFactory: () => ArgumentFactory,
35
- ArrayExprFactory: () => ArrayExprFactory,
36
- AstFactory: () => AstFactory,
37
- AttributeArgFactory: () => AttributeArgFactory,
38
- AttributeFactory: () => AttributeFactory,
39
- AttributeParamFactory: () => AttributeParamFactory,
40
- AttributeParamTypeFactory: () => AttributeParamTypeFactory,
41
- BinaryExprFactory: () => BinaryExprFactory,
42
- BooleanLiteralFactory: () => BooleanLiteralFactory,
43
- DataFieldAttributeFactory: () => DataFieldAttributeFactory,
44
- DataFieldFactory: () => DataFieldFactory,
45
- DataFieldTypeFactory: () => DataFieldTypeFactory,
46
- DataModelAttributeFactory: () => DataModelAttributeFactory,
47
- DataModelFactory: () => DataModelFactory,
48
- DeclarationBuilder: () => DeclarationBuilder,
49
- EnumFactory: () => EnumFactory,
50
- EnumFieldFactory: () => EnumFieldFactory,
51
- ExpressionBuilder: () => ExpressionBuilder,
52
- FieldInitializerFactory: () => FieldInitializerFactory,
53
- InternalAttributeFactory: () => InternalAttributeFactory,
54
- InvocationExprFactory: () => InvocationExprFactory,
55
- MemberAccessExprFactory: () => MemberAccessExprFactory,
56
- ModelFactory: () => ModelFactory,
57
- ModelImportFactory: () => ModelImportFactory,
58
- NullExprFactory: () => NullExprFactory,
59
- NumberLiteralFactory: () => NumberLiteralFactory,
60
- ObjectExprFactory: () => ObjectExprFactory,
61
- ReferenceArgFactory: () => ReferenceArgFactory,
62
- ReferenceExprFactory: () => ReferenceExprFactory,
63
- StringLiteralFactory: () => StringLiteralFactory,
64
- ThisExprFactory: () => ThisExprFactory,
65
- UnaryExprFactory: () => UnaryExprFactory,
66
- UnsupportedFieldTypeFactory: () => UnsupportedFieldTypeFactory
67
- });
68
- module.exports = __toCommonJS(factory_exports);
69
-
70
- // src/factory/ast-factory.ts
71
- var AstFactory = class _AstFactory {
72
- static {
73
- __name(this, "AstFactory");
74
- }
75
- node = {};
76
- constructor({ type, node }) {
77
- this.node.$type = type;
78
- if (node) {
79
- this.update(node);
80
- }
81
- }
82
- setContainer(container) {
83
- this.node.$container = container;
84
- return this;
85
- }
86
- get(params) {
87
- if (params) this.update(params);
88
- return this.node;
89
- }
90
- update(nodeArg) {
91
- const keys = Object.keys(nodeArg);
92
- keys.forEach((key) => {
93
- const child = nodeArg[key];
94
- if (child instanceof _AstFactory) {
95
- this.node[key] = child.get({
96
- $container: this.node
97
- });
98
- } else if (Array.isArray(child)) {
99
- this.node[key] = child.map((item) => item instanceof _AstFactory ? item.get({
100
- $container: this.node
101
- }) : item);
102
- } else {
103
- this.node[key] = child;
104
- }
105
- });
106
- return this.node;
107
- }
108
- };
109
-
110
- // src/generated/ast.ts
111
- var langium = __toESM(require("langium"), 1);
112
- var AbstractDeclaration = "AbstractDeclaration";
113
- var ConfigExpr = "ConfigExpr";
114
- var Expression = "Expression";
115
- var LiteralExpr = "LiteralExpr";
116
- var MemberAccessTarget = "MemberAccessTarget";
117
- var ReferenceTarget = "ReferenceTarget";
118
- var TypeDeclaration = "TypeDeclaration";
119
- var Argument = "Argument";
120
- var ArrayExpr = "ArrayExpr";
121
- var Attribute = "Attribute";
122
- var AttributeArg = "AttributeArg";
123
- var AttributeParam = "AttributeParam";
124
- var AttributeParamType = "AttributeParamType";
125
- var BinaryExpr = "BinaryExpr";
126
- var BooleanLiteral = "BooleanLiteral";
127
- var CollectionPredicateBinding = "CollectionPredicateBinding";
128
- var ConfigArrayExpr = "ConfigArrayExpr";
129
- var ConfigField = "ConfigField";
130
- var ConfigInvocationArg = "ConfigInvocationArg";
131
- var ConfigInvocationExpr = "ConfigInvocationExpr";
132
- var DataField = "DataField";
133
- var DataFieldAttribute = "DataFieldAttribute";
134
- var DataFieldType = "DataFieldType";
135
- var DataModel = "DataModel";
136
- var DataModelAttribute = "DataModelAttribute";
137
- var DataSource = "DataSource";
138
- var Enum = "Enum";
139
- var EnumField = "EnumField";
140
- var FieldInitializer = "FieldInitializer";
141
- var FunctionDecl = "FunctionDecl";
142
- var FunctionParam = "FunctionParam";
143
- var FunctionParamType = "FunctionParamType";
144
- var GeneratorDecl = "GeneratorDecl";
145
- var InternalAttribute = "InternalAttribute";
146
- var InvocationExpr = "InvocationExpr";
147
- var MemberAccessExpr = "MemberAccessExpr";
148
- var Model = "Model";
149
- var ModelImport = "ModelImport";
150
- var NullExpr = "NullExpr";
151
- var NumberLiteral = "NumberLiteral";
152
- var ObjectExpr = "ObjectExpr";
153
- var Plugin = "Plugin";
154
- var PluginField = "PluginField";
155
- var Procedure = "Procedure";
156
- var ProcedureParam = "ProcedureParam";
157
- var ReferenceArg = "ReferenceArg";
158
- var ReferenceExpr = "ReferenceExpr";
159
- var StringLiteral = "StringLiteral";
160
- var ThisExpr = "ThisExpr";
161
- var TypeDef = "TypeDef";
162
- var UnaryExpr = "UnaryExpr";
163
- var UnsupportedFieldType = "UnsupportedFieldType";
164
- var ZModelAstReflection = class extends langium.AbstractAstReflection {
165
- static {
166
- __name(this, "ZModelAstReflection");
167
- }
168
- getAllTypes() {
169
- return [
170
- AbstractDeclaration,
171
- Argument,
172
- ArrayExpr,
173
- Attribute,
174
- AttributeArg,
175
- AttributeParam,
176
- AttributeParamType,
177
- BinaryExpr,
178
- BooleanLiteral,
179
- CollectionPredicateBinding,
180
- ConfigArrayExpr,
181
- ConfigExpr,
182
- ConfigField,
183
- ConfigInvocationArg,
184
- ConfigInvocationExpr,
185
- DataField,
186
- DataFieldAttribute,
187
- DataFieldType,
188
- DataModel,
189
- DataModelAttribute,
190
- DataSource,
191
- Enum,
192
- EnumField,
193
- Expression,
194
- FieldInitializer,
195
- FunctionDecl,
196
- FunctionParam,
197
- FunctionParamType,
198
- GeneratorDecl,
199
- InternalAttribute,
200
- InvocationExpr,
201
- LiteralExpr,
202
- MemberAccessExpr,
203
- MemberAccessTarget,
204
- Model,
205
- ModelImport,
206
- NullExpr,
207
- NumberLiteral,
208
- ObjectExpr,
209
- Plugin,
210
- PluginField,
211
- Procedure,
212
- ProcedureParam,
213
- ReferenceArg,
214
- ReferenceExpr,
215
- ReferenceTarget,
216
- StringLiteral,
217
- ThisExpr,
218
- TypeDeclaration,
219
- TypeDef,
220
- UnaryExpr,
221
- UnsupportedFieldType
222
- ];
223
- }
224
- computeIsSubtype(subtype, supertype) {
225
- switch (subtype) {
226
- case ArrayExpr:
227
- case BinaryExpr:
228
- case MemberAccessExpr:
229
- case NullExpr:
230
- case ObjectExpr:
231
- case ReferenceExpr:
232
- case ThisExpr:
233
- case UnaryExpr: {
234
- return this.isSubtype(Expression, supertype);
235
- }
236
- case Attribute:
237
- case DataSource:
238
- case FunctionDecl:
239
- case GeneratorDecl:
240
- case Plugin:
241
- case Procedure: {
242
- return this.isSubtype(AbstractDeclaration, supertype);
243
- }
244
- case BooleanLiteral:
245
- case NumberLiteral:
246
- case StringLiteral: {
247
- return this.isSubtype(LiteralExpr, supertype);
248
- }
249
- case CollectionPredicateBinding:
250
- case EnumField:
251
- case FunctionParam: {
252
- return this.isSubtype(ReferenceTarget, supertype);
253
- }
254
- case ConfigArrayExpr: {
255
- return this.isSubtype(ConfigExpr, supertype);
256
- }
257
- case DataField: {
258
- return this.isSubtype(MemberAccessTarget, supertype) || this.isSubtype(ReferenceTarget, supertype);
259
- }
260
- case DataModel:
261
- case Enum:
262
- case TypeDef: {
263
- return this.isSubtype(AbstractDeclaration, supertype) || this.isSubtype(TypeDeclaration, supertype);
264
- }
265
- case InvocationExpr:
266
- case LiteralExpr: {
267
- return this.isSubtype(ConfigExpr, supertype) || this.isSubtype(Expression, supertype);
268
- }
269
- default: {
270
- return false;
271
- }
272
- }
273
- }
274
- getReferenceType(refInfo) {
275
- const referenceId = `${refInfo.container.$type}:${refInfo.property}`;
276
- switch (referenceId) {
277
- case "AttributeParamType:reference":
278
- case "DataFieldType:reference":
279
- case "FunctionParamType:reference": {
280
- return TypeDeclaration;
281
- }
282
- case "DataFieldAttribute:decl":
283
- case "DataModelAttribute:decl":
284
- case "InternalAttribute:decl": {
285
- return Attribute;
286
- }
287
- case "DataModel:baseModel": {
288
- return DataModel;
289
- }
290
- case "DataModel:mixins":
291
- case "TypeDef:mixins": {
292
- return TypeDef;
293
- }
294
- case "InvocationExpr:function": {
295
- return FunctionDecl;
296
- }
297
- case "MemberAccessExpr:member": {
298
- return MemberAccessTarget;
299
- }
300
- case "ReferenceExpr:target": {
301
- return ReferenceTarget;
302
- }
303
- default: {
304
- throw new Error(`${referenceId} is not a valid reference id.`);
305
- }
306
- }
307
- }
308
- getTypeMetaData(type) {
309
- switch (type) {
310
- case Argument: {
311
- return {
312
- name: Argument,
313
- properties: [
314
- {
315
- name: "value"
316
- }
317
- ]
318
- };
319
- }
320
- case ArrayExpr: {
321
- return {
322
- name: ArrayExpr,
323
- properties: [
324
- {
325
- name: "items",
326
- defaultValue: []
327
- }
328
- ]
329
- };
330
- }
331
- case Attribute: {
332
- return {
333
- name: Attribute,
334
- properties: [
335
- {
336
- name: "attributes",
337
- defaultValue: []
338
- },
339
- {
340
- name: "comments",
341
- defaultValue: []
342
- },
343
- {
344
- name: "name"
345
- },
346
- {
347
- name: "params",
348
- defaultValue: []
349
- }
350
- ]
351
- };
352
- }
353
- case AttributeArg: {
354
- return {
355
- name: AttributeArg,
356
- properties: [
357
- {
358
- name: "name"
359
- },
360
- {
361
- name: "value"
362
- }
363
- ]
364
- };
365
- }
366
- case AttributeParam: {
367
- return {
368
- name: AttributeParam,
369
- properties: [
370
- {
371
- name: "attributes",
372
- defaultValue: []
373
- },
374
- {
375
- name: "comments",
376
- defaultValue: []
377
- },
378
- {
379
- name: "default",
380
- defaultValue: false
381
- },
382
- {
383
- name: "name"
384
- },
385
- {
386
- name: "type"
387
- }
388
- ]
389
- };
390
- }
391
- case AttributeParamType: {
392
- return {
393
- name: AttributeParamType,
394
- properties: [
395
- {
396
- name: "array",
397
- defaultValue: false
398
- },
399
- {
400
- name: "optional",
401
- defaultValue: false
402
- },
403
- {
404
- name: "reference"
405
- },
406
- {
407
- name: "type"
408
- }
409
- ]
410
- };
411
- }
412
- case BinaryExpr: {
413
- return {
414
- name: BinaryExpr,
415
- properties: [
416
- {
417
- name: "binding"
418
- },
419
- {
420
- name: "left"
421
- },
422
- {
423
- name: "operator"
424
- },
425
- {
426
- name: "right"
427
- }
428
- ]
429
- };
430
- }
431
- case BooleanLiteral: {
432
- return {
433
- name: BooleanLiteral,
434
- properties: [
435
- {
436
- name: "value"
437
- }
438
- ]
439
- };
440
- }
441
- case CollectionPredicateBinding: {
442
- return {
443
- name: CollectionPredicateBinding,
444
- properties: [
445
- {
446
- name: "name"
447
- }
448
- ]
449
- };
450
- }
451
- case ConfigArrayExpr: {
452
- return {
453
- name: ConfigArrayExpr,
454
- properties: [
455
- {
456
- name: "items",
457
- defaultValue: []
458
- }
459
- ]
460
- };
461
- }
462
- case ConfigField: {
463
- return {
464
- name: ConfigField,
465
- properties: [
466
- {
467
- name: "name"
468
- },
469
- {
470
- name: "value"
471
- }
472
- ]
473
- };
474
- }
475
- case ConfigInvocationArg: {
476
- return {
477
- name: ConfigInvocationArg,
478
- properties: [
479
- {
480
- name: "name"
481
- },
482
- {
483
- name: "value"
484
- }
485
- ]
486
- };
487
- }
488
- case ConfigInvocationExpr: {
489
- return {
490
- name: ConfigInvocationExpr,
491
- properties: [
492
- {
493
- name: "args",
494
- defaultValue: []
495
- },
496
- {
497
- name: "name"
498
- }
499
- ]
500
- };
501
- }
502
- case DataField: {
503
- return {
504
- name: DataField,
505
- properties: [
506
- {
507
- name: "attributes",
508
- defaultValue: []
509
- },
510
- {
511
- name: "comments",
512
- defaultValue: []
513
- },
514
- {
515
- name: "name"
516
- },
517
- {
518
- name: "type"
519
- }
520
- ]
521
- };
522
- }
523
- case DataFieldAttribute: {
524
- return {
525
- name: DataFieldAttribute,
526
- properties: [
527
- {
528
- name: "args",
529
- defaultValue: []
530
- },
531
- {
532
- name: "decl"
533
- }
534
- ]
535
- };
536
- }
537
- case DataFieldType: {
538
- return {
539
- name: DataFieldType,
540
- properties: [
541
- {
542
- name: "array",
543
- defaultValue: false
544
- },
545
- {
546
- name: "optional",
547
- defaultValue: false
548
- },
549
- {
550
- name: "reference"
551
- },
552
- {
553
- name: "type"
554
- },
555
- {
556
- name: "unsupported"
557
- }
558
- ]
559
- };
560
- }
561
- case DataModel: {
562
- return {
563
- name: DataModel,
564
- properties: [
565
- {
566
- name: "attributes",
567
- defaultValue: []
568
- },
569
- {
570
- name: "baseModel"
571
- },
572
- {
573
- name: "comments",
574
- defaultValue: []
575
- },
576
- {
577
- name: "fields",
578
- defaultValue: []
579
- },
580
- {
581
- name: "isView",
582
- defaultValue: false
583
- },
584
- {
585
- name: "mixins",
586
- defaultValue: []
587
- },
588
- {
589
- name: "name"
590
- }
591
- ]
592
- };
593
- }
594
- case DataModelAttribute: {
595
- return {
596
- name: DataModelAttribute,
597
- properties: [
598
- {
599
- name: "args",
600
- defaultValue: []
601
- },
602
- {
603
- name: "decl"
604
- }
605
- ]
606
- };
607
- }
608
- case DataSource: {
609
- return {
610
- name: DataSource,
611
- properties: [
612
- {
613
- name: "fields",
614
- defaultValue: []
615
- },
616
- {
617
- name: "name"
618
- }
619
- ]
620
- };
621
- }
622
- case Enum: {
623
- return {
624
- name: Enum,
625
- properties: [
626
- {
627
- name: "attributes",
628
- defaultValue: []
629
- },
630
- {
631
- name: "comments",
632
- defaultValue: []
633
- },
634
- {
635
- name: "fields",
636
- defaultValue: []
637
- },
638
- {
639
- name: "name"
640
- }
641
- ]
642
- };
643
- }
644
- case EnumField: {
645
- return {
646
- name: EnumField,
647
- properties: [
648
- {
649
- name: "attributes",
650
- defaultValue: []
651
- },
652
- {
653
- name: "comments",
654
- defaultValue: []
655
- },
656
- {
657
- name: "name"
658
- }
659
- ]
660
- };
661
- }
662
- case FieldInitializer: {
663
- return {
664
- name: FieldInitializer,
665
- properties: [
666
- {
667
- name: "name"
668
- },
669
- {
670
- name: "value"
671
- }
672
- ]
673
- };
674
- }
675
- case FunctionDecl: {
676
- return {
677
- name: FunctionDecl,
678
- properties: [
679
- {
680
- name: "attributes",
681
- defaultValue: []
682
- },
683
- {
684
- name: "expression"
685
- },
686
- {
687
- name: "name"
688
- },
689
- {
690
- name: "params",
691
- defaultValue: []
692
- },
693
- {
694
- name: "returnType"
695
- }
696
- ]
697
- };
698
- }
699
- case FunctionParam: {
700
- return {
701
- name: FunctionParam,
702
- properties: [
703
- {
704
- name: "name"
705
- },
706
- {
707
- name: "optional",
708
- defaultValue: false
709
- },
710
- {
711
- name: "type"
712
- }
713
- ]
714
- };
715
- }
716
- case FunctionParamType: {
717
- return {
718
- name: FunctionParamType,
719
- properties: [
720
- {
721
- name: "array",
722
- defaultValue: false
723
- },
724
- {
725
- name: "reference"
726
- },
727
- {
728
- name: "type"
729
- }
730
- ]
731
- };
732
- }
733
- case GeneratorDecl: {
734
- return {
735
- name: GeneratorDecl,
736
- properties: [
737
- {
738
- name: "fields",
739
- defaultValue: []
740
- },
741
- {
742
- name: "name"
743
- }
744
- ]
745
- };
746
- }
747
- case InternalAttribute: {
748
- return {
749
- name: InternalAttribute,
750
- properties: [
751
- {
752
- name: "args",
753
- defaultValue: []
754
- },
755
- {
756
- name: "decl"
757
- }
758
- ]
759
- };
760
- }
761
- case InvocationExpr: {
762
- return {
763
- name: InvocationExpr,
764
- properties: [
765
- {
766
- name: "args",
767
- defaultValue: []
768
- },
769
- {
770
- name: "function"
771
- }
772
- ]
773
- };
774
- }
775
- case MemberAccessExpr: {
776
- return {
777
- name: MemberAccessExpr,
778
- properties: [
779
- {
780
- name: "member"
781
- },
782
- {
783
- name: "operand"
784
- }
785
- ]
786
- };
787
- }
788
- case Model: {
789
- return {
790
- name: Model,
791
- properties: [
792
- {
793
- name: "declarations",
794
- defaultValue: []
795
- },
796
- {
797
- name: "imports",
798
- defaultValue: []
799
- }
800
- ]
801
- };
802
- }
803
- case ModelImport: {
804
- return {
805
- name: ModelImport,
806
- properties: [
807
- {
808
- name: "path"
809
- }
810
- ]
811
- };
812
- }
813
- case NullExpr: {
814
- return {
815
- name: NullExpr,
816
- properties: [
817
- {
818
- name: "value"
819
- }
820
- ]
821
- };
822
- }
823
- case NumberLiteral: {
824
- return {
825
- name: NumberLiteral,
826
- properties: [
827
- {
828
- name: "value"
829
- }
830
- ]
831
- };
832
- }
833
- case ObjectExpr: {
834
- return {
835
- name: ObjectExpr,
836
- properties: [
837
- {
838
- name: "fields",
839
- defaultValue: []
840
- }
841
- ]
842
- };
843
- }
844
- case Plugin: {
845
- return {
846
- name: Plugin,
847
- properties: [
848
- {
849
- name: "fields",
850
- defaultValue: []
851
- },
852
- {
853
- name: "name"
854
- }
855
- ]
856
- };
857
- }
858
- case PluginField: {
859
- return {
860
- name: PluginField,
861
- properties: [
862
- {
863
- name: "name"
864
- },
865
- {
866
- name: "value"
867
- }
868
- ]
869
- };
870
- }
871
- case Procedure: {
872
- return {
873
- name: Procedure,
874
- properties: [
875
- {
876
- name: "attributes",
877
- defaultValue: []
878
- },
879
- {
880
- name: "mutation",
881
- defaultValue: false
882
- },
883
- {
884
- name: "name"
885
- },
886
- {
887
- name: "params",
888
- defaultValue: []
889
- },
890
- {
891
- name: "returnType"
892
- }
893
- ]
894
- };
895
- }
896
- case ProcedureParam: {
897
- return {
898
- name: ProcedureParam,
899
- properties: [
900
- {
901
- name: "name"
902
- },
903
- {
904
- name: "optional",
905
- defaultValue: false
906
- },
907
- {
908
- name: "type"
909
- }
910
- ]
911
- };
912
- }
913
- case ReferenceArg: {
914
- return {
915
- name: ReferenceArg,
916
- properties: [
917
- {
918
- name: "name"
919
- },
920
- {
921
- name: "value"
922
- }
923
- ]
924
- };
925
- }
926
- case ReferenceExpr: {
927
- return {
928
- name: ReferenceExpr,
929
- properties: [
930
- {
931
- name: "args",
932
- defaultValue: []
933
- },
934
- {
935
- name: "target"
936
- }
937
- ]
938
- };
939
- }
940
- case StringLiteral: {
941
- return {
942
- name: StringLiteral,
943
- properties: [
944
- {
945
- name: "value"
946
- }
947
- ]
948
- };
949
- }
950
- case ThisExpr: {
951
- return {
952
- name: ThisExpr,
953
- properties: [
954
- {
955
- name: "value"
956
- }
957
- ]
958
- };
959
- }
960
- case TypeDef: {
961
- return {
962
- name: TypeDef,
963
- properties: [
964
- {
965
- name: "attributes",
966
- defaultValue: []
967
- },
968
- {
969
- name: "comments",
970
- defaultValue: []
971
- },
972
- {
973
- name: "fields",
974
- defaultValue: []
975
- },
976
- {
977
- name: "mixins",
978
- defaultValue: []
979
- },
980
- {
981
- name: "name"
982
- }
983
- ]
984
- };
985
- }
986
- case UnaryExpr: {
987
- return {
988
- name: UnaryExpr,
989
- properties: [
990
- {
991
- name: "operand"
992
- },
993
- {
994
- name: "operator"
995
- }
996
- ]
997
- };
998
- }
999
- case UnsupportedFieldType: {
1000
- return {
1001
- name: UnsupportedFieldType,
1002
- properties: [
1003
- {
1004
- name: "value"
1005
- }
1006
- ]
1007
- };
1008
- }
1009
- default: {
1010
- return {
1011
- name: type,
1012
- properties: []
1013
- };
1014
- }
1015
- }
1016
- }
1017
- };
1018
- var reflection = new ZModelAstReflection();
1019
-
1020
- // src/factory/primitives.ts
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_ast = require("./ast-Clidp86c.cjs");
3
+ require("./ast.cjs");
4
+ //#region src/factory/ast-factory.ts
5
+ var AstFactory = class AstFactory {
6
+ node = {};
7
+ constructor({ type, node }) {
8
+ this.node.$type = type;
9
+ if (node) this.update(node);
10
+ }
11
+ setContainer(container) {
12
+ this.node.$container = container;
13
+ return this;
14
+ }
15
+ get(params) {
16
+ if (params) this.update(params);
17
+ return this.node;
18
+ }
19
+ update(nodeArg) {
20
+ Object.keys(nodeArg).forEach((key) => {
21
+ const child = nodeArg[key];
22
+ if (child instanceof AstFactory) this.node[key] = child.get({ $container: this.node });
23
+ else if (Array.isArray(child)) this.node[key] = child.map((item) => item instanceof AstFactory ? item.get({ $container: this.node }) : item);
24
+ else this.node[key] = child;
25
+ });
26
+ return this.node;
27
+ }
28
+ };
29
+ //#endregion
30
+ //#region src/factory/primitives.ts
1021
31
  var ThisExprFactory = class extends AstFactory {
1022
- static {
1023
- __name(this, "ThisExprFactory");
1024
- }
1025
- constructor() {
1026
- super({
1027
- type: ThisExpr,
1028
- node: {
1029
- value: "this"
1030
- }
1031
- });
1032
- }
32
+ constructor() {
33
+ super({
34
+ type: require_ast.ThisExpr,
35
+ node: { value: "this" }
36
+ });
37
+ }
1033
38
  };
1034
39
  var NullExprFactory = class extends AstFactory {
1035
- static {
1036
- __name(this, "NullExprFactory");
1037
- }
1038
- constructor() {
1039
- super({
1040
- type: NullExpr,
1041
- node: {
1042
- value: "null"
1043
- }
1044
- });
1045
- }
40
+ constructor() {
41
+ super({
42
+ type: require_ast.NullExpr,
43
+ node: { value: "null" }
44
+ });
45
+ }
1046
46
  };
1047
47
  var NumberLiteralFactory = class extends AstFactory {
1048
- static {
1049
- __name(this, "NumberLiteralFactory");
1050
- }
1051
- value;
1052
- constructor() {
1053
- super({
1054
- type: NumberLiteral
1055
- });
1056
- }
1057
- setValue(value) {
1058
- this.value = value;
1059
- this.update({
1060
- value: this.value.toString()
1061
- });
1062
- return this;
1063
- }
48
+ value;
49
+ constructor() {
50
+ super({ type: require_ast.NumberLiteral });
51
+ }
52
+ setValue(value) {
53
+ this.value = value;
54
+ this.update({ value: this.value.toString() });
55
+ return this;
56
+ }
1064
57
  };
1065
58
  var StringLiteralFactory = class extends AstFactory {
1066
- static {
1067
- __name(this, "StringLiteralFactory");
1068
- }
1069
- value;
1070
- constructor() {
1071
- super({
1072
- type: StringLiteral
1073
- });
1074
- }
1075
- setValue(value) {
1076
- this.value = value;
1077
- this.update({
1078
- value: this.value
1079
- });
1080
- return this;
1081
- }
59
+ value;
60
+ constructor() {
61
+ super({ type: require_ast.StringLiteral });
62
+ }
63
+ setValue(value) {
64
+ this.value = value;
65
+ this.update({ value: this.value });
66
+ return this;
67
+ }
1082
68
  };
1083
69
  var BooleanLiteralFactory = class extends AstFactory {
1084
- static {
1085
- __name(this, "BooleanLiteralFactory");
1086
- }
1087
- value;
1088
- constructor() {
1089
- super({
1090
- type: BooleanLiteral
1091
- });
1092
- }
1093
- setValue(value) {
1094
- this.value = value;
1095
- this.update({
1096
- value: this.value
1097
- });
1098
- return this;
1099
- }
1100
- };
1101
-
1102
- // src/factory/expression.ts
1103
- var ExpressionBuilder = /* @__PURE__ */ __name(() => ({
1104
- get ArrayExpr() {
1105
- return new ArrayExprFactory();
1106
- },
1107
- get BinaryExpr() {
1108
- return new BinaryExprFactory();
1109
- },
1110
- get BooleanLiteral() {
1111
- return new BooleanLiteralFactory();
1112
- },
1113
- get InvocationExpr() {
1114
- return new InvocationExprFactory();
1115
- },
1116
- get MemberAccessExpr() {
1117
- return new MemberAccessExprFactory();
1118
- },
1119
- get NullExpr() {
1120
- return new NullExprFactory();
1121
- },
1122
- get NumberLiteral() {
1123
- return new NumberLiteralFactory();
1124
- },
1125
- get ObjectExpr() {
1126
- return new ObjectExprFactory();
1127
- },
1128
- get ReferenceExpr() {
1129
- return new ReferenceExprFactory();
1130
- },
1131
- get StringLiteral() {
1132
- return new StringLiteralFactory();
1133
- },
1134
- get ThisExpr() {
1135
- return new ThisExprFactory();
1136
- },
1137
- get UnaryExpr() {
1138
- return new UnaryExprFactory();
1139
- }
1140
- }), "ExpressionBuilder");
70
+ value;
71
+ constructor() {
72
+ super({ type: require_ast.BooleanLiteral });
73
+ }
74
+ setValue(value) {
75
+ this.value = value;
76
+ this.update({ value: this.value });
77
+ return this;
78
+ }
79
+ };
80
+ //#endregion
81
+ //#region src/factory/expression.ts
82
+ const ExpressionBuilder = () => ({
83
+ get ArrayExpr() {
84
+ return new ArrayExprFactory();
85
+ },
86
+ get BinaryExpr() {
87
+ return new BinaryExprFactory();
88
+ },
89
+ get BooleanLiteral() {
90
+ return new BooleanLiteralFactory();
91
+ },
92
+ get InvocationExpr() {
93
+ return new InvocationExprFactory();
94
+ },
95
+ get MemberAccessExpr() {
96
+ return new MemberAccessExprFactory();
97
+ },
98
+ get NullExpr() {
99
+ return new NullExprFactory();
100
+ },
101
+ get NumberLiteral() {
102
+ return new NumberLiteralFactory();
103
+ },
104
+ get ObjectExpr() {
105
+ return new ObjectExprFactory();
106
+ },
107
+ get ReferenceExpr() {
108
+ return new ReferenceExprFactory();
109
+ },
110
+ get StringLiteral() {
111
+ return new StringLiteralFactory();
112
+ },
113
+ get ThisExpr() {
114
+ return new ThisExprFactory();
115
+ },
116
+ get UnaryExpr() {
117
+ return new UnaryExprFactory();
118
+ }
119
+ });
1141
120
  var UnaryExprFactory = class extends AstFactory {
1142
- static {
1143
- __name(this, "UnaryExprFactory");
1144
- }
1145
- operand;
1146
- constructor() {
1147
- super({
1148
- type: UnaryExpr,
1149
- node: {
1150
- operator: "!"
1151
- }
1152
- });
1153
- }
1154
- setOperand(builder) {
1155
- this.operand = builder(ExpressionBuilder());
1156
- this.update({
1157
- operand: this.operand
1158
- });
1159
- return this;
1160
- }
121
+ operand;
122
+ constructor() {
123
+ super({
124
+ type: require_ast.UnaryExpr,
125
+ node: { operator: "!" }
126
+ });
127
+ }
128
+ setOperand(builder) {
129
+ this.operand = builder(ExpressionBuilder());
130
+ this.update({ operand: this.operand });
131
+ return this;
132
+ }
1161
133
  };
1162
134
  var ReferenceExprFactory = class extends AstFactory {
1163
- static {
1164
- __name(this, "ReferenceExprFactory");
1165
- }
1166
- target;
1167
- args = [];
1168
- constructor() {
1169
- super({
1170
- type: ReferenceExpr,
1171
- node: {
1172
- args: []
1173
- }
1174
- });
1175
- }
1176
- setTarget(target) {
1177
- this.target = {
1178
- $refText: target.name,
1179
- ref: target
1180
- };
1181
- this.update({
1182
- target: this.target
1183
- });
1184
- return this;
1185
- }
1186
- addArg(builder, name) {
1187
- const arg = new ReferenceArgFactory().setValue(builder);
1188
- if (name) {
1189
- arg.setName(name);
1190
- }
1191
- this.args.push(arg);
1192
- this.update({
1193
- args: this.args
1194
- });
1195
- return this;
1196
- }
135
+ target;
136
+ args = [];
137
+ constructor() {
138
+ super({
139
+ type: require_ast.ReferenceExpr,
140
+ node: { args: [] }
141
+ });
142
+ }
143
+ setTarget(target) {
144
+ this.target = {
145
+ $refText: target.name,
146
+ ref: target
147
+ };
148
+ this.update({ target: this.target });
149
+ return this;
150
+ }
151
+ addArg(builder, name) {
152
+ const arg = new ReferenceArgFactory().setValue(builder);
153
+ if (name) arg.setName(name);
154
+ this.args.push(arg);
155
+ this.update({ args: this.args });
156
+ return this;
157
+ }
1197
158
  };
1198
159
  var ReferenceArgFactory = class extends AstFactory {
1199
- static {
1200
- __name(this, "ReferenceArgFactory");
1201
- }
1202
- name;
1203
- value;
1204
- constructor() {
1205
- super({
1206
- type: ReferenceArg
1207
- });
1208
- }
1209
- setName(name) {
1210
- this.name = name;
1211
- this.update({
1212
- name: this.name
1213
- });
1214
- return this;
1215
- }
1216
- setValue(builder) {
1217
- this.value = builder(ExpressionBuilder());
1218
- this.update({
1219
- value: this.value
1220
- });
1221
- return this;
1222
- }
160
+ name;
161
+ value;
162
+ constructor() {
163
+ super({ type: require_ast.ReferenceArg });
164
+ }
165
+ setName(name) {
166
+ this.name = name;
167
+ this.update({ name: this.name });
168
+ return this;
169
+ }
170
+ setValue(builder) {
171
+ this.value = builder(ExpressionBuilder());
172
+ this.update({ value: this.value });
173
+ return this;
174
+ }
1223
175
  };
1224
176
  var MemberAccessExprFactory = class extends AstFactory {
1225
- static {
1226
- __name(this, "MemberAccessExprFactory");
1227
- }
1228
- member;
1229
- operand;
1230
- constructor() {
1231
- super({
1232
- type: MemberAccessExpr
1233
- });
1234
- }
1235
- setMember(target) {
1236
- this.member = target;
1237
- this.update({
1238
- member: this.member
1239
- });
1240
- return this;
1241
- }
1242
- setOperand(builder) {
1243
- this.operand = builder(ExpressionBuilder());
1244
- this.update({
1245
- operand: this.operand
1246
- });
1247
- return this;
1248
- }
177
+ member;
178
+ operand;
179
+ constructor() {
180
+ super({ type: require_ast.MemberAccessExpr });
181
+ }
182
+ setMember(target) {
183
+ this.member = target;
184
+ this.update({ member: this.member });
185
+ return this;
186
+ }
187
+ setOperand(builder) {
188
+ this.operand = builder(ExpressionBuilder());
189
+ this.update({ operand: this.operand });
190
+ return this;
191
+ }
1249
192
  };
1250
193
  var ObjectExprFactory = class extends AstFactory {
1251
- static {
1252
- __name(this, "ObjectExprFactory");
1253
- }
1254
- fields = [];
1255
- constructor() {
1256
- super({
1257
- type: ObjectExpr,
1258
- node: {
1259
- fields: []
1260
- }
1261
- });
1262
- }
1263
- addField(builder) {
1264
- this.fields.push(builder(new FieldInitializerFactory()));
1265
- this.update({
1266
- fields: this.fields
1267
- });
1268
- return this;
1269
- }
194
+ fields = [];
195
+ constructor() {
196
+ super({
197
+ type: require_ast.ObjectExpr,
198
+ node: { fields: [] }
199
+ });
200
+ }
201
+ addField(builder) {
202
+ this.fields.push(builder(new FieldInitializerFactory()));
203
+ this.update({ fields: this.fields });
204
+ return this;
205
+ }
1270
206
  };
1271
207
  var FieldInitializerFactory = class extends AstFactory {
1272
- static {
1273
- __name(this, "FieldInitializerFactory");
1274
- }
1275
- name;
1276
- value;
1277
- constructor() {
1278
- super({
1279
- type: FieldInitializer
1280
- });
1281
- }
1282
- setName(name) {
1283
- this.name = name;
1284
- this.update({
1285
- name: this.name
1286
- });
1287
- return this;
1288
- }
1289
- setValue(builder) {
1290
- this.value = builder(ExpressionBuilder());
1291
- this.update({
1292
- value: this.value
1293
- });
1294
- return this;
1295
- }
208
+ name;
209
+ value;
210
+ constructor() {
211
+ super({ type: require_ast.FieldInitializer });
212
+ }
213
+ setName(name) {
214
+ this.name = name;
215
+ this.update({ name: this.name });
216
+ return this;
217
+ }
218
+ setValue(builder) {
219
+ this.value = builder(ExpressionBuilder());
220
+ this.update({ value: this.value });
221
+ return this;
222
+ }
1296
223
  };
1297
224
  var InvocationExprFactory = class extends AstFactory {
1298
- static {
1299
- __name(this, "InvocationExprFactory");
1300
- }
1301
- args = [];
1302
- function;
1303
- constructor() {
1304
- super({
1305
- type: InvocationExpr,
1306
- node: {
1307
- args: []
1308
- }
1309
- });
1310
- }
1311
- addArg(builder) {
1312
- this.args.push(builder(new ArgumentFactory()));
1313
- this.update({
1314
- args: this.args
1315
- });
1316
- return this;
1317
- }
1318
- setFunction(value) {
1319
- this.function = {
1320
- $refText: value.name,
1321
- ref: value
1322
- };
1323
- this.update({
1324
- function: this.function
1325
- });
1326
- return this;
1327
- }
225
+ args = [];
226
+ function;
227
+ constructor() {
228
+ super({
229
+ type: require_ast.InvocationExpr,
230
+ node: { args: [] }
231
+ });
232
+ }
233
+ addArg(builder) {
234
+ this.args.push(builder(new ArgumentFactory()));
235
+ this.update({ args: this.args });
236
+ return this;
237
+ }
238
+ setFunction(value) {
239
+ this.function = {
240
+ $refText: value.name,
241
+ ref: value
242
+ };
243
+ this.update({ function: this.function });
244
+ return this;
245
+ }
1328
246
  };
1329
247
  var ArgumentFactory = class extends AstFactory {
1330
- static {
1331
- __name(this, "ArgumentFactory");
1332
- }
1333
- value;
1334
- constructor() {
1335
- super({
1336
- type: Argument
1337
- });
1338
- }
1339
- setValue(builder) {
1340
- this.value = builder(ExpressionBuilder());
1341
- this.update({
1342
- value: this.value
1343
- });
1344
- return this;
1345
- }
248
+ value;
249
+ constructor() {
250
+ super({ type: require_ast.Argument });
251
+ }
252
+ setValue(builder) {
253
+ this.value = builder(ExpressionBuilder());
254
+ this.update({ value: this.value });
255
+ return this;
256
+ }
1346
257
  };
1347
258
  var ArrayExprFactory = class extends AstFactory {
1348
- static {
1349
- __name(this, "ArrayExprFactory");
1350
- }
1351
- items = [];
1352
- constructor() {
1353
- super({
1354
- type: ArrayExpr,
1355
- node: {
1356
- items: []
1357
- }
1358
- });
1359
- }
1360
- addItem(builder) {
1361
- this.items.push(builder(ExpressionBuilder()));
1362
- this.update({
1363
- items: this.items
1364
- });
1365
- return this;
1366
- }
259
+ items = [];
260
+ constructor() {
261
+ super({
262
+ type: require_ast.ArrayExpr,
263
+ node: { items: [] }
264
+ });
265
+ }
266
+ addItem(builder) {
267
+ this.items.push(builder(ExpressionBuilder()));
268
+ this.update({ items: this.items });
269
+ return this;
270
+ }
1367
271
  };
1368
272
  var BinaryExprFactory = class extends AstFactory {
1369
- static {
1370
- __name(this, "BinaryExprFactory");
1371
- }
1372
- operator;
1373
- right;
1374
- left;
1375
- // TODO: add support for CollectionPredicateBinding
1376
- constructor() {
1377
- super({
1378
- type: BinaryExpr
1379
- });
1380
- }
1381
- setOperator(operator) {
1382
- this.operator = operator;
1383
- this.update({
1384
- operator: this.operator
1385
- });
1386
- return this;
1387
- }
1388
- setRight(builder) {
1389
- this.right = builder(ExpressionBuilder());
1390
- this.update({
1391
- right: this.right
1392
- });
1393
- return this;
1394
- }
1395
- setLeft(builder) {
1396
- this.left = builder(ExpressionBuilder());
1397
- this.update({
1398
- left: this.left
1399
- });
1400
- return this;
1401
- }
1402
- };
1403
-
1404
- // src/factory/attribute.ts
273
+ operator;
274
+ right;
275
+ left;
276
+ constructor() {
277
+ super({ type: require_ast.BinaryExpr });
278
+ }
279
+ setOperator(operator) {
280
+ this.operator = operator;
281
+ this.update({ operator: this.operator });
282
+ return this;
283
+ }
284
+ setRight(builder) {
285
+ this.right = builder(ExpressionBuilder());
286
+ this.update({ right: this.right });
287
+ return this;
288
+ }
289
+ setLeft(builder) {
290
+ this.left = builder(ExpressionBuilder());
291
+ this.update({ left: this.left });
292
+ return this;
293
+ }
294
+ };
295
+ //#endregion
296
+ //#region src/factory/attribute.ts
1405
297
  var DataFieldAttributeFactory = class extends AstFactory {
1406
- static {
1407
- __name(this, "DataFieldAttributeFactory");
1408
- }
1409
- args = [];
1410
- decl;
1411
- constructor() {
1412
- super({
1413
- type: DataFieldAttribute,
1414
- node: {
1415
- args: []
1416
- }
1417
- });
1418
- }
1419
- setDecl(decl) {
1420
- if (!decl) {
1421
- throw new Error("Attribute declaration is required");
1422
- }
1423
- this.decl = {
1424
- $refText: decl.name,
1425
- ref: decl
1426
- };
1427
- this.update({
1428
- decl: this.decl
1429
- });
1430
- return this;
1431
- }
1432
- addArg(builder, name) {
1433
- const factory = new AttributeArgFactory().setValue(builder);
1434
- if (name) {
1435
- factory.setName(name);
1436
- }
1437
- this.args.push(factory);
1438
- this.update({
1439
- args: this.args
1440
- });
1441
- return this;
1442
- }
298
+ args = [];
299
+ decl;
300
+ constructor() {
301
+ super({
302
+ type: require_ast.DataFieldAttribute,
303
+ node: { args: [] }
304
+ });
305
+ }
306
+ setDecl(decl) {
307
+ if (!decl) throw new Error("Attribute declaration is required");
308
+ this.decl = {
309
+ $refText: decl.name,
310
+ ref: decl
311
+ };
312
+ this.update({ decl: this.decl });
313
+ return this;
314
+ }
315
+ addArg(builder, name) {
316
+ const factory = new AttributeArgFactory().setValue(builder);
317
+ if (name) factory.setName(name);
318
+ this.args.push(factory);
319
+ this.update({ args: this.args });
320
+ return this;
321
+ }
1443
322
  };
1444
323
  var DataModelAttributeFactory = class extends AstFactory {
1445
- static {
1446
- __name(this, "DataModelAttributeFactory");
1447
- }
1448
- args = [];
1449
- decl;
1450
- constructor() {
1451
- super({
1452
- type: DataModelAttribute,
1453
- node: {
1454
- args: []
1455
- }
1456
- });
1457
- }
1458
- setDecl(decl) {
1459
- if (!decl) {
1460
- throw new Error("Attribute declaration is required");
1461
- }
1462
- this.decl = {
1463
- $refText: decl.name,
1464
- ref: decl
1465
- };
1466
- this.update({
1467
- decl: this.decl
1468
- });
1469
- return this;
1470
- }
1471
- addArg(builder, name) {
1472
- const factory = new AttributeArgFactory().setValue(builder);
1473
- if (name) {
1474
- factory.setName(name);
1475
- }
1476
- this.args.push(factory);
1477
- this.update({
1478
- args: this.args
1479
- });
1480
- return this;
1481
- }
324
+ args = [];
325
+ decl;
326
+ constructor() {
327
+ super({
328
+ type: require_ast.DataModelAttribute,
329
+ node: { args: [] }
330
+ });
331
+ }
332
+ setDecl(decl) {
333
+ if (!decl) throw new Error("Attribute declaration is required");
334
+ this.decl = {
335
+ $refText: decl.name,
336
+ ref: decl
337
+ };
338
+ this.update({ decl: this.decl });
339
+ return this;
340
+ }
341
+ addArg(builder, name) {
342
+ const factory = new AttributeArgFactory().setValue(builder);
343
+ if (name) factory.setName(name);
344
+ this.args.push(factory);
345
+ this.update({ args: this.args });
346
+ return this;
347
+ }
1482
348
  };
1483
349
  var AttributeArgFactory = class extends AstFactory {
1484
- static {
1485
- __name(this, "AttributeArgFactory");
1486
- }
1487
- name = "";
1488
- value;
1489
- constructor() {
1490
- super({
1491
- type: AttributeArg
1492
- });
1493
- }
1494
- setName(name) {
1495
- this.name = name;
1496
- this.update({
1497
- name: this.name
1498
- });
1499
- return this;
1500
- }
1501
- setValue(builder) {
1502
- this.value = builder(ExpressionBuilder());
1503
- this.update({
1504
- value: this.value
1505
- });
1506
- return this;
1507
- }
350
+ name = "";
351
+ value;
352
+ constructor() {
353
+ super({ type: require_ast.AttributeArg });
354
+ }
355
+ setName(name) {
356
+ this.name = name;
357
+ this.update({ name: this.name });
358
+ return this;
359
+ }
360
+ setValue(builder) {
361
+ this.value = builder(ExpressionBuilder());
362
+ this.update({ value: this.value });
363
+ return this;
364
+ }
1508
365
  };
1509
366
  var InternalAttributeFactory = class extends AstFactory {
1510
- static {
1511
- __name(this, "InternalAttributeFactory");
1512
- }
1513
- decl;
1514
- args = [];
1515
- constructor() {
1516
- super({
1517
- type: InternalAttribute,
1518
- node: {
1519
- args: []
1520
- }
1521
- });
1522
- }
1523
- setDecl(decl) {
1524
- this.decl = {
1525
- $refText: decl.name,
1526
- ref: decl
1527
- };
1528
- this.update({
1529
- decl: this.decl
1530
- });
1531
- return this;
1532
- }
1533
- addArg(builder, name) {
1534
- const factory = new AttributeArgFactory().setValue(builder);
1535
- if (name) {
1536
- factory.setName(name);
1537
- }
1538
- this.args.push(factory);
1539
- this.update({
1540
- args: this.args
1541
- });
1542
- return this;
1543
- }
367
+ decl;
368
+ args = [];
369
+ constructor() {
370
+ super({
371
+ type: require_ast.InternalAttribute,
372
+ node: { args: [] }
373
+ });
374
+ }
375
+ setDecl(decl) {
376
+ this.decl = {
377
+ $refText: decl.name,
378
+ ref: decl
379
+ };
380
+ this.update({ decl: this.decl });
381
+ return this;
382
+ }
383
+ addArg(builder, name) {
384
+ const factory = new AttributeArgFactory().setValue(builder);
385
+ if (name) factory.setName(name);
386
+ this.args.push(factory);
387
+ this.update({ args: this.args });
388
+ return this;
389
+ }
1544
390
  };
1545
391
  var AttributeParamFactory = class extends AstFactory {
1546
- static {
1547
- __name(this, "AttributeParamFactory");
1548
- }
1549
- attributes = [];
1550
- comments = [];
1551
- default;
1552
- name;
1553
- type;
1554
- constructor() {
1555
- super({
1556
- type: AttributeParam,
1557
- node: {
1558
- comments: [],
1559
- attributes: []
1560
- }
1561
- });
1562
- }
1563
- addAttribute(builder) {
1564
- this.attributes.push(builder(new InternalAttributeFactory()));
1565
- this.update({
1566
- attributes: this.attributes
1567
- });
1568
- return this;
1569
- }
1570
- setComments(comments) {
1571
- this.comments = comments;
1572
- this.update({
1573
- comments: this.comments
1574
- });
1575
- return this;
1576
- }
1577
- setDefault(defaultValue) {
1578
- this.default = defaultValue;
1579
- this.update({
1580
- default: this.default
1581
- });
1582
- return this;
1583
- }
1584
- setName(name) {
1585
- this.name = name;
1586
- this.update({
1587
- name: this.name
1588
- });
1589
- return this;
1590
- }
1591
- setType(builder) {
1592
- this.type = builder(new AttributeParamTypeFactory());
1593
- this.update({
1594
- type: this.type
1595
- });
1596
- return this;
1597
- }
392
+ attributes = [];
393
+ comments = [];
394
+ default;
395
+ name;
396
+ type;
397
+ constructor() {
398
+ super({
399
+ type: require_ast.AttributeParam,
400
+ node: {
401
+ comments: [],
402
+ attributes: []
403
+ }
404
+ });
405
+ }
406
+ addAttribute(builder) {
407
+ this.attributes.push(builder(new InternalAttributeFactory()));
408
+ this.update({ attributes: this.attributes });
409
+ return this;
410
+ }
411
+ setComments(comments) {
412
+ this.comments = comments;
413
+ this.update({ comments: this.comments });
414
+ return this;
415
+ }
416
+ setDefault(defaultValue) {
417
+ this.default = defaultValue;
418
+ this.update({ default: this.default });
419
+ return this;
420
+ }
421
+ setName(name) {
422
+ this.name = name;
423
+ this.update({ name: this.name });
424
+ return this;
425
+ }
426
+ setType(builder) {
427
+ this.type = builder(new AttributeParamTypeFactory());
428
+ this.update({ type: this.type });
429
+ return this;
430
+ }
1598
431
  };
1599
432
  var AttributeParamTypeFactory = class extends AstFactory {
1600
- static {
1601
- __name(this, "AttributeParamTypeFactory");
1602
- }
1603
- array;
1604
- optional;
1605
- reference;
1606
- type;
1607
- constructor() {
1608
- super({
1609
- type: AttributeParamType
1610
- });
1611
- }
1612
- setArray(array) {
1613
- this.array = array;
1614
- this.update({
1615
- array: this.array
1616
- });
1617
- return this;
1618
- }
1619
- setOptional(optional) {
1620
- this.optional = optional;
1621
- this.update({
1622
- optional: this.optional
1623
- });
1624
- return this;
1625
- }
1626
- setReference(reference) {
1627
- this.reference = {
1628
- $refText: reference.name,
1629
- ref: reference
1630
- };
1631
- this.update({
1632
- reference: this.reference
1633
- });
1634
- return this;
1635
- }
1636
- setType(type) {
1637
- this.type = type;
1638
- this.update({
1639
- type: this.type
1640
- });
1641
- return this;
1642
- }
433
+ array;
434
+ optional;
435
+ reference;
436
+ type;
437
+ constructor() {
438
+ super({ type: require_ast.AttributeParamType });
439
+ }
440
+ setArray(array) {
441
+ this.array = array;
442
+ this.update({ array: this.array });
443
+ return this;
444
+ }
445
+ setOptional(optional) {
446
+ this.optional = optional;
447
+ this.update({ optional: this.optional });
448
+ return this;
449
+ }
450
+ setReference(reference) {
451
+ this.reference = {
452
+ $refText: reference.name,
453
+ ref: reference
454
+ };
455
+ this.update({ reference: this.reference });
456
+ return this;
457
+ }
458
+ setType(type) {
459
+ this.type = type;
460
+ this.update({ type: this.type });
461
+ return this;
462
+ }
1643
463
  };
1644
464
  var AttributeFactory = class extends AstFactory {
1645
- static {
1646
- __name(this, "AttributeFactory");
1647
- }
1648
- name;
1649
- comments = [];
1650
- attributes = [];
1651
- params = [];
1652
- constructor() {
1653
- super({
1654
- type: Attribute,
1655
- node: {
1656
- comments: [],
1657
- attributes: [],
1658
- params: []
1659
- }
1660
- });
1661
- }
1662
- setName(name) {
1663
- this.name = name;
1664
- this.update({
1665
- name: this.name
1666
- });
1667
- return this;
1668
- }
1669
- setComments(comments) {
1670
- this.comments = comments;
1671
- this.update({
1672
- comments: this.comments
1673
- });
1674
- return this;
1675
- }
1676
- addAttribute(builder) {
1677
- this.attributes.push(builder(new InternalAttributeFactory()));
1678
- this.update({
1679
- attributes: this.attributes
1680
- });
1681
- return this;
1682
- }
1683
- addParam(builder) {
1684
- this.params.push(builder(new AttributeParamFactory()));
1685
- this.update({
1686
- params: this.params
1687
- });
1688
- return this;
1689
- }
1690
- };
1691
-
1692
- // src/factory/declaration.ts
1693
- var DeclarationBuilder = /* @__PURE__ */ __name(() => ({
1694
- get Attribute() {
1695
- return new AttributeFactory();
1696
- },
1697
- get DataModel() {
1698
- return new DataModelFactory();
1699
- },
1700
- get DataSource() {
1701
- throw new Error("DataSource is not implemented");
1702
- },
1703
- get Enum() {
1704
- return new EnumFactory();
1705
- },
1706
- get FunctionDecl() {
1707
- throw new Error("FunctionDecl is not implemented");
1708
- },
1709
- get GeneratorDecl() {
1710
- throw new Error("GeneratorDecl is not implemented");
1711
- },
1712
- get Plugin() {
1713
- throw new Error("Plugin is not implemented");
1714
- },
1715
- get Procedure() {
1716
- throw new Error("Procedure is not implemented");
1717
- },
1718
- get TypeDef() {
1719
- throw new Error("TypeDef is not implemented");
1720
- }
1721
- }), "DeclarationBuilder");
465
+ name;
466
+ comments = [];
467
+ attributes = [];
468
+ params = [];
469
+ constructor() {
470
+ super({
471
+ type: require_ast.Attribute,
472
+ node: {
473
+ comments: [],
474
+ attributes: [],
475
+ params: []
476
+ }
477
+ });
478
+ }
479
+ setName(name) {
480
+ this.name = name;
481
+ this.update({ name: this.name });
482
+ return this;
483
+ }
484
+ setComments(comments) {
485
+ this.comments = comments;
486
+ this.update({ comments: this.comments });
487
+ return this;
488
+ }
489
+ addAttribute(builder) {
490
+ this.attributes.push(builder(new InternalAttributeFactory()));
491
+ this.update({ attributes: this.attributes });
492
+ return this;
493
+ }
494
+ addParam(builder) {
495
+ this.params.push(builder(new AttributeParamFactory()));
496
+ this.update({ params: this.params });
497
+ return this;
498
+ }
499
+ };
500
+ //#endregion
501
+ //#region src/factory/declaration.ts
502
+ const DeclarationBuilder = () => ({
503
+ get Attribute() {
504
+ return new AttributeFactory();
505
+ },
506
+ get DataModel() {
507
+ return new DataModelFactory();
508
+ },
509
+ get DataSource() {
510
+ throw new Error("DataSource is not implemented");
511
+ },
512
+ get Enum() {
513
+ return new EnumFactory();
514
+ },
515
+ get FunctionDecl() {
516
+ throw new Error("FunctionDecl is not implemented");
517
+ },
518
+ get GeneratorDecl() {
519
+ throw new Error("GeneratorDecl is not implemented");
520
+ },
521
+ get Plugin() {
522
+ throw new Error("Plugin is not implemented");
523
+ },
524
+ get Procedure() {
525
+ throw new Error("Procedure is not implemented");
526
+ },
527
+ get TypeDef() {
528
+ throw new Error("TypeDef is not implemented");
529
+ }
530
+ });
1722
531
  var DataModelFactory = class extends AstFactory {
1723
- static {
1724
- __name(this, "DataModelFactory");
1725
- }
1726
- attributes = [];
1727
- baseModel;
1728
- comments = [];
1729
- fields = [];
1730
- isView;
1731
- mixins = [];
1732
- name;
1733
- constructor() {
1734
- super({
1735
- type: DataModel,
1736
- node: {
1737
- attributes: [],
1738
- comments: [],
1739
- fields: [],
1740
- mixins: []
1741
- }
1742
- });
1743
- }
1744
- addAttribute(builder) {
1745
- this.attributes.push(builder(new DataModelAttributeFactory()).setContainer(this.node));
1746
- this.update({
1747
- attributes: this.attributes
1748
- });
1749
- return this;
1750
- }
1751
- setBaseModel(model) {
1752
- this.baseModel = model;
1753
- this.update({
1754
- baseModel: this.baseModel
1755
- });
1756
- return this;
1757
- }
1758
- setComments(comments) {
1759
- this.comments = comments;
1760
- this.update({
1761
- comments: this.comments
1762
- });
1763
- return this;
1764
- }
1765
- addComment(comment) {
1766
- this.comments.push(comment);
1767
- this.update({
1768
- comments: this.comments
1769
- });
1770
- return this;
1771
- }
1772
- addField(builder) {
1773
- this.fields.push(builder(new DataFieldFactory()).setContainer(this.node));
1774
- this.update({
1775
- fields: this.fields
1776
- });
1777
- return this;
1778
- }
1779
- setIsView(isView) {
1780
- this.isView = isView;
1781
- this.update({
1782
- isView: this.isView
1783
- });
1784
- return this;
1785
- }
1786
- addMixin(mixin) {
1787
- this.mixins.push(mixin);
1788
- this.update({
1789
- mixins: this.mixins
1790
- });
1791
- return this;
1792
- }
1793
- setName(name) {
1794
- this.name = name;
1795
- this.update({
1796
- name: this.name
1797
- });
1798
- return this;
1799
- }
532
+ attributes = [];
533
+ baseModel;
534
+ comments = [];
535
+ fields = [];
536
+ isView;
537
+ mixins = [];
538
+ name;
539
+ constructor() {
540
+ super({
541
+ type: require_ast.DataModel,
542
+ node: {
543
+ attributes: [],
544
+ comments: [],
545
+ fields: [],
546
+ mixins: []
547
+ }
548
+ });
549
+ }
550
+ addAttribute(builder) {
551
+ this.attributes.push(builder(new DataModelAttributeFactory()).setContainer(this.node));
552
+ this.update({ attributes: this.attributes });
553
+ return this;
554
+ }
555
+ setBaseModel(model) {
556
+ this.baseModel = model;
557
+ this.update({ baseModel: this.baseModel });
558
+ return this;
559
+ }
560
+ setComments(comments) {
561
+ this.comments = comments;
562
+ this.update({ comments: this.comments });
563
+ return this;
564
+ }
565
+ addComment(comment) {
566
+ this.comments.push(comment);
567
+ this.update({ comments: this.comments });
568
+ return this;
569
+ }
570
+ addField(builder) {
571
+ this.fields.push(builder(new DataFieldFactory()).setContainer(this.node));
572
+ this.update({ fields: this.fields });
573
+ return this;
574
+ }
575
+ setIsView(isView) {
576
+ this.isView = isView;
577
+ this.update({ isView: this.isView });
578
+ return this;
579
+ }
580
+ addMixin(mixin) {
581
+ this.mixins.push(mixin);
582
+ this.update({ mixins: this.mixins });
583
+ return this;
584
+ }
585
+ setName(name) {
586
+ this.name = name;
587
+ this.update({ name: this.name });
588
+ return this;
589
+ }
1800
590
  };
1801
591
  var DataFieldFactory = class extends AstFactory {
1802
- static {
1803
- __name(this, "DataFieldFactory");
1804
- }
1805
- attributes = [];
1806
- comments = [];
1807
- name;
1808
- type;
1809
- constructor() {
1810
- super({
1811
- type: DataField,
1812
- node: {
1813
- attributes: [],
1814
- comments: []
1815
- }
1816
- });
1817
- }
1818
- addAttribute(builder) {
1819
- if (builder instanceof DataFieldAttributeFactory) {
1820
- builder.setContainer(this.node);
1821
- this.attributes.push(builder);
1822
- } else {
1823
- const attr = builder(new DataFieldAttributeFactory());
1824
- attr.setContainer(this.node);
1825
- this.attributes.push(attr);
1826
- }
1827
- this.update({
1828
- attributes: this.attributes
1829
- });
1830
- return this;
1831
- }
1832
- setComments(comments) {
1833
- this.comments = comments;
1834
- this.update({
1835
- comments: this.comments
1836
- });
1837
- return this;
1838
- }
1839
- setName(name) {
1840
- this.name = name;
1841
- this.update({
1842
- name: this.name
1843
- });
1844
- return this;
1845
- }
1846
- setType(builder) {
1847
- this.type = builder(new DataFieldTypeFactory()).setContainer(this.node);
1848
- this.update({
1849
- type: this.type
1850
- });
1851
- return this;
1852
- }
592
+ attributes = [];
593
+ comments = [];
594
+ name;
595
+ type;
596
+ constructor() {
597
+ super({
598
+ type: require_ast.DataField,
599
+ node: {
600
+ attributes: [],
601
+ comments: []
602
+ }
603
+ });
604
+ }
605
+ addAttribute(builder) {
606
+ if (builder instanceof DataFieldAttributeFactory) {
607
+ builder.setContainer(this.node);
608
+ this.attributes.push(builder);
609
+ } else {
610
+ const attr = builder(new DataFieldAttributeFactory());
611
+ attr.setContainer(this.node);
612
+ this.attributes.push(attr);
613
+ }
614
+ this.update({ attributes: this.attributes });
615
+ return this;
616
+ }
617
+ setComments(comments) {
618
+ this.comments = comments;
619
+ this.update({ comments: this.comments });
620
+ return this;
621
+ }
622
+ setName(name) {
623
+ this.name = name;
624
+ this.update({ name: this.name });
625
+ return this;
626
+ }
627
+ setType(builder) {
628
+ this.type = builder(new DataFieldTypeFactory()).setContainer(this.node);
629
+ this.update({ type: this.type });
630
+ return this;
631
+ }
1853
632
  };
1854
633
  var DataFieldTypeFactory = class extends AstFactory {
1855
- static {
1856
- __name(this, "DataFieldTypeFactory");
1857
- }
1858
- array;
1859
- optional;
1860
- reference;
1861
- type;
1862
- unsupported;
1863
- constructor() {
1864
- super({
1865
- type: DataFieldType
1866
- });
1867
- }
1868
- setArray(array) {
1869
- this.array = array;
1870
- this.update({
1871
- array: this.array
1872
- });
1873
- return this;
1874
- }
1875
- setOptional(optional) {
1876
- this.optional = optional;
1877
- this.update({
1878
- optional: this.optional
1879
- });
1880
- return this;
1881
- }
1882
- setReference(reference) {
1883
- this.reference = {
1884
- $refText: reference.name,
1885
- ref: reference
1886
- };
1887
- this.update({
1888
- reference: this.reference
1889
- });
1890
- return this;
1891
- }
1892
- setType(type) {
1893
- this.type = type;
1894
- this.update({
1895
- type: this.type
1896
- });
1897
- return this;
1898
- }
1899
- setUnsupported(builder) {
1900
- this.unsupported = builder(new UnsupportedFieldTypeFactory()).setContainer(this.node);
1901
- this.update({
1902
- unsupported: this.unsupported
1903
- });
1904
- return this;
1905
- }
634
+ array;
635
+ optional;
636
+ reference;
637
+ type;
638
+ unsupported;
639
+ constructor() {
640
+ super({ type: require_ast.DataFieldType });
641
+ }
642
+ setArray(array) {
643
+ this.array = array;
644
+ this.update({ array: this.array });
645
+ return this;
646
+ }
647
+ setOptional(optional) {
648
+ this.optional = optional;
649
+ this.update({ optional: this.optional });
650
+ return this;
651
+ }
652
+ setReference(reference) {
653
+ this.reference = {
654
+ $refText: reference.name,
655
+ ref: reference
656
+ };
657
+ this.update({ reference: this.reference });
658
+ return this;
659
+ }
660
+ setType(type) {
661
+ this.type = type;
662
+ this.update({ type: this.type });
663
+ return this;
664
+ }
665
+ setUnsupported(builder) {
666
+ this.unsupported = builder(new UnsupportedFieldTypeFactory()).setContainer(this.node);
667
+ this.update({ unsupported: this.unsupported });
668
+ return this;
669
+ }
1906
670
  };
1907
671
  var UnsupportedFieldTypeFactory = class extends AstFactory {
1908
- static {
1909
- __name(this, "UnsupportedFieldTypeFactory");
1910
- }
1911
- value;
1912
- constructor() {
1913
- super({
1914
- type: UnsupportedFieldType
1915
- });
1916
- }
1917
- setValue(builder) {
1918
- this.value = builder(ExpressionBuilder());
1919
- this.update({
1920
- value: this.value
1921
- });
1922
- return this;
1923
- }
672
+ value;
673
+ constructor() {
674
+ super({ type: require_ast.UnsupportedFieldType });
675
+ }
676
+ setValue(builder) {
677
+ this.value = builder(ExpressionBuilder());
678
+ this.update({ value: this.value });
679
+ return this;
680
+ }
1924
681
  };
1925
682
  var ModelFactory = class extends AstFactory {
1926
- static {
1927
- __name(this, "ModelFactory");
1928
- }
1929
- declarations = [];
1930
- imports = [];
1931
- constructor() {
1932
- super({
1933
- type: Model,
1934
- node: {
1935
- declarations: [],
1936
- imports: []
1937
- }
1938
- });
1939
- }
1940
- addImport(builder) {
1941
- this.imports.push(builder(new ModelImportFactory()).setContainer(this.node));
1942
- this.update({
1943
- imports: this.imports
1944
- });
1945
- return this;
1946
- }
1947
- addDeclaration(builder) {
1948
- this.declarations.push(builder(DeclarationBuilder()).setContainer(this.node));
1949
- this.update({
1950
- declarations: this.declarations
1951
- });
1952
- return this;
1953
- }
683
+ declarations = [];
684
+ imports = [];
685
+ constructor() {
686
+ super({
687
+ type: require_ast.Model,
688
+ node: {
689
+ declarations: [],
690
+ imports: []
691
+ }
692
+ });
693
+ }
694
+ addImport(builder) {
695
+ this.imports.push(builder(new ModelImportFactory()).setContainer(this.node));
696
+ this.update({ imports: this.imports });
697
+ return this;
698
+ }
699
+ addDeclaration(builder) {
700
+ this.declarations.push(builder(DeclarationBuilder()).setContainer(this.node));
701
+ this.update({ declarations: this.declarations });
702
+ return this;
703
+ }
1954
704
  };
1955
705
  var ModelImportFactory = class extends AstFactory {
1956
- static {
1957
- __name(this, "ModelImportFactory");
1958
- }
1959
- path;
1960
- constructor() {
1961
- super({
1962
- type: ModelImport
1963
- });
1964
- }
1965
- setPath(path) {
1966
- this.path = path;
1967
- this.update({
1968
- path: this.path
1969
- });
1970
- return this;
1971
- }
706
+ path;
707
+ constructor() {
708
+ super({ type: require_ast.ModelImport });
709
+ }
710
+ setPath(path) {
711
+ this.path = path;
712
+ this.update({ path: this.path });
713
+ return this;
714
+ }
1972
715
  };
1973
716
  var EnumFactory = class extends AstFactory {
1974
- static {
1975
- __name(this, "EnumFactory");
1976
- }
1977
- name;
1978
- comments = [];
1979
- fields = [];
1980
- attributes = [];
1981
- constructor() {
1982
- super({
1983
- type: Enum,
1984
- node: {
1985
- comments: [],
1986
- fields: [],
1987
- attributes: []
1988
- }
1989
- });
1990
- }
1991
- addField(builder) {
1992
- this.fields.push(builder(new EnumFieldFactory()).setContainer(this.node));
1993
- this.update({
1994
- fields: this.fields
1995
- });
1996
- return this;
1997
- }
1998
- addAttribute(builder) {
1999
- this.attributes.push(builder(new DataModelAttributeFactory()).setContainer(this.node));
2000
- this.update({
2001
- attributes: this.attributes
2002
- });
2003
- return this;
2004
- }
2005
- setName(name) {
2006
- this.name = name;
2007
- this.update({
2008
- name: this.name
2009
- });
2010
- return this;
2011
- }
717
+ name;
718
+ comments = [];
719
+ fields = [];
720
+ attributes = [];
721
+ constructor() {
722
+ super({
723
+ type: require_ast.Enum,
724
+ node: {
725
+ comments: [],
726
+ fields: [],
727
+ attributes: []
728
+ }
729
+ });
730
+ }
731
+ addField(builder) {
732
+ this.fields.push(builder(new EnumFieldFactory()).setContainer(this.node));
733
+ this.update({ fields: this.fields });
734
+ return this;
735
+ }
736
+ addAttribute(builder) {
737
+ this.attributes.push(builder(new DataModelAttributeFactory()).setContainer(this.node));
738
+ this.update({ attributes: this.attributes });
739
+ return this;
740
+ }
741
+ setName(name) {
742
+ this.name = name;
743
+ this.update({ name: this.name });
744
+ return this;
745
+ }
2012
746
  };
2013
747
  var EnumFieldFactory = class extends AstFactory {
2014
- static {
2015
- __name(this, "EnumFieldFactory");
2016
- }
2017
- name;
2018
- comments = [];
2019
- attributes = [];
2020
- constructor() {
2021
- super({
2022
- type: EnumField,
2023
- node: {
2024
- comments: [],
2025
- attributes: []
2026
- }
2027
- });
2028
- }
2029
- setName(name) {
2030
- this.name = name;
2031
- this.update({
2032
- name: this.name
2033
- });
2034
- return this;
2035
- }
2036
- addAttribute(builder) {
2037
- this.attributes.push(builder(new DataFieldAttributeFactory()).setContainer(this.node));
2038
- this.update({
2039
- attributes: this.attributes
2040
- });
2041
- return this;
2042
- }
2043
- addComment(comment) {
2044
- this.comments.push(comment);
2045
- this.update({
2046
- comments: this.comments
2047
- });
2048
- return this;
2049
- }
2050
- };
2051
- // Annotate the CommonJS export names for ESM import in node:
2052
- 0 && (module.exports = {
2053
- ArgumentFactory,
2054
- ArrayExprFactory,
2055
- AstFactory,
2056
- AttributeArgFactory,
2057
- AttributeFactory,
2058
- AttributeParamFactory,
2059
- AttributeParamTypeFactory,
2060
- BinaryExprFactory,
2061
- BooleanLiteralFactory,
2062
- DataFieldAttributeFactory,
2063
- DataFieldFactory,
2064
- DataFieldTypeFactory,
2065
- DataModelAttributeFactory,
2066
- DataModelFactory,
2067
- DeclarationBuilder,
2068
- EnumFactory,
2069
- EnumFieldFactory,
2070
- ExpressionBuilder,
2071
- FieldInitializerFactory,
2072
- InternalAttributeFactory,
2073
- InvocationExprFactory,
2074
- MemberAccessExprFactory,
2075
- ModelFactory,
2076
- ModelImportFactory,
2077
- NullExprFactory,
2078
- NumberLiteralFactory,
2079
- ObjectExprFactory,
2080
- ReferenceArgFactory,
2081
- ReferenceExprFactory,
2082
- StringLiteralFactory,
2083
- ThisExprFactory,
2084
- UnaryExprFactory,
2085
- UnsupportedFieldTypeFactory
2086
- });
748
+ name;
749
+ comments = [];
750
+ attributes = [];
751
+ constructor() {
752
+ super({
753
+ type: require_ast.EnumField,
754
+ node: {
755
+ comments: [],
756
+ attributes: []
757
+ }
758
+ });
759
+ }
760
+ setName(name) {
761
+ this.name = name;
762
+ this.update({ name: this.name });
763
+ return this;
764
+ }
765
+ addAttribute(builder) {
766
+ this.attributes.push(builder(new DataFieldAttributeFactory()).setContainer(this.node));
767
+ this.update({ attributes: this.attributes });
768
+ return this;
769
+ }
770
+ addComment(comment) {
771
+ this.comments.push(comment);
772
+ this.update({ comments: this.comments });
773
+ return this;
774
+ }
775
+ };
776
+ //#endregion
777
+ exports.ArgumentFactory = ArgumentFactory;
778
+ exports.ArrayExprFactory = ArrayExprFactory;
779
+ exports.AstFactory = AstFactory;
780
+ exports.AttributeArgFactory = AttributeArgFactory;
781
+ exports.AttributeFactory = AttributeFactory;
782
+ exports.AttributeParamFactory = AttributeParamFactory;
783
+ exports.AttributeParamTypeFactory = AttributeParamTypeFactory;
784
+ exports.BinaryExprFactory = BinaryExprFactory;
785
+ exports.BooleanLiteralFactory = BooleanLiteralFactory;
786
+ exports.DataFieldAttributeFactory = DataFieldAttributeFactory;
787
+ exports.DataFieldFactory = DataFieldFactory;
788
+ exports.DataFieldTypeFactory = DataFieldTypeFactory;
789
+ exports.DataModelAttributeFactory = DataModelAttributeFactory;
790
+ exports.DataModelFactory = DataModelFactory;
791
+ exports.DeclarationBuilder = DeclarationBuilder;
792
+ exports.EnumFactory = EnumFactory;
793
+ exports.EnumFieldFactory = EnumFieldFactory;
794
+ exports.ExpressionBuilder = ExpressionBuilder;
795
+ exports.FieldInitializerFactory = FieldInitializerFactory;
796
+ exports.InternalAttributeFactory = InternalAttributeFactory;
797
+ exports.InvocationExprFactory = InvocationExprFactory;
798
+ exports.MemberAccessExprFactory = MemberAccessExprFactory;
799
+ exports.ModelFactory = ModelFactory;
800
+ exports.ModelImportFactory = ModelImportFactory;
801
+ exports.NullExprFactory = NullExprFactory;
802
+ exports.NumberLiteralFactory = NumberLiteralFactory;
803
+ exports.ObjectExprFactory = ObjectExprFactory;
804
+ exports.ReferenceArgFactory = ReferenceArgFactory;
805
+ exports.ReferenceExprFactory = ReferenceExprFactory;
806
+ exports.StringLiteralFactory = StringLiteralFactory;
807
+ exports.ThisExprFactory = ThisExprFactory;
808
+ exports.UnaryExprFactory = UnaryExprFactory;
809
+ exports.UnsupportedFieldTypeFactory = UnsupportedFieldTypeFactory;
810
+
2087
811
  //# sourceMappingURL=factory.cjs.map