@osdk/maker-experimental 0.88.0 → 0.89.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/CHANGELOG.md +16 -0
- package/build/browser/api/defineOntologyV2.js +39 -4
- package/build/browser/api/defineOntologyV2.js.map +1 -1
- package/build/browser/cli/generateBackingMediaSet.js +53 -23
- package/build/browser/cli/generateBackingMediaSet.js.map +1 -1
- package/build/browser/cli/main.js +3 -2
- package/build/browser/cli/main.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertObject.js +2 -1
- package/build/browser/conversion/toMarketplace/convertObject.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertOntologyDefinitionToWireBlockData.js +15 -0
- package/build/browser/conversion/toMarketplace/convertOntologyDefinitionToWireBlockData.js.map +1 -1
- package/build/browser/util/generateRid.js +7 -0
- package/build/browser/util/generateRid.js.map +1 -1
- package/build/browser/util/mediaSetMarkings.js +36 -0
- package/build/browser/util/mediaSetMarkings.js.map +1 -0
- package/build/cjs/{ActionTypeShapeExtractor-QWYGFLDM.cjs → ActionTypeShapeExtractor-4J4WGKU4.cjs} +6 -6
- package/build/cjs/{ActionTypeShapeExtractor-QWYGFLDM.cjs.map → ActionTypeShapeExtractor-4J4WGKU4.cjs.map} +1 -1
- package/build/cjs/{chunk-MPWLPQEH.cjs → chunk-Y53H6FV7.cjs} +9 -2
- package/build/cjs/chunk-Y53H6FV7.cjs.map +1 -0
- package/build/cjs/index.cjs +210 -119
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +2 -1
- package/build/esm/api/defineOntologyV2.js +39 -4
- package/build/esm/api/defineOntologyV2.js.map +1 -1
- package/build/esm/cli/generateBackingMediaSet.js +53 -23
- package/build/esm/cli/generateBackingMediaSet.js.map +1 -1
- package/build/esm/cli/main.js +3 -2
- package/build/esm/cli/main.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertObject.js +2 -1
- package/build/esm/conversion/toMarketplace/convertObject.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertOntologyDefinitionToWireBlockData.js +15 -0
- package/build/esm/conversion/toMarketplace/convertOntologyDefinitionToWireBlockData.js.map +1 -1
- package/build/esm/util/generateRid.js +7 -0
- package/build/esm/util/generateRid.js.map +1 -1
- package/build/esm/util/mediaSetMarkings.js +36 -0
- package/build/esm/util/mediaSetMarkings.js.map +1 -0
- package/build/types/api/defineOntologyV2.d.ts +2 -0
- package/build/types/api/defineOntologyV2.d.ts.map +1 -1
- package/build/types/cli/generateBackingMediaSet.d.ts +2 -1
- package/build/types/cli/generateBackingMediaSet.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/convertObject.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/convertOntologyDefinitionToWireBlockData.d.ts.map +1 -1
- package/build/types/util/generateRid.d.ts +2 -1
- package/build/types/util/generateRid.d.ts.map +1 -1
- package/build/types/util/mediaSetMarkings.d.ts +8 -0
- package/build/types/util/mediaSetMarkings.d.ts.map +1 -0
- package/package.json +8 -8
- package/build/cjs/chunk-MPWLPQEH.cjs.map +0 -1
package/build/cjs/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var chunkY53H6FV7_cjs = require('./chunk-Y53H6FV7.cjs');
|
|
6
6
|
var fs7 = require('fs');
|
|
7
7
|
var path6 = require('path');
|
|
8
8
|
var url = require('url');
|
|
@@ -358,6 +358,24 @@ function unexpectedVariant(value) {
|
|
|
358
358
|
}]);
|
|
359
359
|
}
|
|
360
360
|
|
|
361
|
+
// src/util/mediaSetMarkings.ts
|
|
362
|
+
function getMediaSetMarkings(markings) {
|
|
363
|
+
const groups = Object.keys(markings).sort();
|
|
364
|
+
const readableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForMarkingSet(markings);
|
|
365
|
+
const types = [...new Set(Object.values(markings))];
|
|
366
|
+
const supportedMarkingsType = types.length === 1 ? types[0] : "MANDATORY";
|
|
367
|
+
return {
|
|
368
|
+
readableId,
|
|
369
|
+
placeholderMarkings: groups.length <= 1 ? groups : [readableId],
|
|
370
|
+
shapeTypes: {
|
|
371
|
+
supportedMarkingsType,
|
|
372
|
+
...types.length > 1 ? {
|
|
373
|
+
supportedMarkingsTypesV2: ["CBAC", "MANDATORY_NOT_ORGANIZATION", "ORGANIZATION"]
|
|
374
|
+
} : {}
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
|
|
361
379
|
// src/conversion/toMarketplace/structActionParameterUtils.ts
|
|
362
380
|
function getStructFieldTypes(parameter) {
|
|
363
381
|
if (typeof parameter.type === "string") {
|
|
@@ -692,7 +710,7 @@ function registerGroupsFromCondition(condition, ridGenerator) {
|
|
|
692
710
|
switch (condition.type) {
|
|
693
711
|
case "group":
|
|
694
712
|
if (condition.name) {
|
|
695
|
-
ridGenerator.getGroupIds().put(
|
|
713
|
+
ridGenerator.getGroupIds().put(chunkY53H6FV7_cjs.ReadableIdGenerator.getForGroup(condition.name), condition.name);
|
|
696
714
|
}
|
|
697
715
|
break;
|
|
698
716
|
case "comparison":
|
|
@@ -700,7 +718,7 @@ function registerGroupsFromCondition(condition, ridGenerator) {
|
|
|
700
718
|
const strings = condition.comparison?.right?.staticValue?.stringList?.strings;
|
|
701
719
|
if (Array.isArray(strings)) {
|
|
702
720
|
strings.forEach((groupName) => {
|
|
703
|
-
ridGenerator.getGroupIds().put(
|
|
721
|
+
ridGenerator.getGroupIds().put(chunkY53H6FV7_cjs.ReadableIdGenerator.getForGroup(groupName), groupName);
|
|
704
722
|
});
|
|
705
723
|
}
|
|
706
724
|
}
|
|
@@ -1011,7 +1029,7 @@ function convertAction(action, ridGenerator, functionsIr) {
|
|
|
1011
1029
|
const parameterOrdering = action.parameterOrdering ?? (action.parameters ?? []).map((p) => p.id);
|
|
1012
1030
|
const parameterIds = {};
|
|
1013
1031
|
(action.parameters ?? []).forEach((p) => {
|
|
1014
|
-
const readableId =
|
|
1032
|
+
const readableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForParameter(action.apiName, p.id);
|
|
1015
1033
|
const uuid = ridGenerator.toBlockInternalId(readableId);
|
|
1016
1034
|
parameterIds[uuid] = p.id;
|
|
1017
1035
|
});
|
|
@@ -1024,7 +1042,7 @@ function convertAction(action, ridGenerator, functionsIr) {
|
|
|
1024
1042
|
const rid = ridGenerator.generateInterfacePropertyTypeRid(apiName, parentInterface.apiName);
|
|
1025
1043
|
result[rid] = value;
|
|
1026
1044
|
} else {
|
|
1027
|
-
const sptReadableId =
|
|
1045
|
+
const sptReadableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForSpt(apiName);
|
|
1028
1046
|
const sptRid = ridGenerator.getSharedPropertyTypeRids().get(sptReadableId);
|
|
1029
1047
|
!sptRid ? process.env.NODE_ENV !== "production" ? invariant7__default.default(false, `Could not find SPT RID for property "${apiName}" used in action logic rule`) : invariant7__default.default(false) : void 0;
|
|
1030
1048
|
const iptRid = sptRid.replace("shared-property-type", "interface-property-type");
|
|
@@ -1674,7 +1692,7 @@ function extractAllowedValues(allowedValues, ridGenerator) {
|
|
|
1674
1692
|
user: {
|
|
1675
1693
|
filter: (allowedValues.fromGroups ?? []).map((group) => {
|
|
1676
1694
|
if (group.type === "static") {
|
|
1677
|
-
ridGenerator.getGroupIds().put(
|
|
1695
|
+
ridGenerator.getGroupIds().put(chunkY53H6FV7_cjs.ReadableIdGenerator.getForGroup(group.name), group.name);
|
|
1678
1696
|
}
|
|
1679
1697
|
return {
|
|
1680
1698
|
type: "groupFilter",
|
|
@@ -2145,7 +2163,7 @@ function convertSecurityComparisonValue(value, otherValue, ridGenerator, objectT
|
|
|
2145
2163
|
groupIds = value.constant.strings;
|
|
2146
2164
|
}
|
|
2147
2165
|
for (const groupId of groupIds) {
|
|
2148
|
-
ridGenerator?.getGroupIds().put(
|
|
2166
|
+
ridGenerator?.getGroupIds().put(chunkY53H6FV7_cjs.ReadableIdGenerator.getForGroup(groupId), groupId);
|
|
2149
2167
|
}
|
|
2150
2168
|
}
|
|
2151
2169
|
if (value.type !== "property") {
|
|
@@ -2889,7 +2907,7 @@ function extractPropertyDatasource(property, objectTypeApiName, ridGenerator) {
|
|
|
2889
2907
|
const mediaSetDefinition = {
|
|
2890
2908
|
type: "mediaSetView",
|
|
2891
2909
|
mediaSetView: {
|
|
2892
|
-
assumedMarkings:
|
|
2910
|
+
assumedMarkings: getMediaSetMarkings(property.backingMediaSetMarkings ?? {}).placeholderMarkings,
|
|
2893
2911
|
clearOnDeleteProperties: [],
|
|
2894
2912
|
mediaSetViewLocator: ridGenerator.generateMediaSetViewLocator(identifier),
|
|
2895
2913
|
properties: [propertyRid],
|
|
@@ -5054,7 +5072,7 @@ async function getShapes(ontologyBlockDataV2, ridGenerator, functionsIr, randomn
|
|
|
5054
5072
|
}
|
|
5055
5073
|
const {
|
|
5056
5074
|
ActionTypeShapeExtractor
|
|
5057
|
-
} = await import('./ActionTypeShapeExtractor-
|
|
5075
|
+
} = await import('./ActionTypeShapeExtractor-4J4WGKU4.cjs');
|
|
5058
5076
|
for (const [_rid, actionType] of Object.entries(ontologyBlockDataV2.actionTypes || {})) {
|
|
5059
5077
|
const actionExtractor = new ActionTypeShapeExtractor();
|
|
5060
5078
|
const actionShapes = actionExtractor.extract(actionType, ridGenerator, ontologyBlockDataV2.knownIdentifiers, functionsIr);
|
|
@@ -5071,7 +5089,7 @@ async function getShapes(ontologyBlockDataV2, ridGenerator, functionsIr, randomn
|
|
|
5071
5089
|
if (allBlockShapes.inputShapes.has(readableId)) {
|
|
5072
5090
|
allBlockShapes.inputMappings.push({
|
|
5073
5091
|
input: readableId,
|
|
5074
|
-
output:
|
|
5092
|
+
output: chunkY53H6FV7_cjs.ReadableIdGenerator.getProducedReadableId(readableId)
|
|
5075
5093
|
});
|
|
5076
5094
|
}
|
|
5077
5095
|
}
|
|
@@ -5151,7 +5169,7 @@ function extractInterfaceType(outputShapeMap, inputShapeMap, inputShapeMetadataM
|
|
|
5151
5169
|
}
|
|
5152
5170
|
}
|
|
5153
5171
|
for (const transition of schemaTransitions) {
|
|
5154
|
-
outputShapeMap.set(
|
|
5172
|
+
outputShapeMap.set(chunkY53H6FV7_cjs.ReadableIdGenerator.getForInterfaceSchemaTransition(interfaceType.apiName, transition.id), {
|
|
5155
5173
|
type: "interfaceTypeSchemaTransition",
|
|
5156
5174
|
interfaceTypeSchemaTransition: getInterfaceSchemaTransitionOutputShape(knownMarketplaceIdentifiers, interfaceType, transition)
|
|
5157
5175
|
});
|
|
@@ -5186,7 +5204,7 @@ function getInterfacePropertyTypeOutputShape(knownMarketplaceIdentifiers, interf
|
|
|
5186
5204
|
const interfaceTypeRef = ridGenerator.toBlockInternalId(interfaceReadableId);
|
|
5187
5205
|
if (property.type === "interfaceDefinedPropertyType") {
|
|
5188
5206
|
const idp = property.interfaceDefinedPropertyType;
|
|
5189
|
-
const readableId =
|
|
5207
|
+
const readableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForInterfaceProperty(interfaceType.apiName, idp.apiName);
|
|
5190
5208
|
const shape = {
|
|
5191
5209
|
about: createLocalizedAbout3(idp.displayMetadata.displayName, idp.displayMetadata.description ?? idp.displayMetadata.displayName),
|
|
5192
5210
|
interfaceType: interfaceTypeRef,
|
|
@@ -5203,7 +5221,7 @@ function getInterfacePropertyTypeOutputShape(knownMarketplaceIdentifiers, interf
|
|
|
5203
5221
|
} else {
|
|
5204
5222
|
const spt = property.sharedPropertyBasedPropertyType.sharedPropertyType;
|
|
5205
5223
|
const sptApiName = spt.apiName;
|
|
5206
|
-
const readableId = multiInterfaceSptApiNames.has(sptApiName) ?
|
|
5224
|
+
const readableId = multiInterfaceSptApiNames.has(sptApiName) ? chunkY53H6FV7_cjs.ReadableIdGenerator.getForSptBackedInterfaceProperty(sptApiName) : chunkY53H6FV7_cjs.ReadableIdGenerator.getForSptBackedInterfaceProperty(interfaceType.apiName, sptApiName);
|
|
5207
5225
|
const sptBlockInternalId = knownMarketplaceIdentifiers.sharedPropertyTypes?.[spt.rid];
|
|
5208
5226
|
const shape = {
|
|
5209
5227
|
about: getTitleAndDescriptionForSharedPropertyType(spt),
|
|
@@ -5276,7 +5294,7 @@ function getInterfaceActionTypeConstraintOutputShape(knownMarketplaceIdentifiers
|
|
|
5276
5294
|
parameterConstraints: parameterConstraintRefs,
|
|
5277
5295
|
requireImplementation: actionTypeConstraint.requireImplementation
|
|
5278
5296
|
};
|
|
5279
|
-
const readableId =
|
|
5297
|
+
const readableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForInterfaceActionTypeConstraint(interfaceType.apiName, actionTypeConstraint.metadata.apiName);
|
|
5280
5298
|
return {
|
|
5281
5299
|
id: readableId,
|
|
5282
5300
|
outputShape: {
|
|
@@ -5483,7 +5501,7 @@ function getMarkingShapes(ontologyBlockDataV2, ridGenerator) {
|
|
|
5483
5501
|
if (markingType) {
|
|
5484
5502
|
const propertyApiName = propertyType.apiName ?? propertyType.displayMetadata?.displayName;
|
|
5485
5503
|
if (propertyApiName) {
|
|
5486
|
-
const readableId =
|
|
5504
|
+
const readableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForObjectProperty(objectApiName, propertyApiName);
|
|
5487
5505
|
if (markingType === "CBAC") {
|
|
5488
5506
|
cbacReadableIdsByRid.set(propertyRid, readableId);
|
|
5489
5507
|
} else if (markingType === "MANDATORY") {
|
|
@@ -5549,7 +5567,7 @@ function getMarkingShapes(ontologyBlockDataV2, ridGenerator) {
|
|
|
5549
5567
|
if (propType) {
|
|
5550
5568
|
const propApiName = propType.apiName ?? propType.displayMetadata?.displayName;
|
|
5551
5569
|
if (propApiName) {
|
|
5552
|
-
existing.add(
|
|
5570
|
+
existing.add(chunkY53H6FV7_cjs.ReadableIdGenerator.getForObjectProperty(objectApiName, propApiName));
|
|
5553
5571
|
}
|
|
5554
5572
|
}
|
|
5555
5573
|
}
|
|
@@ -5560,7 +5578,7 @@ function getMarkingShapes(ontologyBlockDataV2, ridGenerator) {
|
|
|
5560
5578
|
}
|
|
5561
5579
|
const inputShapes = /* @__PURE__ */ new Map();
|
|
5562
5580
|
for (const [markingId, props] of cbacMarkingsAndAffectedProps) {
|
|
5563
|
-
const readableId =
|
|
5581
|
+
const readableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForMarking(markingId, "CBAC");
|
|
5564
5582
|
const shape = {
|
|
5565
5583
|
about: createLocalizedAbout3(`Max Classification ${markingId}`, MAX_CLASS_DESC),
|
|
5566
5584
|
operation: "USE",
|
|
@@ -5574,7 +5592,7 @@ function getMarkingShapes(ontologyBlockDataV2, ridGenerator) {
|
|
|
5574
5592
|
});
|
|
5575
5593
|
}
|
|
5576
5594
|
for (const [markingId, props] of additionalCbacMarkingsAndAffectedProps) {
|
|
5577
|
-
const readableId =
|
|
5595
|
+
const readableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForMarking(markingId, "CBAC");
|
|
5578
5596
|
const shape = {
|
|
5579
5597
|
about: createLocalizedAbout3(`Marking ${markingId}`, "Marking"),
|
|
5580
5598
|
operation: "USE",
|
|
@@ -5588,7 +5606,7 @@ function getMarkingShapes(ontologyBlockDataV2, ridGenerator) {
|
|
|
5588
5606
|
});
|
|
5589
5607
|
}
|
|
5590
5608
|
for (const [markingId, props] of mandatoryMarkingsAndAffectedProps) {
|
|
5591
|
-
const readableId =
|
|
5609
|
+
const readableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForMarking(markingId, "MANDATORY");
|
|
5592
5610
|
const shape = {
|
|
5593
5611
|
about: createLocalizedAbout3(`Max Marking ${markingId}`, "Max Marking"),
|
|
5594
5612
|
operation: "USE",
|
|
@@ -5629,13 +5647,13 @@ function consumeBlockShapes(target, source) {
|
|
|
5629
5647
|
}
|
|
5630
5648
|
}
|
|
5631
5649
|
function getReadableIdForSpt(apiName) {
|
|
5632
|
-
return
|
|
5650
|
+
return chunkY53H6FV7_cjs.ReadableIdGenerator.getForSpt(apiName);
|
|
5633
5651
|
}
|
|
5634
5652
|
function getReadableIdForInterface(apiName) {
|
|
5635
|
-
return
|
|
5653
|
+
return chunkY53H6FV7_cjs.ReadableIdGenerator.getForInterface(apiName);
|
|
5636
5654
|
}
|
|
5637
5655
|
function getReadableIdForInterfaceLink(interfaceApiName, linkApiName) {
|
|
5638
|
-
return
|
|
5656
|
+
return chunkY53H6FV7_cjs.ReadableIdGenerator.getForInterfaceLinkType(interfaceApiName, linkApiName);
|
|
5639
5657
|
}
|
|
5640
5658
|
function requireKnownIdentifier(identifiers, rid, kind) {
|
|
5641
5659
|
const blockInternalId = identifiers?.[rid];
|
|
@@ -5752,14 +5770,14 @@ function convertOntologyDefinitionToWireBlockData(ontology, ridGenerator, allOnt
|
|
|
5752
5770
|
function buildKnownIdentifiers(ontology, objectTypes, ridGenerator, ontologiesToScan, interfacePropertyMappings) {
|
|
5753
5771
|
const interfaceMappings = Object.fromEntries(Array.from(ridGenerator.getInterfaceRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));
|
|
5754
5772
|
const sharedPropertyMappings = Object.fromEntries(Array.from(ridGenerator.getSharedPropertyTypeRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));
|
|
5755
|
-
const interfaceSchemaTransitionMappings = Object.fromEntries(Object.entries(ontology[maker.OntologyEntityTypeEnum.INTERFACE_TYPE]).flatMap(([apiName, interfaceType]) => (interfaceType.schemaMigrations?.transitions ?? []).map((transition) => [ridGenerator.generateRidForInterfaceSchemaTransition(transition.id, apiName), ridGenerator.toBlockInternalId(
|
|
5773
|
+
const interfaceSchemaTransitionMappings = Object.fromEntries(Object.entries(ontology[maker.OntologyEntityTypeEnum.INTERFACE_TYPE]).flatMap(([apiName, interfaceType]) => (interfaceType.schemaMigrations?.transitions ?? []).map((transition) => [ridGenerator.generateRidForInterfaceSchemaTransition(transition.id, apiName), ridGenerator.toBlockInternalId(chunkY53H6FV7_cjs.ReadableIdGenerator.getForInterfaceSchemaTransition(apiName, transition.id))])));
|
|
5756
5774
|
const interfaceLinkMappings = Object.fromEntries(Array.from(ridGenerator.getInterfaceLinkTypeRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));
|
|
5757
5775
|
const interfaceActionTypeConstraintMappings = Object.fromEntries(Array.from(ridGenerator.getInterfaceActionTypeConstraintRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));
|
|
5758
5776
|
const interfaceParameterConstraintMappings = Object.fromEntries(Array.from(ridGenerator.getInterfaceParameterConstraintRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));
|
|
5759
5777
|
const backingDatasourceMappings = Object.fromEntries([...ridGenerator.getDatasourceLocators().entries(), ...ridGenerator.getDirectDatasourceLocators().entries()].map(([readableId, locator]) => [ridGenerator.toBlockInternalId(readableId), locator]));
|
|
5760
5778
|
const filesDatasourceMappings = Object.fromEntries(Array.from(ridGenerator.getFilesDatasourceLocators().entries()).map(([readableId, locator]) => [ridGenerator.toBlockInternalId(readableId), locator]));
|
|
5761
5779
|
const objectTypeRids = Object.fromEntries(Array.from(ridGenerator.getObjectTypeRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));
|
|
5762
|
-
const objectTypeIds = Object.fromEntries(ontologiesToScan.flatMap((ont) => Object.entries(ont[maker.OntologyEntityTypeEnum.OBJECT_TYPE]).map(([objectTypeApiName, objectType]) => [ridGenerator.generateObjectTypeId(objectTypeApiName), ridGenerator.toBlockInternalId(
|
|
5780
|
+
const objectTypeIds = Object.fromEntries(ontologiesToScan.flatMap((ont) => Object.entries(ont[maker.OntologyEntityTypeEnum.OBJECT_TYPE]).map(([objectTypeApiName, objectType]) => [ridGenerator.generateObjectTypeId(objectTypeApiName), ridGenerator.toBlockInternalId(chunkY53H6FV7_cjs.ReadableIdGenerator.getForObjectType(objectTypeApiName))])));
|
|
5763
5781
|
const propertyTypeIds = {};
|
|
5764
5782
|
const objectPropertyTypeIdsToRids = {};
|
|
5765
5783
|
const structFieldRidsToApiNames = {};
|
|
@@ -5769,7 +5787,7 @@ function buildKnownIdentifiers(ontology, objectTypes, ridGenerator, ontologiesTo
|
|
|
5769
5787
|
const propertyTypeIdsToRids = {};
|
|
5770
5788
|
(objectType.properties ?? []).forEach((property) => {
|
|
5771
5789
|
const propertyTypeRid = ridGenerator.generatePropertyRid(property.apiName, objectTypeApiName);
|
|
5772
|
-
propMap[property.apiName] = ridGenerator.toBlockInternalId(
|
|
5790
|
+
propMap[property.apiName] = ridGenerator.toBlockInternalId(chunkY53H6FV7_cjs.ReadableIdGenerator.getForObjectProperty(objectTypeApiName, property.apiName));
|
|
5773
5791
|
propertyTypeIdsToRids[property.apiName] = propertyTypeRid;
|
|
5774
5792
|
if (typeof property.type === "object" && property.type.type === "struct") {
|
|
5775
5793
|
structFieldRidsToApiNames[propertyTypeRid] = Object.fromEntries(Object.keys(property.type.structDefinition).map((structFieldApiName) => [ridGenerator.generateStructFieldRid(property.apiName, structFieldApiName), structFieldApiName]));
|
|
@@ -5784,7 +5802,7 @@ function buildKnownIdentifiers(ontology, objectTypes, ridGenerator, ontologiesTo
|
|
|
5784
5802
|
const datasourceColumns = Object.fromEntries([...ridGenerator.getColumnShapes().entries(), ...ridGenerator.getDirectDatasourceColumnShapes().entries()].map(([readableId, shape]) => [ridGenerator.toBlockInternalId(readableId), shape]));
|
|
5785
5803
|
const timeSeriesSyncs = Object.fromEntries(Array.from(ridGenerator.getTimeSeriesSyncs().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));
|
|
5786
5804
|
const geotimeSeriesSyncs = Object.fromEntries(Array.from(ridGenerator.getGeotimeSeriesIntegrationRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));
|
|
5787
|
-
const linkTypeIds = Object.fromEntries(ontologiesToScan.flatMap((ont) => Object.keys(ont[maker.OntologyEntityTypeEnum.LINK_TYPE]).map((linkTypeId) => [maker.cleanAndValidateLinkTypeId(linkTypeId), ridGenerator.toBlockInternalId(
|
|
5805
|
+
const linkTypeIds = Object.fromEntries(ontologiesToScan.flatMap((ont) => Object.keys(ont[maker.OntologyEntityTypeEnum.LINK_TYPE]).map((linkTypeId) => [maker.cleanAndValidateLinkTypeId(linkTypeId), ridGenerator.toBlockInternalId(chunkY53H6FV7_cjs.ReadableIdGenerator.getForLinkType(maker.cleanAndValidateLinkTypeId(linkTypeId)))])));
|
|
5788
5806
|
const linkTypeRids = Object.fromEntries(Array.from(ridGenerator.getLinkTypeRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));
|
|
5789
5807
|
const actionTypeMappings = Object.fromEntries(Array.from(ridGenerator.getActionTypeRids().inverse().entries()).map(([rid, readableId]) => [rid, ridGenerator.toBlockInternalId(readableId)]));
|
|
5790
5808
|
const actionParameterMappings = {};
|
|
@@ -5855,10 +5873,22 @@ function buildKnownIdentifiers(ontology, objectTypes, ridGenerator, ontologiesTo
|
|
|
5855
5873
|
const key = `${markingId}-${markingType}`;
|
|
5856
5874
|
if (seenMarkings.has(key)) return;
|
|
5857
5875
|
seenMarkings.add(key);
|
|
5858
|
-
const readableId =
|
|
5876
|
+
const readableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForMarking(markingId, markingType);
|
|
5859
5877
|
const blockInternalId = ridGenerator.toBlockInternalId(readableId);
|
|
5860
5878
|
markingsMappings[blockInternalId] = [markingId];
|
|
5861
5879
|
});
|
|
5880
|
+
for (const object of Object.values(ontology[maker.OntologyEntityTypeEnum.OBJECT_TYPE])) {
|
|
5881
|
+
for (const property of object.properties ?? []) {
|
|
5882
|
+
const markings = property.backingMediaSetMarkings ?? {};
|
|
5883
|
+
if (Object.keys(markings).length > 0) {
|
|
5884
|
+
const {
|
|
5885
|
+
readableId,
|
|
5886
|
+
placeholderMarkings
|
|
5887
|
+
} = getMediaSetMarkings(markings);
|
|
5888
|
+
markingsMappings[ridGenerator.toBlockInternalId(readableId)] = placeholderMarkings;
|
|
5889
|
+
}
|
|
5890
|
+
}
|
|
5891
|
+
}
|
|
5862
5892
|
return {
|
|
5863
5893
|
actionParameterIds: actionParameterIdMappings,
|
|
5864
5894
|
actionParameters: actionParameterMappings,
|
|
@@ -5901,10 +5931,10 @@ function getInterfacePropertyMappings(interfaces, ridGenerator) {
|
|
|
5901
5931
|
for (const [iptRid, property] of Object.entries(iface.propertiesV3)) {
|
|
5902
5932
|
let readableId;
|
|
5903
5933
|
if (property.type === "interfaceDefinedPropertyType") {
|
|
5904
|
-
readableId =
|
|
5934
|
+
readableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForInterfaceProperty(iface.apiName, property.interfaceDefinedPropertyType.apiName);
|
|
5905
5935
|
} else {
|
|
5906
5936
|
const sptApiName = property.sharedPropertyBasedPropertyType.sharedPropertyType.apiName;
|
|
5907
|
-
readableId = multiInterfaceSptApiNames.has(sptApiName) ?
|
|
5937
|
+
readableId = multiInterfaceSptApiNames.has(sptApiName) ? chunkY53H6FV7_cjs.ReadableIdGenerator.getForSptBackedInterfaceProperty(sptApiName) : chunkY53H6FV7_cjs.ReadableIdGenerator.getForSptBackedInterfaceProperty(iface.apiName, sptApiName);
|
|
5908
5938
|
}
|
|
5909
5939
|
mappings[iptRid] = ridGenerator.toBlockInternalId(readableId);
|
|
5910
5940
|
}
|
|
@@ -5917,7 +5947,7 @@ function getImportedInterfacePropertyMappings(importedOntologies, ridGenerator)
|
|
|
5917
5947
|
for (const [interfaceApiName, interfaceType] of Object.entries(ontology[maker.OntologyEntityTypeEnum.INTERFACE_TYPE])) {
|
|
5918
5948
|
for (const [propertyApiName, property] of Object.entries(interfaceType.propertiesV3)) {
|
|
5919
5949
|
if (maker.isInterfaceSharedPropertyType(property)) continue;
|
|
5920
|
-
const readableId =
|
|
5950
|
+
const readableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForInterfaceProperty(interfaceApiName, propertyApiName);
|
|
5921
5951
|
const interfacePropertyTypeRid = ridGenerator.generateInterfacePropertyTypeRid(propertyApiName, interfaceApiName);
|
|
5922
5952
|
mappings[interfacePropertyTypeRid] = ridGenerator.toBlockInternalId(readableId);
|
|
5923
5953
|
}
|
|
@@ -6003,7 +6033,7 @@ function convertOntologyDefinition(ontology, ridGenerator, functionsIr, randomne
|
|
|
6003
6033
|
SHARED_PROPERTY_TYPE: {},
|
|
6004
6034
|
VALUE_TYPE: {}
|
|
6005
6035
|
};
|
|
6006
|
-
const throwawayRidGenerator = new
|
|
6036
|
+
const throwawayRidGenerator = new chunkY53H6FV7_cjs.OntologyRidGeneratorImpl(maker.getImportedTypes(), randomnessKey);
|
|
6007
6037
|
const transitiveImportedOntology = convertOntologyDefinitionToWireBlockData(transitiveOntology, throwawayRidGenerator);
|
|
6008
6038
|
const valueTypes = convertValueTypeToWireBlockData(ontology, ridGenerator);
|
|
6009
6039
|
const importedValueTypeBlocks = convertValueTypeToWireBlockData(importedTypes, ridGenerator);
|
|
@@ -6259,8 +6289,8 @@ function extractImportedInterfaceTypes(importedBlockData, ridGenerator, blockSha
|
|
|
6259
6289
|
const knownIdentifiers = importedBlockData.knownIdentifiers;
|
|
6260
6290
|
for (const [_rid, interfaceTypeBlock] of Object.entries(importedBlockData.interfaceTypes)) {
|
|
6261
6291
|
const interfaceType = interfaceTypeBlock.interfaceType;
|
|
6262
|
-
const interfaceReadableId =
|
|
6263
|
-
const properties = Object.values(interfaceType.propertiesV2 ?? {}).map((propEntry) => ridGenerator.toBlockInternalId(
|
|
6292
|
+
const interfaceReadableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForInterface(interfaceType.apiName);
|
|
6293
|
+
const properties = Object.values(interfaceType.propertiesV2 ?? {}).map((propEntry) => ridGenerator.toBlockInternalId(chunkY53H6FV7_cjs.ReadableIdGenerator.getForSpt(propEntry.sharedPropertyType.apiName)));
|
|
6264
6294
|
const propertiesV2 = [];
|
|
6265
6295
|
for (const [propertyRid, property] of Object.entries(interfaceType.propertiesV3 ?? {})) {
|
|
6266
6296
|
if (property.type !== "interfaceDefinedPropertyType") continue;
|
|
@@ -6304,7 +6334,7 @@ function extractImportedInterfaceTypes(importedBlockData, ridGenerator, blockSha
|
|
|
6304
6334
|
}
|
|
6305
6335
|
for (const [_sptRid, propEntry] of Object.entries(interfaceType.propertiesV2 ?? {})) {
|
|
6306
6336
|
const spt = propEntry.sharedPropertyType;
|
|
6307
|
-
const sptReadableId =
|
|
6337
|
+
const sptReadableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForSpt(spt.apiName);
|
|
6308
6338
|
if (blockShapes.inputShapes.has(sptReadableId)) continue;
|
|
6309
6339
|
blockShapes.inputShapes.set(sptReadableId, {
|
|
6310
6340
|
type: "sharedPropertyType",
|
|
@@ -6346,7 +6376,7 @@ function extractImportedInterfaceTypes(importedBlockData, ridGenerator, blockSha
|
|
|
6346
6376
|
addApiNamePreset(blockShapes, propReadableId, property.interfaceDefinedPropertyType.apiName);
|
|
6347
6377
|
}
|
|
6348
6378
|
for (const interfaceLinkType of interfaceType.links ?? []) {
|
|
6349
|
-
const linkReadableId =
|
|
6379
|
+
const linkReadableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForInterfaceLinkType(interfaceType.apiName, interfaceLinkType.metadata.apiName);
|
|
6350
6380
|
const linkedInterfaceRid = interfaceLinkType.linkedEntityTypeId.type === "interfaceType" ? interfaceLinkType.linkedEntityTypeId.interfaceType : void 0;
|
|
6351
6381
|
const linkedReadableId = linkedInterfaceRid ? ridGenerator.getInterfaceRids().inverse().get(linkedInterfaceRid) : void 0;
|
|
6352
6382
|
const linkedEntityTypeRef = linkedReadableId ? {
|
|
@@ -6368,10 +6398,10 @@ function extractImportedInterfaceTypes(importedBlockData, ridGenerator, blockSha
|
|
|
6368
6398
|
addApiNamePreset(blockShapes, linkReadableId, interfaceLinkType.metadata.apiName);
|
|
6369
6399
|
}
|
|
6370
6400
|
for (const actionTypeConstraint of interfaceType.actionTypeConstraints ?? []) {
|
|
6371
|
-
const constraintReadableId =
|
|
6401
|
+
const constraintReadableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForInterfaceActionTypeConstraint(interfaceType.apiName, actionTypeConstraint.metadata.apiName);
|
|
6372
6402
|
const parameterConstraintRefs = Object.entries(actionTypeConstraint.parameters ?? {}).map(([paramRid, paramConstraint]) => {
|
|
6373
6403
|
const paramDisplayApiName = paramConstraint.displayMetadata.apiName;
|
|
6374
|
-
return ridGenerator.toBlockInternalId(
|
|
6404
|
+
return ridGenerator.toBlockInternalId(chunkY53H6FV7_cjs.ReadableIdGenerator.getForInterfaceParameterConstraint(interfaceType.apiName, actionTypeConstraint.metadata.apiName, paramDisplayApiName));
|
|
6375
6405
|
});
|
|
6376
6406
|
const constraintInputShape = {
|
|
6377
6407
|
about: createLocalizedAbout4(actionTypeConstraint.metadata.displayName, actionTypeConstraint.metadata.description ?? actionTypeConstraint.metadata.displayName),
|
|
@@ -6386,7 +6416,7 @@ function extractImportedInterfaceTypes(importedBlockData, ridGenerator, blockSha
|
|
|
6386
6416
|
addApiNamePreset(blockShapes, constraintReadableId, actionTypeConstraint.metadata.apiName);
|
|
6387
6417
|
for (const [paramRid, paramConstraint] of Object.entries(actionTypeConstraint.parameters ?? {})) {
|
|
6388
6418
|
const paramDisplayApiName = paramConstraint.displayMetadata.apiName;
|
|
6389
|
-
const paramReadableId =
|
|
6419
|
+
const paramReadableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForInterfaceParameterConstraint(interfaceType.apiName, actionTypeConstraint.metadata.apiName, paramDisplayApiName);
|
|
6390
6420
|
const paramInputShape = {
|
|
6391
6421
|
about: createLocalizedAbout4(paramConstraint.displayMetadata.displayName, paramConstraint.displayMetadata.displayName),
|
|
6392
6422
|
actionTypeConstraint: ridGenerator.toBlockInternalId(constraintReadableId),
|
|
@@ -6406,7 +6436,7 @@ function extractImportedInterfaceTypes(importedBlockData, ridGenerator, blockSha
|
|
|
6406
6436
|
function extractImportedSharedPropertyTypes(importedBlockData, ridGenerator, blockShapes, externalImportedMetadata) {
|
|
6407
6437
|
for (const [_rid, sptBlock] of Object.entries(importedBlockData.sharedPropertyTypes)) {
|
|
6408
6438
|
const spt = sptBlock.sharedPropertyType;
|
|
6409
|
-
const readableId =
|
|
6439
|
+
const readableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForSpt(spt.apiName);
|
|
6410
6440
|
const inputShape = {
|
|
6411
6441
|
about: createLocalizedAbout4(spt.displayMetadata.displayName, spt.displayMetadata.description ?? ""),
|
|
6412
6442
|
type: {
|
|
@@ -6431,9 +6461,9 @@ function extractImportedSharedPropertyTypes(importedBlockData, ridGenerator, blo
|
|
|
6431
6461
|
function extractImportedActionTypes(importedBlockData, ridGenerator, blockShapes, externalImportedMetadata) {
|
|
6432
6462
|
for (const [_rid, actionTypeBlock] of Object.entries(importedBlockData.actionTypes ?? {})) {
|
|
6433
6463
|
const actionApiName = actionTypeBlock.actionType.metadata.apiName;
|
|
6434
|
-
const actionReadableId =
|
|
6464
|
+
const actionReadableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForActionType(actionApiName);
|
|
6435
6465
|
const parametersV2 = Object.entries(actionTypeBlock.parameterIds ?? {}).map(([_key, parameterId]) => {
|
|
6436
|
-
const paramReadableId =
|
|
6466
|
+
const paramReadableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForParameter(actionApiName, parameterId);
|
|
6437
6467
|
return ridGenerator.toBlockInternalId(paramReadableId);
|
|
6438
6468
|
});
|
|
6439
6469
|
const actionShape = {
|
|
@@ -6465,7 +6495,7 @@ function extractImportedActionTypes(importedBlockData, ridGenerator, blockShapes
|
|
|
6465
6495
|
if (parameters) {
|
|
6466
6496
|
const converter = new ImportedBaseParameterTypeConverter(importedBlockData.knownIdentifiers.objectTypeIds, importedBlockData.knownIdentifiers.interfaceTypes);
|
|
6467
6497
|
for (const [parameterId, parameter] of Object.entries(parameters)) {
|
|
6468
|
-
const paramReadableId =
|
|
6498
|
+
const paramReadableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForParameter(actionApiName, parameterId);
|
|
6469
6499
|
const parameterShape = {
|
|
6470
6500
|
about: createLocalizedAbout4(parameter.displayMetadata.displayName, parameter.displayMetadata.description),
|
|
6471
6501
|
type: converter.convert(parameter.type),
|
|
@@ -6646,11 +6676,11 @@ function resolveFolderDefinitions(definitions, ontology) {
|
|
|
6646
6676
|
}
|
|
6647
6677
|
function getOntologyFolders(folders, outputShapes) {
|
|
6648
6678
|
const getReadableId = {
|
|
6649
|
-
OBJECT_TYPE:
|
|
6650
|
-
INTERFACE_TYPE:
|
|
6651
|
-
SHARED_PROPERTY_TYPE:
|
|
6652
|
-
ACTION_TYPE:
|
|
6653
|
-
LINK_TYPE: (apiName) =>
|
|
6679
|
+
OBJECT_TYPE: chunkY53H6FV7_cjs.ReadableIdGenerator.getForObjectType,
|
|
6680
|
+
INTERFACE_TYPE: chunkY53H6FV7_cjs.ReadableIdGenerator.getForInterface,
|
|
6681
|
+
SHARED_PROPERTY_TYPE: chunkY53H6FV7_cjs.ReadableIdGenerator.getForSpt,
|
|
6682
|
+
ACTION_TYPE: chunkY53H6FV7_cjs.ReadableIdGenerator.getForActionType,
|
|
6683
|
+
LINK_TYPE: (apiName) => chunkY53H6FV7_cjs.ReadableIdGenerator.getForLinkType(maker.cleanAndValidateLinkTypeId(apiName))
|
|
6654
6684
|
};
|
|
6655
6685
|
const ontologyFolders = folders.map(({
|
|
6656
6686
|
id,
|
|
@@ -6673,7 +6703,7 @@ function getFolderLocationInputs(folders) {
|
|
|
6673
6703
|
};
|
|
6674
6704
|
for (const folder of folders) {
|
|
6675
6705
|
if (folder.outputIds.length === 0 || folder.location === "/") continue;
|
|
6676
|
-
const inputId =
|
|
6706
|
+
const inputId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForCompassFolder(folder.id);
|
|
6677
6707
|
for (const outputId of folder.outputIds) {
|
|
6678
6708
|
result.outputToLocationInput.set(outputId, inputId);
|
|
6679
6709
|
}
|
|
@@ -6706,7 +6736,7 @@ function getFolderLocationInputs(folders) {
|
|
|
6706
6736
|
});
|
|
6707
6737
|
result.inputMappings.push({
|
|
6708
6738
|
input: inputId,
|
|
6709
|
-
output:
|
|
6739
|
+
output: chunkY53H6FV7_cjs.ReadableIdGenerator.getForCompassFolderOutput(folder.id)
|
|
6710
6740
|
});
|
|
6711
6741
|
}
|
|
6712
6742
|
return result;
|
|
@@ -6752,8 +6782,8 @@ function buildFolderTree(folderDefinitions, randomnessKey) {
|
|
|
6752
6782
|
const {
|
|
6753
6783
|
id
|
|
6754
6784
|
} = foldersByLocation.get(location);
|
|
6755
|
-
const outputReadableId =
|
|
6756
|
-
const outputShapeId =
|
|
6785
|
+
const outputReadableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForCompassFolderOutput(id);
|
|
6786
|
+
const outputShapeId = chunkY53H6FV7_cjs.toBlockShapeId(outputReadableId, randomnessKey);
|
|
6757
6787
|
return {
|
|
6758
6788
|
id,
|
|
6759
6789
|
location,
|
|
@@ -6777,10 +6807,10 @@ function generateFolderBlockResults(folderDefinitions, buildDir, randomnessKey)
|
|
|
6777
6807
|
const addOn = {
|
|
6778
6808
|
idToBlockShapeId: {
|
|
6779
6809
|
[COMPASS_FOLDER_INTERNAL_SHAPE_ID]: folder.outputShapeId,
|
|
6780
|
-
...Object.fromEntries(Array.from(folderLocations.inputShapes.keys(), (input) => [input,
|
|
6810
|
+
...Object.fromEntries(Array.from(folderLocations.inputShapes.keys(), (input) => [input, chunkY53H6FV7_cjs.toBlockShapeId(input, randomnessKey)]))
|
|
6781
6811
|
},
|
|
6782
6812
|
idToInputGroupId: {},
|
|
6783
|
-
outputToLocationInput: Object.fromEntries(Array.from(folderLocations.outputToLocationInput, ([output, input]) => [
|
|
6813
|
+
outputToLocationInput: Object.fromEntries(Array.from(folderLocations.outputToLocationInput, ([output, input]) => [chunkY53H6FV7_cjs.toBlockShapeId(output, randomnessKey), input]))
|
|
6784
6814
|
};
|
|
6785
6815
|
const blockDataDirectory = path6__namespace.resolve(buildDir, folder.blockIdentifier);
|
|
6786
6816
|
await fs__namespace.mkdir(blockDataDirectory, {
|
|
@@ -6841,7 +6871,7 @@ async function defineOntologyV2(ns, body, outputDir, dependencyFile, functionsIr
|
|
|
6841
6871
|
if (functionsIrFile) {
|
|
6842
6872
|
functionsIr = JSON.parse(fs7__namespace.readFileSync(functionsIrFile, "utf-8"));
|
|
6843
6873
|
}
|
|
6844
|
-
const ridGenerator = new
|
|
6874
|
+
const ridGenerator = new chunkY53H6FV7_cjs.OntologyRidGeneratorImpl(importedTypes, randomnessKey);
|
|
6845
6875
|
const ontologyIr = convertOntologyDefinition(ontologyDefinition, ridGenerator, functionsIr, randomnessKey, packagingOptions.targetEnvironment === "EDGE");
|
|
6846
6876
|
const shapes = await getShapes(ontologyIr.ontology, ridGenerator, functionsIr, randomnessKey);
|
|
6847
6877
|
const folders = getOntologyFolders(folderDefinitions, shapes.outputShapes);
|
|
@@ -6866,17 +6896,50 @@ async function defineOntologyV2(ns, body, outputDir, dependencyFile, functionsIr
|
|
|
6866
6896
|
const lt = link;
|
|
6867
6897
|
return "many" in lt && !("intermediaryObjectType" in lt) && lt.includeEmptyBackingDatasource === true;
|
|
6868
6898
|
}).map(([apiName]) => apiName);
|
|
6869
|
-
const
|
|
6899
|
+
const backingMediaSetMarkings = Object.fromEntries(Object.values(ontologyDefinition[maker.OntologyEntityTypeEnum.OBJECT_TYPE]).flatMap((ontologyEntity) => {
|
|
6870
6900
|
const objectType = ontologyEntity;
|
|
6871
6901
|
return (objectType.properties ?? []).filter(({
|
|
6872
6902
|
includeEmptyBackingMediaSet
|
|
6873
6903
|
}) => includeEmptyBackingMediaSet === true).map(({
|
|
6874
|
-
apiName
|
|
6875
|
-
|
|
6876
|
-
|
|
6904
|
+
apiName,
|
|
6905
|
+
backingMediaSetMarkings: backingMediaSetMarkings2
|
|
6906
|
+
}) => [`${objectType.apiName}.${apiName}`, backingMediaSetMarkings2 ?? {}]);
|
|
6907
|
+
}));
|
|
6908
|
+
const backingMediaSetNames = Object.keys(backingMediaSetMarkings);
|
|
6909
|
+
for (const object of Object.values(ontologyDefinition[maker.OntologyEntityTypeEnum.OBJECT_TYPE])) {
|
|
6910
|
+
for (const property of object.properties ?? []) {
|
|
6911
|
+
const markings = property.backingMediaSetMarkings ?? {};
|
|
6912
|
+
const groups = Object.keys(markings).sort();
|
|
6913
|
+
if (groups.length > 0) {
|
|
6914
|
+
const {
|
|
6915
|
+
readableId,
|
|
6916
|
+
shapeTypes
|
|
6917
|
+
} = getMediaSetMarkings(markings);
|
|
6918
|
+
const existing = shapes.inputShapes.get(readableId);
|
|
6919
|
+
const affectedShape = ridGenerator.toBlockInternalId(chunkY53H6FV7_cjs.ReadableIdGenerator.getForObjectProperty(object.apiName, property.apiName));
|
|
6920
|
+
shapes.inputShapes.set(readableId, {
|
|
6921
|
+
type: "markings",
|
|
6922
|
+
markings: {
|
|
6923
|
+
...existing?.type === "markings" ? existing.markings : {
|
|
6924
|
+
about: {
|
|
6925
|
+
fallbackTitle: `Assumed media markings ${groups.join(", ")}`,
|
|
6926
|
+
fallbackDescription: "",
|
|
6927
|
+
localizedTitle: {},
|
|
6928
|
+
localizedDescription: {}
|
|
6929
|
+
},
|
|
6930
|
+
...shapeTypes,
|
|
6931
|
+
stableId: groups.join(",")
|
|
6932
|
+
},
|
|
6933
|
+
operation: "DECLASSIFY",
|
|
6934
|
+
affectedShapes: [.../* @__PURE__ */ new Set([...existing?.type === "markings" ? existing.markings.affectedShapes : [], affectedShape])]
|
|
6935
|
+
}
|
|
6936
|
+
});
|
|
6937
|
+
}
|
|
6938
|
+
}
|
|
6939
|
+
}
|
|
6877
6940
|
const explicitMediaSetNames = Object.values(ontologyDefinition[maker.OntologyEntityTypeEnum.OBJECT_TYPE]).flatMap((object) => (object.properties ?? []).flatMap((property) => property.reference?.sources.map((source) => source.apiName) ?? []));
|
|
6878
6941
|
for (const mediaSetName of [...backingMediaSetNames, ...explicitMediaSetNames]) {
|
|
6879
|
-
shapes.inputShapeMetadata.set(
|
|
6942
|
+
shapes.inputShapeMetadata.set(chunkY53H6FV7_cjs.ReadableIdGenerator.getForMediaSetView(mediaSetName), {
|
|
6880
6943
|
isOptional: false,
|
|
6881
6944
|
isAccessedInReconcile: true,
|
|
6882
6945
|
reconcileAccessRequirements: "RESOURCE_EXISTENCE_REQUIRED"
|
|
@@ -6904,6 +6967,7 @@ async function defineOntologyV2(ns, body, outputDir, dependencyFile, functionsIr
|
|
|
6904
6967
|
backingDatasourceApiNames,
|
|
6905
6968
|
backingDatasourceLinkApiNames,
|
|
6906
6969
|
backingMediaSetNames,
|
|
6970
|
+
backingMediaSetMarkings,
|
|
6907
6971
|
folders
|
|
6908
6972
|
};
|
|
6909
6973
|
}
|
|
@@ -6944,14 +7008,14 @@ function getExternalRecommendationsForType(items, getApiName, getReadableId, pac
|
|
|
6944
7008
|
}));
|
|
6945
7009
|
}
|
|
6946
7010
|
function externalRecsForInterfaces(importedOntology) {
|
|
6947
|
-
return getExternalRecommendationsForType(Object.values(importedOntology.interfaceTypes), (i) => i.interfaceType.apiName, (apiName) =>
|
|
7011
|
+
return getExternalRecommendationsForType(Object.values(importedOntology.interfaceTypes), (i) => i.interfaceType.apiName, (apiName) => chunkY53H6FV7_cjs.ReadableIdGenerator.getForInterface(apiName));
|
|
6948
7012
|
}
|
|
6949
7013
|
function externalRecsForInterfaceProperties(importedOntology) {
|
|
6950
7014
|
const results = [];
|
|
6951
7015
|
for (const interfaceBlock of Object.values(importedOntology.interfaceTypes)) {
|
|
6952
7016
|
const interfaceApiName = interfaceBlock.interfaceType.apiName;
|
|
6953
7017
|
const interfaceDefinedProperties = Object.values(interfaceBlock.interfaceType.propertiesV3 ?? {}).filter((property) => property.type === "interfaceDefinedPropertyType");
|
|
6954
|
-
results.push(...getExternalRecommendationsForType(interfaceDefinedProperties, (property) => property.interfaceDefinedPropertyType.apiName, (propertyApiName) =>
|
|
7018
|
+
results.push(...getExternalRecommendationsForType(interfaceDefinedProperties, (property) => property.interfaceDefinedPropertyType.apiName, (propertyApiName) => chunkY53H6FV7_cjs.ReadableIdGenerator.getForInterfaceProperty(interfaceApiName, propertyApiName), getPackage(interfaceApiName)));
|
|
6955
7019
|
}
|
|
6956
7020
|
return results;
|
|
6957
7021
|
}
|
|
@@ -6960,7 +7024,7 @@ function externalRecsForInterfaceLinks(importedOntology) {
|
|
|
6960
7024
|
for (const interfaceBlock of Object.values(importedOntology.interfaceTypes)) {
|
|
6961
7025
|
const interfaceApiName = interfaceBlock.interfaceType.apiName;
|
|
6962
7026
|
const links = interfaceBlock.interfaceType.links ?? [];
|
|
6963
|
-
results.push(...getExternalRecommendationsForType(links, (link) => link.metadata.apiName, (linkApiName) =>
|
|
7027
|
+
results.push(...getExternalRecommendationsForType(links, (link) => link.metadata.apiName, (linkApiName) => chunkY53H6FV7_cjs.ReadableIdGenerator.getForInterfaceLinkType(interfaceApiName, linkApiName), getPackage(interfaceApiName)));
|
|
6964
7028
|
}
|
|
6965
7029
|
return results;
|
|
6966
7030
|
}
|
|
@@ -6969,7 +7033,7 @@ function externalRecsForInterfaceActionTypeConstraints(importedOntology) {
|
|
|
6969
7033
|
for (const interfaceBlock of Object.values(importedOntology.interfaceTypes)) {
|
|
6970
7034
|
const interfaceApiName = interfaceBlock.interfaceType.apiName;
|
|
6971
7035
|
const constraints = interfaceBlock.interfaceType.actionTypeConstraints ?? [];
|
|
6972
|
-
results.push(...getExternalRecommendationsForType(constraints, (constraint) => constraint.metadata.apiName, (constraintApiName) =>
|
|
7036
|
+
results.push(...getExternalRecommendationsForType(constraints, (constraint) => constraint.metadata.apiName, (constraintApiName) => chunkY53H6FV7_cjs.ReadableIdGenerator.getForInterfaceActionTypeConstraint(interfaceApiName, constraintApiName), getPackage(interfaceApiName)));
|
|
6973
7037
|
}
|
|
6974
7038
|
return results;
|
|
6975
7039
|
}
|
|
@@ -6978,7 +7042,7 @@ function externalRecsForInterfaceParameterConstraints(importedOntology) {
|
|
|
6978
7042
|
for (const interfaceBlock of Object.values(importedOntology.interfaceTypes)) {
|
|
6979
7043
|
const interfaceApiName = interfaceBlock.interfaceType.apiName;
|
|
6980
7044
|
for (const constraint of interfaceBlock.interfaceType.actionTypeConstraints ?? []) {
|
|
6981
|
-
results.push(...getExternalRecommendationsForType(Object.values(constraint.parameters ?? {}), (parameter) => parameter.displayMetadata.apiName, (parameterApiName) =>
|
|
7045
|
+
results.push(...getExternalRecommendationsForType(Object.values(constraint.parameters ?? {}), (parameter) => parameter.displayMetadata.apiName, (parameterApiName) => chunkY53H6FV7_cjs.ReadableIdGenerator.getForInterfaceParameterConstraint(interfaceApiName, constraint.metadata.apiName, parameterApiName), getPackage(interfaceApiName)));
|
|
6982
7046
|
}
|
|
6983
7047
|
}
|
|
6984
7048
|
return results;
|
|
@@ -6995,10 +7059,10 @@ function externalRecsForSpts(importedOntology) {
|
|
|
6995
7059
|
}
|
|
6996
7060
|
}
|
|
6997
7061
|
}
|
|
6998
|
-
return getExternalRecommendationsForType(sptApiNames, (apiName) => apiName, (apiName) =>
|
|
7062
|
+
return getExternalRecommendationsForType(sptApiNames, (apiName) => apiName, (apiName) => chunkY53H6FV7_cjs.ReadableIdGenerator.getForSpt(apiName));
|
|
6999
7063
|
}
|
|
7000
7064
|
function externalRecsForObjects(importedOntology) {
|
|
7001
|
-
return getExternalRecommendationsForType(Object.values(importedOntology.objectTypes).filter((o) => o.objectType.apiName != null), (o) => o.objectType.apiName, (apiName) =>
|
|
7065
|
+
return getExternalRecommendationsForType(Object.values(importedOntology.objectTypes).filter((o) => o.objectType.apiName != null), (o) => o.objectType.apiName, (apiName) => chunkY53H6FV7_cjs.ReadableIdGenerator.getForObjectType(apiName));
|
|
7002
7066
|
}
|
|
7003
7067
|
function externalRecsForProperties(importedOntology) {
|
|
7004
7068
|
const results = [];
|
|
@@ -7006,15 +7070,15 @@ function externalRecsForProperties(importedOntology) {
|
|
|
7006
7070
|
const objectApiName = objectBlock.objectType.apiName;
|
|
7007
7071
|
if (objectApiName == null) continue;
|
|
7008
7072
|
const properties = Object.values(objectBlock.objectType.propertyTypes).filter((p) => p.apiName != null);
|
|
7009
|
-
results.push(...getExternalRecommendationsForType(properties, (p) => p.apiName, (propApiName) =>
|
|
7073
|
+
results.push(...getExternalRecommendationsForType(properties, (p) => p.apiName, (propApiName) => chunkY53H6FV7_cjs.ReadableIdGenerator.getForObjectProperty(objectApiName, propApiName), getPackage(objectApiName)));
|
|
7010
7074
|
}
|
|
7011
7075
|
return results;
|
|
7012
7076
|
}
|
|
7013
7077
|
function externalRecsForLinks(importedOntology) {
|
|
7014
|
-
return getExternalRecommendationsForType(Object.values(importedOntology.linkTypes), (l) => l.linkType.id, (id) =>
|
|
7078
|
+
return getExternalRecommendationsForType(Object.values(importedOntology.linkTypes), (l) => l.linkType.id, (id) => chunkY53H6FV7_cjs.ReadableIdGenerator.getForLinkType(id));
|
|
7015
7079
|
}
|
|
7016
7080
|
function externalRecsForActions(importedOntology) {
|
|
7017
|
-
return getExternalRecommendationsForType(Object.values(importedOntology.actionTypes), (a) => a.actionType.metadata.apiName, (apiName) =>
|
|
7081
|
+
return getExternalRecommendationsForType(Object.values(importedOntology.actionTypes), (a) => a.actionType.metadata.apiName, (apiName) => chunkY53H6FV7_cjs.ReadableIdGenerator.getForActionType(apiName));
|
|
7018
7082
|
}
|
|
7019
7083
|
function externalRecsForActionParams(importedOntology) {
|
|
7020
7084
|
const results = [];
|
|
@@ -7022,7 +7086,7 @@ function externalRecsForActionParams(importedOntology) {
|
|
|
7022
7086
|
const actionApiName = actionBlock.actionType.metadata.apiName;
|
|
7023
7087
|
const parameters = actionBlock.actionType.metadata.parameters;
|
|
7024
7088
|
if (!parameters) continue;
|
|
7025
|
-
results.push(...getExternalRecommendationsForType(Object.keys(parameters), (paramId) => paramId, (paramId) =>
|
|
7089
|
+
results.push(...getExternalRecommendationsForType(Object.keys(parameters), (paramId) => paramId, (paramId) => chunkY53H6FV7_cjs.ReadableIdGenerator.getForParameter(actionApiName, paramId), getPackage(actionApiName)));
|
|
7026
7090
|
}
|
|
7027
7091
|
return results;
|
|
7028
7092
|
}
|
|
@@ -7050,7 +7114,7 @@ function getConsumedValueTypes(importedTypes, inputShapes) {
|
|
|
7050
7114
|
}
|
|
7051
7115
|
for (const versions of Object.values(importedTypes.VALUE_TYPE)) {
|
|
7052
7116
|
for (const valueType of versions) {
|
|
7053
|
-
const consumedId =
|
|
7117
|
+
const consumedId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForConsumedValueType(valueType.apiName, valueType.version);
|
|
7054
7118
|
if (inputShapes.has(consumedId)) {
|
|
7055
7119
|
addReference(valueType);
|
|
7056
7120
|
}
|
|
@@ -7073,11 +7137,11 @@ function getValueTypeExternalRecommendations(producedValueTypes, importedTypes,
|
|
|
7073
7137
|
const results = [];
|
|
7074
7138
|
for (const [apiName, versions] of consumed) {
|
|
7075
7139
|
if (producedApiNames.has(apiName)) continue;
|
|
7076
|
-
const consumedVersions = versions.filter((version) => inputShapes.has(
|
|
7140
|
+
const consumedVersions = versions.filter((version) => inputShapes.has(chunkY53H6FV7_cjs.ReadableIdGenerator.getForConsumedValueType(apiName, version.version)));
|
|
7077
7141
|
if (consumedVersions.length === 0) continue;
|
|
7078
7142
|
const mappings = consumedVersions.map((v) => ({
|
|
7079
|
-
targetInputReadableId:
|
|
7080
|
-
upstreamOutputReadableId:
|
|
7143
|
+
targetInputReadableId: chunkY53H6FV7_cjs.ReadableIdGenerator.getForConsumedValueType(apiName, v.version),
|
|
7144
|
+
upstreamOutputReadableId: chunkY53H6FV7_cjs.ReadableIdGenerator.getForProducedValueType(apiName, v.version)
|
|
7081
7145
|
}));
|
|
7082
7146
|
results.push({
|
|
7083
7147
|
upstreamPackageName: consumedVersions[0].packageNamespace,
|
|
@@ -7168,9 +7232,9 @@ function getBackingDatasetProperties(objectTypeBlockData) {
|
|
|
7168
7232
|
}
|
|
7169
7233
|
async function generateBackingDatasetBlock(datasetName, blockIdentifier, dirSuffix, columns, buildDir, randomnessKey, folder) {
|
|
7170
7234
|
const outputs = {};
|
|
7171
|
-
const datasourceReadableId =
|
|
7172
|
-
const columnReadableIds = columns.map((col) =>
|
|
7173
|
-
const datasourceBlockInternalId =
|
|
7235
|
+
const datasourceReadableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForDatasetOutput(datasetName);
|
|
7236
|
+
const columnReadableIds = columns.map((col) => chunkY53H6FV7_cjs.ReadableIdGenerator.getForDatasetColumnOutput(datasetName, col.name));
|
|
7237
|
+
const datasourceBlockInternalId = chunkY53H6FV7_cjs.toBlockShapeId(datasourceReadableId, randomnessKey);
|
|
7174
7238
|
outputs[datasourceReadableId] = {
|
|
7175
7239
|
type: "tabularDatasource",
|
|
7176
7240
|
tabularDatasource: {
|
|
@@ -7180,7 +7244,7 @@ async function generateBackingDatasetBlock(datasetName, blockIdentifier, dirSuff
|
|
|
7180
7244
|
localizedTitle: {},
|
|
7181
7245
|
localizedDescription: {}
|
|
7182
7246
|
},
|
|
7183
|
-
schema: columnReadableIds.map((id) =>
|
|
7247
|
+
schema: columnReadableIds.map((id) => chunkY53H6FV7_cjs.toBlockShapeId(id, randomnessKey)),
|
|
7184
7248
|
type: "DATASET",
|
|
7185
7249
|
buildRequirements: {
|
|
7186
7250
|
isBuildable: false
|
|
@@ -7208,21 +7272,21 @@ async function generateBackingDatasetBlock(datasetName, blockIdentifier, dirSuff
|
|
|
7208
7272
|
}
|
|
7209
7273
|
};
|
|
7210
7274
|
}
|
|
7211
|
-
const columnInternalIds = columns.map((col) =>
|
|
7275
|
+
const columnInternalIds = columns.map((col) => chunkY53H6FV7_cjs.toBlockShapeId(`column-internal-${datasetName}-${col.name}`, randomnessKey));
|
|
7212
7276
|
const folderLocations = getFolderLocationInputs(folder === void 0 ? [] : [{
|
|
7213
7277
|
...folder,
|
|
7214
7278
|
outputIds: [datasourceReadableId]
|
|
7215
7279
|
}]);
|
|
7216
|
-
const datasourceInternalId =
|
|
7280
|
+
const datasourceInternalId = chunkY53H6FV7_cjs.toBlockShapeId(`datasource-internal-${datasetName}`, randomnessKey);
|
|
7217
7281
|
const addOnOverride = {
|
|
7218
7282
|
idToBlockShapeId: {
|
|
7219
7283
|
"dataset-internal-shape-id": datasourceBlockInternalId,
|
|
7220
7284
|
[datasourceInternalId]: datasourceBlockInternalId,
|
|
7221
|
-
...Object.fromEntries(Array.from(folderLocations.inputShapes.keys(), (input) => [input,
|
|
7222
|
-
...Object.fromEntries(columnInternalIds.map((internalId, i) => [internalId,
|
|
7285
|
+
...Object.fromEntries(Array.from(folderLocations.inputShapes.keys(), (input) => [input, chunkY53H6FV7_cjs.toBlockShapeId(input, randomnessKey)])),
|
|
7286
|
+
...Object.fromEntries(columnInternalIds.map((internalId, i) => [internalId, chunkY53H6FV7_cjs.toBlockShapeId(columnReadableIds[i], randomnessKey)]))
|
|
7223
7287
|
},
|
|
7224
7288
|
idToInputGroupId: {},
|
|
7225
|
-
outputToLocationInput: Object.fromEntries(Array.from(folderLocations.outputToLocationInput, ([output, input]) => [
|
|
7289
|
+
outputToLocationInput: Object.fromEntries(Array.from(folderLocations.outputToLocationInput, ([output, input]) => [chunkY53H6FV7_cjs.toBlockShapeId(output, randomnessKey), input]))
|
|
7226
7290
|
};
|
|
7227
7291
|
const dsBlockDataDir = path6__namespace.join(buildDir, `temp_block_data_${dirSuffix}`);
|
|
7228
7292
|
await fs7__namespace.promises.mkdir(dsBlockDataDir, {
|
|
@@ -7307,14 +7371,14 @@ async function generateBackingDatasetBlockResultForLink(linkTypeBlockData, linkA
|
|
|
7307
7371
|
}], buildDir, randomnessKey, folder);
|
|
7308
7372
|
}
|
|
7309
7373
|
var MEDIA_SET_INTERNAL_SHAPE_ID = "media-set-internal-shape-id";
|
|
7310
|
-
async function generateBackingMediaSetBlockResult(mediaSetName, buildDir, randomnessKey) {
|
|
7374
|
+
async function generateBackingMediaSetBlockResult(mediaSetName, buildDir, randomnessKey, markings = {}) {
|
|
7311
7375
|
const blockIdentifier = `${mediaSetName}-backing-media-set`;
|
|
7312
|
-
const outputReadableId =
|
|
7376
|
+
const outputReadableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForMediaSetViewOutput(mediaSetName);
|
|
7313
7377
|
const compassReadableId = `${blockIdentifier}-compass-resource`;
|
|
7314
|
-
const outputBlockShapeId =
|
|
7315
|
-
const compassBlockShapeId =
|
|
7316
|
-
const mediaSetTemplateId =
|
|
7317
|
-
const blockDataDirectory = path6__namespace.join(buildDir, `temp_block_data_${
|
|
7378
|
+
const outputBlockShapeId = chunkY53H6FV7_cjs.toBlockShapeId(outputReadableId, randomnessKey);
|
|
7379
|
+
const compassBlockShapeId = chunkY53H6FV7_cjs.toBlockShapeId(compassReadableId, randomnessKey);
|
|
7380
|
+
const mediaSetTemplateId = chunkY53H6FV7_cjs.toBlockShapeId(`media-set-template-${mediaSetName}`, randomnessKey);
|
|
7381
|
+
const blockDataDirectory = path6__namespace.join(buildDir, `temp_block_data_${chunkY53H6FV7_cjs.toBlockShapeId(blockIdentifier, randomnessKey)}`);
|
|
7318
7382
|
await fs7__namespace.promises.rm(blockDataDirectory, {
|
|
7319
7383
|
force: true,
|
|
7320
7384
|
recursive: true
|
|
@@ -7346,6 +7410,32 @@ async function generateBackingMediaSetBlockResult(mediaSetName, buildDir, random
|
|
|
7346
7410
|
isAccessedInReconcile: true
|
|
7347
7411
|
}
|
|
7348
7412
|
};
|
|
7413
|
+
const groups = Object.keys(markings).sort();
|
|
7414
|
+
if (groups.length > 0) {
|
|
7415
|
+
const config = getMediaSetMarkings(markings);
|
|
7416
|
+
const readableId = `media-set-${mediaSetName}-${config.readableId}`;
|
|
7417
|
+
const markingShape = {
|
|
7418
|
+
about: createLocalizedAbout5(`Media set markings ${groups.join(", ")}`),
|
|
7419
|
+
operation: "USE",
|
|
7420
|
+
affectedShapes: [outputBlockShapeId],
|
|
7421
|
+
...config.shapeTypes,
|
|
7422
|
+
// Organization markings are inherited from the project, not applied to a media set directly.
|
|
7423
|
+
supportedMarkingsTypesV2: [...new Set(Object.values(markings))].sort().map((type) => type === "CBAC" ? "CBAC" : "MANDATORY_NOT_ORGANIZATION"),
|
|
7424
|
+
stableId: `media-set.${mediaSetName}.${groups.join(",")}`,
|
|
7425
|
+
shapeConstraints: {
|
|
7426
|
+
constraints: ["RESOURCE_MARKINGS"]
|
|
7427
|
+
}
|
|
7428
|
+
};
|
|
7429
|
+
inputs[readableId] = {
|
|
7430
|
+
type: "markings",
|
|
7431
|
+
markings: markingShape
|
|
7432
|
+
};
|
|
7433
|
+
inputShapeMetadata[readableId] = {
|
|
7434
|
+
isOptional: false,
|
|
7435
|
+
isAccessedInReconcile: true,
|
|
7436
|
+
reconcileAccessRequirements: "RESOURCE_EXISTENCE_REQUIRED"
|
|
7437
|
+
};
|
|
7438
|
+
}
|
|
7349
7439
|
const mediaSetOutput = {
|
|
7350
7440
|
about,
|
|
7351
7441
|
datasourceType: {
|
|
@@ -7459,9 +7549,9 @@ async function generateDirectDatasourceBlockResult(objectType, buildDir, randomn
|
|
|
7459
7549
|
if (objectTypeApiName == null) {
|
|
7460
7550
|
throw new Error("Direct datasource object type is missing an API name");
|
|
7461
7551
|
}
|
|
7462
|
-
const consumedDatasourceReadableId =
|
|
7463
|
-
const producedDatasourceReadableId =
|
|
7464
|
-
const producedDatasourceBlockShapeId =
|
|
7552
|
+
const consumedDatasourceReadableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForDataset(objectTypeApiName);
|
|
7553
|
+
const producedDatasourceReadableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getProducedReadableId(consumedDatasourceReadableId);
|
|
7554
|
+
const producedDatasourceBlockShapeId = chunkY53H6FV7_cjs.toBlockShapeId(producedDatasourceReadableId, randomnessKey);
|
|
7465
7555
|
const columnOutputs = {};
|
|
7466
7556
|
const blockData = {};
|
|
7467
7557
|
const producedColumnReadableIds = [];
|
|
@@ -7476,8 +7566,8 @@ async function generateDirectDatasourceBlockResult(objectType, buildDir, randomn
|
|
|
7476
7566
|
if (propertyType === void 0) {
|
|
7477
7567
|
throw new Error(`No property type found for direct datasource mapping '${propertyTypeRid}'`);
|
|
7478
7568
|
}
|
|
7479
|
-
const consumedColumnReadableId =
|
|
7480
|
-
const producedColumnReadableId =
|
|
7569
|
+
const consumedColumnReadableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForDatasetColumn(objectTypeApiName, columnName);
|
|
7570
|
+
const producedColumnReadableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getProducedReadableId(consumedColumnReadableId);
|
|
7481
7571
|
producedColumnReadableIds.push(producedColumnReadableId);
|
|
7482
7572
|
blockData[producedColumnReadableId] = columnName;
|
|
7483
7573
|
columnOutputs[producedColumnReadableId] = {
|
|
@@ -7509,12 +7599,12 @@ async function generateDirectDatasourceBlockResult(objectType, buildDir, randomn
|
|
|
7509
7599
|
localizedDescription: {}
|
|
7510
7600
|
},
|
|
7511
7601
|
type: "DATASET",
|
|
7512
|
-
schema: producedColumnReadableIds.map((readableId) =>
|
|
7602
|
+
schema: producedColumnReadableIds.map((readableId) => chunkY53H6FV7_cjs.toBlockShapeId(readableId, randomnessKey))
|
|
7513
7603
|
}
|
|
7514
7604
|
},
|
|
7515
7605
|
...columnOutputs
|
|
7516
7606
|
};
|
|
7517
|
-
const idToBlockShapeId = Object.fromEntries(Object.keys(outputs).map((readableId) => [readableId,
|
|
7607
|
+
const idToBlockShapeId = Object.fromEntries(Object.keys(outputs).map((readableId) => [readableId, chunkY53H6FV7_cjs.toBlockShapeId(readableId, randomnessKey)]));
|
|
7518
7608
|
idToBlockShapeId[DIRECT_SOURCE_INTERNAL_SHAPE_ID] = producedDatasourceBlockShapeId;
|
|
7519
7609
|
const blockDataDirectory = path6__namespace.join(buildDir, `temp_direct_datasource_${objectType.objectType.id}`);
|
|
7520
7610
|
await fs7__namespace.promises.mkdir(blockDataDirectory, {
|
|
@@ -7556,7 +7646,7 @@ async function generateValueTypeBlockResults(valueTypeBlocks, buildDir, randomne
|
|
|
7556
7646
|
}
|
|
7557
7647
|
await fs7__namespace.promises.writeFile(path6__namespace.join(outputDir, "value-types.json"), JSON.stringify(entry, null, 2));
|
|
7558
7648
|
const outputs = buildOutputShapes(entry);
|
|
7559
|
-
const idToBlockShapeId = Object.fromEntries(Array.from(outputs.keys(), (readableId) => [readableId,
|
|
7649
|
+
const idToBlockShapeId = Object.fromEntries(Array.from(outputs.keys(), (readableId) => [readableId, chunkY53H6FV7_cjs.toBlockShapeId(readableId, randomnessKey)]));
|
|
7560
7650
|
const dependencies = buildDependencies(rawDependencies, producedValueTypes, randomnessKey);
|
|
7561
7651
|
results.push({
|
|
7562
7652
|
block_identifier: blockIdentifier,
|
|
@@ -7593,7 +7683,7 @@ function buildDependencies(rawDependencies, producedValueTypes, randomnessKey) {
|
|
|
7593
7683
|
target,
|
|
7594
7684
|
baseType
|
|
7595
7685
|
} = dependency;
|
|
7596
|
-
const consumedId =
|
|
7686
|
+
const consumedId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForConsumedValueType(target.apiName, target.version);
|
|
7597
7687
|
inputs.set(consumedId, {
|
|
7598
7688
|
type: "valueType",
|
|
7599
7689
|
valueType: {
|
|
@@ -7609,11 +7699,11 @@ function buildDependencies(rawDependencies, producedValueTypes, randomnessKey) {
|
|
|
7609
7699
|
if (reference.versionId === void 0) {
|
|
7610
7700
|
throw new Error(`Value type reference ${reference.rid} must include a version`);
|
|
7611
7701
|
}
|
|
7612
|
-
idToBlockShapeIds.set(reference.versionId,
|
|
7702
|
+
idToBlockShapeIds.set(reference.versionId, chunkY53H6FV7_cjs.toBlockShapeId(consumedId, randomnessKey));
|
|
7613
7703
|
if (producedValueTypes.has(valueTypeKey(target.apiName, target.version))) {
|
|
7614
7704
|
mappings.set(consumedId, {
|
|
7615
7705
|
input: consumedId,
|
|
7616
|
-
output:
|
|
7706
|
+
output: chunkY53H6FV7_cjs.ReadableIdGenerator.getForProducedValueType(target.apiName, target.version)
|
|
7617
7707
|
});
|
|
7618
7708
|
}
|
|
7619
7709
|
}
|
|
@@ -7648,11 +7738,11 @@ function buildExternalRecommendations(rawDependencies, producedValueTypes) {
|
|
|
7648
7738
|
if (producedValueTypes.has(valueTypeKey(target.apiName, target.version))) {
|
|
7649
7739
|
continue;
|
|
7650
7740
|
}
|
|
7651
|
-
const consumedId =
|
|
7741
|
+
const consumedId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForConsumedValueType(target.apiName, target.version);
|
|
7652
7742
|
const packageMappings = mappingsByPackage.get(target.packageNamespace) ?? /* @__PURE__ */ new Map();
|
|
7653
7743
|
packageMappings.set(consumedId, {
|
|
7654
7744
|
targetInputReadableId: consumedId,
|
|
7655
|
-
upstreamOutputReadableId:
|
|
7745
|
+
upstreamOutputReadableId: chunkY53H6FV7_cjs.ReadableIdGenerator.getForProducedValueType(target.apiName, target.version)
|
|
7656
7746
|
});
|
|
7657
7747
|
mappingsByPackage.set(target.packageNamespace, packageMappings);
|
|
7658
7748
|
}
|
|
@@ -7671,7 +7761,7 @@ function valueTypeKey(apiName, version) {
|
|
|
7671
7761
|
function buildOutputShapes(entry) {
|
|
7672
7762
|
const outputs = /* @__PURE__ */ new Map();
|
|
7673
7763
|
for (const version of entry.versions) {
|
|
7674
|
-
const readableId =
|
|
7764
|
+
const readableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForProducedValueType(entry.metadata.apiName, version.version);
|
|
7675
7765
|
outputs.set(readableId, {
|
|
7676
7766
|
type: "valueType",
|
|
7677
7767
|
valueType: {
|
|
@@ -7691,9 +7781,9 @@ function getValueTypeInternalMappings(producedValueTypes, inputShapes) {
|
|
|
7691
7781
|
const mappings = [];
|
|
7692
7782
|
for (const entry of producedValueTypes) {
|
|
7693
7783
|
for (const version of entry.versions) {
|
|
7694
|
-
const consumedId =
|
|
7784
|
+
const consumedId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForConsumedValueType(entry.metadata.apiName, version.version);
|
|
7695
7785
|
if (inputShapes.has(consumedId)) {
|
|
7696
|
-
const producedId =
|
|
7786
|
+
const producedId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForProducedValueType(entry.metadata.apiName, version.version);
|
|
7697
7787
|
mappings.push({
|
|
7698
7788
|
input: consumedId,
|
|
7699
7789
|
output: producedId
|
|
@@ -7709,7 +7799,7 @@ var apiNamespaceRegex = /^[a-z0-9-]+(\.[a-z0-9-]+)*\.$/u;
|
|
|
7709
7799
|
var uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/u;
|
|
7710
7800
|
async function main(args = process.argv) {
|
|
7711
7801
|
consola.consola.log("Generating BlockGeneratorResult for ontology...");
|
|
7712
|
-
const commandLineOpts = await yargs__default.default(helpers.hideBin(args)).version("0.
|
|
7802
|
+
const commandLineOpts = await yargs__default.default(helpers.hideBin(args)).version("0.89.0").wrap(Math.min(150, yargs__default.default().terminalWidth())).strict().help().options({
|
|
7713
7803
|
input: {
|
|
7714
7804
|
alias: "i",
|
|
7715
7805
|
describe: "Input file",
|
|
@@ -7860,6 +7950,7 @@ async function main(args = process.argv) {
|
|
|
7860
7950
|
backingDatasourceApiNames,
|
|
7861
7951
|
backingDatasourceLinkApiNames,
|
|
7862
7952
|
backingMediaSetNames,
|
|
7953
|
+
backingMediaSetMarkings,
|
|
7863
7954
|
folders
|
|
7864
7955
|
} = await loadOntology(
|
|
7865
7956
|
commandLineOpts.input,
|
|
@@ -7914,8 +8005,8 @@ async function main(args = process.argv) {
|
|
|
7914
8005
|
const objectTypeBlockData = findObjectTypeByApiName(ontologyIr.ontology.objectTypes, apiName);
|
|
7915
8006
|
if (!objectTypeBlockData) continue;
|
|
7916
8007
|
const backingProperties = getBackingDatasetProperties(objectTypeBlockData);
|
|
7917
|
-
const inputDatasetReadableId =
|
|
7918
|
-
const outputDatasetReadableId =
|
|
8008
|
+
const inputDatasetReadableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForDataset(apiName);
|
|
8009
|
+
const outputDatasetReadableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForDatasetOutput(apiName);
|
|
7919
8010
|
if (shapes.inputShapes.has(inputDatasetReadableId)) {
|
|
7920
8011
|
ontologyInputMappingEntries.push({
|
|
7921
8012
|
input: inputDatasetReadableId,
|
|
@@ -7923,8 +8014,8 @@ async function main(args = process.argv) {
|
|
|
7923
8014
|
});
|
|
7924
8015
|
}
|
|
7925
8016
|
for (const prop of backingProperties) {
|
|
7926
|
-
const colInputReadableId =
|
|
7927
|
-
const getForDatasetColumnOutput =
|
|
8017
|
+
const colInputReadableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForDatasetColumn(apiName, prop.apiName);
|
|
8018
|
+
const getForDatasetColumnOutput = chunkY53H6FV7_cjs.ReadableIdGenerator.getForDatasetColumnOutput(apiName, prop.apiName);
|
|
7928
8019
|
if (shapes.inputShapes.has(colInputReadableId)) {
|
|
7929
8020
|
ontologyInputMappingEntries.push({
|
|
7930
8021
|
input: colInputReadableId,
|
|
@@ -7937,8 +8028,8 @@ async function main(args = process.argv) {
|
|
|
7937
8028
|
const linkTypeBlockData = findLinkTypeByApiName(ontologyIr.ontology.linkTypes, linkApiName);
|
|
7938
8029
|
if (!linkTypeBlockData) continue;
|
|
7939
8030
|
const datasetName = `link.${linkApiName}`;
|
|
7940
|
-
const inputDsId =
|
|
7941
|
-
const outputDsId =
|
|
8031
|
+
const inputDsId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForDataset(datasetName);
|
|
8032
|
+
const outputDsId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForDatasetOutput(datasetName);
|
|
7942
8033
|
if (shapes.inputShapes.has(inputDsId)) {
|
|
7943
8034
|
ontologyInputMappingEntries.push({
|
|
7944
8035
|
input: inputDsId,
|
|
@@ -7949,8 +8040,8 @@ async function main(args = process.argv) {
|
|
|
7949
8040
|
if (ds?.type === "dataset") {
|
|
7950
8041
|
const columnNames = [...Object.values(ds.dataset.objectTypeAPrimaryKeyMapping).map(String), ...Object.values(ds.dataset.objectTypeBPrimaryKeyMapping).map(String)];
|
|
7951
8042
|
for (const colName of columnNames) {
|
|
7952
|
-
const colInputId =
|
|
7953
|
-
const colOutputId =
|
|
8043
|
+
const colInputId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForDatasetColumn(datasetName, colName);
|
|
8044
|
+
const colOutputId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForDatasetColumnOutput(datasetName, colName);
|
|
7954
8045
|
if (shapes.inputShapes.has(colInputId)) {
|
|
7955
8046
|
ontologyInputMappingEntries.push({
|
|
7956
8047
|
input: colInputId,
|
|
@@ -7961,11 +8052,11 @@ async function main(args = process.argv) {
|
|
|
7961
8052
|
}
|
|
7962
8053
|
}
|
|
7963
8054
|
for (const mediaSetName of backingMediaSetNames) {
|
|
7964
|
-
const inputReadableId =
|
|
8055
|
+
const inputReadableId = chunkY53H6FV7_cjs.ReadableIdGenerator.getForMediaSetView(mediaSetName);
|
|
7965
8056
|
if (shapes.inputShapes.has(inputReadableId)) {
|
|
7966
8057
|
ontologyInputMappingEntries.push({
|
|
7967
8058
|
input: inputReadableId,
|
|
7968
|
-
output:
|
|
8059
|
+
output: chunkY53H6FV7_cjs.ReadableIdGenerator.getForMediaSetViewOutput(mediaSetName)
|
|
7969
8060
|
});
|
|
7970
8061
|
}
|
|
7971
8062
|
}
|
|
@@ -7979,17 +8070,17 @@ async function main(args = process.argv) {
|
|
|
7979
8070
|
}).map(async (apiName) => {
|
|
7980
8071
|
const objectTypeBlockData = findObjectTypeByApiName(ontologyIr.ontology.objectTypes, apiName);
|
|
7981
8072
|
consola.consola.info(`Generating backing datasource BlockGeneratorResult for ${apiName}...`);
|
|
7982
|
-
return await generateBackingDatasetBlockResult(objectTypeBlockData, commandLineOpts.buildDir, commandLineOpts.randomnessKey, outputFolders.get(
|
|
8073
|
+
return await generateBackingDatasetBlockResult(objectTypeBlockData, commandLineOpts.buildDir, commandLineOpts.randomnessKey, outputFolders.get(chunkY53H6FV7_cjs.ReadableIdGenerator.getForObjectType(apiName)));
|
|
7983
8074
|
}));
|
|
7984
8075
|
const backingDsLinkGeneratorResults = await Promise.all(backingDatasourceLinkApiNames.map((linkApiName) => {
|
|
7985
8076
|
const linkTypeBlockData = findLinkTypeByApiName(ontologyIr.ontology.linkTypes, linkApiName);
|
|
7986
8077
|
if (!linkTypeBlockData) return void 0;
|
|
7987
8078
|
consola.consola.info(`Generating backing datasource BlockGeneratorResult for link ${linkApiName}...`);
|
|
7988
|
-
return generateBackingDatasetBlockResultForLink(linkTypeBlockData, linkApiName, ontologyIr.ontology.objectTypes, commandLineOpts.buildDir, commandLineOpts.randomnessKey, outputFolders.get(
|
|
8079
|
+
return generateBackingDatasetBlockResultForLink(linkTypeBlockData, linkApiName, ontologyIr.ontology.objectTypes, commandLineOpts.buildDir, commandLineOpts.randomnessKey, outputFolders.get(chunkY53H6FV7_cjs.ReadableIdGenerator.getForLinkType(maker.cleanAndValidateLinkTypeId(linkApiName))));
|
|
7989
8080
|
}).filter((p) => p !== void 0));
|
|
7990
8081
|
const backingMediaSetGeneratorResults = await Promise.all(backingMediaSetNames.map((mediaSetName) => {
|
|
7991
8082
|
consola.consola.info(`Generating backing Media Set BlockGeneratorResult for ${mediaSetName}...`);
|
|
7992
|
-
return generateBackingMediaSetBlockResult(mediaSetName, commandLineOpts.buildDir, commandLineOpts.randomnessKey);
|
|
8083
|
+
return generateBackingMediaSetBlockResult(mediaSetName, commandLineOpts.buildDir, commandLineOpts.randomnessKey, backingMediaSetMarkings[mediaSetName]);
|
|
7993
8084
|
}));
|
|
7994
8085
|
const blockGeneratorResult = {
|
|
7995
8086
|
block_identifier: "ontology",
|