@ja-platform/parser-schema-xml 0.0.0-dev-20261021194038 → 0.0.0-stage

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 (96) hide show
  1. package/README.md +3 -0
  2. package/package.json +3 -40
  3. package/dist/@types/SchemaDefinition.d.ts +0 -13
  4. package/dist/@types/XmlField.d.ts +0 -10
  5. package/dist/@types/XmlModel.d.ts +0 -12
  6. package/dist/@types/XmlParam.d.ts +0 -7
  7. package/dist/@types/XmlSchema.d.ts +0 -20
  8. package/dist/@types/attributes/SchemaDatabaseAttribute.d.ts +0 -11
  9. package/dist/@types/attributes/SchemaEnumAttribute.d.ts +0 -6
  10. package/dist/@types/attributes/SchemaFieldTypeAttribute.d.ts +0 -9
  11. package/dist/@types/attributes/SchemaIndexAttribute.d.ts +0 -9
  12. package/dist/@types/attributes/SchemaNameAttribute.d.ts +0 -4
  13. package/dist/@types/attributes/SchemaOptionKeyAttribute.d.ts +0 -15
  14. package/dist/@types/expressions/SchemaDatabasesExpression.d.ts +0 -10
  15. package/dist/@types/expressions/SchemaFieldTypeExpression.d.ts +0 -14
  16. package/dist/@types/expressions/SchemaIndexExpression.d.ts +0 -14
  17. package/dist/@types/index.d.ts +0 -10
  18. package/dist/@types/loadSchemaXml.d.ts +0 -8
  19. package/dist/@types/nodes/SchemaBelongsToNode.d.ts +0 -9
  20. package/dist/@types/nodes/SchemaDisplayNode.d.ts +0 -8
  21. package/dist/@types/nodes/SchemaFieldNode.d.ts +0 -21
  22. package/dist/@types/nodes/SchemaHasManyNode.d.ts +0 -10
  23. package/dist/@types/nodes/SchemaIndexNode.d.ts +0 -12
  24. package/dist/@types/nodes/SchemaModelNode.d.ts +0 -26
  25. package/dist/@types/nodes/SchemaNotificationNode.d.ts +0 -12
  26. package/dist/@types/nodes/SchemaOptionNode.d.ts +0 -10
  27. package/dist/@types/nodes/SchemaWebhookFieldNode.d.ts +0 -11
  28. package/dist/@types/nodes/SchemaWebhookNode.d.ts +0 -13
  29. package/dist/@types/parsed/ParsedSchemaFieldNode.d.ts +0 -7
  30. package/dist/@types/parsed/ParsedSchemaModelNode.d.ts +0 -15
  31. package/dist/@types/parsed/ParsedSchemaNode.d.ts +0 -10
  32. package/dist/@types/schemaSerializer.d.ts +0 -11
  33. package/dist/@types/tokens/SchemaIndexKeyToken.d.ts +0 -14
  34. package/dist/SchemaDefinition.js +0 -20
  35. package/dist/SchemaDefinition.js.map +0 -1
  36. package/dist/XmlField.js +0 -12
  37. package/dist/XmlField.js.map +0 -1
  38. package/dist/XmlModel.js +0 -8
  39. package/dist/XmlModel.js.map +0 -1
  40. package/dist/XmlParam.js +0 -12
  41. package/dist/XmlParam.js.map +0 -1
  42. package/dist/XmlSchema.js +0 -29
  43. package/dist/XmlSchema.js.map +0 -1
  44. package/dist/attributes/SchemaDatabaseAttribute.js +0 -12
  45. package/dist/attributes/SchemaDatabaseAttribute.js.map +0 -1
  46. package/dist/attributes/SchemaEnumAttribute.js +0 -27
  47. package/dist/attributes/SchemaEnumAttribute.js.map +0 -1
  48. package/dist/attributes/SchemaFieldTypeAttribute.js +0 -12
  49. package/dist/attributes/SchemaFieldTypeAttribute.js.map +0 -1
  50. package/dist/attributes/SchemaIndexAttribute.js +0 -12
  51. package/dist/attributes/SchemaIndexAttribute.js.map +0 -1
  52. package/dist/attributes/SchemaNameAttribute.js +0 -23
  53. package/dist/attributes/SchemaNameAttribute.js.map +0 -1
  54. package/dist/attributes/SchemaOptionKeyAttribute.js +0 -28
  55. package/dist/attributes/SchemaOptionKeyAttribute.js.map +0 -1
  56. package/dist/expressions/SchemaDatabasesExpression.js +0 -28
  57. package/dist/expressions/SchemaDatabasesExpression.js.map +0 -1
  58. package/dist/expressions/SchemaFieldTypeExpression.js +0 -50
  59. package/dist/expressions/SchemaFieldTypeExpression.js.map +0 -1
  60. package/dist/expressions/SchemaIndexExpression.js +0 -30
  61. package/dist/expressions/SchemaIndexExpression.js.map +0 -1
  62. package/dist/index.js +0 -27
  63. package/dist/index.js.map +0 -1
  64. package/dist/loadSchemaXml.js +0 -39
  65. package/dist/loadSchemaXml.js.map +0 -1
  66. package/dist/nodes/SchemaBelongsToNode.js +0 -14
  67. package/dist/nodes/SchemaBelongsToNode.js.map +0 -1
  68. package/dist/nodes/SchemaDisplayNode.js +0 -13
  69. package/dist/nodes/SchemaDisplayNode.js.map +0 -1
  70. package/dist/nodes/SchemaFieldNode.js +0 -30
  71. package/dist/nodes/SchemaFieldNode.js.map +0 -1
  72. package/dist/nodes/SchemaHasManyNode.js +0 -15
  73. package/dist/nodes/SchemaHasManyNode.js.map +0 -1
  74. package/dist/nodes/SchemaIndexNode.js +0 -22
  75. package/dist/nodes/SchemaIndexNode.js.map +0 -1
  76. package/dist/nodes/SchemaModelNode.js +0 -34
  77. package/dist/nodes/SchemaModelNode.js.map +0 -1
  78. package/dist/nodes/SchemaNotificationNode.js +0 -21
  79. package/dist/nodes/SchemaNotificationNode.js.map +0 -1
  80. package/dist/nodes/SchemaOptionNode.js +0 -20
  81. package/dist/nodes/SchemaOptionNode.js.map +0 -1
  82. package/dist/nodes/SchemaWebhookFieldNode.js +0 -17
  83. package/dist/nodes/SchemaWebhookFieldNode.js.map +0 -1
  84. package/dist/nodes/SchemaWebhookNode.js +0 -19
  85. package/dist/nodes/SchemaWebhookNode.js.map +0 -1
  86. package/dist/parsed/ParsedSchemaFieldNode.js +0 -55
  87. package/dist/parsed/ParsedSchemaFieldNode.js.map +0 -1
  88. package/dist/parsed/ParsedSchemaModelNode.js +0 -112
  89. package/dist/parsed/ParsedSchemaModelNode.js.map +0 -1
  90. package/dist/parsed/ParsedSchemaNode.js +0 -28
  91. package/dist/parsed/ParsedSchemaNode.js.map +0 -1
  92. package/dist/schemaSerializer.js +0 -181
  93. package/dist/schemaSerializer.js.map +0 -1
  94. package/dist/tokens/SchemaIndexKeyToken.js +0 -39
  95. package/dist/tokens/SchemaIndexKeyToken.js.map +0 -1
  96. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchemaEnumAttribute = void 0;
4
- const parser_core_1 = require("@ja-platform/parser-core");
5
- const parser_type_system_1 = require("@ja-platform/parser-type-system");
6
- /**
7
- * Schema enums are literal strings, without evaluated syntax or engine size defaults.
8
- */
9
- class SchemaEnumType extends parser_type_system_1.TextType {
10
- constructor(values) {
11
- super();
12
- this.values = values;
13
- }
14
- parse(value) {
15
- const text = super.parse(value);
16
- if (!this.values.includes(text))
17
- throw new SyntaxError(`Expected one of ${this.values.join(', ')}`);
18
- return text;
19
- }
20
- }
21
- class SchemaEnumAttribute extends parser_core_1.V5ConstantTextAttribute {
22
- constructor(options) {
23
- super(Object.assign(Object.assign({}, options), { valueType: new SchemaEnumType(options.values) }));
24
- }
25
- }
26
- exports.SchemaEnumAttribute = SchemaEnumAttribute;
27
- //# sourceMappingURL=SchemaEnumAttribute.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SchemaEnumAttribute.js","sourceRoot":"","sources":["../../src/attributes/SchemaEnumAttribute.ts"],"names":[],"mappings":";;;AAAA,0DAAuF;AACvF,wEAA2D;AAE3D;;GAEG;AACH,MAAM,cAAe,SAAQ,6BAAQ;IACnC,YAAqB,MAAyB;QAC5C,KAAK,EAAE,CAAC;sBADW,MAAM;IAE3B,CAAC;IAED,KAAK,CAAC,KAAc;QAClB,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAChC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,MAAM,IAAI,WAAW,CAAC,mBAAmB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpG,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,yBAAiC,SAAQ,qCAAuB;IAC9D,YAAY,OAA2E;QACrF,KAAK,iCAAM,OAAO,KAAE,SAAS,EAAE,IAAI,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,IAAG,CAAC;IACvE,CAAC;CACF","sourcesContent":["import { V5ConstantTextAttribute, V5AttributeOptions } from '@ja-platform/parser-core';\nimport { TextType } from '@ja-platform/parser-type-system';\n\n/**\n * Schema enums are literal strings, without evaluated syntax or engine size defaults.\n */\nclass SchemaEnumType extends TextType {\n constructor(readonly values: readonly string[]) {\n super();\n }\n\n parse(value: unknown): string {\n const text = super.parse(value);\n if (!this.values.includes(text)) throw new SyntaxError(`Expected one of ${this.values.join(', ')}`);\n return text;\n }\n}\n\nexport class SchemaEnumAttribute extends V5ConstantTextAttribute {\n constructor(options: V5AttributeOptions<string, string> & { values: readonly string[] }) {\n super({ ...options, valueType: new SchemaEnumType(options.values) });\n }\n}\n"]}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchemaFieldTypeAttribute = void 0;
4
- const parser_core_1 = require("@ja-platform/parser-core");
5
- const SchemaFieldTypeExpression_1 = require("../expressions/SchemaFieldTypeExpression");
6
- class SchemaFieldTypeAttribute extends parser_core_1.V5Attribute {
7
- constructor(options) {
8
- super('schema-field-type', Object.assign(Object.assign({}, options), { syntax: new SchemaFieldTypeExpression_1.SchemaFieldTypeExpressionParser() }));
9
- }
10
- }
11
- exports.SchemaFieldTypeAttribute = SchemaFieldTypeAttribute;
12
- //# sourceMappingURL=SchemaFieldTypeAttribute.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SchemaFieldTypeAttribute.js","sourceRoot":"","sources":["../../src/attributes/SchemaFieldTypeAttribute.ts"],"names":[],"mappings":";;;AAAA,0DAAgG;AAChG,wFAAsH;AAMtH,8BAAsC,SAAQ,yBAA6C;IACzF,YAAY,OAA2B;QACrC,KAAK,CAAC,mBAAmB,kCAAO,OAAO,KAAE,MAAM,EAAE,IAAI,2DAA+B,EAAE,IAAG,CAAC;IAC5F,CAAC;CACF","sourcesContent":["import { V5Attribute, V5AttributeGenerics, V5AttributeOptions } from '@ja-platform/parser-core';\nimport { SchemaFieldTypeExpression, SchemaFieldTypeExpressionParser } from '../expressions/SchemaFieldTypeExpression';\n\ninterface SchemaFieldTypeAttributeGenerics extends V5AttributeGenerics {\n Value: SchemaFieldTypeExpression;\n}\n\nexport class SchemaFieldTypeAttribute extends V5Attribute<SchemaFieldTypeAttributeGenerics> {\n constructor(options: V5AttributeOptions) {\n super('schema-field-type', { ...options, syntax: new SchemaFieldTypeExpressionParser() });\n }\n}\n"]}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchemaIndexAttribute = void 0;
4
- const parser_core_1 = require("@ja-platform/parser-core");
5
- const SchemaIndexExpression_1 = require("../expressions/SchemaIndexExpression");
6
- class SchemaIndexAttribute extends parser_core_1.V5Attribute {
7
- constructor(options) {
8
- super('schema-index', Object.assign(Object.assign({}, options), { syntax: new SchemaIndexExpression_1.SchemaIndexExpressionParser() }));
9
- }
10
- }
11
- exports.SchemaIndexAttribute = SchemaIndexAttribute;
12
- //# sourceMappingURL=SchemaIndexAttribute.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SchemaIndexAttribute.js","sourceRoot":"","sources":["../../src/attributes/SchemaIndexAttribute.ts"],"names":[],"mappings":";;;AAAA,0DAAgG;AAChG,gFAA0G;AAM1G,0BAAkC,SAAQ,yBAAyC;IACjF,YAAY,OAA2B;QACrC,KAAK,CAAC,cAAc,kCAAO,OAAO,KAAE,MAAM,EAAE,IAAI,mDAA2B,EAAE,IAAG,CAAC;IACnF,CAAC;CACF","sourcesContent":["import { V5Attribute, V5AttributeGenerics, V5AttributeOptions } from '@ja-platform/parser-core';\nimport { SchemaIndexExpression, SchemaIndexExpressionParser } from '../expressions/SchemaIndexExpression';\n\ninterface SchemaIndexAttributeGenerics extends V5AttributeGenerics {\n Value: SchemaIndexExpression;\n}\n\nexport class SchemaIndexAttribute extends V5Attribute<SchemaIndexAttributeGenerics> {\n constructor(options: V5AttributeOptions) {\n super('schema-index', { ...options, syntax: new SchemaIndexExpressionParser() });\n }\n}\n"]}
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchemaNameAttribute = void 0;
4
- const parser_core_1 = require("@ja-platform/parser-core");
5
- const parser_type_system_1 = require("@ja-platform/parser-type-system");
6
- const common_xml_1 = require("@journeyapps/common-xml");
7
- class SchemaNameType extends parser_type_system_1.TextType {
8
- parse(value) {
9
- try {
10
- return common_xml_1.attribute.name(super.parse(value));
11
- }
12
- catch (error) {
13
- throw new SyntaxError(error.message);
14
- }
15
- }
16
- }
17
- class SchemaNameAttribute extends parser_core_1.V5ConstantTextAttribute {
18
- constructor(options) {
19
- super(Object.assign(Object.assign({}, options), { valueType: new SchemaNameType() }));
20
- }
21
- }
22
- exports.SchemaNameAttribute = SchemaNameAttribute;
23
- //# sourceMappingURL=SchemaNameAttribute.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SchemaNameAttribute.js","sourceRoot":"","sources":["../../src/attributes/SchemaNameAttribute.ts"],"names":[],"mappings":";;;AAAA,0DAAuF;AACvF,wEAA2D;AAC3D,wDAAoD;AAEpD,MAAM,cAAe,SAAQ,6BAAQ;IACnC,KAAK,CAAC,KAAc;QAClB,IAAI,CAAC;YACH,OAAO,sBAAS,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QAC5C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;CACF;AAED,yBAAiC,SAAQ,qCAAuB;IAC9D,YAAY,OAA2C;QACrD,KAAK,iCAAM,OAAO,KAAE,SAAS,EAAE,IAAI,cAAc,EAAE,IAAG,CAAC;IACzD,CAAC;CACF","sourcesContent":["import { V5ConstantTextAttribute, V5AttributeOptions } from '@ja-platform/parser-core';\nimport { TextType } from '@ja-platform/parser-type-system';\nimport { attribute } from '@journeyapps/common-xml';\n\nclass SchemaNameType extends TextType {\n parse(value: unknown): string {\n try {\n return attribute.name(super.parse(value));\n } catch (error) {\n throw new SyntaxError(error.message);\n }\n }\n}\n\nexport class SchemaNameAttribute extends V5ConstantTextAttribute {\n constructor(options: V5AttributeOptions<string, string>) {\n super({ ...options, valueType: new SchemaNameType() });\n }\n}\n"]}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchemaOptionKeyAttribute = void 0;
4
- const parser_core_1 = require("@ja-platform/parser-core");
5
- const parser_expressions_1 = require("@ja-platform/parser-expressions");
6
- const parser_type_system_1 = require("@ja-platform/parser-type-system");
7
- const parser_schema_1 = require("@ja-platform/parser-schema");
8
- /**
9
- * Choice keys use the enclosing field's declared literal type.
10
- */
11
- class SchemaOptionKeyAttribute extends parser_core_1.V5Attribute {
12
- constructor() {
13
- super('schema-option-key', { name: 'key' });
14
- }
15
- getParsedValue(event) {
16
- var _a;
17
- const field = (_a = event.parentNode) === null || _a === void 0 ? void 0 : _a.attrExpression('type');
18
- const type = (field === null || field === void 0 ? void 0 : field.primitive) === parser_schema_1.PrimitiveType.BOOLEAN
19
- ? parser_type_system_1.booleanType
20
- : (field === null || field === void 0 ? void 0 : field.primitive) === parser_schema_1.PrimitiveType.SINGLE_CHOICE_INTEGER ||
21
- (field === null || field === void 0 ? void 0 : field.primitive) === parser_schema_1.PrimitiveType.MULTIPLE_CHOICE_INTEGER
22
- ? parser_type_system_1.integerType
23
- : parser_type_system_1.textType;
24
- return new parser_expressions_1.ConstantExpressionParser(type).parse(event.input.value);
25
- }
26
- }
27
- exports.SchemaOptionKeyAttribute = SchemaOptionKeyAttribute;
28
- //# sourceMappingURL=SchemaOptionKeyAttribute.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SchemaOptionKeyAttribute.js","sourceRoot":"","sources":["../../src/attributes/SchemaOptionKeyAttribute.ts"],"names":[],"mappings":";;;AAAA,0DAAiG;AACjG,wEAA+F;AAC/F,wEAA2F;AAC3F,8DAA2D;AAU3D;;GAEG;AACH,8BAAsC,SAAQ,yBAAoC;IAChF;QACE,KAAK,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC9C,CAAC;IAES,cAAc,CAAC,KAA0B;;QACjD,MAAM,KAAK,GAAG,MAAA,KAAK,CAAC,UAAU,0CAAE,cAAc,CAAC,MAAM,CAA0C,CAAC;QAChG,MAAM,IAAI,GACR,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,MAAK,6BAAa,CAAC,OAAO;YACxC,CAAC,CAAC,gCAAW;YACb,CAAC,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,MAAK,6BAAa,CAAC,qBAAqB;gBACtD,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,MAAK,6BAAa,CAAC,uBAAuB;gBAC5D,CAAC,CAAC,gCAAW;gBACb,CAAC,CAAC,6BAAQ,CAAC;QACjB,OAAO,IAAI,6CAAwB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrE,CAAC;CACF","sourcesContent":["import { AttributeParseEvent, V5Attribute, V5AttributeGenerics } from '@ja-platform/parser-core';\nimport { ConstantExpression, ConstantExpressionParser } from '@ja-platform/parser-expressions';\nimport { booleanType, integerType, textType, Type } from '@ja-platform/parser-type-system';\nimport { PrimitiveType } from '@ja-platform/parser-schema';\nimport { SchemaFieldTypeExpression } from '../expressions/SchemaFieldTypeExpression';\n\nexport type SchemaOptionKey = string | number | boolean;\n\ninterface SchemaOptionKeyGenerics extends V5AttributeGenerics {\n Value: ConstantExpression<SchemaOptionKey>;\n NormalizedValue: SchemaOptionKey;\n}\n\n/**\n * Choice keys use the enclosing field's declared literal type.\n */\nexport class SchemaOptionKeyAttribute extends V5Attribute<SchemaOptionKeyGenerics> {\n constructor() {\n super('schema-option-key', { name: 'key' });\n }\n\n protected getParsedValue(event: AttributeParseEvent): ConstantExpression<SchemaOptionKey> {\n const field = event.parentNode?.attrExpression('type') as SchemaFieldTypeExpression | undefined;\n const type: Type<SchemaOptionKey> =\n field?.primitive === PrimitiveType.BOOLEAN\n ? booleanType\n : field?.primitive === PrimitiveType.SINGLE_CHOICE_INTEGER ||\n field?.primitive === PrimitiveType.MULTIPLE_CHOICE_INTEGER\n ? integerType\n : textType;\n return new ConstantExpressionParser(type).parse(event.input.value);\n }\n}\n"]}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchemaDatabasesExpressionParser = exports.SchemaDatabasesExpression = void 0;
4
- const parser_expressions_1 = require("@ja-platform/parser-expressions");
5
- const parser_schema_1 = require("@ja-platform/parser-schema");
6
- class SchemaDatabasesExpression extends parser_expressions_1.ListExpression {
7
- constructor(options) {
8
- super('schema-databases', options);
9
- }
10
- isValid() {
11
- return (super.isValid() &&
12
- this.items.every((token) => token instanceof parser_expressions_1.IdentifierToken && Object.values(parser_schema_1.IndexDatabase).includes(token.raw())));
13
- }
14
- get databases() {
15
- return this.items.map((token) => token.raw());
16
- }
17
- }
18
- exports.SchemaDatabasesExpression = SchemaDatabasesExpression;
19
- class SchemaDatabasesExpressionParser extends parser_expressions_1.ListExpressionParser {
20
- constructor() {
21
- super({
22
- parseItem: ({ source, start }) => new parser_expressions_1.IdentifierToken(source, start),
23
- createExpression: (options) => new SchemaDatabasesExpression(options)
24
- });
25
- }
26
- }
27
- exports.SchemaDatabasesExpressionParser = SchemaDatabasesExpressionParser;
28
- //# sourceMappingURL=SchemaDatabasesExpression.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SchemaDatabasesExpression.js","sourceRoot":"","sources":["../../src/expressions/SchemaDatabasesExpression.ts"],"names":[],"mappings":";;;AAAA,wEAKyC;AACzC,8DAA2D;AAE3D,+BAAuC,SAAQ,mCAA+B;IAC5E,YAAY,OAAkC;QAC5C,KAAK,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,OAAO;QACL,OAAO,CACL,KAAK,CAAC,OAAO,EAAE;YACf,IAAI,CAAC,KAAK,CAAC,KAAK,CACd,CAAC,KAAK,EAAE,EAAE,CACR,KAAK,YAAY,oCAAe,IAAI,MAAM,CAAC,MAAM,CAAC,6BAAa,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAmB,CAAC,CAC1G,CACF,CAAC;IACJ,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,EAAmB,CAAC,CAAC;IACjE,CAAC;CACF;;AAED,qCAA6C,SAAQ,yCAA+C;IAClG;QACE,KAAK,CAAC;YACJ,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,IAAI,oCAAe,CAAC,MAAM,EAAE,KAAK,CAAC;YACpE,gBAAgB,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,yBAAyB,CAAC,OAAO,CAAC;SACtE,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import {\n AbstractExpressionOptions,\n ListExpression,\n ListExpressionParser,\n IdentifierToken\n} from '@ja-platform/parser-expressions';\nimport { IndexDatabase } from '@ja-platform/parser-schema';\n\nexport class SchemaDatabasesExpression extends ListExpression<IdentifierToken> {\n constructor(options: AbstractExpressionOptions) {\n super('schema-databases', options);\n }\n\n isValid(): boolean {\n return (\n super.isValid() &&\n this.items.every(\n (token) =>\n token instanceof IdentifierToken && Object.values(IndexDatabase).includes(token.raw() as IndexDatabase)\n )\n );\n }\n\n get databases(): readonly IndexDatabase[] {\n return this.items.map((token) => token.raw() as IndexDatabase);\n }\n}\n\nexport class SchemaDatabasesExpressionParser extends ListExpressionParser<SchemaDatabasesExpression> {\n constructor() {\n super({\n parseItem: ({ source, start }) => new IdentifierToken(source, start),\n createExpression: (options) => new SchemaDatabasesExpression(options)\n });\n }\n}\n"]}
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchemaFieldTypeExpressionParser = exports.SchemaFieldTypeExpression = void 0;
4
- const parser_expressions_1 = require("@ja-platform/parser-expressions");
5
- const parser_schema_1 = require("@ja-platform/parser-schema");
6
- const parser_schema_2 = require("@ja-platform/parser-schema");
7
- /**
8
- * A primitive declaration, with an optional prefix introducing its subtype.
9
- */
10
- class SchemaFieldTypeExpression extends parser_expressions_1.AbstractExpression {
11
- constructor(options) {
12
- super('schema-field-type', options);
13
- }
14
- get primitive() {
15
- const first = this.tokens[0];
16
- return (first instanceof parser_expressions_1.PrefixToken ? first.raw().slice(0, -1) : first === null || first === void 0 ? void 0 : first.raw());
17
- }
18
- get subtype() {
19
- var _a;
20
- return this.tokens[0] instanceof parser_expressions_1.PrefixToken ? (_a = this.tokens[1]) === null || _a === void 0 ? void 0 : _a.raw() : undefined;
21
- }
22
- isValid() {
23
- const [first, second] = this.tokens;
24
- if (first instanceof parser_expressions_1.PrefixToken) {
25
- return (this.tokens.length === 2 &&
26
- first.isValid() &&
27
- first.raw() === 'text:' &&
28
- second instanceof parser_expressions_1.TextToken &&
29
- parser_schema_2.TEXT_SUBTYPES.includes(second.raw()));
30
- }
31
- return this.tokens.length === 1 && first instanceof parser_expressions_1.TextToken && Object.hasOwn(parser_schema_1.PrimitiveTypeMap, first.raw());
32
- }
33
- }
34
- exports.SchemaFieldTypeExpression = SchemaFieldTypeExpression;
35
- class SchemaFieldTypeExpressionParser extends parser_expressions_1.ExpressionParser {
36
- tryParse(source, start = 0) {
37
- if (typeof source !== 'string')
38
- return new SchemaFieldTypeExpression({ tokens: source });
39
- const colon = source.indexOf(':');
40
- const tokens = colon === -1
41
- ? [new parser_expressions_1.TextToken(source, start)]
42
- : [
43
- new parser_expressions_1.PrefixToken(start, source.slice(0, colon + 1)),
44
- new parser_expressions_1.TextToken(source.slice(colon + 1), start + colon + 1)
45
- ];
46
- return new SchemaFieldTypeExpression({ tokens });
47
- }
48
- }
49
- exports.SchemaFieldTypeExpressionParser = SchemaFieldTypeExpressionParser;
50
- //# sourceMappingURL=SchemaFieldTypeExpression.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SchemaFieldTypeExpression.js","sourceRoot":"","sources":["../../src/expressions/SchemaFieldTypeExpression.ts"],"names":[],"mappings":";;;AAAA,wEAOyC;AACzC,8DAA8D;AAC9D,8DAA2D;AAE3D;;GAEG;AACH,+BAAuC,SAAQ,uCAAkB;IAC/D,YAAY,OAAkC;QAC5C,KAAK,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,SAAS;QACX,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC7B,OAAO,CAAC,KAAK,YAAY,gCAAW,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,GAAG,EAAE,CAAkC,CAAC;IACnH,CAAC;IAED,IAAI,OAAO;;QACT,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,gCAAW,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,0CAAE,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IACnF,CAAC;IAED,OAAO;QACL,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QACpC,IAAI,KAAK,YAAY,gCAAW,EAAE,CAAC;YACjC,OAAO,CACL,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;gBACxB,KAAK,CAAC,OAAO,EAAE;gBACf,KAAK,CAAC,GAAG,EAAE,KAAK,OAAO;gBACvB,MAAM,YAAY,8BAAS;gBAC3B,6BAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CACrC,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,YAAY,8BAAS,IAAI,MAAM,CAAC,MAAM,CAAC,gCAAgB,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;IAChH,CAAC;CACF;;AAED,qCAA6C,SAAQ,qCAA2C;IAC9F,QAAQ,CAAC,MAAwB,EAAE,KAAK,GAAG,CAAC;QAC1C,IAAI,OAAO,MAAM,KAAK,QAAQ;YAAE,OAAO,IAAI,yBAAyB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QACzF,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAClC,MAAM,MAAM,GACV,KAAK,KAAK,CAAC,CAAC;YACV,CAAC,CAAC,CAAC,IAAI,8BAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YAChC,CAAC,CAAC;gBACE,IAAI,gCAAW,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;gBAClD,IAAI,8BAAS,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC;aAC1D,CAAC;QACR,OAAO,IAAI,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IACnD,CAAC;CACF","sourcesContent":["import {\n AbstractExpression,\n AbstractExpressionOptions,\n ExpressionParser,\n ExpressionSource,\n PrefixToken,\n TextToken\n} from '@ja-platform/parser-expressions';\nimport { PrimitiveTypeMap } from '@ja-platform/parser-schema';\nimport { TEXT_SUBTYPES } from '@ja-platform/parser-schema';\n\n/**\n * A primitive declaration, with an optional prefix introducing its subtype.\n */\nexport class SchemaFieldTypeExpression extends AbstractExpression {\n constructor(options: AbstractExpressionOptions) {\n super('schema-field-type', options);\n }\n\n get primitive(): keyof typeof PrimitiveTypeMap {\n const first = this.tokens[0];\n return (first instanceof PrefixToken ? first.raw().slice(0, -1) : first?.raw()) as keyof typeof PrimitiveTypeMap;\n }\n\n get subtype(): string | undefined {\n return this.tokens[0] instanceof PrefixToken ? this.tokens[1]?.raw() : undefined;\n }\n\n isValid(): boolean {\n const [first, second] = this.tokens;\n if (first instanceof PrefixToken) {\n return (\n this.tokens.length === 2 &&\n first.isValid() &&\n first.raw() === 'text:' &&\n second instanceof TextToken &&\n TEXT_SUBTYPES.includes(second.raw())\n );\n }\n return this.tokens.length === 1 && first instanceof TextToken && Object.hasOwn(PrimitiveTypeMap, first.raw());\n }\n}\n\nexport class SchemaFieldTypeExpressionParser extends ExpressionParser<SchemaFieldTypeExpression> {\n tryParse(source: ExpressionSource, start = 0): SchemaFieldTypeExpression {\n if (typeof source !== 'string') return new SchemaFieldTypeExpression({ tokens: source });\n const colon = source.indexOf(':');\n const tokens =\n colon === -1\n ? [new TextToken(source, start)]\n : [\n new PrefixToken(start, source.slice(0, colon + 1)),\n new TextToken(source.slice(colon + 1), start + colon + 1)\n ];\n return new SchemaFieldTypeExpression({ tokens });\n }\n}\n"]}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchemaIndexExpressionParser = exports.SchemaIndexExpression = void 0;
4
- const parser_expressions_1 = require("@ja-platform/parser-expressions");
5
- const SchemaIndexKeyToken_1 = require("../tokens/SchemaIndexKeyToken");
6
- /**
7
- * Index field references and their sort directions, derived from the source tokens.
8
- */
9
- class SchemaIndexExpression extends parser_expressions_1.ListExpression {
10
- constructor(options) {
11
- super('schema-index', options);
12
- }
13
- isValid() {
14
- return super.isValid() && this.items.every((token) => token instanceof SchemaIndexKeyToken_1.SchemaIndexKeyToken && token.isValid());
15
- }
16
- get keys() {
17
- return this.items.map((token) => ({ field: token.field, dir: token.direction }));
18
- }
19
- }
20
- exports.SchemaIndexExpression = SchemaIndexExpression;
21
- class SchemaIndexExpressionParser extends parser_expressions_1.ListExpressionParser {
22
- constructor() {
23
- super({
24
- parseItem: ({ source, start }) => new SchemaIndexKeyToken_1.SchemaIndexKeyToken(source, start),
25
- createExpression: (options) => new SchemaIndexExpression(options)
26
- });
27
- }
28
- }
29
- exports.SchemaIndexExpressionParser = SchemaIndexExpressionParser;
30
- //# sourceMappingURL=SchemaIndexExpression.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SchemaIndexExpression.js","sourceRoot":"","sources":["../../src/expressions/SchemaIndexExpression.ts"],"names":[],"mappings":";;;AAAA,wEAAkH;AAElH,uEAAoE;AAEpE;;GAEG;AACH,2BAAmC,SAAQ,mCAAmC;IAC5E,YAAY,OAAkC;QAC5C,KAAK,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACjC,CAAC;IAED,OAAO;QACL,OAAO,KAAK,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,YAAY,yCAAmB,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACjH,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACnF,CAAC;CACF;;AAED,iCAAyC,SAAQ,yCAA2C;IAC1F;QACE,KAAK,CAAC;YACJ,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,IAAI,yCAAmB,CAAC,MAAM,EAAE,KAAK,CAAC;YACxE,gBAAgB,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,qBAAqB,CAAC,OAAO,CAAC;SAClE,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import { AbstractExpressionOptions, ListExpression, ListExpressionParser } from '@ja-platform/parser-expressions';\nimport { ModelIndexKey } from '@ja-platform/parser-schema';\nimport { SchemaIndexKeyToken } from '../tokens/SchemaIndexKeyToken';\n\n/**\n * Index field references and their sort directions, derived from the source tokens.\n */\nexport class SchemaIndexExpression extends ListExpression<SchemaIndexKeyToken> {\n constructor(options: AbstractExpressionOptions) {\n super('schema-index', options);\n }\n\n isValid(): boolean {\n return super.isValid() && this.items.every((token) => token instanceof SchemaIndexKeyToken && token.isValid());\n }\n\n get keys(): readonly ModelIndexKey[] {\n return this.items.map((token) => ({ field: token.field, dir: token.direction }));\n }\n}\n\nexport class SchemaIndexExpressionParser extends ListExpressionParser<SchemaIndexExpression> {\n constructor() {\n super({\n parseItem: ({ source, start }) => new SchemaIndexKeyToken(source, start),\n createExpression: (options) => new SchemaIndexExpression(options)\n });\n }\n}\n"]}
package/dist/index.js DELETED
@@ -1,27 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./schemaSerializer"), exports);
18
- __exportStar(require("./loadSchemaXml"), exports);
19
- __exportStar(require("./SchemaDefinition"), exports);
20
- __exportStar(require("./parsed/ParsedSchemaNode"), exports);
21
- __exportStar(require("./parsed/ParsedSchemaModelNode"), exports);
22
- __exportStar(require("./parsed/ParsedSchemaFieldNode"), exports);
23
- __exportStar(require("./XmlSchema"), exports);
24
- __exportStar(require("./XmlField"), exports);
25
- __exportStar(require("./XmlModel"), exports);
26
- __exportStar(require("./XmlParam"), exports);
27
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,kDAAgC;AAChC,qDAAmC;AACnC,4DAA0C;AAC1C,iEAA+C;AAC/C,iEAA+C;AAC/C,8CAA4B;AAC5B,6CAA2B;AAC3B,6CAA2B;AAC3B,6CAA2B","sourcesContent":["export * from './schemaSerializer';\nexport * from './loadSchemaXml';\nexport * from './SchemaDefinition';\nexport * from './parsed/ParsedSchemaNode';\nexport * from './parsed/ParsedSchemaModelNode';\nexport * from './parsed/ParsedSchemaFieldNode';\nexport * from './XmlSchema';\nexport * from './XmlField';\nexport * from './XmlModel';\nexport * from './XmlParam';\n"]}
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loadSchemaXml = loadSchemaXml;
4
- const XmlSchema_1 = require("./XmlSchema");
5
- const common_xml_1 = require("@journeyapps/common-xml");
6
- const SchemaDefinition_1 = require("./SchemaDefinition");
7
- /**
8
- * Parse schema XML using the node definitions and convert the resulting tree to a schema.
9
- */
10
- function loadSchemaXml({ source }) {
11
- var _a;
12
- const document = (0, common_xml_1.parse)(source);
13
- let schema = new XmlSchema_1.XmlSchema();
14
- schema.errors = [...((_a = document.errors) !== null && _a !== void 0 ? _a : [])];
15
- if (schema.errors.length)
16
- return schema;
17
- const element = document.documentElement;
18
- const definition = new SchemaDefinition_1.SchemaDefinition();
19
- if ((element === null || element === void 0 ? void 0 : element.tagName) !== definition.name) {
20
- schema.errors.push((0, common_xml_1.error)(element, `<${definition.name}> root tag expected`));
21
- return schema;
22
- }
23
- const parsed = definition.parseTree({
24
- event: {
25
- element,
26
- helper: {
27
- pushError: ({ element, message, type }) => schema.errors.push((0, common_xml_1.error)(element, message, type))
28
- }
29
- }
30
- });
31
- schema.parsedNode = parsed;
32
- if (!schema.errors.some((diagnostic) => !('type' in diagnostic) || diagnostic.type !== 'warning')) {
33
- const errors = schema.errors;
34
- schema = parsed.toSchema();
35
- schema.errors = errors;
36
- }
37
- return schema;
38
- }
39
- //# sourceMappingURL=loadSchemaXml.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loadSchemaXml.js","sourceRoot":"","sources":["../src/loadSchemaXml.ts"],"names":[],"mappings":";;;AAAA,2CAAkD;AAClD,wDAAuD;AACvD,yDAAsD;AAMtD;;GAEG;AACH,uBAA8B,EAAE,MAAM,EAAwB;;IAC5D,MAAM,QAAQ,GAAG,IAAA,kBAAK,EAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,MAAM,GAAG,IAAI,qBAAM,EAAE,CAAC;IAC1B,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,OAAC,QAAQ,CAAC,MAAM,mCAAI,EAAE,CAAC,CAAC,CAAC;IAC7C,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM;QAAE,OAAO,MAAM,CAAC;IAExC,MAAM,OAAO,GAAG,QAAQ,CAAC,eAAe,CAAC;IACzC,MAAM,UAAU,GAAG,IAAI,mCAAgB,EAAE,CAAC;IAC1C,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,MAAK,UAAU,CAAC,IAAI,EAAE,CAAC;QACzC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAA,kBAAK,EAAC,OAAO,EAAE,IAAI,UAAU,CAAC,IAAI,qBAAqB,CAAC,CAAC,CAAC;QAC7E,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,CAAC;QAClC,KAAK,EAAE;YACL,OAAO;YACP,MAAM,EAAE;gBACN,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAA,kBAAK,EAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;aAC7F;SACF;KACF,CAAC,CAAC;IACH,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC;IAC3B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,UAAU,CAAC,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,CAAC,EAAE,CAAC;QAClG,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC7B,MAAM,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC3B,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { XmlSchema as Schema } from './XmlSchema';\nimport { error, parse } from '@journeyapps/common-xml';\nimport { SchemaDefinition } from './SchemaDefinition';\n\nexport interface LoadSchemaXmlOptions {\n source: string;\n}\n\n/**\n * Parse schema XML using the node definitions and convert the resulting tree to a schema.\n */\nexport function loadSchemaXml({ source }: LoadSchemaXmlOptions): Schema {\n const document = parse(source);\n let schema = new Schema();\n schema.errors = [...(document.errors ?? [])];\n if (schema.errors.length) return schema;\n\n const element = document.documentElement;\n const definition = new SchemaDefinition();\n if (element?.tagName !== definition.name) {\n schema.errors.push(error(element, `<${definition.name}> root tag expected`));\n return schema;\n }\n\n const parsed = definition.parseTree({\n event: {\n element,\n helper: {\n pushError: ({ element, message, type }) => schema.errors.push(error(element, message, type))\n }\n }\n });\n schema.parsedNode = parsed;\n if (!schema.errors.some((diagnostic) => !('type' in diagnostic) || diagnostic.type !== 'warning')) {\n const errors = schema.errors;\n schema = parsed.toSchema();\n schema.errors = errors;\n }\n return schema;\n}\n"]}
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchemaBelongsToNode = void 0;
4
- const parser_core_1 = require("@ja-platform/parser-core");
5
- const SchemaNameAttribute_1 = require("../attributes/SchemaNameAttribute");
6
- class SchemaBelongsToNode extends parser_core_1.V5Node {
7
- constructor() {
8
- super({ name: 'belongs-to', key: 'belongsTo', isMultiple: true });
9
- this.addAttribute(new SchemaNameAttribute_1.SchemaNameAttribute({ name: 'name' }));
10
- this.addAttribute(new SchemaNameAttribute_1.SchemaNameAttribute({ name: 'model', required: true }));
11
- }
12
- }
13
- exports.SchemaBelongsToNode = SchemaBelongsToNode;
14
- //# sourceMappingURL=SchemaBelongsToNode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SchemaBelongsToNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaBelongsToNode.ts"],"names":[],"mappings":";;;AAAA,0DAAmF;AAEnF,2EAAwE;AAOxE,yBAAiC,SAAQ,oBAA4C;IACnF;QACE,KAAK,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAClE,IAAI,CAAC,YAAY,CAAC,IAAI,yCAAmB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QAC7D,IAAI,CAAC,YAAY,CAAC,IAAI,yCAAmB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAChF,CAAC;CACF","sourcesContent":["import { V5Node, V5NodeGenerics, ParsedNodeShape } from '@ja-platform/parser-core';\nimport { ConstantExpression } from '@ja-platform/parser-expressions';\nimport { SchemaNameAttribute } from '../attributes/SchemaNameAttribute';\n\nexport interface SchemaBelongsToShape extends ParsedNodeShape {\n name?: ConstantExpression<string>;\n model: ConstantExpression<string>;\n}\n\nexport class SchemaBelongsToNode extends V5Node<V5NodeGenerics<SchemaBelongsToShape>> {\n constructor() {\n super({ name: 'belongs-to', key: 'belongsTo', isMultiple: true });\n this.addAttribute(new SchemaNameAttribute({ name: 'name' }));\n this.addAttribute(new SchemaNameAttribute({ name: 'model', required: true }));\n }\n}\n"]}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchemaDisplayNode = void 0;
4
- const parser_core_1 = require("@ja-platform/parser-core");
5
- const parser_schema_1 = require("@ja-platform/parser-schema");
6
- class SchemaDisplayNode extends parser_core_1.V5Node {
7
- constructor() {
8
- super({ name: 'display', isRequired: true });
9
- this.addAttribute(new parser_core_1.V5ContentTextAttribute({ name: 'format', syntax: new parser_schema_1.SchemaObjectDisplayExpressionParser() }));
10
- }
11
- }
12
- exports.SchemaDisplayNode = SchemaDisplayNode;
13
- //# sourceMappingURL=SchemaDisplayNode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SchemaDisplayNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaDisplayNode.ts"],"names":[],"mappings":";;;AAAA,0DAA2G;AAC3G,8DAAgH;AAMhH,uBAA+B,SAAQ,oBAA0C;IAC/E;QACE,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7C,IAAI,CAAC,YAAY,CACf,IAAI,oCAAsB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,mDAAmC,EAAE,EAAE,CAAC,CAClG,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { V5Node, V5NodeGenerics, ParsedNodeShape, V5ContentTextAttribute } from '@ja-platform/parser-core';\nimport { SchemaObjectDisplayExpression, SchemaObjectDisplayExpressionParser } from '@ja-platform/parser-schema';\n\nexport interface SchemaDisplayShape extends ParsedNodeShape {\n format: SchemaObjectDisplayExpression;\n}\n\nexport class SchemaDisplayNode extends V5Node<V5NodeGenerics<SchemaDisplayShape>> {\n constructor() {\n super({ name: 'display', isRequired: true });\n this.addAttribute(\n new V5ContentTextAttribute({ name: 'format', syntax: new SchemaObjectDisplayExpressionParser() })\n );\n }\n}\n"]}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchemaFieldNode = void 0;
4
- const parser_core_1 = require("@ja-platform/parser-core");
5
- const SchemaFieldTypeAttribute_1 = require("../attributes/SchemaFieldTypeAttribute");
6
- const SchemaNameAttribute_1 = require("../attributes/SchemaNameAttribute");
7
- const SchemaEnumAttribute_1 = require("../attributes/SchemaEnumAttribute");
8
- const parser_schema_1 = require("@ja-platform/parser-schema");
9
- const SchemaOptionNode_1 = require("./SchemaOptionNode");
10
- const ParsedSchemaFieldNode_1 = require("../parsed/ParsedSchemaFieldNode");
11
- class SchemaFieldNode extends parser_core_1.V5Node {
12
- constructor() {
13
- super({ name: 'field', key: 'fields', isMultiple: true });
14
- this.addAttribute(new SchemaNameAttribute_1.SchemaNameAttribute({ name: 'name', required: true }));
15
- this.addAttribute(new parser_core_1.V5ConstantTextAttribute({ name: 'label', required: true }));
16
- this.addAttribute(new SchemaFieldTypeAttribute_1.SchemaFieldTypeAttribute({ name: 'type', required: true }));
17
- this.addAttribute(new SchemaEnumAttribute_1.SchemaEnumAttribute({ name: 'media', values: parser_schema_1.ATTACHMENT_MEDIA_TYPES }));
18
- this.addAttribute(new parser_core_1.V5ConstantBooleanAttribute({ name: 'auto-download', key: 'autoDownload', defaultValue: false }));
19
- this.addAttribute(new parser_core_1.V5ConstantTextAttribute({ name: 'spec', deprecated: true }));
20
- this.addAttribute(new parser_core_1.V5ConstantTextAttribute({ name: 'deprecated-spec', key: 'deprecatedSpec', deprecated: true }));
21
- this.addAttribute(new parser_core_1.V5ConstantTextAttribute({ name: 'minValue', deprecated: true }));
22
- this.addAttribute(new parser_core_1.V5ConstantTextAttribute({ name: 'maxValue', deprecated: true }));
23
- this.addNode(new SchemaOptionNode_1.SchemaOptionNode());
24
- }
25
- createParsedNode(options) {
26
- return new ParsedSchemaFieldNode_1.ParsedSchemaFieldNode(Object.assign({ definition: this }, options));
27
- }
28
- }
29
- exports.SchemaFieldNode = SchemaFieldNode;
30
- //# sourceMappingURL=SchemaFieldNode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SchemaFieldNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaFieldNode.ts"],"names":[],"mappings":";;;AAAA,0DASkC;AAElC,qFAAkF;AAElF,2EAAwE;AACxE,2EAAwE;AACxE,8DAAoE;AACpE,yDAAyE;AACzE,2EAAwE;AAexE,qBAA6B,SAAQ,oBAA+D;IAClG;QACE,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D,IAAI,CAAC,YAAY,CAAC,IAAI,yCAAmB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC7E,IAAI,CAAC,YAAY,CAAC,IAAI,qCAAuB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAClF,IAAI,CAAC,YAAY,CAAC,IAAI,mDAAwB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAClF,IAAI,CAAC,YAAY,CAAC,IAAI,yCAAmB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,sCAAsB,EAAE,CAAC,CAAC,CAAC;QAC9F,IAAI,CAAC,YAAY,CACf,IAAI,wCAA0B,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CACpG,CAAC;QACF,IAAI,CAAC,YAAY,CAAC,IAAI,qCAAuB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACnF,IAAI,CAAC,YAAY,CACf,IAAI,qCAAuB,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,gBAAgB,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAClG,CAAC;QACF,IAAI,CAAC,YAAY,CAAC,IAAI,qCAAuB,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACvF,IAAI,CAAC,YAAY,CAAC,IAAI,qCAAuB,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACvF,IAAI,CAAC,OAAO,CAAC,IAAI,mCAAgB,EAAE,CAAC,CAAC;IACvC,CAAC;IAES,gBAAgB,CAAC,OAAyB;QAClD,OAAO,IAAI,6CAAqB,iBAAG,UAAU,EAAE,IAAI,IAAK,OAAO,EAAG,CAAC;IACrE,CAAC;CACF","sourcesContent":["import {\n V5Node,\n V5NodeGenerics,\n ParsedNodeShape,\n ParsedNode,\n ParsedArrayNode,\n V5ConstantTextAttribute,\n V5ConstantBooleanAttribute,\n ParseTreeOptions\n} from '@ja-platform/parser-core';\nimport { ConstantExpression } from '@ja-platform/parser-expressions';\nimport { SchemaFieldTypeAttribute } from '../attributes/SchemaFieldTypeAttribute';\nimport { SchemaFieldTypeExpression } from '../expressions/SchemaFieldTypeExpression';\nimport { SchemaNameAttribute } from '../attributes/SchemaNameAttribute';\nimport { SchemaEnumAttribute } from '../attributes/SchemaEnumAttribute';\nimport { ATTACHMENT_MEDIA_TYPES } from '@ja-platform/parser-schema';\nimport { SchemaOptionNode, SchemaOptionShape } from './SchemaOptionNode';\nimport { ParsedSchemaFieldNode } from '../parsed/ParsedSchemaFieldNode';\n\nexport interface SchemaFieldShape extends ParsedNodeShape {\n name: ConstantExpression<string>;\n label: ConstantExpression<string>;\n type: SchemaFieldTypeExpression;\n media?: ConstantExpression<string>;\n autoDownload?: ConstantExpression<boolean>;\n spec?: ConstantExpression<string>;\n deprecatedSpec?: ConstantExpression<string>;\n minValue?: ConstantExpression<string>;\n maxValue?: ConstantExpression<string>;\n options: ParsedArrayNode<ParsedNode<SchemaOptionShape>>;\n}\n\nexport class SchemaFieldNode extends V5Node<V5NodeGenerics<SchemaFieldShape, ParsedSchemaFieldNode>> {\n constructor() {\n super({ name: 'field', key: 'fields', isMultiple: true });\n this.addAttribute(new SchemaNameAttribute({ name: 'name', required: true }));\n this.addAttribute(new V5ConstantTextAttribute({ name: 'label', required: true }));\n this.addAttribute(new SchemaFieldTypeAttribute({ name: 'type', required: true }));\n this.addAttribute(new SchemaEnumAttribute({ name: 'media', values: ATTACHMENT_MEDIA_TYPES }));\n this.addAttribute(\n new V5ConstantBooleanAttribute({ name: 'auto-download', key: 'autoDownload', defaultValue: false })\n );\n this.addAttribute(new V5ConstantTextAttribute({ name: 'spec', deprecated: true }));\n this.addAttribute(\n new V5ConstantTextAttribute({ name: 'deprecated-spec', key: 'deprecatedSpec', deprecated: true })\n );\n this.addAttribute(new V5ConstantTextAttribute({ name: 'minValue', deprecated: true }));\n this.addAttribute(new V5ConstantTextAttribute({ name: 'maxValue', deprecated: true }));\n this.addNode(new SchemaOptionNode());\n }\n\n protected createParsedNode(options: ParseTreeOptions): ParsedSchemaFieldNode {\n return new ParsedSchemaFieldNode({ definition: this, ...options });\n }\n}\n"]}
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchemaHasManyNode = void 0;
4
- const parser_core_1 = require("@ja-platform/parser-core");
5
- const SchemaNameAttribute_1 = require("../attributes/SchemaNameAttribute");
6
- class SchemaHasManyNode extends parser_core_1.V5Node {
7
- constructor() {
8
- super({ name: 'has-many', key: 'hasMany', isMultiple: true });
9
- this.addAttribute(new SchemaNameAttribute_1.SchemaNameAttribute({ name: 'name', required: true }));
10
- this.addAttribute(new SchemaNameAttribute_1.SchemaNameAttribute({ name: 'model', required: true }));
11
- this.addAttribute(new SchemaNameAttribute_1.SchemaNameAttribute({ name: 'inverse-of', key: 'inverseOf' }));
12
- }
13
- }
14
- exports.SchemaHasManyNode = SchemaHasManyNode;
15
- //# sourceMappingURL=SchemaHasManyNode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SchemaHasManyNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaHasManyNode.ts"],"names":[],"mappings":";;;AAAA,0DAAmF;AAEnF,2EAAwE;AAQxE,uBAA+B,SAAQ,oBAA0C;IAC/E;QACE,KAAK,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAC9D,IAAI,CAAC,YAAY,CAAC,IAAI,yCAAmB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC7E,IAAI,CAAC,YAAY,CAAC,IAAI,yCAAmB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC9E,IAAI,CAAC,YAAY,CAAC,IAAI,yCAAmB,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;IACvF,CAAC;CACF","sourcesContent":["import { V5Node, V5NodeGenerics, ParsedNodeShape } from '@ja-platform/parser-core';\nimport { ConstantExpression } from '@ja-platform/parser-expressions';\nimport { SchemaNameAttribute } from '../attributes/SchemaNameAttribute';\n\nexport interface SchemaHasManyShape extends ParsedNodeShape {\n name: ConstantExpression<string>;\n model: ConstantExpression<string>;\n inverseOf?: ConstantExpression<string>;\n}\n\nexport class SchemaHasManyNode extends V5Node<V5NodeGenerics<SchemaHasManyShape>> {\n constructor() {\n super({ name: 'has-many', key: 'hasMany', isMultiple: true });\n this.addAttribute(new SchemaNameAttribute({ name: 'name', required: true }));\n this.addAttribute(new SchemaNameAttribute({ name: 'model', required: true }));\n this.addAttribute(new SchemaNameAttribute({ name: 'inverse-of', key: 'inverseOf' }));\n }\n}\n"]}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchemaIndexNode = void 0;
4
- const parser_core_1 = require("@ja-platform/parser-core");
5
- const parser_schema_1 = require("@ja-platform/parser-schema");
6
- const SchemaNameAttribute_1 = require("../attributes/SchemaNameAttribute");
7
- const SchemaIndexAttribute_1 = require("../attributes/SchemaIndexAttribute");
8
- const SchemaDatabaseAttribute_1 = require("../attributes/SchemaDatabaseAttribute");
9
- class SchemaIndexNode extends parser_core_1.V5Node {
10
- constructor() {
11
- super({ name: 'index', key: 'indexes', isMultiple: true });
12
- this.addAttribute(new SchemaNameAttribute_1.SchemaNameAttribute({ name: 'name' }));
13
- this.addAttribute(new SchemaIndexAttribute_1.SchemaIndexAttribute({ name: 'on', key: 'keys', required: true }));
14
- this.addAttribute(new SchemaDatabaseAttribute_1.SchemaDatabaseAttribute({
15
- name: 'database',
16
- key: 'databases',
17
- defaultValue: [parser_schema_1.IndexDatabase.APP, parser_schema_1.IndexDatabase.CLOUD]
18
- }));
19
- }
20
- }
21
- exports.SchemaIndexNode = SchemaIndexNode;
22
- //# sourceMappingURL=SchemaIndexNode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SchemaIndexNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaIndexNode.ts"],"names":[],"mappings":";;;AAAA,0DAAmF;AAEnF,8DAA2D;AAG3D,2EAAwE;AACxE,6EAA0E;AAC1E,mFAAgF;AAQhF,qBAA6B,SAAQ,oBAAwC;IAC3E;QACE,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3D,IAAI,CAAC,YAAY,CAAC,IAAI,yCAAmB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QAC7D,IAAI,CAAC,YAAY,CAAC,IAAI,2CAAoB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACzF,IAAI,CAAC,YAAY,CACf,IAAI,iDAAuB,CAAC;YAC1B,IAAI,EAAE,UAAU;YAChB,GAAG,EAAE,WAAW;YAChB,YAAY,EAAE,CAAC,6BAAa,CAAC,GAAG,EAAE,6BAAa,CAAC,KAAK,CAAC;SACvD,CAAC,CACH,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { V5Node, V5NodeGenerics, ParsedNodeShape } from '@ja-platform/parser-core';\nimport { ConstantExpression } from '@ja-platform/parser-expressions';\nimport { IndexDatabase } from '@ja-platform/parser-schema';\nimport { SchemaIndexExpression } from '../expressions/SchemaIndexExpression';\nimport { SchemaDatabasesExpression } from '../expressions/SchemaDatabasesExpression';\nimport { SchemaNameAttribute } from '../attributes/SchemaNameAttribute';\nimport { SchemaIndexAttribute } from '../attributes/SchemaIndexAttribute';\nimport { SchemaDatabaseAttribute } from '../attributes/SchemaDatabaseAttribute';\n\nexport interface SchemaIndexShape extends ParsedNodeShape {\n name?: ConstantExpression<string>;\n keys: SchemaIndexExpression;\n databases?: SchemaDatabasesExpression;\n}\n\nexport class SchemaIndexNode extends V5Node<V5NodeGenerics<SchemaIndexShape>> {\n constructor() {\n super({ name: 'index', key: 'indexes', isMultiple: true });\n this.addAttribute(new SchemaNameAttribute({ name: 'name' }));\n this.addAttribute(new SchemaIndexAttribute({ name: 'on', key: 'keys', required: true }));\n this.addAttribute(\n new SchemaDatabaseAttribute({\n name: 'database',\n key: 'databases',\n defaultValue: [IndexDatabase.APP, IndexDatabase.CLOUD]\n })\n );\n }\n}\n"]}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchemaModelNode = void 0;
4
- const parser_core_1 = require("@ja-platform/parser-core");
5
- const SchemaNameAttribute_1 = require("../attributes/SchemaNameAttribute");
6
- const SchemaEnumAttribute_1 = require("../attributes/SchemaEnumAttribute");
7
- const SchemaFieldNode_1 = require("./SchemaFieldNode");
8
- const ParsedSchemaModelNode_1 = require("../parsed/ParsedSchemaModelNode");
9
- const SchemaBelongsToNode_1 = require("./SchemaBelongsToNode");
10
- const SchemaHasManyNode_1 = require("./SchemaHasManyNode");
11
- const SchemaIndexNode_1 = require("./SchemaIndexNode");
12
- const SchemaDisplayNode_1 = require("./SchemaDisplayNode");
13
- const SchemaNotificationNode_1 = require("./SchemaNotificationNode");
14
- const SchemaWebhookNode_1 = require("./SchemaWebhookNode");
15
- class SchemaModelNode extends parser_core_1.V5Node {
16
- constructor() {
17
- super({ name: 'model', key: 'models', isMultiple: true });
18
- this.addAttribute(new SchemaNameAttribute_1.SchemaNameAttribute({ name: 'name', required: true }));
19
- this.addAttribute(new parser_core_1.V5ConstantTextAttribute({ name: 'label', required: true }));
20
- this.addAttribute(new SchemaEnumAttribute_1.SchemaEnumAttribute({ name: 'classification', values: ['standard', 'sensitive'] }));
21
- this.addNode(new SchemaFieldNode_1.SchemaFieldNode());
22
- this.addNode(new SchemaBelongsToNode_1.SchemaBelongsToNode());
23
- this.addNode(new SchemaHasManyNode_1.SchemaHasManyNode());
24
- this.addNode(new SchemaIndexNode_1.SchemaIndexNode());
25
- this.addNode(new SchemaDisplayNode_1.SchemaDisplayNode());
26
- this.addNode(new SchemaNotificationNode_1.SchemaNotificationNode());
27
- this.addNode(new SchemaWebhookNode_1.SchemaWebhookNode());
28
- }
29
- createParsedNode(options) {
30
- return new ParsedSchemaModelNode_1.ParsedSchemaModelNode(Object.assign({ definition: this }, options));
31
- }
32
- }
33
- exports.SchemaModelNode = SchemaModelNode;
34
- //# sourceMappingURL=SchemaModelNode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SchemaModelNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaModelNode.ts"],"names":[],"mappings":";;;AAAA,0DAQkC;AAElC,2EAAwE;AACxE,2EAAwE;AACxE,uDAAoD;AAEpD,2EAAwE;AACxE,+DAAkF;AAClF,2DAA4E;AAC5E,uDAAsE;AACtE,2DAA4E;AAC5E,qEAA2F;AAC3F,2DAA4E;AAe5E,qBAA6B,SAAQ,oBAA+D;IAClG;QACE,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D,IAAI,CAAC,YAAY,CAAC,IAAI,yCAAmB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC7E,IAAI,CAAC,YAAY,CAAC,IAAI,qCAAuB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAClF,IAAI,CAAC,YAAY,CAAC,IAAI,yCAAmB,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC;QAC1G,IAAI,CAAC,OAAO,CAAC,IAAI,iCAAe,EAAE,CAAC,CAAC;QACpC,IAAI,CAAC,OAAO,CAAC,IAAI,yCAAmB,EAAE,CAAC,CAAC;QACxC,IAAI,CAAC,OAAO,CAAC,IAAI,qCAAiB,EAAE,CAAC,CAAC;QACtC,IAAI,CAAC,OAAO,CAAC,IAAI,iCAAe,EAAE,CAAC,CAAC;QACpC,IAAI,CAAC,OAAO,CAAC,IAAI,qCAAiB,EAAE,CAAC,CAAC;QACtC,IAAI,CAAC,OAAO,CAAC,IAAI,+CAAsB,EAAE,CAAC,CAAC;QAC3C,IAAI,CAAC,OAAO,CAAC,IAAI,qCAAiB,EAAE,CAAC,CAAC;IACxC,CAAC;IAES,gBAAgB,CAAC,OAAyB;QAClD,OAAO,IAAI,6CAAqB,iBAAG,UAAU,EAAE,IAAI,IAAK,OAAO,EAAG,CAAC;IACrE,CAAC;CACF","sourcesContent":["import {\n V5Node,\n V5NodeGenerics,\n ParsedNodeShape,\n ParsedNode,\n ParsedArrayNode,\n V5ConstantTextAttribute,\n ParseTreeOptions\n} from '@ja-platform/parser-core';\nimport { ConstantExpression } from '@ja-platform/parser-expressions';\nimport { SchemaNameAttribute } from '../attributes/SchemaNameAttribute';\nimport { SchemaEnumAttribute } from '../attributes/SchemaEnumAttribute';\nimport { SchemaFieldNode } from './SchemaFieldNode';\nimport { ParsedSchemaFieldNode } from '../parsed/ParsedSchemaFieldNode';\nimport { ParsedSchemaModelNode } from '../parsed/ParsedSchemaModelNode';\nimport { SchemaBelongsToNode, SchemaBelongsToShape } from './SchemaBelongsToNode';\nimport { SchemaHasManyNode, SchemaHasManyShape } from './SchemaHasManyNode';\nimport { SchemaIndexNode, SchemaIndexShape } from './SchemaIndexNode';\nimport { SchemaDisplayNode, SchemaDisplayShape } from './SchemaDisplayNode';\nimport { SchemaNotificationNode, SchemaNotificationShape } from './SchemaNotificationNode';\nimport { SchemaWebhookNode, SchemaWebhookShape } from './SchemaWebhookNode';\n\nexport interface SchemaModelShape extends ParsedNodeShape {\n name: ConstantExpression<string>;\n label: ConstantExpression<string>;\n classification?: ConstantExpression<string>;\n fields: ParsedArrayNode<ParsedSchemaFieldNode>;\n belongsTo: ParsedArrayNode<ParsedNode<SchemaBelongsToShape>>;\n hasMany: ParsedArrayNode<ParsedNode<SchemaHasManyShape>>;\n indexes: ParsedArrayNode<ParsedNode<SchemaIndexShape>>;\n display?: ParsedNode<SchemaDisplayShape>;\n notifications: ParsedArrayNode<ParsedNode<SchemaNotificationShape>>;\n webhooks: ParsedArrayNode<ParsedNode<SchemaWebhookShape>>;\n}\n\nexport class SchemaModelNode extends V5Node<V5NodeGenerics<SchemaModelShape, ParsedSchemaModelNode>> {\n constructor() {\n super({ name: 'model', key: 'models', isMultiple: true });\n this.addAttribute(new SchemaNameAttribute({ name: 'name', required: true }));\n this.addAttribute(new V5ConstantTextAttribute({ name: 'label', required: true }));\n this.addAttribute(new SchemaEnumAttribute({ name: 'classification', values: ['standard', 'sensitive'] }));\n this.addNode(new SchemaFieldNode());\n this.addNode(new SchemaBelongsToNode());\n this.addNode(new SchemaHasManyNode());\n this.addNode(new SchemaIndexNode());\n this.addNode(new SchemaDisplayNode());\n this.addNode(new SchemaNotificationNode());\n this.addNode(new SchemaWebhookNode());\n }\n\n protected createParsedNode(options: ParseTreeOptions): ParsedSchemaModelNode {\n return new ParsedSchemaModelNode({ definition: this, ...options });\n }\n}\n"]}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchemaNotificationNode = void 0;
4
- const parser_core_1 = require("@ja-platform/parser-core");
5
- const parser_schema_1 = require("@ja-platform/parser-schema");
6
- const SchemaNameAttribute_1 = require("../attributes/SchemaNameAttribute");
7
- class SchemaNotificationNode extends parser_core_1.V5Node {
8
- constructor() {
9
- super({ name: 'notify-user', key: 'notifications', isMultiple: true });
10
- this.addAttribute(new parser_core_1.V5Attribute('schema-notification-message', {
11
- name: 'message',
12
- required: true,
13
- syntax: new parser_schema_1.SchemaObjectDisplayExpressionParser()
14
- }));
15
- this.addAttribute(new SchemaNameAttribute_1.SchemaNameAttribute({ name: 'received-field', key: 'received', required: true }));
16
- this.addAttribute(new SchemaNameAttribute_1.SchemaNameAttribute({ name: 'recipient-field', key: 'recipient', required: true }));
17
- this.addAttribute(new SchemaNameAttribute_1.SchemaNameAttribute({ name: 'badge-count-field', key: 'badgeCount' }));
18
- }
19
- }
20
- exports.SchemaNotificationNode = SchemaNotificationNode;
21
- //# sourceMappingURL=SchemaNotificationNode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SchemaNotificationNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaNotificationNode.ts"],"names":[],"mappings":";;;AAAA,0DAAgG;AAEhG,8DAAgH;AAChH,2EAAwE;AASxE,4BAAoC,SAAQ,oBAA+C;IACzF;QACE,KAAK,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,eAAe,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QACvE,IAAI,CAAC,YAAY,CACf,IAAI,yBAAW,CAAC,6BAA6B,EAAE;YAC7C,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,IAAI,mDAAmC,EAAE;SAClD,CAAC,CACH,CAAC;QACF,IAAI,CAAC,YAAY,CAAC,IAAI,yCAAmB,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACxG,IAAI,CAAC,YAAY,CAAC,IAAI,yCAAmB,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC1G,IAAI,CAAC,YAAY,CAAC,IAAI,yCAAmB,CAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;IAC/F,CAAC;CACF","sourcesContent":["import { V5Node, V5NodeGenerics, ParsedNodeShape, V5Attribute } from '@ja-platform/parser-core';\nimport { ConstantExpression } from '@ja-platform/parser-expressions';\nimport { SchemaObjectDisplayExpression, SchemaObjectDisplayExpressionParser } from '@ja-platform/parser-schema';\nimport { SchemaNameAttribute } from '../attributes/SchemaNameAttribute';\n\nexport interface SchemaNotificationShape extends ParsedNodeShape {\n message: SchemaObjectDisplayExpression;\n received: ConstantExpression<string>;\n recipient: ConstantExpression<string>;\n badgeCount?: ConstantExpression<string>;\n}\n\nexport class SchemaNotificationNode extends V5Node<V5NodeGenerics<SchemaNotificationShape>> {\n constructor() {\n super({ name: 'notify-user', key: 'notifications', isMultiple: true });\n this.addAttribute(\n new V5Attribute('schema-notification-message', {\n name: 'message',\n required: true,\n syntax: new SchemaObjectDisplayExpressionParser()\n })\n );\n this.addAttribute(new SchemaNameAttribute({ name: 'received-field', key: 'received', required: true }));\n this.addAttribute(new SchemaNameAttribute({ name: 'recipient-field', key: 'recipient', required: true }));\n this.addAttribute(new SchemaNameAttribute({ name: 'badge-count-field', key: 'badgeCount' }));\n }\n}\n"]}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchemaOptionNode = void 0;
4
- const parser_core_1 = require("@ja-platform/parser-core");
5
- const parser_expressions_1 = require("@ja-platform/parser-expressions");
6
- const parser_type_system_1 = require("@ja-platform/parser-type-system");
7
- const SchemaOptionKeyAttribute_1 = require("../attributes/SchemaOptionKeyAttribute");
8
- class SchemaOptionNode extends parser_core_1.V5Node {
9
- constructor() {
10
- super({ name: 'option', key: 'options', isMultiple: true });
11
- this.addAttribute(new SchemaOptionKeyAttribute_1.SchemaOptionKeyAttribute());
12
- this.addAttribute(new parser_core_1.ContentValueAttribute('schema-option-label', {
13
- name: 'label',
14
- valueType: parser_type_system_1.textType,
15
- syntax: new parser_expressions_1.ConstantExpressionParser(parser_type_system_1.textType)
16
- }));
17
- }
18
- }
19
- exports.SchemaOptionNode = SchemaOptionNode;
20
- //# sourceMappingURL=SchemaOptionNode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SchemaOptionNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaOptionNode.ts"],"names":[],"mappings":";;;AAAA,0DAA0G;AAC1G,wEAA+F;AAC/F,wEAA2D;AAC3D,qFAAmG;AAOnG,sBAA8B,SAAQ,oBAAyC;IAC7E;QACE,KAAK,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5D,IAAI,CAAC,YAAY,CAAC,IAAI,mDAAwB,EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,YAAY,CACf,IAAI,mCAAqB,CAAC,qBAAqB,EAAE;YAC/C,IAAI,EAAE,OAAO;YACb,SAAS,EAAE,6BAAQ;YACnB,MAAM,EAAE,IAAI,6CAAwB,CAAC,6BAAQ,CAAC;SAC/C,CAAC,CACH,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { V5Node, V5NodeGenerics, ParsedNodeShape, ContentValueAttribute } from '@ja-platform/parser-core';\nimport { ConstantExpression, ConstantExpressionParser } from '@ja-platform/parser-expressions';\nimport { textType } from '@ja-platform/parser-type-system';\nimport { SchemaOptionKey, SchemaOptionKeyAttribute } from '../attributes/SchemaOptionKeyAttribute';\n\nexport interface SchemaOptionShape extends ParsedNodeShape {\n key?: ConstantExpression<SchemaOptionKey>;\n label: ConstantExpression<string>;\n}\n\nexport class SchemaOptionNode extends V5Node<V5NodeGenerics<SchemaOptionShape>> {\n constructor() {\n super({ name: 'option', key: 'options', isMultiple: true });\n this.addAttribute(new SchemaOptionKeyAttribute());\n this.addAttribute(\n new ContentValueAttribute('schema-option-label', {\n name: 'label',\n valueType: textType,\n syntax: new ConstantExpressionParser(textType)\n })\n );\n }\n}\n"]}