@ja-platform/parser-schema-xml 0.0.0-dev-20261021200117 → 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.
- package/dist/@types/{SchemaDefinition.d.ts → SchemaNode.d.ts} +2 -2
- package/dist/@types/attributes/SchemaDatabaseAttribute.d.ts +4 -4
- package/dist/@types/attributes/SchemaEnumAttribute.d.ts +3 -3
- package/dist/@types/attributes/SchemaFieldTypeAttribute.d.ts +4 -4
- package/dist/@types/attributes/SchemaIndexAttribute.d.ts +4 -4
- package/dist/@types/attributes/SchemaNameAttribute.d.ts +3 -3
- package/dist/@types/attributes/SchemaOptionKeyAttribute.d.ts +3 -3
- package/dist/@types/index.d.ts +1 -1
- package/dist/@types/nodes/SchemaBelongsToNode.d.ts +2 -2
- package/dist/@types/nodes/SchemaDisplayNode.d.ts +2 -2
- package/dist/@types/nodes/SchemaFieldNode.d.ts +2 -2
- package/dist/@types/nodes/SchemaHasManyNode.d.ts +2 -2
- package/dist/@types/nodes/SchemaIndexNode.d.ts +2 -2
- package/dist/@types/nodes/SchemaModelNode.d.ts +2 -2
- package/dist/@types/nodes/SchemaNotificationNode.d.ts +2 -2
- package/dist/@types/nodes/SchemaOptionNode.d.ts +2 -2
- package/dist/@types/nodes/SchemaWebhookFieldNode.d.ts +2 -2
- package/dist/@types/nodes/SchemaWebhookNode.d.ts +2 -2
- package/dist/@types/parsed/ParsedSchemaNode.d.ts +1 -1
- package/dist/{SchemaDefinition.js → SchemaNode.js} +4 -4
- package/dist/SchemaNode.js.map +1 -0
- package/dist/attributes/SchemaDatabaseAttribute.js +1 -1
- package/dist/attributes/SchemaDatabaseAttribute.js.map +1 -1
- package/dist/attributes/SchemaEnumAttribute.js +1 -1
- package/dist/attributes/SchemaEnumAttribute.js.map +1 -1
- package/dist/attributes/SchemaFieldTypeAttribute.js +1 -1
- package/dist/attributes/SchemaFieldTypeAttribute.js.map +1 -1
- package/dist/attributes/SchemaIndexAttribute.js +1 -1
- package/dist/attributes/SchemaIndexAttribute.js.map +1 -1
- package/dist/attributes/SchemaNameAttribute.js +1 -1
- package/dist/attributes/SchemaNameAttribute.js.map +1 -1
- package/dist/attributes/SchemaOptionKeyAttribute.js +1 -1
- package/dist/attributes/SchemaOptionKeyAttribute.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/loadSchemaXml.js +2 -2
- package/dist/loadSchemaXml.js.map +1 -1
- package/dist/nodes/SchemaBelongsToNode.js +1 -1
- package/dist/nodes/SchemaBelongsToNode.js.map +1 -1
- package/dist/nodes/SchemaDisplayNode.js +2 -2
- package/dist/nodes/SchemaDisplayNode.js.map +1 -1
- package/dist/nodes/SchemaFieldNode.js +7 -7
- package/dist/nodes/SchemaFieldNode.js.map +1 -1
- package/dist/nodes/SchemaHasManyNode.js +1 -1
- package/dist/nodes/SchemaHasManyNode.js.map +1 -1
- package/dist/nodes/SchemaIndexNode.js +1 -1
- package/dist/nodes/SchemaIndexNode.js.map +1 -1
- package/dist/nodes/SchemaModelNode.js +2 -2
- package/dist/nodes/SchemaModelNode.js.map +1 -1
- package/dist/nodes/SchemaNotificationNode.js +2 -2
- package/dist/nodes/SchemaNotificationNode.js.map +1 -1
- package/dist/nodes/SchemaOptionNode.js +1 -1
- package/dist/nodes/SchemaOptionNode.js.map +1 -1
- package/dist/nodes/SchemaWebhookFieldNode.js +3 -3
- package/dist/nodes/SchemaWebhookFieldNode.js.map +1 -1
- package/dist/nodes/SchemaWebhookNode.js +2 -2
- package/dist/nodes/SchemaWebhookNode.js.map +1 -1
- package/dist/parsed/ParsedSchemaNode.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/dist/SchemaDefinition.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaHasManyNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaHasManyNode.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"SchemaHasManyNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaHasManyNode.ts"],"names":[],"mappings":";;;AAAA,0DAA+E;AAE/E,2EAAwE;AAQxE,uBAA+B,SAAQ,kBAAsC;IAC3E;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 { Node, NodeGenerics, 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 Node<NodeGenerics<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"]}
|
|
@@ -6,7 +6,7 @@ const parser_schema_1 = require("@ja-platform/parser-schema");
|
|
|
6
6
|
const SchemaNameAttribute_1 = require("../attributes/SchemaNameAttribute");
|
|
7
7
|
const SchemaIndexAttribute_1 = require("../attributes/SchemaIndexAttribute");
|
|
8
8
|
const SchemaDatabaseAttribute_1 = require("../attributes/SchemaDatabaseAttribute");
|
|
9
|
-
class SchemaIndexNode extends parser_core_1.
|
|
9
|
+
class SchemaIndexNode extends parser_core_1.Node {
|
|
10
10
|
constructor() {
|
|
11
11
|
super({ name: 'index', key: 'indexes', isMultiple: true });
|
|
12
12
|
this.addAttribute(new SchemaNameAttribute_1.SchemaNameAttribute({ name: 'name' }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaIndexNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaIndexNode.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"SchemaIndexNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaIndexNode.ts"],"names":[],"mappings":";;;AAAA,0DAA+E;AAE/E,8DAA2D;AAG3D,2EAAwE;AACxE,6EAA0E;AAC1E,mFAAgF;AAQhF,qBAA6B,SAAQ,kBAAoC;IACvE;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 { Node, NodeGenerics, 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 Node<NodeGenerics<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"]}
|
|
@@ -12,11 +12,11 @@ const SchemaIndexNode_1 = require("./SchemaIndexNode");
|
|
|
12
12
|
const SchemaDisplayNode_1 = require("./SchemaDisplayNode");
|
|
13
13
|
const SchemaNotificationNode_1 = require("./SchemaNotificationNode");
|
|
14
14
|
const SchemaWebhookNode_1 = require("./SchemaWebhookNode");
|
|
15
|
-
class SchemaModelNode extends parser_core_1.
|
|
15
|
+
class SchemaModelNode extends parser_core_1.Node {
|
|
16
16
|
constructor() {
|
|
17
17
|
super({ name: 'model', key: 'models', isMultiple: true });
|
|
18
18
|
this.addAttribute(new SchemaNameAttribute_1.SchemaNameAttribute({ name: 'name', required: true }));
|
|
19
|
-
this.addAttribute(new parser_core_1.
|
|
19
|
+
this.addAttribute(new parser_core_1.ConstantTextAttribute({ name: 'label', required: true }));
|
|
20
20
|
this.addAttribute(new SchemaEnumAttribute_1.SchemaEnumAttribute({ name: 'classification', values: ['standard', 'sensitive'] }));
|
|
21
21
|
this.addNode(new SchemaFieldNode_1.SchemaFieldNode());
|
|
22
22
|
this.addNode(new SchemaBelongsToNode_1.SchemaBelongsToNode());
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,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,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 Node,\n NodeGenerics,\n ParsedNodeShape,\n ParsedNode,\n ParsedArrayNode,\n ConstantTextAttribute,\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 Node<NodeGenerics<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 ConstantTextAttribute({ 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"]}
|
|
@@ -4,10 +4,10 @@ exports.SchemaNotificationNode = 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
6
|
const SchemaNameAttribute_1 = require("../attributes/SchemaNameAttribute");
|
|
7
|
-
class SchemaNotificationNode extends parser_core_1.
|
|
7
|
+
class SchemaNotificationNode extends parser_core_1.Node {
|
|
8
8
|
constructor() {
|
|
9
9
|
super({ name: 'notify-user', key: 'notifications', isMultiple: true });
|
|
10
|
-
this.addAttribute(new parser_core_1.
|
|
10
|
+
this.addAttribute(new parser_core_1.Attribute('schema-notification-message', {
|
|
11
11
|
name: 'message',
|
|
12
12
|
required: true,
|
|
13
13
|
syntax: new parser_schema_1.SchemaObjectDisplayExpressionParser()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaNotificationNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaNotificationNode.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"SchemaNotificationNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaNotificationNode.ts"],"names":[],"mappings":";;;AAAA,0DAA0F;AAE1F,8DAAgH;AAChH,2EAAwE;AASxE,4BAAoC,SAAQ,kBAA2C;IACrF;QACE,KAAK,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,eAAe,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QACvE,IAAI,CAAC,YAAY,CACf,IAAI,uBAAS,CAAC,6BAA6B,EAAE;YAC3C,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 { Node, NodeGenerics, ParsedNodeShape, Attribute } 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 Node<NodeGenerics<SchemaNotificationShape>> {\n constructor() {\n super({ name: 'notify-user', key: 'notifications', isMultiple: true });\n this.addAttribute(\n new Attribute('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"]}
|
|
@@ -5,7 +5,7 @@ const parser_core_1 = require("@ja-platform/parser-core");
|
|
|
5
5
|
const parser_expressions_1 = require("@ja-platform/parser-expressions");
|
|
6
6
|
const parser_type_system_1 = require("@ja-platform/parser-type-system");
|
|
7
7
|
const SchemaOptionKeyAttribute_1 = require("../attributes/SchemaOptionKeyAttribute");
|
|
8
|
-
class SchemaOptionNode extends parser_core_1.
|
|
8
|
+
class SchemaOptionNode extends parser_core_1.Node {
|
|
9
9
|
constructor() {
|
|
10
10
|
super({ name: 'option', key: 'options', isMultiple: true });
|
|
11
11
|
this.addAttribute(new SchemaOptionKeyAttribute_1.SchemaOptionKeyAttribute());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaOptionNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaOptionNode.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"SchemaOptionNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaOptionNode.ts"],"names":[],"mappings":";;;AAAA,0DAAsG;AACtG,wEAA+F;AAC/F,wEAA2D;AAC3D,qFAAmG;AAOnG,sBAA8B,SAAQ,kBAAqC;IACzE;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 { Node, NodeGenerics, 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 Node<NodeGenerics<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"]}
|
|
@@ -4,12 +4,12 @@ exports.SchemaWebhookFieldNode = void 0;
|
|
|
4
4
|
const parser_core_1 = require("@ja-platform/parser-core");
|
|
5
5
|
const SchemaNameAttribute_1 = require("../attributes/SchemaNameAttribute");
|
|
6
6
|
const SchemaEnumAttribute_1 = require("../attributes/SchemaEnumAttribute");
|
|
7
|
-
class SchemaWebhookFieldNode extends parser_core_1.
|
|
7
|
+
class SchemaWebhookFieldNode extends parser_core_1.Node {
|
|
8
8
|
constructor() {
|
|
9
9
|
super({ name: 'field', key: 'fields', isMultiple: true });
|
|
10
10
|
this.addAttribute(new SchemaNameAttribute_1.SchemaNameAttribute({ name: 'name', required: true }));
|
|
11
|
-
this.addAttribute(new parser_core_1.
|
|
12
|
-
this.addAttribute(new parser_core_1.
|
|
11
|
+
this.addAttribute(new parser_core_1.ConstantBooleanAttribute({ name: 'required', defaultValue: true }));
|
|
12
|
+
this.addAttribute(new parser_core_1.ConstantBooleanAttribute({ name: 'embed', defaultValue: true }));
|
|
13
13
|
this.addAttribute(new SchemaEnumAttribute_1.SchemaEnumAttribute({ name: 'state', values: ['present', 'uploaded'], defaultValue: 'present' }));
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaWebhookFieldNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaWebhookFieldNode.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"SchemaWebhookFieldNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaWebhookFieldNode.ts"],"names":[],"mappings":";;;AAAA,0DAAyG;AAEzG,2EAAwE;AACxE,2EAAwE;AASxE,4BAAoC,SAAQ,kBAA2C;IACrF;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,sCAAwB,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC1F,IAAI,CAAC,YAAY,CAAC,IAAI,sCAAwB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACvF,IAAI,CAAC,YAAY,CACf,IAAI,yCAAmB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,CACrG,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { Node, NodeGenerics, ParsedNodeShape, ConstantBooleanAttribute } from '@ja-platform/parser-core';\nimport { ConstantExpression } from '@ja-platform/parser-expressions';\nimport { SchemaNameAttribute } from '../attributes/SchemaNameAttribute';\nimport { SchemaEnumAttribute } from '../attributes/SchemaEnumAttribute';\n\nexport interface SchemaWebhookFieldShape extends ParsedNodeShape {\n name: ConstantExpression<string>;\n required?: ConstantExpression<boolean>;\n embed?: ConstantExpression<boolean>;\n state?: ConstantExpression<string>;\n}\n\nexport class SchemaWebhookFieldNode extends Node<NodeGenerics<SchemaWebhookFieldShape>> {\n constructor() {\n super({ name: 'field', key: 'fields', isMultiple: true });\n this.addAttribute(new SchemaNameAttribute({ name: 'name', required: true }));\n this.addAttribute(new ConstantBooleanAttribute({ name: 'required', defaultValue: true }));\n this.addAttribute(new ConstantBooleanAttribute({ name: 'embed', defaultValue: true }));\n this.addAttribute(\n new SchemaEnumAttribute({ name: 'state', values: ['present', 'uploaded'], defaultValue: 'present' })\n );\n }\n}\n"]}
|
|
@@ -5,13 +5,13 @@ const parser_core_1 = require("@ja-platform/parser-core");
|
|
|
5
5
|
const SchemaNameAttribute_1 = require("../attributes/SchemaNameAttribute");
|
|
6
6
|
const SchemaEnumAttribute_1 = require("../attributes/SchemaEnumAttribute");
|
|
7
7
|
const SchemaWebhookFieldNode_1 = require("./SchemaWebhookFieldNode");
|
|
8
|
-
class SchemaWebhookNode extends parser_core_1.
|
|
8
|
+
class SchemaWebhookNode extends parser_core_1.Node {
|
|
9
9
|
constructor() {
|
|
10
10
|
super({ name: 'webhook', key: 'webhooks', isMultiple: true });
|
|
11
11
|
this.addAttribute(new SchemaNameAttribute_1.SchemaNameAttribute({ name: 'name' }));
|
|
12
12
|
this.addAttribute(new SchemaEnumAttribute_1.SchemaEnumAttribute({ name: 'type', values: ['ready', 'update'], required: true }));
|
|
13
13
|
this.addAttribute(new SchemaEnumAttribute_1.SchemaEnumAttribute({ name: 'receiver', values: ['pdfmailer', 'cloudcode'] }));
|
|
14
|
-
this.addAttribute(new parser_core_1.
|
|
14
|
+
this.addAttribute(new parser_core_1.ConstantTextAttribute({ name: 'action' }));
|
|
15
15
|
this.addNode(new SchemaWebhookFieldNode_1.SchemaWebhookFieldNode());
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaWebhookNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaWebhookNode.ts"],"names":[],"mappings":";;;AAAA,0DAOkC;AAElC,2EAAwE;AACxE,2EAAwE;AACxE,qEAA2F;AAU3F,uBAA+B,SAAQ,
|
|
1
|
+
{"version":3,"file":"SchemaWebhookNode.js","sourceRoot":"","sources":["../../src/nodes/SchemaWebhookNode.ts"],"names":[],"mappings":";;;AAAA,0DAOkC;AAElC,2EAAwE;AACxE,2EAAwE;AACxE,qEAA2F;AAU3F,uBAA+B,SAAQ,kBAAsC;IAC3E;QACE,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAC9D,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,MAAM,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC1G,IAAI,CAAC,YAAY,CAAC,IAAI,yCAAmB,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC;QACrG,IAAI,CAAC,YAAY,CAAC,IAAI,mCAAqB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;QACjE,IAAI,CAAC,OAAO,CAAC,IAAI,+CAAsB,EAAE,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["import {\n Node,\n NodeGenerics,\n ParsedNodeShape,\n ParsedNode,\n ParsedArrayNode,\n ConstantTextAttribute\n} from '@ja-platform/parser-core';\nimport { ConstantExpression } from '@ja-platform/parser-expressions';\nimport { SchemaNameAttribute } from '../attributes/SchemaNameAttribute';\nimport { SchemaEnumAttribute } from '../attributes/SchemaEnumAttribute';\nimport { SchemaWebhookFieldNode, SchemaWebhookFieldShape } from './SchemaWebhookFieldNode';\n\nexport interface SchemaWebhookShape extends ParsedNodeShape {\n name?: ConstantExpression<string>;\n type: ConstantExpression<string>;\n receiver?: ConstantExpression<string>;\n action?: ConstantExpression<string>;\n fields: ParsedArrayNode<ParsedNode<SchemaWebhookFieldShape>>;\n}\n\nexport class SchemaWebhookNode extends Node<NodeGenerics<SchemaWebhookShape>> {\n constructor() {\n super({ name: 'webhook', key: 'webhooks', isMultiple: true });\n this.addAttribute(new SchemaNameAttribute({ name: 'name' }));\n this.addAttribute(new SchemaEnumAttribute({ name: 'type', values: ['ready', 'update'], required: true }));\n this.addAttribute(new SchemaEnumAttribute({ name: 'receiver', values: ['pdfmailer', 'cloudcode'] }));\n this.addAttribute(new ConstantTextAttribute({ name: 'action' }));\n this.addNode(new SchemaWebhookFieldNode());\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParsedSchemaNode.js","sourceRoot":"","sources":["../../src/parsed/ParsedSchemaNode.ts"],"names":[],"mappings":";;;AAAA,0DAAsD;AACtD,4CAAmD;AAGnD,sBAA8B,SAAQ,wBAAuB;IAC3D;;;OAGG;IACH,QAAQ;QACN,MAAM,MAAM,GAAG,IAAI,qBAAM,EAAE,CAAC;QAC5B,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;QAC1C,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC;QACzB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,CAAC;QAC3C,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QAC7D,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;QACjF,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;YAC9C,KAAK,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC5D,CAAC;QACD,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;YAC9C,KAAK,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC1D,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["import { ParsedNode } from '@ja-platform/parser-core';\nimport { XmlSchema as Schema } from '../XmlSchema';\nimport type { SchemaShape } from '../
|
|
1
|
+
{"version":3,"file":"ParsedSchemaNode.js","sourceRoot":"","sources":["../../src/parsed/ParsedSchemaNode.ts"],"names":[],"mappings":";;;AAAA,0DAAsD;AACtD,4CAAmD;AAGnD,sBAA8B,SAAQ,wBAAuB;IAC3D;;;OAGG;IACH,QAAQ;QACN,MAAM,MAAM,GAAG,IAAI,qBAAM,EAAE,CAAC;QAC5B,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;QAC1C,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC;QACzB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,CAAC;QAC3C,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QAC7D,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;QACjF,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;YAC9C,KAAK,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC5D,CAAC;QACD,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;YAC9C,KAAK,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC1D,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["import { ParsedNode } from '@ja-platform/parser-core';\nimport { XmlSchema as Schema } from '../XmlSchema';\nimport type { SchemaShape } from '../SchemaNode';\n\nexport class ParsedSchemaNode extends ParsedNode<SchemaShape> {\n /**\n * Construct a fresh schema from the parsed declarations, then link its relationships.\n * Validation remains an explicit, separate operation on the parsed tree.\n */\n toSchema(): Schema {\n const schema = new Schema();\n schema.sourceElement = this.sourceElement;\n schema.parsedNode = this;\n const models = this.node('models').nodes();\n const objects = models.map((model) => model.toModel(schema));\n schema.objects = Object.fromEntries(objects.map((model) => [model.name, model]));\n for (const [index, model] of models.entries()) {\n model.resolveBelongsTo({ schema, model: objects[index] });\n }\n for (const [index, model] of models.entries()) {\n model.resolveHasMany({ schema, model: objects[index] });\n }\n return schema;\n }\n}\n"]}
|