@ja-platform/parser-schema-xml 0.0.0-dev-20261021195551 → 0.0.0-dev-20261021212654

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 (61) hide show
  1. package/dist/@types/{SchemaDefinition.d.ts → SchemaNode.d.ts} +2 -2
  2. package/dist/@types/attributes/SchemaDatabaseAttribute.d.ts +4 -4
  3. package/dist/@types/attributes/SchemaEnumAttribute.d.ts +3 -3
  4. package/dist/@types/attributes/SchemaFieldTypeAttribute.d.ts +4 -4
  5. package/dist/@types/attributes/SchemaIndexAttribute.d.ts +4 -4
  6. package/dist/@types/attributes/SchemaNameAttribute.d.ts +3 -3
  7. package/dist/@types/attributes/SchemaOptionKeyAttribute.d.ts +3 -3
  8. package/dist/@types/index.d.ts +1 -1
  9. package/dist/@types/nodes/SchemaBelongsToNode.d.ts +2 -2
  10. package/dist/@types/nodes/SchemaDisplayNode.d.ts +2 -2
  11. package/dist/@types/nodes/SchemaFieldNode.d.ts +2 -2
  12. package/dist/@types/nodes/SchemaHasManyNode.d.ts +2 -2
  13. package/dist/@types/nodes/SchemaIndexNode.d.ts +2 -2
  14. package/dist/@types/nodes/SchemaModelNode.d.ts +2 -2
  15. package/dist/@types/nodes/SchemaNotificationNode.d.ts +2 -2
  16. package/dist/@types/nodes/SchemaOptionNode.d.ts +2 -2
  17. package/dist/@types/nodes/SchemaWebhookFieldNode.d.ts +2 -2
  18. package/dist/@types/nodes/SchemaWebhookNode.d.ts +2 -2
  19. package/dist/@types/parsed/ParsedSchemaNode.d.ts +1 -1
  20. package/dist/{SchemaDefinition.js → SchemaNode.js} +4 -4
  21. package/dist/SchemaNode.js.map +1 -0
  22. package/dist/attributes/SchemaDatabaseAttribute.js +1 -1
  23. package/dist/attributes/SchemaDatabaseAttribute.js.map +1 -1
  24. package/dist/attributes/SchemaEnumAttribute.js +1 -1
  25. package/dist/attributes/SchemaEnumAttribute.js.map +1 -1
  26. package/dist/attributes/SchemaFieldTypeAttribute.js +1 -1
  27. package/dist/attributes/SchemaFieldTypeAttribute.js.map +1 -1
  28. package/dist/attributes/SchemaIndexAttribute.js +1 -1
  29. package/dist/attributes/SchemaIndexAttribute.js.map +1 -1
  30. package/dist/attributes/SchemaNameAttribute.js +1 -1
  31. package/dist/attributes/SchemaNameAttribute.js.map +1 -1
  32. package/dist/attributes/SchemaOptionKeyAttribute.js +1 -1
  33. package/dist/attributes/SchemaOptionKeyAttribute.js.map +1 -1
  34. package/dist/index.js +1 -1
  35. package/dist/index.js.map +1 -1
  36. package/dist/loadSchemaXml.js +2 -2
  37. package/dist/loadSchemaXml.js.map +1 -1
  38. package/dist/nodes/SchemaBelongsToNode.js +1 -1
  39. package/dist/nodes/SchemaBelongsToNode.js.map +1 -1
  40. package/dist/nodes/SchemaDisplayNode.js +2 -2
  41. package/dist/nodes/SchemaDisplayNode.js.map +1 -1
  42. package/dist/nodes/SchemaFieldNode.js +7 -7
  43. package/dist/nodes/SchemaFieldNode.js.map +1 -1
  44. package/dist/nodes/SchemaHasManyNode.js +1 -1
  45. package/dist/nodes/SchemaHasManyNode.js.map +1 -1
  46. package/dist/nodes/SchemaIndexNode.js +1 -1
  47. package/dist/nodes/SchemaIndexNode.js.map +1 -1
  48. package/dist/nodes/SchemaModelNode.js +2 -2
  49. package/dist/nodes/SchemaModelNode.js.map +1 -1
  50. package/dist/nodes/SchemaNotificationNode.js +2 -2
  51. package/dist/nodes/SchemaNotificationNode.js.map +1 -1
  52. package/dist/nodes/SchemaOptionNode.js +1 -1
  53. package/dist/nodes/SchemaOptionNode.js.map +1 -1
  54. package/dist/nodes/SchemaWebhookFieldNode.js +3 -3
  55. package/dist/nodes/SchemaWebhookFieldNode.js.map +1 -1
  56. package/dist/nodes/SchemaWebhookNode.js +2 -2
  57. package/dist/nodes/SchemaWebhookNode.js.map +1 -1
  58. package/dist/parsed/ParsedSchemaNode.js.map +1 -1
  59. package/dist/tsconfig.tsbuildinfo +1 -1
  60. package/package.json +6 -6
  61. package/dist/SchemaDefinition.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { V5Node, V5NodeGenerics, ParsedNodeShape, ParsedArrayNode, ParseTreeOptions } from '@ja-platform/parser-core';
1
+ import { Node, NodeGenerics, ParsedNodeShape, ParsedArrayNode, ParseTreeOptions } from '@ja-platform/parser-core';
2
2
  import { ParsedSchemaNode } from './parsed/ParsedSchemaNode';
3
3
  import { ParsedSchemaModelNode } from './parsed/ParsedSchemaModelNode';
4
4
  export interface SchemaShape extends ParsedNodeShape {
@@ -7,7 +7,7 @@ export interface SchemaShape extends ParsedNodeShape {
7
7
  /**
8
8
  * The schema XML grammar, producing a tree that can be converted to a schema.
9
9
  */
10
- export declare class SchemaDefinition extends V5Node<V5NodeGenerics<SchemaShape, ParsedSchemaNode>> {
10
+ export declare class SchemaNode extends Node<NodeGenerics<SchemaShape, ParsedSchemaNode>> {
11
11
  constructor();
12
12
  protected createParsedNode(options: ParseTreeOptions): ParsedSchemaNode;
13
13
  }
@@ -1,11 +1,11 @@
1
- import { V5Attribute, V5AttributeGenerics, V5AttributeOptions } from '@ja-platform/parser-core';
1
+ import { Attribute, AttributeGenerics, AttributeOptions } from '@ja-platform/parser-core';
2
2
  import { IndexDatabase } from '@ja-platform/parser-schema';
3
3
  import { SchemaDatabasesExpression } from '../expressions/SchemaDatabasesExpression';
4
- interface SchemaDatabaseAttributeGenerics extends V5AttributeGenerics {
4
+ interface SchemaDatabaseAttributeGenerics extends AttributeGenerics {
5
5
  Value: SchemaDatabasesExpression;
6
- Options: V5AttributeOptions<IndexDatabase[]>;
6
+ Options: AttributeOptions<IndexDatabase[]>;
7
7
  }
8
- export declare class SchemaDatabaseAttribute extends V5Attribute<SchemaDatabaseAttributeGenerics> {
8
+ export declare class SchemaDatabaseAttribute extends Attribute<SchemaDatabaseAttributeGenerics> {
9
9
  constructor(options: SchemaDatabaseAttributeGenerics['Options']);
10
10
  }
11
11
  export {};
@@ -1,6 +1,6 @@
1
- import { V5ConstantTextAttribute, V5AttributeOptions } from '@ja-platform/parser-core';
2
- export declare class SchemaEnumAttribute extends V5ConstantTextAttribute {
3
- constructor(options: V5AttributeOptions<string, string> & {
1
+ import { ConstantTextAttribute, AttributeOptions } from '@ja-platform/parser-core';
2
+ export declare class SchemaEnumAttribute extends ConstantTextAttribute {
3
+ constructor(options: AttributeOptions<string, string> & {
4
4
  values: readonly string[];
5
5
  });
6
6
  }
@@ -1,9 +1,9 @@
1
- import { V5Attribute, V5AttributeGenerics, V5AttributeOptions } from '@ja-platform/parser-core';
1
+ import { Attribute, AttributeGenerics, AttributeOptions } from '@ja-platform/parser-core';
2
2
  import { SchemaFieldTypeExpression } from '../expressions/SchemaFieldTypeExpression';
3
- interface SchemaFieldTypeAttributeGenerics extends V5AttributeGenerics {
3
+ interface SchemaFieldTypeAttributeGenerics extends AttributeGenerics {
4
4
  Value: SchemaFieldTypeExpression;
5
5
  }
6
- export declare class SchemaFieldTypeAttribute extends V5Attribute<SchemaFieldTypeAttributeGenerics> {
7
- constructor(options: V5AttributeOptions);
6
+ export declare class SchemaFieldTypeAttribute extends Attribute<SchemaFieldTypeAttributeGenerics> {
7
+ constructor(options: AttributeOptions);
8
8
  }
9
9
  export {};
@@ -1,9 +1,9 @@
1
- import { V5Attribute, V5AttributeGenerics, V5AttributeOptions } from '@ja-platform/parser-core';
1
+ import { Attribute, AttributeGenerics, AttributeOptions } from '@ja-platform/parser-core';
2
2
  import { SchemaIndexExpression } from '../expressions/SchemaIndexExpression';
3
- interface SchemaIndexAttributeGenerics extends V5AttributeGenerics {
3
+ interface SchemaIndexAttributeGenerics extends AttributeGenerics {
4
4
  Value: SchemaIndexExpression;
5
5
  }
6
- export declare class SchemaIndexAttribute extends V5Attribute<SchemaIndexAttributeGenerics> {
7
- constructor(options: V5AttributeOptions);
6
+ export declare class SchemaIndexAttribute extends Attribute<SchemaIndexAttributeGenerics> {
7
+ constructor(options: AttributeOptions);
8
8
  }
9
9
  export {};
@@ -1,4 +1,4 @@
1
- import { V5ConstantTextAttribute, V5AttributeOptions } from '@ja-platform/parser-core';
2
- export declare class SchemaNameAttribute extends V5ConstantTextAttribute {
3
- constructor(options: V5AttributeOptions<string, string>);
1
+ import { ConstantTextAttribute, AttributeOptions } from '@ja-platform/parser-core';
2
+ export declare class SchemaNameAttribute extends ConstantTextAttribute {
3
+ constructor(options: AttributeOptions<string, string>);
4
4
  }
@@ -1,14 +1,14 @@
1
- import { AttributeParseEvent, V5Attribute, V5AttributeGenerics } from '@ja-platform/parser-core';
1
+ import { AttributeParseEvent, Attribute, AttributeGenerics } from '@ja-platform/parser-core';
2
2
  import { ConstantExpression } from '@ja-platform/parser-expressions';
3
3
  export type SchemaOptionKey = string | number | boolean;
4
- interface SchemaOptionKeyGenerics extends V5AttributeGenerics {
4
+ interface SchemaOptionKeyGenerics extends AttributeGenerics {
5
5
  Value: ConstantExpression<SchemaOptionKey>;
6
6
  NormalizedValue: SchemaOptionKey;
7
7
  }
8
8
  /**
9
9
  * Choice keys use the enclosing field's declared literal type.
10
10
  */
11
- export declare class SchemaOptionKeyAttribute extends V5Attribute<SchemaOptionKeyGenerics> {
11
+ export declare class SchemaOptionKeyAttribute extends Attribute<SchemaOptionKeyGenerics> {
12
12
  constructor();
13
13
  protected getParsedValue(event: AttributeParseEvent): ConstantExpression<SchemaOptionKey>;
14
14
  }
@@ -1,6 +1,6 @@
1
1
  export * from './schemaSerializer';
2
2
  export * from './loadSchemaXml';
3
- export * from './SchemaDefinition';
3
+ export * from './SchemaNode';
4
4
  export * from './parsed/ParsedSchemaNode';
5
5
  export * from './parsed/ParsedSchemaModelNode';
6
6
  export * from './parsed/ParsedSchemaFieldNode';
@@ -1,9 +1,9 @@
1
- import { V5Node, V5NodeGenerics, ParsedNodeShape } from '@ja-platform/parser-core';
1
+ import { Node, NodeGenerics, ParsedNodeShape } from '@ja-platform/parser-core';
2
2
  import { ConstantExpression } from '@ja-platform/parser-expressions';
3
3
  export interface SchemaBelongsToShape extends ParsedNodeShape {
4
4
  name?: ConstantExpression<string>;
5
5
  model: ConstantExpression<string>;
6
6
  }
7
- export declare class SchemaBelongsToNode extends V5Node<V5NodeGenerics<SchemaBelongsToShape>> {
7
+ export declare class SchemaBelongsToNode extends Node<NodeGenerics<SchemaBelongsToShape>> {
8
8
  constructor();
9
9
  }
@@ -1,8 +1,8 @@
1
- import { V5Node, V5NodeGenerics, ParsedNodeShape } from '@ja-platform/parser-core';
1
+ import { Node, NodeGenerics, ParsedNodeShape } from '@ja-platform/parser-core';
2
2
  import { SchemaObjectDisplayExpression } from '@ja-platform/parser-schema';
3
3
  export interface SchemaDisplayShape extends ParsedNodeShape {
4
4
  format: SchemaObjectDisplayExpression;
5
5
  }
6
- export declare class SchemaDisplayNode extends V5Node<V5NodeGenerics<SchemaDisplayShape>> {
6
+ export declare class SchemaDisplayNode extends Node<NodeGenerics<SchemaDisplayShape>> {
7
7
  constructor();
8
8
  }
@@ -1,4 +1,4 @@
1
- import { V5Node, V5NodeGenerics, ParsedNodeShape, ParsedNode, ParsedArrayNode, ParseTreeOptions } from '@ja-platform/parser-core';
1
+ import { Node, NodeGenerics, ParsedNodeShape, ParsedNode, ParsedArrayNode, ParseTreeOptions } from '@ja-platform/parser-core';
2
2
  import { ConstantExpression } from '@ja-platform/parser-expressions';
3
3
  import { SchemaFieldTypeExpression } from '../expressions/SchemaFieldTypeExpression';
4
4
  import { SchemaOptionShape } from './SchemaOptionNode';
@@ -15,7 +15,7 @@ export interface SchemaFieldShape extends ParsedNodeShape {
15
15
  maxValue?: ConstantExpression<string>;
16
16
  options: ParsedArrayNode<ParsedNode<SchemaOptionShape>>;
17
17
  }
18
- export declare class SchemaFieldNode extends V5Node<V5NodeGenerics<SchemaFieldShape, ParsedSchemaFieldNode>> {
18
+ export declare class SchemaFieldNode extends Node<NodeGenerics<SchemaFieldShape, ParsedSchemaFieldNode>> {
19
19
  constructor();
20
20
  protected createParsedNode(options: ParseTreeOptions): ParsedSchemaFieldNode;
21
21
  }
@@ -1,10 +1,10 @@
1
- import { V5Node, V5NodeGenerics, ParsedNodeShape } from '@ja-platform/parser-core';
1
+ import { Node, NodeGenerics, ParsedNodeShape } from '@ja-platform/parser-core';
2
2
  import { ConstantExpression } from '@ja-platform/parser-expressions';
3
3
  export interface SchemaHasManyShape extends ParsedNodeShape {
4
4
  name: ConstantExpression<string>;
5
5
  model: ConstantExpression<string>;
6
6
  inverseOf?: ConstantExpression<string>;
7
7
  }
8
- export declare class SchemaHasManyNode extends V5Node<V5NodeGenerics<SchemaHasManyShape>> {
8
+ export declare class SchemaHasManyNode extends Node<NodeGenerics<SchemaHasManyShape>> {
9
9
  constructor();
10
10
  }
@@ -1,4 +1,4 @@
1
- import { V5Node, V5NodeGenerics, ParsedNodeShape } from '@ja-platform/parser-core';
1
+ import { Node, NodeGenerics, ParsedNodeShape } from '@ja-platform/parser-core';
2
2
  import { ConstantExpression } from '@ja-platform/parser-expressions';
3
3
  import { SchemaIndexExpression } from '../expressions/SchemaIndexExpression';
4
4
  import { SchemaDatabasesExpression } from '../expressions/SchemaDatabasesExpression';
@@ -7,6 +7,6 @@ export interface SchemaIndexShape extends ParsedNodeShape {
7
7
  keys: SchemaIndexExpression;
8
8
  databases?: SchemaDatabasesExpression;
9
9
  }
10
- export declare class SchemaIndexNode extends V5Node<V5NodeGenerics<SchemaIndexShape>> {
10
+ export declare class SchemaIndexNode extends Node<NodeGenerics<SchemaIndexShape>> {
11
11
  constructor();
12
12
  }
@@ -1,4 +1,4 @@
1
- import { V5Node, V5NodeGenerics, ParsedNodeShape, ParsedNode, ParsedArrayNode, ParseTreeOptions } from '@ja-platform/parser-core';
1
+ import { Node, NodeGenerics, ParsedNodeShape, ParsedNode, ParsedArrayNode, ParseTreeOptions } from '@ja-platform/parser-core';
2
2
  import { ConstantExpression } from '@ja-platform/parser-expressions';
3
3
  import { ParsedSchemaFieldNode } from '../parsed/ParsedSchemaFieldNode';
4
4
  import { ParsedSchemaModelNode } from '../parsed/ParsedSchemaModelNode';
@@ -20,7 +20,7 @@ export interface SchemaModelShape extends ParsedNodeShape {
20
20
  notifications: ParsedArrayNode<ParsedNode<SchemaNotificationShape>>;
21
21
  webhooks: ParsedArrayNode<ParsedNode<SchemaWebhookShape>>;
22
22
  }
23
- export declare class SchemaModelNode extends V5Node<V5NodeGenerics<SchemaModelShape, ParsedSchemaModelNode>> {
23
+ export declare class SchemaModelNode extends Node<NodeGenerics<SchemaModelShape, ParsedSchemaModelNode>> {
24
24
  constructor();
25
25
  protected createParsedNode(options: ParseTreeOptions): ParsedSchemaModelNode;
26
26
  }
@@ -1,4 +1,4 @@
1
- import { V5Node, V5NodeGenerics, ParsedNodeShape } from '@ja-platform/parser-core';
1
+ import { Node, NodeGenerics, ParsedNodeShape } from '@ja-platform/parser-core';
2
2
  import { ConstantExpression } from '@ja-platform/parser-expressions';
3
3
  import { SchemaObjectDisplayExpression } from '@ja-platform/parser-schema';
4
4
  export interface SchemaNotificationShape extends ParsedNodeShape {
@@ -7,6 +7,6 @@ export interface SchemaNotificationShape extends ParsedNodeShape {
7
7
  recipient: ConstantExpression<string>;
8
8
  badgeCount?: ConstantExpression<string>;
9
9
  }
10
- export declare class SchemaNotificationNode extends V5Node<V5NodeGenerics<SchemaNotificationShape>> {
10
+ export declare class SchemaNotificationNode extends Node<NodeGenerics<SchemaNotificationShape>> {
11
11
  constructor();
12
12
  }
@@ -1,10 +1,10 @@
1
- import { V5Node, V5NodeGenerics, ParsedNodeShape } from '@ja-platform/parser-core';
1
+ import { Node, NodeGenerics, ParsedNodeShape } from '@ja-platform/parser-core';
2
2
  import { ConstantExpression } from '@ja-platform/parser-expressions';
3
3
  import { SchemaOptionKey } from '../attributes/SchemaOptionKeyAttribute';
4
4
  export interface SchemaOptionShape extends ParsedNodeShape {
5
5
  key?: ConstantExpression<SchemaOptionKey>;
6
6
  label: ConstantExpression<string>;
7
7
  }
8
- export declare class SchemaOptionNode extends V5Node<V5NodeGenerics<SchemaOptionShape>> {
8
+ export declare class SchemaOptionNode extends Node<NodeGenerics<SchemaOptionShape>> {
9
9
  constructor();
10
10
  }
@@ -1,4 +1,4 @@
1
- import { V5Node, V5NodeGenerics, ParsedNodeShape } from '@ja-platform/parser-core';
1
+ import { Node, NodeGenerics, ParsedNodeShape } from '@ja-platform/parser-core';
2
2
  import { ConstantExpression } from '@ja-platform/parser-expressions';
3
3
  export interface SchemaWebhookFieldShape extends ParsedNodeShape {
4
4
  name: ConstantExpression<string>;
@@ -6,6 +6,6 @@ export interface SchemaWebhookFieldShape extends ParsedNodeShape {
6
6
  embed?: ConstantExpression<boolean>;
7
7
  state?: ConstantExpression<string>;
8
8
  }
9
- export declare class SchemaWebhookFieldNode extends V5Node<V5NodeGenerics<SchemaWebhookFieldShape>> {
9
+ export declare class SchemaWebhookFieldNode extends Node<NodeGenerics<SchemaWebhookFieldShape>> {
10
10
  constructor();
11
11
  }
@@ -1,4 +1,4 @@
1
- import { V5Node, V5NodeGenerics, ParsedNodeShape, ParsedNode, ParsedArrayNode } from '@ja-platform/parser-core';
1
+ import { Node, NodeGenerics, ParsedNodeShape, ParsedNode, ParsedArrayNode } from '@ja-platform/parser-core';
2
2
  import { ConstantExpression } from '@ja-platform/parser-expressions';
3
3
  import { SchemaWebhookFieldShape } from './SchemaWebhookFieldNode';
4
4
  export interface SchemaWebhookShape extends ParsedNodeShape {
@@ -8,6 +8,6 @@ export interface SchemaWebhookShape extends ParsedNodeShape {
8
8
  action?: ConstantExpression<string>;
9
9
  fields: ParsedArrayNode<ParsedNode<SchemaWebhookFieldShape>>;
10
10
  }
11
- export declare class SchemaWebhookNode extends V5Node<V5NodeGenerics<SchemaWebhookShape>> {
11
+ export declare class SchemaWebhookNode extends Node<NodeGenerics<SchemaWebhookShape>> {
12
12
  constructor();
13
13
  }
@@ -1,6 +1,6 @@
1
1
  import { ParsedNode } from '@ja-platform/parser-core';
2
2
  import { XmlSchema as Schema } from '../XmlSchema';
3
- import type { SchemaShape } from '../SchemaDefinition';
3
+ import type { SchemaShape } from '../SchemaNode';
4
4
  export declare class ParsedSchemaNode extends ParsedNode<SchemaShape> {
5
5
  /**
6
6
  * Construct a fresh schema from the parsed declarations, then link its relationships.
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchemaDefinition = void 0;
3
+ exports.SchemaNode = void 0;
4
4
  const parser_core_1 = require("@ja-platform/parser-core");
5
5
  const SchemaModelNode_1 = require("./nodes/SchemaModelNode");
6
6
  const ParsedSchemaNode_1 = require("./parsed/ParsedSchemaNode");
7
7
  /**
8
8
  * The schema XML grammar, producing a tree that can be converted to a schema.
9
9
  */
10
- class SchemaDefinition extends parser_core_1.V5Node {
10
+ class SchemaNode extends parser_core_1.Node {
11
11
  constructor() {
12
12
  super({ name: 'data-model' });
13
13
  this.addNode(new SchemaModelNode_1.SchemaModelNode());
@@ -16,5 +16,5 @@ class SchemaDefinition extends parser_core_1.V5Node {
16
16
  return new ParsedSchemaNode_1.ParsedSchemaNode(Object.assign({ definition: this }, options));
17
17
  }
18
18
  }
19
- exports.SchemaDefinition = SchemaDefinition;
20
- //# sourceMappingURL=SchemaDefinition.js.map
19
+ exports.SchemaNode = SchemaNode;
20
+ //# sourceMappingURL=SchemaNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaNode.js","sourceRoot":"","sources":["../src/SchemaNode.ts"],"names":[],"mappings":";;;AAAA,0DAAkH;AAClH,6DAA0D;AAC1D,gEAA6D;AAO7D;;GAEG;AACH,gBAAwB,SAAQ,kBAAiD;IAC/E;QACE,KAAK,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;QAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,iCAAe,EAAE,CAAC,CAAC;IACtC,CAAC;IAES,gBAAgB,CAAC,OAAyB;QAClD,OAAO,IAAI,mCAAgB,iBAAG,UAAU,EAAE,IAAI,IAAK,OAAO,EAAG,CAAC;IAChE,CAAC;CACF","sourcesContent":["import { Node, NodeGenerics, ParsedNodeShape, ParsedArrayNode, ParseTreeOptions } from '@ja-platform/parser-core';\nimport { SchemaModelNode } from './nodes/SchemaModelNode';\nimport { ParsedSchemaNode } from './parsed/ParsedSchemaNode';\nimport { ParsedSchemaModelNode } from './parsed/ParsedSchemaModelNode';\n\nexport interface SchemaShape extends ParsedNodeShape {\n models: ParsedArrayNode<ParsedSchemaModelNode>;\n}\n\n/**\n * The schema XML grammar, producing a tree that can be converted to a schema.\n */\nexport class SchemaNode extends Node<NodeGenerics<SchemaShape, ParsedSchemaNode>> {\n constructor() {\n super({ name: 'data-model' });\n this.addNode(new SchemaModelNode());\n }\n\n protected createParsedNode(options: ParseTreeOptions): ParsedSchemaNode {\n return new ParsedSchemaNode({ definition: this, ...options });\n }\n}\n"]}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SchemaDatabaseAttribute = void 0;
4
4
  const parser_core_1 = require("@ja-platform/parser-core");
5
5
  const SchemaDatabasesExpression_1 = require("../expressions/SchemaDatabasesExpression");
6
- class SchemaDatabaseAttribute extends parser_core_1.V5Attribute {
6
+ class SchemaDatabaseAttribute extends parser_core_1.Attribute {
7
7
  constructor(options) {
8
8
  super('schema-databases', Object.assign(Object.assign({}, options), { syntax: new SchemaDatabasesExpression_1.SchemaDatabasesExpressionParser() }));
9
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaDatabaseAttribute.js","sourceRoot":"","sources":["../../src/attributes/SchemaDatabaseAttribute.ts"],"names":[],"mappings":";;;AAAA,0DAAgG;AAEhG,wFAAsH;AAOtH,6BAAqC,SAAQ,yBAA4C;IACvF,YAAY,OAAmD;QAC7D,KAAK,CAAC,kBAAkB,kCAAO,OAAO,KAAE,MAAM,EAAE,IAAI,2DAA+B,EAAE,IAAG,CAAC;IAC3F,CAAC;CACF","sourcesContent":["import { V5Attribute, V5AttributeGenerics, V5AttributeOptions } from '@ja-platform/parser-core';\nimport { IndexDatabase } from '@ja-platform/parser-schema';\nimport { SchemaDatabasesExpression, SchemaDatabasesExpressionParser } from '../expressions/SchemaDatabasesExpression';\n\ninterface SchemaDatabaseAttributeGenerics extends V5AttributeGenerics {\n Value: SchemaDatabasesExpression;\n Options: V5AttributeOptions<IndexDatabase[]>;\n}\n\nexport class SchemaDatabaseAttribute extends V5Attribute<SchemaDatabaseAttributeGenerics> {\n constructor(options: SchemaDatabaseAttributeGenerics['Options']) {\n super('schema-databases', { ...options, syntax: new SchemaDatabasesExpressionParser() });\n }\n}\n"]}
1
+ {"version":3,"file":"SchemaDatabaseAttribute.js","sourceRoot":"","sources":["../../src/attributes/SchemaDatabaseAttribute.ts"],"names":[],"mappings":";;;AAAA,0DAA0F;AAE1F,wFAAsH;AAOtH,6BAAqC,SAAQ,uBAA0C;IACrF,YAAY,OAAmD;QAC7D,KAAK,CAAC,kBAAkB,kCAAO,OAAO,KAAE,MAAM,EAAE,IAAI,2DAA+B,EAAE,IAAG,CAAC;IAC3F,CAAC;CACF","sourcesContent":["import { Attribute, AttributeGenerics, AttributeOptions } from '@ja-platform/parser-core';\nimport { IndexDatabase } from '@ja-platform/parser-schema';\nimport { SchemaDatabasesExpression, SchemaDatabasesExpressionParser } from '../expressions/SchemaDatabasesExpression';\n\ninterface SchemaDatabaseAttributeGenerics extends AttributeGenerics {\n Value: SchemaDatabasesExpression;\n Options: AttributeOptions<IndexDatabase[]>;\n}\n\nexport class SchemaDatabaseAttribute extends Attribute<SchemaDatabaseAttributeGenerics> {\n constructor(options: SchemaDatabaseAttributeGenerics['Options']) {\n super('schema-databases', { ...options, syntax: new SchemaDatabasesExpressionParser() });\n }\n}\n"]}
@@ -18,7 +18,7 @@ class SchemaEnumType extends parser_type_system_1.TextType {
18
18
  return text;
19
19
  }
20
20
  }
21
- class SchemaEnumAttribute extends parser_core_1.V5ConstantTextAttribute {
21
+ class SchemaEnumAttribute extends parser_core_1.ConstantTextAttribute {
22
22
  constructor(options) {
23
23
  super(Object.assign(Object.assign({}, options), { valueType: new SchemaEnumType(options.values) }));
24
24
  }
@@ -1 +1 @@
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
+ {"version":3,"file":"SchemaEnumAttribute.js","sourceRoot":"","sources":["../../src/attributes/SchemaEnumAttribute.ts"],"names":[],"mappings":";;;AAAA,0DAAmF;AACnF,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,mCAAqB;IAC5D,YAAY,OAAyE;QACnF,KAAK,iCAAM,OAAO,KAAE,SAAS,EAAE,IAAI,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,IAAG,CAAC;IACvE,CAAC;CACF","sourcesContent":["import { ConstantTextAttribute, AttributeOptions } 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 ConstantTextAttribute {\n constructor(options: AttributeOptions<string, string> & { values: readonly string[] }) {\n super({ ...options, valueType: new SchemaEnumType(options.values) });\n }\n}\n"]}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SchemaFieldTypeAttribute = void 0;
4
4
  const parser_core_1 = require("@ja-platform/parser-core");
5
5
  const SchemaFieldTypeExpression_1 = require("../expressions/SchemaFieldTypeExpression");
6
- class SchemaFieldTypeAttribute extends parser_core_1.V5Attribute {
6
+ class SchemaFieldTypeAttribute extends parser_core_1.Attribute {
7
7
  constructor(options) {
8
8
  super('schema-field-type', Object.assign(Object.assign({}, options), { syntax: new SchemaFieldTypeExpression_1.SchemaFieldTypeExpressionParser() }));
9
9
  }
@@ -1 +1 @@
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
+ {"version":3,"file":"SchemaFieldTypeAttribute.js","sourceRoot":"","sources":["../../src/attributes/SchemaFieldTypeAttribute.ts"],"names":[],"mappings":";;;AAAA,0DAA0F;AAC1F,wFAAsH;AAMtH,8BAAsC,SAAQ,uBAA2C;IACvF,YAAY,OAAyB;QACnC,KAAK,CAAC,mBAAmB,kCAAO,OAAO,KAAE,MAAM,EAAE,IAAI,2DAA+B,EAAE,IAAG,CAAC;IAC5F,CAAC;CACF","sourcesContent":["import { Attribute, AttributeGenerics, AttributeOptions } from '@ja-platform/parser-core';\nimport { SchemaFieldTypeExpression, SchemaFieldTypeExpressionParser } from '../expressions/SchemaFieldTypeExpression';\n\ninterface SchemaFieldTypeAttributeGenerics extends AttributeGenerics {\n Value: SchemaFieldTypeExpression;\n}\n\nexport class SchemaFieldTypeAttribute extends Attribute<SchemaFieldTypeAttributeGenerics> {\n constructor(options: AttributeOptions) {\n super('schema-field-type', { ...options, syntax: new SchemaFieldTypeExpressionParser() });\n }\n}\n"]}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SchemaIndexAttribute = void 0;
4
4
  const parser_core_1 = require("@ja-platform/parser-core");
5
5
  const SchemaIndexExpression_1 = require("../expressions/SchemaIndexExpression");
6
- class SchemaIndexAttribute extends parser_core_1.V5Attribute {
6
+ class SchemaIndexAttribute extends parser_core_1.Attribute {
7
7
  constructor(options) {
8
8
  super('schema-index', Object.assign(Object.assign({}, options), { syntax: new SchemaIndexExpression_1.SchemaIndexExpressionParser() }));
9
9
  }
@@ -1 +1 @@
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
+ {"version":3,"file":"SchemaIndexAttribute.js","sourceRoot":"","sources":["../../src/attributes/SchemaIndexAttribute.ts"],"names":[],"mappings":";;;AAAA,0DAA0F;AAC1F,gFAA0G;AAM1G,0BAAkC,SAAQ,uBAAuC;IAC/E,YAAY,OAAyB;QACnC,KAAK,CAAC,cAAc,kCAAO,OAAO,KAAE,MAAM,EAAE,IAAI,mDAA2B,EAAE,IAAG,CAAC;IACnF,CAAC;CACF","sourcesContent":["import { Attribute, AttributeGenerics, AttributeOptions } from '@ja-platform/parser-core';\nimport { SchemaIndexExpression, SchemaIndexExpressionParser } from '../expressions/SchemaIndexExpression';\n\ninterface SchemaIndexAttributeGenerics extends AttributeGenerics {\n Value: SchemaIndexExpression;\n}\n\nexport class SchemaIndexAttribute extends Attribute<SchemaIndexAttributeGenerics> {\n constructor(options: AttributeOptions) {\n super('schema-index', { ...options, syntax: new SchemaIndexExpressionParser() });\n }\n}\n"]}
@@ -14,7 +14,7 @@ class SchemaNameType extends parser_type_system_1.TextType {
14
14
  }
15
15
  }
16
16
  }
17
- class SchemaNameAttribute extends parser_core_1.V5ConstantTextAttribute {
17
+ class SchemaNameAttribute extends parser_core_1.ConstantTextAttribute {
18
18
  constructor(options) {
19
19
  super(Object.assign(Object.assign({}, options), { valueType: new SchemaNameType() }));
20
20
  }
@@ -1 +1 @@
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
+ {"version":3,"file":"SchemaNameAttribute.js","sourceRoot":"","sources":["../../src/attributes/SchemaNameAttribute.ts"],"names":[],"mappings":";;;AAAA,0DAAmF;AACnF,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,mCAAqB;IAC5D,YAAY,OAAyC;QACnD,KAAK,iCAAM,OAAO,KAAE,SAAS,EAAE,IAAI,cAAc,EAAE,IAAG,CAAC;IACzD,CAAC;CACF","sourcesContent":["import { ConstantTextAttribute, AttributeOptions } 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 ConstantTextAttribute {\n constructor(options: AttributeOptions<string, string>) {\n super({ ...options, valueType: new SchemaNameType() });\n }\n}\n"]}
@@ -8,7 +8,7 @@ const parser_schema_1 = require("@ja-platform/parser-schema");
8
8
  /**
9
9
  * Choice keys use the enclosing field's declared literal type.
10
10
  */
11
- class SchemaOptionKeyAttribute extends parser_core_1.V5Attribute {
11
+ class SchemaOptionKeyAttribute extends parser_core_1.Attribute {
12
12
  constructor() {
13
13
  super('schema-option-key', { name: 'key' });
14
14
  }
@@ -1 +1 @@
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
+ {"version":3,"file":"SchemaOptionKeyAttribute.js","sourceRoot":"","sources":["../../src/attributes/SchemaOptionKeyAttribute.ts"],"names":[],"mappings":";;;AAAA,0DAA6F;AAC7F,wEAA+F;AAC/F,wEAA2F;AAC3F,8DAA2D;AAU3D;;GAEG;AACH,8BAAsC,SAAQ,uBAAkC;IAC9E;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, Attribute, AttributeGenerics } 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 AttributeGenerics {\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 Attribute<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"]}
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./schemaSerializer"), exports);
18
18
  __exportStar(require("./loadSchemaXml"), exports);
19
- __exportStar(require("./SchemaDefinition"), exports);
19
+ __exportStar(require("./SchemaNode"), exports);
20
20
  __exportStar(require("./parsed/ParsedSchemaNode"), exports);
21
21
  __exportStar(require("./parsed/ParsedSchemaModelNode"), exports);
22
22
  __exportStar(require("./parsed/ParsedSchemaFieldNode"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
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
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,kDAAgC;AAChC,+CAA6B;AAC7B,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 './SchemaNode';\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"]}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadSchemaXml = loadSchemaXml;
4
4
  const XmlSchema_1 = require("./XmlSchema");
5
5
  const common_xml_1 = require("@journeyapps/common-xml");
6
- const SchemaDefinition_1 = require("./SchemaDefinition");
6
+ const SchemaNode_1 = require("./SchemaNode");
7
7
  /**
8
8
  * Parse schema XML using the node definitions and convert the resulting tree to a schema.
9
9
  */
@@ -15,7 +15,7 @@ function loadSchemaXml({ source }) {
15
15
  if (schema.errors.length)
16
16
  return schema;
17
17
  const element = document.documentElement;
18
- const definition = new SchemaDefinition_1.SchemaDefinition();
18
+ const definition = new SchemaNode_1.SchemaNode();
19
19
  if ((element === null || element === void 0 ? void 0 : element.tagName) !== definition.name) {
20
20
  schema.errors.push((0, common_xml_1.error)(element, `<${definition.name}> root tag expected`));
21
21
  return schema;
@@ -1 +1 @@
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
+ {"version":3,"file":"loadSchemaXml.js","sourceRoot":"","sources":["../src/loadSchemaXml.ts"],"names":[],"mappings":";;;AAAA,2CAAkD;AAClD,wDAAuD;AACvD,6CAA0C;AAM1C;;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,uBAAU,EAAE,CAAC;IACpC,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 { SchemaNode } from './SchemaNode';\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 SchemaNode();\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"]}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SchemaBelongsToNode = void 0;
4
4
  const parser_core_1 = require("@ja-platform/parser-core");
5
5
  const SchemaNameAttribute_1 = require("../attributes/SchemaNameAttribute");
6
- class SchemaBelongsToNode extends parser_core_1.V5Node {
6
+ class SchemaBelongsToNode extends parser_core_1.Node {
7
7
  constructor() {
8
8
  super({ name: 'belongs-to', key: 'belongsTo', isMultiple: true });
9
9
  this.addAttribute(new SchemaNameAttribute_1.SchemaNameAttribute({ name: 'name' }));
@@ -1 +1 @@
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
+ {"version":3,"file":"SchemaBelongsToNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaBelongsToNode.ts"],"names":[],"mappings":";;;AAAA,0DAA+E;AAE/E,2EAAwE;AAOxE,yBAAiC,SAAQ,kBAAwC;IAC/E;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 { Node, NodeGenerics, 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 Node<NodeGenerics<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"]}
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SchemaDisplayNode = void 0;
4
4
  const parser_core_1 = require("@ja-platform/parser-core");
5
5
  const parser_schema_1 = require("@ja-platform/parser-schema");
6
- class SchemaDisplayNode extends parser_core_1.V5Node {
6
+ class SchemaDisplayNode extends parser_core_1.Node {
7
7
  constructor() {
8
8
  super({ name: 'display', isRequired: true });
9
- this.addAttribute(new parser_core_1.V5ContentTextAttribute({ name: 'format', syntax: new parser_schema_1.SchemaObjectDisplayExpressionParser() }));
9
+ this.addAttribute(new parser_core_1.ContentTextAttribute({ name: 'format', syntax: new parser_schema_1.SchemaObjectDisplayExpressionParser() }));
10
10
  }
11
11
  }
12
12
  exports.SchemaDisplayNode = SchemaDisplayNode;
@@ -1 +1 @@
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
+ {"version":3,"file":"SchemaDisplayNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaDisplayNode.ts"],"names":[],"mappings":";;;AAAA,0DAAqG;AACrG,8DAAgH;AAMhH,uBAA+B,SAAQ,kBAAsC;IAC3E;QACE,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7C,IAAI,CAAC,YAAY,CAAC,IAAI,kCAAoB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,mDAAmC,EAAE,EAAE,CAAC,CAAC,CAAC;IACrH,CAAC;CACF","sourcesContent":["import { Node, NodeGenerics, ParsedNodeShape, ContentTextAttribute } 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 Node<NodeGenerics<SchemaDisplayShape>> {\n constructor() {\n super({ name: 'display', isRequired: true });\n this.addAttribute(new ContentTextAttribute({ name: 'format', syntax: new SchemaObjectDisplayExpressionParser() }));\n }\n}\n"]}
@@ -8,18 +8,18 @@ const SchemaEnumAttribute_1 = require("../attributes/SchemaEnumAttribute");
8
8
  const parser_schema_1 = require("@ja-platform/parser-schema");
9
9
  const SchemaOptionNode_1 = require("./SchemaOptionNode");
10
10
  const ParsedSchemaFieldNode_1 = require("../parsed/ParsedSchemaFieldNode");
11
- class SchemaFieldNode extends parser_core_1.V5Node {
11
+ class SchemaFieldNode extends parser_core_1.Node {
12
12
  constructor() {
13
13
  super({ name: 'field', key: 'fields', isMultiple: true });
14
14
  this.addAttribute(new SchemaNameAttribute_1.SchemaNameAttribute({ name: 'name', required: true }));
15
- this.addAttribute(new parser_core_1.V5ConstantTextAttribute({ name: 'label', required: true }));
15
+ this.addAttribute(new parser_core_1.ConstantTextAttribute({ name: 'label', required: true }));
16
16
  this.addAttribute(new SchemaFieldTypeAttribute_1.SchemaFieldTypeAttribute({ name: 'type', required: true }));
17
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 }));
18
+ this.addAttribute(new parser_core_1.ConstantBooleanAttribute({ name: 'auto-download', key: 'autoDownload', defaultValue: false }));
19
+ this.addAttribute(new parser_core_1.ConstantTextAttribute({ name: 'spec', deprecated: true }));
20
+ this.addAttribute(new parser_core_1.ConstantTextAttribute({ name: 'deprecated-spec', key: 'deprecatedSpec', deprecated: true }));
21
+ this.addAttribute(new parser_core_1.ConstantTextAttribute({ name: 'minValue', deprecated: true }));
22
+ this.addAttribute(new parser_core_1.ConstantTextAttribute({ name: 'maxValue', deprecated: true }));
23
23
  this.addNode(new SchemaOptionNode_1.SchemaOptionNode());
24
24
  }
25
25
  createParsedNode(options) {
@@ -1 +1 @@
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
+ {"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,kBAA2D;IAC9F;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,mCAAqB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAChF,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,sCAAwB,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAClG,CAAC;QACF,IAAI,CAAC,YAAY,CAAC,IAAI,mCAAqB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACjF,IAAI,CAAC,YAAY,CAAC,IAAI,mCAAqB,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,gBAAgB,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACnH,IAAI,CAAC,YAAY,CAAC,IAAI,mCAAqB,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACrF,IAAI,CAAC,YAAY,CAAC,IAAI,mCAAqB,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACrF,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 Node,\n NodeGenerics,\n ParsedNodeShape,\n ParsedNode,\n ParsedArrayNode,\n ConstantTextAttribute,\n ConstantBooleanAttribute,\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 Node<NodeGenerics<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 ConstantTextAttribute({ 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 ConstantBooleanAttribute({ name: 'auto-download', key: 'autoDownload', defaultValue: false })\n );\n this.addAttribute(new ConstantTextAttribute({ name: 'spec', deprecated: true }));\n this.addAttribute(new ConstantTextAttribute({ name: 'deprecated-spec', key: 'deprecatedSpec', deprecated: true }));\n this.addAttribute(new ConstantTextAttribute({ name: 'minValue', deprecated: true }));\n this.addAttribute(new ConstantTextAttribute({ 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"]}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SchemaHasManyNode = void 0;
4
4
  const parser_core_1 = require("@ja-platform/parser-core");
5
5
  const SchemaNameAttribute_1 = require("../attributes/SchemaNameAttribute");
6
- class SchemaHasManyNode extends parser_core_1.V5Node {
6
+ class SchemaHasManyNode extends parser_core_1.Node {
7
7
  constructor() {
8
8
  super({ name: 'has-many', key: 'hasMany', isMultiple: true });
9
9
  this.addAttribute(new SchemaNameAttribute_1.SchemaNameAttribute({ name: 'name', required: true }));