@luvio/compiler 0.63.1 → 0.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/codegen/adapter/adapter-browser-factory.js +7 -7
- package/dist/codegen/adapter/adapter-browser-factory.js.map +1 -1
- package/dist/codegen/adapter/adapter-build-snapshot-context.js +3 -3
- package/dist/codegen/adapter/adapter-build-snapshot-context.js.map +1 -1
- package/dist/codegen/adapter/adapter-cache.js +4 -4
- package/dist/codegen/adapter/adapter-cache.js.map +1 -1
- package/dist/codegen/adapter/adapter-config-coercion.js +4 -4
- package/dist/codegen/adapter/adapter-config-coercion.js.map +1 -1
- package/dist/codegen/adapter/adapter-config-interface.js +3 -3
- package/dist/codegen/adapter/adapter-config-interface.js.map +1 -1
- package/dist/codegen/adapter/adapter-config-validation.js +3 -3
- package/dist/codegen/adapter/adapter-config-validation.js.map +1 -1
- package/dist/codegen/adapter/adapter-fragment.js +2 -2
- package/dist/codegen/adapter/adapter-fragment.js.map +1 -1
- package/dist/codegen/adapter/adapter-key-builder.js +2 -2
- package/dist/codegen/adapter/adapter-key-builder.js.map +1 -1
- package/dist/codegen/adapter/adapter-memory-cache-policy.js +4 -4
- package/dist/codegen/adapter/adapter-memory-cache-policy.js.map +1 -1
- package/dist/codegen/adapter/adapter-name.js +1 -1
- package/dist/codegen/adapter/adapter-name.js.map +1 -1
- package/dist/codegen/adapter/adapter-network-cache-policy.js +12 -4
- package/dist/codegen/adapter/adapter-network-cache-policy.js.map +1 -1
- package/dist/codegen/adapter/adapter-network.d.ts +2 -1
- package/dist/codegen/adapter/adapter-network.js +23 -6
- package/dist/codegen/adapter/adapter-network.js.map +1 -1
- package/dist/codegen/adapter/adapter-notify-change.js +4 -4
- package/dist/codegen/adapter/adapter-notify-change.js.map +1 -1
- package/dist/codegen/adapter/adapter-one-of-params.js +1 -1
- package/dist/codegen/adapter/adapter-one-of-params.js.map +1 -1
- package/dist/codegen/adapter/adapter-param-type-check.js +21 -21
- package/dist/codegen/adapter/adapter-param-type-check.js.map +1 -1
- package/dist/codegen/adapter/adapter-prepare-request.d.ts +6 -0
- package/dist/codegen/adapter/adapter-prepare-request.js +162 -0
- package/dist/codegen/adapter/adapter-prepare-request.js.map +1 -0
- package/dist/codegen/adapter/adapter-resource-error.js +3 -3
- package/dist/codegen/adapter/adapter-resource-error.js.map +1 -1
- package/dist/codegen/adapter/adapter-resource-success.js +3 -3
- package/dist/codegen/adapter/adapter-resource-success.js.map +1 -1
- package/dist/codegen/adapter/adapter-shape-key-param-coercion.js +5 -5
- package/dist/codegen/adapter/adapter-shape-key-param-coercion.js.map +1 -1
- package/dist/codegen/adapter/adapter-type-check.js +4 -4
- package/dist/codegen/adapter/adapter-type-check.js.map +1 -1
- package/dist/codegen/adapter/adapter-validation-config-object.js +2 -2
- package/dist/codegen/adapter/adapter-validation-config-object.js.map +1 -1
- package/dist/codegen/adapter/constants.d.ts +1 -0
- package/dist/codegen/adapter/constants.js +44 -42
- package/dist/codegen/adapter/constants.js.map +1 -1
- package/dist/codegen/adapter/create-resource-params.js +7 -7
- package/dist/codegen/adapter/create-resource-params.js.map +1 -1
- package/dist/codegen/adapter/delete/adapter-browser-factory.js +5 -5
- package/dist/codegen/adapter/delete/adapter-browser-factory.js.map +1 -1
- package/dist/codegen/adapter/delete/adapter-network.js +2 -2
- package/dist/codegen/adapter/delete/adapter-network.js.map +1 -1
- package/dist/codegen/adapter/index.js +58 -56
- package/dist/codegen/adapter/index.js.map +1 -1
- package/dist/codegen/adapter/patch-post/adapter-browser-factory.js +4 -4
- package/dist/codegen/adapter/patch-post/adapter-browser-factory.js.map +1 -1
- package/dist/codegen/adapter/patch-post/adapter-network.js +2 -2
- package/dist/codegen/adapter/patch-post/adapter-network.js.map +1 -1
- package/dist/codegen/adapter/util.js +1 -1
- package/dist/codegen/adapter/util.js.map +1 -1
- package/dist/codegen/adapter-tests/expected-responses.js +10 -10
- package/dist/codegen/adapter-tests/expected-responses.js.map +1 -1
- package/dist/codegen/adapter-tests/index.js +8 -8
- package/dist/codegen/adapter-tests/index.js.map +1 -1
- package/dist/codegen/adapter-tests/invalid-configs.js +3 -3
- package/dist/codegen/adapter-tests/invalid-configs.js.map +1 -1
- package/dist/codegen/adapter-tests/mock-payloads.js +5 -5
- package/dist/codegen/adapter-tests/mock-payloads.js.map +1 -1
- package/dist/codegen/adapter-tests/valid-configs.js +3 -3
- package/dist/codegen/adapter-tests/valid-configs.js.map +1 -1
- package/dist/codegen/adapter-utils.js +15 -15
- package/dist/codegen/adapter-utils.js.map +1 -1
- package/dist/codegen/pagination-utils/cursor-based.js +17 -15
- package/dist/codegen/pagination-utils/cursor-based.js.map +1 -1
- package/dist/codegen/resource/composite/child-envelopes.js +1 -1
- package/dist/codegen/resource/composite/child-envelopes.js.map +1 -1
- package/dist/codegen/resource/composite/create-child-resource-params.js +3 -3
- package/dist/codegen/resource/composite/create-child-resource-params.js.map +1 -1
- package/dist/codegen/resource/composite/ingest-success-child-resource-params.js +1 -1
- package/dist/codegen/resource/composite/ingest-success-child-resource-params.js.map +1 -1
- package/dist/codegen/resource/composite/ingest-success.js +2 -2
- package/dist/codegen/resource/composite/ingest-success.js.map +1 -1
- package/dist/codegen/resource/composite/non-cached-errors-object.js +1 -1
- package/dist/codegen/resource/composite/non-cached-errors-object.js.map +1 -1
- package/dist/codegen/resource/composite/response-child-cache-keys.js +4 -4
- package/dist/codegen/resource/composite/response-child-cache-keys.js.map +1 -1
- package/dist/codegen/resource/composite/select-child-resource-params.js +1 -1
- package/dist/codegen/resource/composite/select-child-resource-params.js.map +1 -1
- package/dist/codegen/resource/composite/select.js +1 -1
- package/dist/codegen/resource/composite/select.js.map +1 -1
- package/dist/codegen/resource/create-resource-request-from-representation.js +1 -1
- package/dist/codegen/resource/create-resource-request-from-representation.js.map +1 -1
- package/dist/codegen/resource/create-resource-request.js +12 -10
- package/dist/codegen/resource/create-resource-request.js.map +1 -1
- package/dist/codegen/resource/evict-success.js +1 -1
- package/dist/codegen/resource/evict-success.js.map +1 -1
- package/dist/codegen/resource/index.js +14 -14
- package/dist/codegen/resource/index.js.map +1 -1
- package/dist/codegen/resource/ingest-error.js +4 -4
- package/dist/codegen/resource/ingest-error.js.map +1 -1
- package/dist/codegen/resource/ingest-success.js +3 -3
- package/dist/codegen/resource/ingest-success.js.map +1 -1
- package/dist/codegen/resource/key-builder.js +11 -11
- package/dist/codegen/resource/key-builder.js.map +1 -1
- package/dist/codegen/resource/pagination/create-pagination-params.js +3 -2
- package/dist/codegen/resource/pagination/create-pagination-params.js.map +1 -1
- package/dist/codegen/resource/pagination/select.js +1 -1
- package/dist/codegen/resource/pagination/select.js.map +1 -1
- package/dist/codegen/resource/resource-params.js +2 -2
- package/dist/codegen/resource/resource-params.js.map +1 -1
- package/dist/codegen/resource/response-cache-keys.js +3 -3
- package/dist/codegen/resource/response-cache-keys.js.map +1 -1
- package/dist/codegen/resource/select.js +5 -5
- package/dist/codegen/resource/select.js.map +1 -1
- package/dist/codegen/shape/constants.js +1 -1
- package/dist/codegen/shape/constants.js.map +1 -1
- package/dist/codegen/shape/index.js +23 -23
- package/dist/codegen/shape/index.js.map +1 -1
- package/dist/codegen/shape/shape-cache-keys.js +22 -22
- package/dist/codegen/shape/shape-cache-keys.js.map +1 -1
- package/dist/codegen/shape/shape-deep-freeze.js +20 -20
- package/dist/codegen/shape/shape-deep-freeze.js.map +1 -1
- package/dist/codegen/shape/shape-discriminator-values-enum.js +5 -5
- package/dist/codegen/shape/shape-discriminator-values-enum.js.map +1 -1
- package/dist/codegen/shape/shape-dynamic-ingest-params.js +2 -2
- package/dist/codegen/shape/shape-dynamic-ingest-params.js.map +1 -1
- package/dist/codegen/shape/shape-dynamic-ingest.js +5 -4
- package/dist/codegen/shape/shape-dynamic-ingest.js.map +1 -1
- package/dist/codegen/shape/shape-dynamic-normalize.js +5 -4
- package/dist/codegen/shape/shape-dynamic-normalize.js.map +1 -1
- package/dist/codegen/shape/shape-dynamic-select-params.js +2 -2
- package/dist/codegen/shape/shape-dynamic-select-params.js.map +1 -1
- package/dist/codegen/shape/shape-dynamic-select.js +3 -3
- package/dist/codegen/shape/shape-dynamic-select.js.map +1 -1
- package/dist/codegen/shape/shape-dynamic-utils.js +6 -5
- package/dist/codegen/shape/shape-dynamic-utils.js.map +1 -1
- package/dist/codegen/shape/shape-equals.js +27 -27
- package/dist/codegen/shape/shape-equals.js.map +1 -1
- package/dist/codegen/shape/shape-ingest-discriminator.js +4 -4
- package/dist/codegen/shape/shape-ingest-discriminator.js.map +1 -1
- package/dist/codegen/shape/shape-ingest-paginated.js +4 -3
- package/dist/codegen/shape/shape-ingest-paginated.js.map +1 -1
- package/dist/codegen/shape/shape-ingest.js +2 -2
- package/dist/codegen/shape/shape-ingest.js.map +1 -1
- package/dist/codegen/shape/shape-key-interface.js +3 -3
- package/dist/codegen/shape/shape-key-interface.js.map +1 -1
- package/dist/codegen/shape/shape-keybuilder.js +9 -9
- package/dist/codegen/shape/shape-keybuilder.js.map +1 -1
- package/dist/codegen/shape/shape-normalize.js +17 -17
- package/dist/codegen/shape/shape-normalize.js.map +1 -1
- package/dist/codegen/shape/shape-normalized-interface.js +3 -3
- package/dist/codegen/shape/shape-normalized-interface.js.map +1 -1
- package/dist/codegen/shape/shape-select-discriminator.js +7 -7
- package/dist/codegen/shape/shape-select-discriminator.js.map +1 -1
- package/dist/codegen/shape/shape-select-paginated.js +29 -26
- package/dist/codegen/shape/shape-select-paginated.js.map +1 -1
- package/dist/codegen/shape/shape-select-utils.js +36 -36
- package/dist/codegen/shape/shape-select-utils.js.map +1 -1
- package/dist/codegen/shape/shape-select.js +11 -11
- package/dist/codegen/shape/shape-select.js.map +1 -1
- package/dist/codegen/shape/shape-ttl.js +3 -3
- package/dist/codegen/shape/shape-ttl.js.map +1 -1
- package/dist/codegen/shape/shape-type-definition.js +9 -9
- package/dist/codegen/shape/shape-type-definition.js.map +1 -1
- package/dist/codegen/shape/shape-utils-ingest.js +6 -6
- package/dist/codegen/shape/shape-utils-ingest.js.map +1 -1
- package/dist/codegen/shape/shape-utils.js +6 -6
- package/dist/codegen/shape/shape-utils.js.map +1 -1
- package/dist/codegen/shape/shape-validation.js +2 -2
- package/dist/codegen/shape/shape-validation.js.map +1 -1
- package/dist/codegen/shared/constants.js +5 -5
- package/dist/codegen/shared/constants.js.map +1 -1
- package/dist/codegen/shared/normalized-type-definition.js +14 -14
- package/dist/codegen/shared/normalized-type-definition.js.map +1 -1
- package/dist/codegen/shared/type-definition.js +20 -20
- package/dist/codegen/shared/type-definition.js.map +1 -1
- package/dist/codegen/shared/validation.js +40 -40
- package/dist/codegen/shared/validation.js.map +1 -1
- package/dist/generate.js +11 -11
- package/dist/generate.js.map +1 -1
- package/dist/intermediate/mock-payload.d.ts +1 -1
- package/dist/intermediate/pagination.d.ts +4 -3
- package/dist/intermediate/pagination.js +1 -0
- package/dist/intermediate/pagination.js.map +1 -1
- package/dist/intermediate/resource.d.ts +2 -0
- package/dist/intermediate/resource.js.map +1 -1
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -1
- package/dist/parse.js +1 -1
- package/dist/parse.js.map +1 -1
- package/dist/parser/annotation-adapter-tests.js +11 -11
- package/dist/parser/annotation-adapter-tests.js.map +1 -1
- package/dist/parser/annotation-adapter.js +11 -11
- package/dist/parser/annotation-adapter.js.map +1 -1
- package/dist/parser/annotation-coerceFunction.js +4 -4
- package/dist/parser/annotation-coerceFunction.js.map +1 -1
- package/dist/parser/annotation-composite.js +48 -48
- package/dist/parser/annotation-composite.js.map +1 -1
- package/dist/parser/annotation-integrity.js +5 -5
- package/dist/parser/annotation-integrity.js.map +1 -1
- package/dist/parser/annotation-key.js +17 -17
- package/dist/parser/annotation-key.js.map +1 -1
- package/dist/parser/annotation-keyPrefix.js +3 -3
- package/dist/parser/annotation-keyPrefix.js.map +1 -1
- package/dist/parser/annotation-method.js +5 -5
- package/dist/parser/annotation-method.js.map +1 -1
- package/dist/parser/annotation-opaque.js +3 -3
- package/dist/parser/annotation-opaque.js.map +1 -1
- package/dist/parser/annotation-paginated.js +37 -22
- package/dist/parser/annotation-paginated.js.map +1 -1
- package/dist/parser/annotation-paginationParams.js +30 -29
- package/dist/parser/annotation-paginationParams.js.map +1 -1
- package/dist/parser/annotation-private.js +10 -10
- package/dist/parser/annotation-private.js.map +1 -1
- package/dist/parser/annotation-resource-key.js +5 -5
- package/dist/parser/annotation-resource-key.js.map +1 -1
- package/dist/parser/annotation-ttl.js +5 -5
- package/dist/parser/annotation-ttl.js.map +1 -1
- package/dist/parser/main.js +52 -44
- package/dist/parser/main.js.map +1 -1
- package/dist/parser/overlay-resolution.js +8 -8
- package/dist/parser/overlay-resolution.js.map +1 -1
- package/dist/parser/parse.js +5 -5
- package/dist/parser/parse.js.map +1 -1
- package/dist/parser/resource.js +26 -26
- package/dist/parser/resource.js.map +1 -1
- package/dist/parser/shape-inheritance.js +16 -16
- package/dist/parser/shape-inheritance.js.map +1 -1
- package/dist/parser/shape-normalization.js +4 -4
- package/dist/parser/shape-normalization.js.map +1 -1
- package/dist/parser/shape-paginated-container.js +2 -2
- package/dist/parser/shape-paginated-container.js.map +1 -1
- package/dist/parser/shape-resolution.js +10 -10
- package/dist/parser/shape-resolution.js.map +1 -1
- package/dist/utils/annotation.js +1 -1
- package/dist/utils/annotation.js.map +1 -1
- package/dist/utils/generation.js +2 -2
- package/dist/utils/generation.js.map +1 -1
- package/dist/utils/imports.js +5 -3
- package/dist/utils/imports.js.map +1 -1
- package/package.json +3 -3
- package/resources/luvio-annotations.raml +6 -0
package/dist/parser/main.js
CHANGED
|
@@ -22,20 +22,20 @@ const logger_1 = require("./logger");
|
|
|
22
22
|
const annotation_composite_1 = require("./annotation-composite");
|
|
23
23
|
const annotation_method_1 = require("./annotation-method");
|
|
24
24
|
function resolveDocument(model) {
|
|
25
|
-
if (aml_1.isOverlay(model)) {
|
|
26
|
-
return overlay_resolution_1.resolveOverlay(model);
|
|
25
|
+
if ((0, aml_1.isOverlay)(model)) {
|
|
26
|
+
return (0, overlay_resolution_1.resolveOverlay)(model);
|
|
27
27
|
}
|
|
28
|
-
else if (aml_1.isDocument(model)) {
|
|
28
|
+
else if ((0, aml_1.isDocument)(model)) {
|
|
29
29
|
return model;
|
|
30
30
|
}
|
|
31
|
-
logger_1.logError('Unexpected RAML type. Expected either a document or an overlay.');
|
|
31
|
+
(0, logger_1.logError)('Unexpected RAML type. Expected either a document or an overlay.');
|
|
32
32
|
return undefined;
|
|
33
33
|
}
|
|
34
34
|
function validateShape(shape, normalizableShapes) {
|
|
35
|
-
if (aml_1.isNodeShape(shape)) {
|
|
35
|
+
if ((0, aml_1.isNodeShape)(shape)) {
|
|
36
36
|
validateNodeShape(shape, normalizableShapes);
|
|
37
37
|
}
|
|
38
|
-
else if (aml_1.isUnionShape(shape)) {
|
|
38
|
+
else if ((0, aml_1.isUnionShape)(shape)) {
|
|
39
39
|
validateUnionShape(shape);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -47,56 +47,56 @@ function validateNodeShape(shape, normalizableShapes) {
|
|
|
47
47
|
const { line, column } = propertyShape.position.start;
|
|
48
48
|
if (patternName !== null) {
|
|
49
49
|
if (propertyName !== '//') {
|
|
50
|
-
logger_1.logError(`Unsupported additional property pattern ${propertyName}`, line, column);
|
|
50
|
+
(0, logger_1.logError)(`Unsupported additional property pattern ${propertyName}`, line, column);
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
else if (normalizableShapes[propertyId] && propertyShape.minCount.value() === 0) {
|
|
55
|
-
logger_1.logError(`Unsupported optional link at ${shape.name.value()}.${propertyName}`, line, column);
|
|
55
|
+
(0, logger_1.logError)(`Unsupported optional link at ${shape.name.value()}.${propertyName}`, line, column);
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
58
|
validateShape(propertyShape.range, normalizableShapes);
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
function validateUnionShape(shape) {
|
|
62
|
-
const nonScalarShapes = shape.anyOf.filter((s) => !aml_1.isScalarShape(s) && !aml_1.isNilShape(s));
|
|
62
|
+
const nonScalarShapes = shape.anyOf.filter((s) => !(0, aml_1.isScalarShape)(s) && !(0, aml_1.isNilShape)(s));
|
|
63
63
|
// If the union contains one or more shapes that are non scalar report an error.
|
|
64
64
|
// Note: Supporting union between multiple non scalar types requires a type check to know which
|
|
65
65
|
// normalization routine need to be invoked.
|
|
66
66
|
if (nonScalarShapes.length > 1) {
|
|
67
67
|
const formattedShapes = nonScalarShapes.map((s) => s.linkTarget ? s.linkTarget.name.value() : s.name.value());
|
|
68
68
|
const { line, column } = shape.anyOf[0].position.start;
|
|
69
|
-
logger_1.logError(`Unsupported complex normalization between ${formattedShapes.join(', ')}`, line, column);
|
|
69
|
+
(0, logger_1.logError)(`Unsupported complex normalization between ${formattedShapes.join(', ')}`, line, column);
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
function buildConfigShape(keys) {
|
|
74
74
|
const configProperties = Object.entries(keys).map(([identifier, { valueShape }]) => new amf_client_js_1.model.domain.PropertyShape().withName(identifier).withRange(valueShape).withMinCount(1));
|
|
75
|
-
return aml_1.convertNodeShapeToNodeShapeDefinition(new amf_client_js_1.model.domain.NodeShape().withProperties(configProperties), Object.create(null));
|
|
75
|
+
return (0, aml_1.convertNodeShapeToNodeShapeDefinition)(new amf_client_js_1.model.domain.NodeShape().withProperties(configProperties), Object.create(null));
|
|
76
76
|
}
|
|
77
77
|
async function parse(path) {
|
|
78
|
-
logger_1.resetLogger();
|
|
79
|
-
const model = await parse_1.parseAndValidate(path);
|
|
78
|
+
(0, logger_1.resetLogger)();
|
|
79
|
+
const model = await (0, parse_1.parseAndValidate)(path);
|
|
80
80
|
const document = resolveDocument(model);
|
|
81
81
|
if (document === undefined) {
|
|
82
82
|
return {
|
|
83
83
|
modelInfo: undefined,
|
|
84
|
-
errors: logger_1.getLogErrors(),
|
|
84
|
+
errors: (0, logger_1.getLogErrors)(),
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
const api = document.encodes;
|
|
88
|
-
const keyPrefix = annotation_keyPrefix_1.getKeyPrefix(api);
|
|
89
|
-
const rootTtl = annotation_ttl_1.collectTTLAnnotation(api);
|
|
88
|
+
const keyPrefix = (0, annotation_keyPrefix_1.getKeyPrefix)(api);
|
|
89
|
+
const rootTtl = (0, annotation_ttl_1.collectTTLAnnotation)(api);
|
|
90
90
|
const shapeCoerceFunction = {};
|
|
91
91
|
const shapes = {};
|
|
92
92
|
for (const decl of document.declares) {
|
|
93
|
-
if (aml_1.isNodeShape(decl)) {
|
|
93
|
+
if ((0, aml_1.isNodeShape)(decl)) {
|
|
94
94
|
shapes[decl.id] = decl;
|
|
95
95
|
}
|
|
96
96
|
// The coerceFunction annotation in particular might be on a Node shape
|
|
97
97
|
// or might be on a scalar shape so populating it here
|
|
98
|
-
if (aml_1.isAnyShape(decl)) {
|
|
99
|
-
const coerceFunction = annotation_coerceFunction_1.collectCoerceFunctionAnnotation(decl, document);
|
|
98
|
+
if ((0, aml_1.isAnyShape)(decl)) {
|
|
99
|
+
const coerceFunction = (0, annotation_coerceFunction_1.collectCoerceFunctionAnnotation)(decl, document);
|
|
100
100
|
if (coerceFunction !== undefined) {
|
|
101
101
|
shapeCoerceFunction[decl.name.value()] = coerceFunction;
|
|
102
102
|
}
|
|
@@ -115,61 +115,61 @@ async function parse(path) {
|
|
|
115
115
|
const compositeResources = {};
|
|
116
116
|
for (const shape of Object.values(shapes)) {
|
|
117
117
|
const shapeId = shape.id;
|
|
118
|
-
const nodeShape = shape_resolution_1.resolveShape(shape);
|
|
118
|
+
const nodeShape = (0, shape_resolution_1.resolveShape)(shape);
|
|
119
119
|
declaredShapes[shapeId] = nodeShape;
|
|
120
|
-
const keys = annotation_key_1.collectKeyAnnotation(shape);
|
|
120
|
+
const keys = (0, annotation_key_1.collectKeyAnnotation)(shape);
|
|
121
121
|
if (keys !== undefined) {
|
|
122
122
|
if (keyPrefix === '') {
|
|
123
|
-
logger_1.logError(`Missing "keyPrefix" annotation. "keyPrefix" must be defined when (key) annotation is present`);
|
|
123
|
+
(0, logger_1.logError)(`Missing "keyPrefix" annotation. "keyPrefix" must be defined when (key) annotation is present`);
|
|
124
124
|
}
|
|
125
125
|
else {
|
|
126
126
|
shapeKeys[shapeId] = keys;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
const ttl = annotation_ttl_1.collectTTLAnnotation(shape);
|
|
129
|
+
const ttl = (0, annotation_ttl_1.collectTTLAnnotation)(shape);
|
|
130
130
|
if (ttl !== undefined) {
|
|
131
131
|
shapeTtls[shapeId] = ttl;
|
|
132
132
|
}
|
|
133
|
-
const integrity = annotation_integrity_1.collectIntegrityAnnotation(shape);
|
|
133
|
+
const integrity = (0, annotation_integrity_1.collectIntegrityAnnotation)(shape);
|
|
134
134
|
if (integrity !== undefined) {
|
|
135
135
|
shapeIntegrity[shapeId] = integrity;
|
|
136
136
|
}
|
|
137
|
-
const opaque = annotation_opaque_1.collectOpaqueAnnotation(shape);
|
|
137
|
+
const opaque = (0, annotation_opaque_1.collectOpaqueAnnotation)(shape);
|
|
138
138
|
if (opaque === true) {
|
|
139
139
|
shapeOpaque[shapeId] = true;
|
|
140
140
|
}
|
|
141
|
-
const paginated = annotation_paginated_1.collectPaginatedAnnotation(shape, keys);
|
|
141
|
+
const paginated = (0, annotation_paginated_1.collectPaginatedAnnotation)(shape, keys);
|
|
142
142
|
if (paginated) {
|
|
143
143
|
shapePaginated[shapeId] = paginated;
|
|
144
144
|
}
|
|
145
|
-
const privates = annotation_private_1.collectPrivateAnnotation(shape);
|
|
145
|
+
const privates = (0, annotation_private_1.collectPrivateAnnotation)(shape);
|
|
146
146
|
if (privates !== undefined) {
|
|
147
147
|
shapePrivate[shapeId] = privates;
|
|
148
148
|
}
|
|
149
|
-
shape_inheritance_1.resolveInheritance(shape, shapeKeys, shapeTtls, shapeInheritance, shapeDiscriminatorTypes);
|
|
149
|
+
(0, shape_inheritance_1.resolveInheritance)(shape, shapeKeys, shapeTtls, shapeInheritance, shapeDiscriminatorTypes);
|
|
150
150
|
}
|
|
151
151
|
let normalizableShapes = {};
|
|
152
152
|
for (const shape of Object.values(declaredShapes)) {
|
|
153
153
|
normalizableShapes = {
|
|
154
154
|
...normalizableShapes,
|
|
155
|
-
...shape_normalization_1.collectNormalizableShapes(shape, shapeKeys, shapeOpaque, shapeDiscriminatorTypes),
|
|
155
|
+
...(0, shape_normalization_1.collectNormalizableShapes)(shape, shapeKeys, shapeOpaque, shapeDiscriminatorTypes),
|
|
156
156
|
};
|
|
157
157
|
validateShape(shape, normalizableShapes);
|
|
158
158
|
}
|
|
159
159
|
const declaredShapeDefinitions = {};
|
|
160
160
|
Object.keys(declaredShapes).forEach((key) => {
|
|
161
161
|
const shape = declaredShapes[key];
|
|
162
|
-
declaredShapeDefinitions[key] = aml_1.convertNodeShapeToNodeShapeDefinition(shape, Object.create(null));
|
|
162
|
+
declaredShapeDefinitions[key] = (0, aml_1.convertNodeShapeToNodeShapeDefinition)(shape, Object.create(null));
|
|
163
163
|
});
|
|
164
164
|
const normalizableShapeDefinitions = {};
|
|
165
165
|
Object.keys(normalizableShapes).forEach((key) => {
|
|
166
166
|
const shape = normalizableShapes[key];
|
|
167
|
-
normalizableShapeDefinitions[key] = aml_1.convertShapeToShapeDefinition(shape, Object.create(null));
|
|
167
|
+
normalizableShapeDefinitions[key] = (0, aml_1.convertShapeToShapeDefinition)(shape, Object.create(null));
|
|
168
168
|
});
|
|
169
169
|
// Collect all method annotations - Composite resource mapping needs to know about all of them.
|
|
170
170
|
for (const endpoint of api.endPoints) {
|
|
171
171
|
for (const operation of endpoint.operations) {
|
|
172
|
-
const annotation = annotation_method_1.collectMethodAnnotation(operation);
|
|
172
|
+
const annotation = (0, annotation_method_1.collectMethodAnnotation)(operation);
|
|
173
173
|
if (annotation !== undefined) {
|
|
174
174
|
methodOperations[operation.id] = annotation;
|
|
175
175
|
}
|
|
@@ -179,18 +179,18 @@ async function parse(path) {
|
|
|
179
179
|
for (const endpoint of api.endPoints) {
|
|
180
180
|
for (const operation of endpoint.operations) {
|
|
181
181
|
const semanticMethod = methodOperations[operation.id] || operation.method.value();
|
|
182
|
-
const composite = annotation_composite_1.collectCompositeAnnotation(document, endpoint, operation, api.endPoints, semanticMethod, methodOperations);
|
|
182
|
+
const composite = (0, annotation_composite_1.collectCompositeAnnotation)(document, endpoint, operation, api.endPoints, semanticMethod, methodOperations);
|
|
183
183
|
if (composite !== undefined) {
|
|
184
184
|
compositeResources[endpoint.id] = composite;
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
const resources = resource_1.collectResources(api, document, rootTtl, shapeKeys, shapeTtls, shapeCoerceFunction, methodOperations);
|
|
188
|
+
const resources = (0, resource_1.collectResources)(api, document, rootTtl, shapeKeys, shapeTtls, shapeCoerceFunction, methodOperations);
|
|
189
189
|
if (resources.length > 0 && keyPrefix === '') {
|
|
190
|
-
logger_1.logError(`Missing "keyPrefix" annotation. "keyPrefix" must be defined when resources are present`);
|
|
190
|
+
(0, logger_1.logError)(`Missing "keyPrefix" annotation. "keyPrefix" must be defined when resources are present`);
|
|
191
191
|
return {
|
|
192
192
|
modelInfo: undefined,
|
|
193
|
-
errors: logger_1.getLogErrors(),
|
|
193
|
+
errors: (0, logger_1.getLogErrors)(),
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
196
|
// collect paginated container types
|
|
@@ -199,15 +199,24 @@ async function parse(path) {
|
|
|
199
199
|
const { paginationParams, returnShape } = resource;
|
|
200
200
|
if (paginationParams === undefined ||
|
|
201
201
|
returnShape === undefined ||
|
|
202
|
-
shapePaginated[returnShape.id] !== undefined ||
|
|
203
202
|
shapePaginatedContainer[returnShape.id] !== undefined) {
|
|
204
203
|
return;
|
|
205
204
|
}
|
|
205
|
+
const paginatedTypeInfo = shapePaginated[returnShape.id];
|
|
206
|
+
if (paginatedTypeInfo !== undefined) {
|
|
207
|
+
resource.paginationPath = [
|
|
208
|
+
{
|
|
209
|
+
propertyName: paginatedTypeInfo.items,
|
|
210
|
+
shape: returnShape,
|
|
211
|
+
},
|
|
212
|
+
];
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
206
215
|
// find the path to paginated type from resource root type
|
|
207
216
|
const { strategy } = paginationParams;
|
|
208
|
-
const paginatedContainerPath = shape_paginated_container_1.collectPaginatedContainerPath(strategy, returnShape, shapePaginated, shapeOpaque);
|
|
217
|
+
const paginatedContainerPath = (0, shape_paginated_container_1.collectPaginatedContainerPath)(strategy, returnShape, shapePaginated, shapeOpaque);
|
|
209
218
|
if (paginatedContainerPath === undefined) {
|
|
210
|
-
logger_1.logError(`Paginated resource '${resource.name}' must contain a paginated type`);
|
|
219
|
+
(0, logger_1.logError)(`Paginated resource '${resource.name}' must contain a paginated type`);
|
|
211
220
|
return;
|
|
212
221
|
}
|
|
213
222
|
paginatedContainerPath.forEach((pathNode, index) => {
|
|
@@ -221,8 +230,7 @@ async function parse(path) {
|
|
|
221
230
|
shape: pathNode.shape,
|
|
222
231
|
};
|
|
223
232
|
});
|
|
224
|
-
|
|
225
|
-
// resource.paginationPath = paginatedContainerPath;
|
|
233
|
+
resource.paginationPath = paginatedContainerPath;
|
|
226
234
|
});
|
|
227
235
|
const shapeKeyConfigs = {};
|
|
228
236
|
const shapeKeysDefinition = {};
|
|
@@ -233,7 +241,7 @@ async function parse(path) {
|
|
|
233
241
|
Object.entries(shapeKey).forEach(([k, { valuePath, valueShape }]) => {
|
|
234
242
|
shapeKeyFieldsDefinition[k] = {
|
|
235
243
|
valuePath,
|
|
236
|
-
valueShapeDefinition: aml_1.convertShapeToShapeDefinition(valueShape, Object.create(null)),
|
|
244
|
+
valueShapeDefinition: (0, aml_1.convertShapeToShapeDefinition)(valueShape, Object.create(null)),
|
|
237
245
|
};
|
|
238
246
|
});
|
|
239
247
|
shapeKeysDefinition[key] = shapeKeyFieldsDefinition;
|
|
@@ -254,10 +262,10 @@ async function parse(path) {
|
|
|
254
262
|
shapeCoerceFunction,
|
|
255
263
|
resources,
|
|
256
264
|
compositeResources,
|
|
257
|
-
shapeDiscriminatorTypes: shape_inheritance_1.convertShapeDiscriminatorTypes(shapeDiscriminatorTypes),
|
|
265
|
+
shapeDiscriminatorTypes: (0, shape_inheritance_1.convertShapeDiscriminatorTypes)(shapeDiscriminatorTypes),
|
|
258
266
|
shapeInheritance,
|
|
259
267
|
};
|
|
260
|
-
const errors = logger_1.getLogErrors();
|
|
268
|
+
const errors = (0, logger_1.getLogErrors)();
|
|
261
269
|
if (errors.length > 0) {
|
|
262
270
|
return { modelInfo: undefined, errors };
|
|
263
271
|
}
|
package/dist/parser/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/parser/main.ts"],"names":[],"mappings":";;;AAAA,iDAA6C;AAgB7C,sCAUsB;AACtB,2EAA8E;AAC9E,iEAAoE;AACpE,qDAAwD;AACxD,iEAAsD;AACtD,2DAA8D;AAC9D,iEAAoE;AACpE,6DAAgE;AAChE,qDAAwD;AACxD,6DAAsD;AACtD,mCAA2C;AAC3C,yCAA8C;AAC9C,2EAA4E;AAC5E,2DAI6B;AAC7B,+DAAkE;AAClE,yDAAkD;AAClD,qCAA2E;AAE3E,iEAAoE;AACpE,2DAA8D;AAyB9D,SAAS,eAAe,CAAC,KAA4B;IACjD,IAAI,eAAS,
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/parser/main.ts"],"names":[],"mappings":";;;AAAA,iDAA6C;AAgB7C,sCAUsB;AACtB,2EAA8E;AAC9E,iEAAoE;AACpE,qDAAwD;AACxD,iEAAsD;AACtD,2DAA8D;AAC9D,iEAAoE;AACpE,6DAAgE;AAChE,qDAAwD;AACxD,6DAAsD;AACtD,mCAA2C;AAC3C,yCAA8C;AAC9C,2EAA4E;AAC5E,2DAI6B;AAC7B,+DAAkE;AAClE,yDAAkD;AAClD,qCAA2E;AAE3E,iEAAoE;AACpE,2DA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,SAAS;QACT,kBAAkB;QAClB,uBAAuB,EAAE,IAAA,kDAA8B,EAAC,uBAAuB,CAAC;QAChF,gBAAgB;KACnB,CAAC;IAEF,MAAM,MAAM,GAAG,IAAA,qBAAY,GAAE,CAAC;IAC9B,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;QACnB,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;KAC3C;IAED,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AAC5C,CAAC;AA1QD,sBA0QC"}
|
|
@@ -45,14 +45,14 @@ function resolveParameterExamples(baseParams, overlayParams) {
|
|
|
45
45
|
}
|
|
46
46
|
function resolveDeclares(base, overlay) {
|
|
47
47
|
for (const declaration of overlay.declares) {
|
|
48
|
-
if (aml_1.isCustomDomainProperty(declaration)) {
|
|
48
|
+
if ((0, aml_1.isCustomDomainProperty)(declaration)) {
|
|
49
49
|
// Overlays can define new annotation types, if it's the case let add the annotation
|
|
50
50
|
// type to the base.
|
|
51
51
|
base.withDeclares([...base.declares, declaration]);
|
|
52
52
|
}
|
|
53
|
-
else if (aml_1.isAnyShape(declaration)) {
|
|
53
|
+
else if ((0, aml_1.isAnyShape)(declaration)) {
|
|
54
54
|
const shapeName = declaration.name.value();
|
|
55
|
-
const baseShape = base.declares.find((decl) => aml_1.isAnyShape(decl) && decl.name.value() === shapeName);
|
|
55
|
+
const baseShape = base.declares.find((decl) => (0, aml_1.isAnyShape)(decl) && decl.name.value() === shapeName);
|
|
56
56
|
if (baseShape) {
|
|
57
57
|
// If the base document also define the same shape then merge the shapes together
|
|
58
58
|
// in the base document.
|
|
@@ -69,14 +69,14 @@ function resolveEncodes(base, overlay) {
|
|
|
69
69
|
var _a, _b, _c, _d;
|
|
70
70
|
const baseApi = base.encodes;
|
|
71
71
|
const overlayApi = overlay.encodes;
|
|
72
|
-
if (!aml_1.isWebApi(baseApi)) {
|
|
72
|
+
if (!(0, aml_1.isWebApi)(baseApi)) {
|
|
73
73
|
const { line: baseApiLine, column: baseApiColumn } = baseApi.position.start;
|
|
74
|
-
logger_1.logError(`Unexpected encodes property.`, baseApiLine, baseApiColumn);
|
|
74
|
+
(0, logger_1.logError)(`Unexpected encodes property.`, baseApiLine, baseApiColumn);
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
|
-
if (!aml_1.isWebApi(overlayApi)) {
|
|
77
|
+
if (!(0, aml_1.isWebApi)(overlayApi)) {
|
|
78
78
|
const { line: overlayApiLine, column: overlayApiColumn } = overlayApi.position.start;
|
|
79
|
-
logger_1.logError(`Unexpected encodes property.`, overlayApiLine, overlayApiColumn);
|
|
79
|
+
(0, logger_1.logError)(`Unexpected encodes property.`, overlayApiLine, overlayApiColumn);
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
82
|
mergeCustomDomainProperties(baseApi, overlayApi);
|
|
@@ -84,7 +84,7 @@ function resolveEncodes(base, overlay) {
|
|
|
84
84
|
const baseEndpoint = baseApi.endPoints.find((endPoint) => endPoint.path.value() === overlayEndpoint.path.value());
|
|
85
85
|
if (baseEndpoint === undefined) {
|
|
86
86
|
const { line, column } = overlayEndpoint.position.start;
|
|
87
|
-
logger_1.logError(`Endpoint '${overlayEndpoint.relativePath}' is not allowed to be added in overlay.`, line, column);
|
|
87
|
+
(0, logger_1.logError)(`Endpoint '${overlayEndpoint.relativePath}' is not allowed to be added in overlay.`, line, column);
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
90
|
if (overlayEndpoint.name.value()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay-resolution.js","sourceRoot":"","sources":["../../src/parser/overlay-resolution.ts"],"names":[],"mappings":";;;AACA,sCAAwF;AACxF,qCAAoC;AAEpC,SAAS,2BAA2B,CAChC,IAA8B,EAC9B,OAAiC;IAEjC,IAAI,CAAC,0BAA0B,CAAC;QAC5B,GAAG,IAAI,CAAC,sBAAsB;QAC9B,GAAG,OAAO,CAAC,sB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AAK,EAAE,CACpE,CAAC;wBAEF,MAAM,eAAe,GAAG;4BACpB,GAAG,cAAc,CAAC,QAAQ;4BAC1B,GAAG,CAAC,MAAA,MAAC,cAAc,CAAC,MAA+B,0CAAE,QAAQ,mCAAI,EAAE,CAAC;yBACvE,CAAC;wBACF,IAAI,WAAW,KAAK,SAAS,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE;4BACzD,WAAW,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;yBAC7C;qBACJ;iBACJ;aACJ;SACJ;QAED,8CAA8C;QAC9C,wBAAwB,CAAC,YAAY,CAAC,UAAU,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;KACjF;AACL,CAAC;AAED,kDAAkD;AAClD,EAAE;AACF,oCAAoC;AACpC,0FAA0F;AAC1F,SAAgB,cAAc,CAAC,OAA6B;IACxD,6FAA6F;IAC7F,6BAA6B;IAC7B,MAAM,+BAA+B,GACjC,OAAgE,CAAC;IAErE,0FAA0F;IAC1F,qDAAqD;IACrD,MAAM,IAAI,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,gBAAU,CAA0B,CAAC;IAE5E,oEAAoE;IACpE,eAAe,CAAC,IAAI,EAAE,+BAA+B,CAAC,CAAC;IACvD,cAAc,CAAC,IAAI,EAAE,+BAA+B,CAAC,CAAC;IAEtD,OAAO,IAAI,CAAC;AAChB,CAAC;AAfD,wCAeC"}
|
package/dist/parser/parse.js
CHANGED
|
@@ -14,7 +14,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
14
14
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
15
|
if (mod && mod.__esModule) return mod;
|
|
16
16
|
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
@@ -35,7 +35,7 @@ const RAML_LOADER = {
|
|
|
35
35
|
accepts(resource) {
|
|
36
36
|
return (resource === annotation_1.LUVIO_ANNOTATIONS_RESOURCE ||
|
|
37
37
|
(resource.startsWith(files_1.AMF_RESOURCE_PREFIX) &&
|
|
38
|
-
fs_1.default.existsSync(files_1.ramlResourceToPath(resource))));
|
|
38
|
+
fs_1.default.existsSync((0, files_1.ramlResourceToPath)(resource))));
|
|
39
39
|
},
|
|
40
40
|
fetch(resource) {
|
|
41
41
|
let source, targetResource = resource;
|
|
@@ -45,7 +45,7 @@ const RAML_LOADER = {
|
|
|
45
45
|
targetResource = annotation_1.LUVIO_ANNOTATIONS_PATH;
|
|
46
46
|
}
|
|
47
47
|
else if (targetResource.startsWith(files_1.AMF_RESOURCE_PREFIX)) {
|
|
48
|
-
const resourcePath = files_1.ramlResourceToPath(targetResource);
|
|
48
|
+
const resourcePath = (0, files_1.ramlResourceToPath)(targetResource);
|
|
49
49
|
source = fs_1.default.readFileSync(resourcePath, 'utf-8');
|
|
50
50
|
}
|
|
51
51
|
const content = new amf.client.remote.Content(source, targetResource);
|
|
@@ -63,7 +63,7 @@ async function parse(path) {
|
|
|
63
63
|
await init();
|
|
64
64
|
const environment = new amf.client.environment.Environment().addClientLoader(RAML_LOADER);
|
|
65
65
|
const parser = new amf.Raml10Parser(environment);
|
|
66
|
-
return parser.parseFileAsync(files_1.pathToRamlResource(path));
|
|
66
|
+
return parser.parseFileAsync((0, files_1.pathToRamlResource)(path));
|
|
67
67
|
}
|
|
68
68
|
async function validate(path) {
|
|
69
69
|
const model = await parse(path);
|
|
@@ -83,7 +83,7 @@ async function validate(path) {
|
|
|
83
83
|
}
|
|
84
84
|
// only includes file name and node name
|
|
85
85
|
const node = targetNode.substring(targetNode.search(/[^/]*.raml/));
|
|
86
|
-
logger_1.logError(`${message.trim()}. Target Node: ${node}`, position.start.line, position.start.column);
|
|
86
|
+
(0, logger_1.logError)(`${message.trim()}. Target Node: ${node}`, position.start.line, position.start.column);
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
async function parseAndValidate(path) {
|
package/dist/parser/parse.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../src/parser/parse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAqC;AACrC,4CAAoB;AACpB,gDAAwB;AAExB,qCAAoC;AACpC,0CAA6F;AAC7F,oDAAyF;AAEzF,MAAM,yBAAyB,GAAG,YAAE,CAAC,YAAY,CAAC,mCAAsB,EAAE,OAAO,CAAC,CAAC;AAEnF,MAAM,sBAAsB,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,wCAAwC,CAAC,CAAC;AAEjG,MAAM,WAAW,GAAgC;IAC7C,OAAO,CAAC,QAAgB;QACpB,OAAO,CACH,QAAQ,KAAK,uCAA0B;YACvC,CAAC,QAAQ,CAAC,UAAU,CAAC,2BAAmB,CAAC;gBACrC,YAAE,CAAC,UAAU,CAAC,0BAAkB,
|
|
1
|
+
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../src/parser/parse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAqC;AACrC,4CAAoB;AACpB,gDAAwB;AAExB,qCAAoC;AACpC,0CAA6F;AAC7F,oDAAyF;AAEzF,MAAM,yBAAyB,GAAG,YAAE,CAAC,YAAY,CAAC,mCAAsB,EAAE,OAAO,CAAC,CAAC;AAEnF,MAAM,sBAAsB,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,wCAAwC,CAAC,CAAC;AAEjG,MAAM,WAAW,GAAgC;IAC7C,OAAO,CAAC,QAAgB;QACpB,OAAO,CACH,QAAQ,KAAK,uCAA0B;YACvC,CAAC,QAAQ,CAAC,UAAU,CAAC,2BAAmB,CAA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C,IAAI,CAAC,CAAC;AACvB,CAAC;AAHD,4CAGC"}
|
package/dist/parser/resource.js
CHANGED
|
@@ -20,7 +20,7 @@ function getJSONPayloadShape(response) {
|
|
|
20
20
|
return payload;
|
|
21
21
|
}
|
|
22
22
|
const { line, column } = payload.schema.position.start;
|
|
23
|
-
logger_1.logError(`Unsupported Response Encoding: [${mediaType}]`, line, column);
|
|
23
|
+
(0, logger_1.logError)(`Unsupported Response Encoding: [${mediaType}]`, line, column);
|
|
24
24
|
}
|
|
25
25
|
return undefined;
|
|
26
26
|
}
|
|
@@ -28,12 +28,12 @@ exports.getJSONPayloadShape = getJSONPayloadShape;
|
|
|
28
28
|
function buildResourceName(path, urlParameters, method) {
|
|
29
29
|
const pathPieces = path
|
|
30
30
|
.split('/')
|
|
31
|
-
.map((part) => (part.startsWith('{') ? '' : format_1.capitalizeFirstCharacter(format_1.camelCase(part))))
|
|
31
|
+
.map((part) => (part.startsWith('{') ? '' : (0, format_1.capitalizeFirstCharacter)((0, format_1.camelCase)(part))))
|
|
32
32
|
.join('');
|
|
33
33
|
const uriParams = urlParameters.length === 0
|
|
34
34
|
? ''
|
|
35
35
|
: `By${urlParameters
|
|
36
|
-
.map((parameter) => format_1.capitalizeFirstCharacter(format_1.camelCase(parameter.name.value())))
|
|
36
|
+
.map((parameter) => (0, format_1.capitalizeFirstCharacter)((0, format_1.camelCase)(parameter.name.value())))
|
|
37
37
|
.join('And')}`;
|
|
38
38
|
return method + pathPieces + uriParams;
|
|
39
39
|
}
|
|
@@ -48,19 +48,19 @@ function getBaseUri(api) {
|
|
|
48
48
|
return servers[0].url.value() || defaultBaseUri;
|
|
49
49
|
}
|
|
50
50
|
else {
|
|
51
|
-
logger_1.logError(`Unsupported definition of multiple API servers.`);
|
|
51
|
+
(0, logger_1.logError)(`Unsupported definition of multiple API servers.`);
|
|
52
52
|
return '';
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
function resolveShapeLink(shape) {
|
|
56
|
-
if (shape.linkTarget !== undefined && aml_1.isNodeShape(shape.linkTarget)) {
|
|
56
|
+
if (shape.linkTarget !== undefined && (0, aml_1.isNodeShape)(shape.linkTarget)) {
|
|
57
57
|
return shape.linkTarget;
|
|
58
58
|
}
|
|
59
59
|
if (shape.inherits[0] === undefined ||
|
|
60
60
|
shape.inherits[0].linkTarget === undefined ||
|
|
61
|
-
!aml_1.isNodeShape(shape.inherits[0].linkTarget)) {
|
|
61
|
+
!(0, aml_1.isNodeShape)(shape.inherits[0].linkTarget)) {
|
|
62
62
|
const { line, column } = shape.position.start;
|
|
63
|
-
logger_1.logError(`Invalid inline shape reference for "${shape.id}"`, line, column);
|
|
63
|
+
(0, logger_1.logError)(`Invalid inline shape reference for "${shape.id}"`, line, column);
|
|
64
64
|
return undefined;
|
|
65
65
|
}
|
|
66
66
|
return shape.inherits[0].linkTarget;
|
|
@@ -92,10 +92,10 @@ function flattenResourceParameters(name, urlParameters, queryParameters, bodySha
|
|
|
92
92
|
// make sure there aren't any duplicate property names
|
|
93
93
|
const propertiesAsSet = new Set(properties.map((p) => p.name.value()));
|
|
94
94
|
if (propertiesAsSet.size !== properties.length) {
|
|
95
|
-
logger_1.logError(`Resource ${name} has multiple parameters with the same name, adapter generation is unsupported for Resources with parameter name collisions.`);
|
|
95
|
+
(0, logger_1.logError)(`Resource ${name} has multiple parameters with the same name, adapter generation is unsupported for Resources with parameter name collisions.`);
|
|
96
96
|
return undefined;
|
|
97
97
|
}
|
|
98
|
-
return aml_1.convertNodeShapeToNodeShapeDefinition(new amf_client_js_1.model.domain.NodeShape().withProperties(properties), Object.create(null));
|
|
98
|
+
return (0, aml_1.convertNodeShapeToNodeShapeDefinition)(new amf_client_js_1.model.domain.NodeShape().withProperties(properties), Object.create(null));
|
|
99
99
|
}
|
|
100
100
|
function buildResourceConfigShape(urlParameters, queryParameters, bodyShape, headers) {
|
|
101
101
|
const configNode = new amf_client_js_1.model.domain.NodeShape();
|
|
@@ -130,17 +130,17 @@ function buildResourceConfigShape(urlParameters, queryParameters, bodyShape, hea
|
|
|
130
130
|
.withRange(headersConfigShape)
|
|
131
131
|
.withMinCount(1);
|
|
132
132
|
}
|
|
133
|
-
return aml_1.convertNodeShapeToNodeShapeDefinition(configNode, Object.create(null));
|
|
133
|
+
return (0, aml_1.convertNodeShapeToNodeShapeDefinition)(configNode, Object.create(null));
|
|
134
134
|
}
|
|
135
135
|
function collectParamExamples(parameter) {
|
|
136
136
|
const exampleMap = {};
|
|
137
137
|
parameter.examples.forEach((example) => {
|
|
138
138
|
const name = example.name.value();
|
|
139
|
-
exampleMap[name] = aml_1.parseExampleValue(example);
|
|
139
|
+
exampleMap[name] = (0, aml_1.parseExampleValue)(example);
|
|
140
140
|
});
|
|
141
141
|
parameter.schema.examples.forEach((example) => {
|
|
142
142
|
const name = example.name.value();
|
|
143
|
-
exampleMap[name] = aml_1.parseExampleValue(example);
|
|
143
|
+
exampleMap[name] = (0, aml_1.parseExampleValue)(example);
|
|
144
144
|
});
|
|
145
145
|
return exampleMap;
|
|
146
146
|
}
|
|
@@ -219,7 +219,7 @@ function getAdapterNames(endpoints) {
|
|
|
219
219
|
const names = [];
|
|
220
220
|
for (const endpoint of endpoints) {
|
|
221
221
|
for (const operation of endpoint.operations) {
|
|
222
|
-
const adapterAnnotation = annotation_1.getAnnotation(operation, annotation_adapter_1.ADAPTER_ANNOTATION_NAME);
|
|
222
|
+
const adapterAnnotation = (0, annotation_1.getAnnotation)(operation, annotation_adapter_1.ADAPTER_ANNOTATION_NAME);
|
|
223
223
|
if (adapterAnnotation === undefined) {
|
|
224
224
|
continue;
|
|
225
225
|
}
|
|
@@ -265,14 +265,14 @@ function validateParameterName(parameter) {
|
|
|
265
265
|
if (name.indexOf('-') > -1) {
|
|
266
266
|
const { line, column } = parameter.position.start;
|
|
267
267
|
const parameterType = parameter.binding.value() === 'path' ? 'uri' : 'query';
|
|
268
|
-
logger_1.logError(`Invalid ${parameterType}Parameter. ${name} cannot have dash (-) in it. Target node: ${parameter.id.substring(parameter.id.search(/[^/]*.raml/))}`, line, column);
|
|
268
|
+
(0, logger_1.logError)(`Invalid ${parameterType}Parameter. ${name} cannot have dash (-) in it. Target node: ${parameter.id.substring(parameter.id.search(/[^/]*.raml/))}`, line, column);
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
function validateReturnShape(name, keys, shapeKeys, statusCode, returnShape) {
|
|
272
272
|
const { id: returnShapeId, name: returnShapeName, position: { start: { line, column }, }, } = returnShape;
|
|
273
273
|
if (statusCode !== 200 && statusCode !== 201) {
|
|
274
274
|
if (shapeKeys[returnShapeId] !== undefined) {
|
|
275
|
-
logger_1.logError(`The error return representation ${returnShapeName} for resource ${name} status ${statusCode} should not have (luvio.key) defined.`, line, column);
|
|
275
|
+
(0, logger_1.logError)(`The error return representation ${returnShapeName} for resource ${name} status ${statusCode} should not have (luvio.key) defined.`, line, column);
|
|
276
276
|
}
|
|
277
277
|
return;
|
|
278
278
|
}
|
|
@@ -280,7 +280,7 @@ function validateReturnShape(name, keys, shapeKeys, statusCode, returnShape) {
|
|
|
280
280
|
return;
|
|
281
281
|
}
|
|
282
282
|
if (shapeKeys[returnShapeId] === undefined) {
|
|
283
|
-
logger_1.logError(`Resource ${name} has (luvio.key) defined but the return representation ${returnShapeName} does not have a (luvio.key) annotation defined.`, line, column);
|
|
283
|
+
(0, logger_1.logError)(`Resource ${name} has (luvio.key) defined but the return representation ${returnShapeName} does not have a (luvio.key) annotation defined.`, line, column);
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
function collectResources(api, document, rootTtl, shapeKeys, shapeTtls, shapeCoercefunction, methodOperations) {
|
|
@@ -300,14 +300,14 @@ function collectResources(api, document, rootTtl, shapeKeys, shapeTtls, shapeCoe
|
|
|
300
300
|
for (const operation of endpoint.operations) {
|
|
301
301
|
let mockPayloads = [];
|
|
302
302
|
const method = operation.method.value();
|
|
303
|
-
const keys = annotation_resource_key_1.collectKeyAnnotation(operation);
|
|
303
|
+
const keys = (0, annotation_resource_key_1.collectKeyAnnotation)(operation);
|
|
304
304
|
const methodAnnotation = methodOperations[operation.id];
|
|
305
305
|
const queryParameters = operation.request ? operation.request.queryParameters : [];
|
|
306
306
|
const name = buildResourceName(path, urlParameters, method);
|
|
307
307
|
const headers = operation.request ? operation.request.headers : [];
|
|
308
308
|
const bodyShape = operation.request ? getEndpointBody(operation.request) : undefined;
|
|
309
309
|
const semanticMethod = methodAnnotation || method;
|
|
310
|
-
const paginationParams = annotation_paginationParams_1.collectPaginationParamsAnnotation(operation, semanticMethod, queryParameters, bodyShape);
|
|
310
|
+
const paginationParams = (0, annotation_paginationParams_1.collectPaginationParamsAnnotation)(operation, semanticMethod, queryParameters, bodyShape);
|
|
311
311
|
const queryParameterExamples = {};
|
|
312
312
|
for (const param of queryParameters) {
|
|
313
313
|
queryParameterExamples[param.name.value()] = collectParamExamples(param);
|
|
@@ -331,10 +331,10 @@ function collectResources(api, document, rootTtl, shapeKeys, shapeTtls, shapeCoe
|
|
|
331
331
|
validateReturnShape(name, keys, shapeKeys, statusCode, returnShape);
|
|
332
332
|
returnShapes.push({
|
|
333
333
|
statusCode,
|
|
334
|
-
returnShape: aml_1.convertNodeShapeToNodeShapeDefinition(returnShape, Object.create(null)),
|
|
334
|
+
returnShape: (0, aml_1.convertNodeShapeToNodeShapeDefinition)(returnShape, Object.create(null)),
|
|
335
335
|
});
|
|
336
336
|
if (statusCode === 200 || statusCode === 201) {
|
|
337
|
-
successReturnShape = aml_1.convertNodeShapeToNodeShapeDefinition(returnShape, Object.create(null));
|
|
337
|
+
successReturnShape = (0, aml_1.convertNodeShapeToNodeShapeDefinition)(returnShape, Object.create(null));
|
|
338
338
|
if (method === 'get') {
|
|
339
339
|
// remember this shape in case there is a DELETE
|
|
340
340
|
// resource that needs to build a key at this same endpoint
|
|
@@ -351,7 +351,7 @@ function collectResources(api, document, rootTtl, shapeKeys, shapeTtls, shapeCoe
|
|
|
351
351
|
const configShapeDefinition = buildResourceConfigShape(urlParameters, queryParameters, bodyShape, headers);
|
|
352
352
|
// adapter needs to know the method to make caching decisions
|
|
353
353
|
const methodForCaching = methodAnnotation || method;
|
|
354
|
-
const adapter = annotation_adapter_1.collectAdapterAnnotation(document, operation, methodForCaching, adapterNames, shapeCoercefunction, shapeKeys, shapeTtls, rootTtl, keys, successReturnShape, mockPayloads, configShapeDefinition);
|
|
354
|
+
const adapter = (0, annotation_adapter_1.collectAdapterAnnotation)(document, operation, methodForCaching, adapterNames, shapeCoercefunction, shapeKeys, shapeTtls, rootTtl, keys, successReturnShape, mockPayloads, configShapeDefinition);
|
|
355
355
|
if (method === 'delete' && keys !== undefined) {
|
|
356
356
|
// remember if this is a DELETE with a cache key so we can
|
|
357
357
|
// validate it later (once all other operations at this endpoint
|
|
@@ -369,16 +369,16 @@ function collectResources(api, document, rootTtl, shapeKeys, shapeTtls, shapeCoe
|
|
|
369
369
|
baseUri,
|
|
370
370
|
path,
|
|
371
371
|
method,
|
|
372
|
-
urlParameters: urlParameters.map((i) => aml_1.convertParameterToParamterDefinition(i, Object.create(null))),
|
|
373
|
-
queryParameters: queryParameters.map((i) => aml_1.convertParameterToParamterDefinition(i, Object.create(null))),
|
|
372
|
+
urlParameters: urlParameters.map((i) => (0, aml_1.convertParameterToParamterDefinition)(i, Object.create(null))),
|
|
373
|
+
queryParameters: queryParameters.map((i) => (0, aml_1.convertParameterToParamterDefinition)(i, Object.create(null))),
|
|
374
374
|
returnShapes,
|
|
375
375
|
returnShape: successReturnShape,
|
|
376
376
|
bodyShape: bodyShape === undefined
|
|
377
377
|
? undefined
|
|
378
|
-
: aml_1.convertNodeShapeToNodeShapeDefinition(bodyShape, Object.create(null)),
|
|
378
|
+
: (0, aml_1.convertNodeShapeToNodeShapeDefinition)(bodyShape, Object.create(null)),
|
|
379
379
|
keys,
|
|
380
380
|
adapter,
|
|
381
|
-
headers: headers.map((i) => aml_1.convertParameterToParamterDefinition(i, Object.create(null))),
|
|
381
|
+
headers: headers.map((i) => (0, aml_1.convertParameterToParamterDefinition)(i, Object.create(null))),
|
|
382
382
|
// TODO: remove fulfill when store is capable of network deduping
|
|
383
383
|
fulfill: undefined,
|
|
384
384
|
configShapeDefinition,
|
|
@@ -393,7 +393,7 @@ function collectResources(api, document, rootTtl, shapeKeys, shapeTtls, shapeCoe
|
|
|
393
393
|
// finally if we have a keyed DELETE resource then validate
|
|
394
394
|
// there is a sibling GET response shape with a key
|
|
395
395
|
if (deleteOperationWithKey !== undefined) {
|
|
396
|
-
annotation_key_1.validateDeleteKey(deleteOperationWithKey, shapeForDeleteKey, shapeKeys);
|
|
396
|
+
(0, annotation_key_1.validateDeleteKey)(deleteOperationWithKey, shapeForDeleteKey, shapeKeys);
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
399
|
return resources;
|