@komaci/common-shared 244.1.2 → 244.1.3
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.
|
@@ -324,6 +324,7 @@
|
|
|
324
324
|
"commerce_dx_sampleapp",
|
|
325
325
|
"commerce_extension",
|
|
326
326
|
"commerce_inventory",
|
|
327
|
+
"commerce_market",
|
|
327
328
|
"commerce_my_account",
|
|
328
329
|
"commerce_ordermanagement",
|
|
329
330
|
"commerce_ordersummary",
|
|
@@ -339,6 +340,7 @@
|
|
|
339
340
|
"commercepayments",
|
|
340
341
|
"commercepricing",
|
|
341
342
|
"commercepromotions",
|
|
343
|
+
"commercestorepricing",
|
|
342
344
|
"commercetax",
|
|
343
345
|
"commonserviceexcellence",
|
|
344
346
|
"commpay_mp",
|
|
@@ -530,6 +532,7 @@
|
|
|
530
532
|
"fsc8gs0",
|
|
531
533
|
"fsc9gs0",
|
|
532
534
|
"fsc_rb",
|
|
535
|
+
"fsccomplaintmanagement",
|
|
533
536
|
"fscmainstgpu",
|
|
534
537
|
"fscmainstguat",
|
|
535
538
|
"fscserviceprocess",
|
|
@@ -626,6 +629,7 @@
|
|
|
626
629
|
"interactiontest",
|
|
627
630
|
"inventorypricing",
|
|
628
631
|
"iot",
|
|
632
|
+
"ise_bots",
|
|
629
633
|
"isotope",
|
|
630
634
|
"jigsaw_clean",
|
|
631
635
|
"jsonxform",
|
|
@@ -749,6 +753,8 @@
|
|
|
749
753
|
"runtime_hcc_scalecenter",
|
|
750
754
|
"runtime_hello_studio",
|
|
751
755
|
"runtime_hybrid_capabilities",
|
|
756
|
+
"runtime_iag_base",
|
|
757
|
+
"runtime_iag_core",
|
|
752
758
|
"runtime_incident_mgmt_components",
|
|
753
759
|
"runtime_industries_actionablelist",
|
|
754
760
|
"runtime_industries_actionplan",
|
|
@@ -756,15 +762,19 @@
|
|
|
756
762
|
"runtime_industries_aisentimentresult",
|
|
757
763
|
"runtime_industries_arcgraph",
|
|
758
764
|
"runtime_industries_assessment",
|
|
765
|
+
"runtime_industries_budget",
|
|
759
766
|
"runtime_industries_churn_ED",
|
|
760
767
|
"runtime_industries_clause_library",
|
|
761
768
|
"runtime_industries_clm",
|
|
762
769
|
"runtime_industries_clm_addin",
|
|
763
770
|
"runtime_industries_components",
|
|
771
|
+
"runtime_industries_cpq",
|
|
764
772
|
"runtime_industries_documentreader",
|
|
765
773
|
"runtime_industries_epc",
|
|
766
774
|
"runtime_industries_eri",
|
|
767
775
|
"runtime_industries_fsc",
|
|
776
|
+
"runtime_industries_fundraising",
|
|
777
|
+
"runtime_industries_fundraisingops",
|
|
768
778
|
"runtime_industries_gdf",
|
|
769
779
|
"runtime_industries_healthcare",
|
|
770
780
|
"runtime_industries_insurance",
|
|
@@ -817,6 +827,7 @@
|
|
|
817
827
|
"runtime_platformservices_condBuilder",
|
|
818
828
|
"runtime_platformservices_transactionSecurity",
|
|
819
829
|
"runtime_process_exception",
|
|
830
|
+
"runtime_process_optimization",
|
|
820
831
|
"runtime_qtc_assetmanagement",
|
|
821
832
|
"runtime_quip",
|
|
822
833
|
"runtime_rbl_flows",
|
|
@@ -846,6 +857,7 @@
|
|
|
846
857
|
"runtime_sales_hvs_test",
|
|
847
858
|
"runtime_sales_insights",
|
|
848
859
|
"runtime_sales_lead",
|
|
860
|
+
"runtime_sales_leadiq",
|
|
849
861
|
"runtime_sales_linkedin",
|
|
850
862
|
"runtime_sales_merge",
|
|
851
863
|
"runtime_sales_multiaddedit",
|
|
@@ -875,6 +887,7 @@
|
|
|
875
887
|
"runtime_ses_base",
|
|
876
888
|
"runtime_ses_ext",
|
|
877
889
|
"runtime_ufa_flows",
|
|
890
|
+
"runtime_web3",
|
|
878
891
|
"runtime_workdotcom_qmgmt",
|
|
879
892
|
"rypple_corp",
|
|
880
893
|
"sales_bots",
|
|
@@ -927,11 +940,13 @@
|
|
|
927
940
|
"setup_industries_clm_addin",
|
|
928
941
|
"setup_industries_common",
|
|
929
942
|
"setup_industries_comprehend",
|
|
943
|
+
"setup_industries_cpq",
|
|
930
944
|
"setup_industries_dataprocessingengine",
|
|
931
945
|
"setup_industries_decisiontable",
|
|
932
946
|
"setup_industries_docgen",
|
|
933
947
|
"setup_industries_documentreader",
|
|
934
948
|
"setup_industries_educationcloud",
|
|
949
|
+
"setup_industries_grantmaking",
|
|
935
950
|
"setup_industries_insurance",
|
|
936
951
|
"setup_industries_mfg_common",
|
|
937
952
|
"setup_industries_mfg_service",
|
|
@@ -963,6 +978,7 @@
|
|
|
963
978
|
"setup_platform_cdc",
|
|
964
979
|
"setup_platform_dsar",
|
|
965
980
|
"setup_platform_dynamodbsetupwizard",
|
|
981
|
+
"setup_platform_eventrelay",
|
|
966
982
|
"setup_platform_externalconnection",
|
|
967
983
|
"setup_platform_externaldatasource",
|
|
968
984
|
"setup_platform_integration",
|
|
@@ -974,6 +990,7 @@
|
|
|
974
990
|
"setup_release_update",
|
|
975
991
|
"setup_revenue_insights",
|
|
976
992
|
"setup_revenue_intelligence",
|
|
993
|
+
"setup_sales_ai4m",
|
|
977
994
|
"setup_sales_bot",
|
|
978
995
|
"setup_sales_einstein",
|
|
979
996
|
"setup_sales_einsteinForecasting",
|
|
@@ -1146,6 +1163,7 @@
|
|
|
1146
1163
|
"vlocityins10",
|
|
1147
1164
|
"vlocityins11",
|
|
1148
1165
|
"vlocityins12",
|
|
1166
|
+
"vlocityins13",
|
|
1149
1167
|
"vlocityins2",
|
|
1150
1168
|
"vlocityins3",
|
|
1151
1169
|
"vlocityins4",
|
|
@@ -227,7 +227,13 @@ function initializePropertiesMap(adgProperties, adgFunctions, adgIndex, doc, mod
|
|
|
227
227
|
const importMetadata = moduleMetadata.importsByName.get(
|
|
228
228
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
229
229
|
moduleMetadata.importIndexReference.get(potentialImportRef.value));
|
|
230
|
-
importMetadata.
|
|
230
|
+
if (importMetadata.isFromInternalNamespace &&
|
|
231
|
+
importMetadata.isFromSupportedLibrary) {
|
|
232
|
+
importMetadata.usedInPriming = true;
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
adgMetadata.requiredAdgFactoryFunctions.add(types_1.IdKeys.UNRESOLVED_VALUE);
|
|
236
|
+
}
|
|
231
237
|
}
|
|
232
238
|
else if (potentialImportRef.type === 'Unresolved') {
|
|
233
239
|
adgMetadata.requiredAdgFactoryFunctions.add(types_1.IdKeys.UNRESOLVED_VALUE);
|
|
@@ -80,6 +80,15 @@ export declare const updateAliasForImport: (lookupName: string, referencedName:
|
|
|
80
80
|
export declare function getImportTemplateKomaciDocByResourceName(resourceName: string, templateKomaciDocMap?: {
|
|
81
81
|
[fName: string]: KomaciDocument;
|
|
82
82
|
}): KomaciDocument | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* multiple things can import something with the same base name before we fully process ast
|
|
85
|
+
* this makes sure we get import metadata for the right namespace.
|
|
86
|
+
* @param name the import name
|
|
87
|
+
* @param namespace the namespace to insure we get from
|
|
88
|
+
* @param moduleMetadata module metadata
|
|
89
|
+
* @returns the import if we could find it
|
|
90
|
+
*/
|
|
91
|
+
export declare function getImportFromNamespace(name: string, namespace: string, moduleMetadata: ModuleMetadata): ImportMetadata | undefined;
|
|
83
92
|
/**
|
|
84
93
|
* pull all needful import metadata we can from the ast
|
|
85
94
|
* for the most part, we can grab data from the komaci document for imports but sometimes
|
|
@@ -94,6 +103,14 @@ export declare function getImportTemplateKomaciDocByResourceName(resourceName: s
|
|
|
94
103
|
* @param ast ast for the given component
|
|
95
104
|
*/
|
|
96
105
|
export declare const collectImportMetadataFromAst: (ast: t.File, moduleMetadata: ModuleMetadata) => void;
|
|
106
|
+
/**
|
|
107
|
+
* Find the other import metadata object that references the same import with a different alias
|
|
108
|
+
* @param resourceName import resource path
|
|
109
|
+
* @param importedName the name as it comes from the import, an exported name, `default` or `*`
|
|
110
|
+
* @param moduleMetadata module metadata for this component
|
|
111
|
+
* @returns the import metadata if it is found
|
|
112
|
+
*/
|
|
113
|
+
export declare const findOtherAlias: (resourceName: string, importedName: string, moduleMetadata: ModuleMetadata) => ImportMetadata | undefined;
|
|
97
114
|
/**
|
|
98
115
|
* From a given adg, collect as much metadata as possible ONLY from the komaci document
|
|
99
116
|
*
|
package/build/moduleMetadata.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isTemplateImport = exports.upliftFakePropsFromTemplate = exports.reconcileDefaultAdg = exports.isImportInvalid = exports.reconcilePrimingAdapater = exports.reconcileWireReference = exports.composeWireFunctionMetadata = exports.addTemplateUsageForAdg = exports.mapExportNamesToAdgs = exports.initalizeAdgMetadata = exports.collectImportMetadataFromAst = exports.getImportTemplateKomaciDocByResourceName = exports.updateAliasForImport = exports.addNewImportFromAst = exports.reconcileImport = exports.reconcileNamespace = exports.traverseAstImports = exports.composeImportMetadata = exports.initializeImportMetdataFromKomaciDocument = exports.initAdgMetadataObject = exports.initModuleMetadataObject = exports.NO_KOMACI_DOC_REF = void 0;
|
|
3
|
+
exports.isTemplateImport = exports.upliftFakePropsFromTemplate = exports.reconcileDefaultAdg = exports.isImportInvalid = exports.reconcilePrimingAdapater = exports.reconcileWireReference = exports.composeWireFunctionMetadata = exports.addTemplateUsageForAdg = exports.mapExportNamesToAdgs = exports.initalizeAdgMetadata = exports.findOtherAlias = exports.collectImportMetadataFromAst = exports.getImportFromNamespace = exports.getImportTemplateKomaciDocByResourceName = exports.updateAliasForImport = exports.addNewImportFromAst = exports.reconcileImport = exports.reconcileNamespace = exports.traverseAstImports = exports.composeImportMetadata = exports.initializeImportMetdataFromKomaciDocument = exports.initAdgMetadataObject = exports.initModuleMetadataObject = exports.NO_KOMACI_DOC_REF = void 0;
|
|
4
4
|
const allowlistNamespaces_1 = require("./allowlistNamespaces");
|
|
5
5
|
const komaciDocumentIntrospection_1 = require("./komaciDocumentIntrospection");
|
|
6
6
|
const types_1 = require("./types");
|
|
@@ -55,6 +55,7 @@ const initializeImportMetdataFromKomaciDocument = (doc, moduleMetadata, template
|
|
|
55
55
|
const namespace = {
|
|
56
56
|
names,
|
|
57
57
|
isSupported,
|
|
58
|
+
originalNames: names,
|
|
58
59
|
resourceName: importNamespace.resourceName,
|
|
59
60
|
isDefaultSpecifier: names.has('default'),
|
|
60
61
|
isNamespaceSpecifier: names.has('*'),
|
|
@@ -63,7 +64,10 @@ const initializeImportMetdataFromKomaciDocument = (doc, moduleMetadata, template
|
|
|
63
64
|
for (let j = 0; j < importNamespace.names.length; j++) {
|
|
64
65
|
const name = importNamespace.names[j];
|
|
65
66
|
const komaciDocImportRef = `${i}/names/${j}`;
|
|
66
|
-
|
|
67
|
+
// komaci doc references to other resolvable modules aren't going to ever be referenced by name so we can hoist them with the extra namespace
|
|
68
|
+
// this prevents collisions between the resolvable module and regular import
|
|
69
|
+
const importAlias = moduleMetadata.importsByName.has(name) ||
|
|
70
|
+
importNamespace.resourceName.startsWith('@salesforce/komaci')
|
|
67
71
|
? `${name}-${importNamespace.resourceName}`
|
|
68
72
|
: undefined;
|
|
69
73
|
(0, exports.composeImportMetadata)(name, importNamespace.resourceName, isSupported, templateAdgIndex !== undefined
|
|
@@ -201,6 +205,7 @@ const reconcileNamespace = (resourceName, moduleMetadata) => {
|
|
|
201
205
|
if (!namespace) {
|
|
202
206
|
namespace = {
|
|
203
207
|
names: new Set(),
|
|
208
|
+
originalNames: new Set(),
|
|
204
209
|
isSupported: allowlistNamespaces_1.isLocalHtmlImportReference.exec(resourceName)
|
|
205
210
|
? (0, allowlistNamespaces_1.isSupportedNamespace)(resourceName)
|
|
206
211
|
: (0, allowlistNamespaces_1.isNamespaceInternal)((0, allowlistNamespaces_1.getNamespaceFromImport)(resourceName)),
|
|
@@ -253,6 +258,13 @@ const addNewImportFromAst = (referencedName, namespace, moduleMetadata, original
|
|
|
253
258
|
}
|
|
254
259
|
moduleMetadata.importsByName.set(referencedName, importMetadata);
|
|
255
260
|
namespace.names.add(referencedName);
|
|
261
|
+
namespace.originalNames.add(originalImportName || referencedName);
|
|
262
|
+
if (originalImportName === 'default') {
|
|
263
|
+
namespace.isDefaultSpecifier = true;
|
|
264
|
+
}
|
|
265
|
+
else if (originalImportName === '*') {
|
|
266
|
+
namespace.isNamespaceSpecifier = true;
|
|
267
|
+
}
|
|
256
268
|
};
|
|
257
269
|
exports.addNewImportFromAst = addNewImportFromAst;
|
|
258
270
|
/**
|
|
@@ -264,13 +276,14 @@ exports.addNewImportFromAst = addNewImportFromAst;
|
|
|
264
276
|
* @param originalImportName (optional) the original name of the import that has been aliases. undefined if no alias.
|
|
265
277
|
*/
|
|
266
278
|
const updateAliasForImport = (lookupName, referencedName, namespace, moduleMetadata, originalImportName) => {
|
|
267
|
-
const importMetadata =
|
|
279
|
+
const importMetadata = getImportFromNamespace(lookupName, namespace.resourceName, moduleMetadata);
|
|
268
280
|
if (originalImportName && referencedName !== originalImportName && importMetadata) {
|
|
269
281
|
const isDefaultOrNamespace = originalImportName === '*' || originalImportName === 'default';
|
|
282
|
+
const oldAlias = importMetadata.importAlias || lookupName;
|
|
270
283
|
importMetadata.importAlias = referencedName;
|
|
284
|
+
moduleMetadata.importsByName.delete(oldAlias);
|
|
271
285
|
moduleMetadata.importsByName.set(referencedName, importMetadata);
|
|
272
|
-
|
|
273
|
-
namespace.names.delete(isDefaultOrNamespace ? originalImportName : lookupName);
|
|
286
|
+
namespace.names.delete(isDefaultOrNamespace ? originalImportName : oldAlias);
|
|
274
287
|
namespace.names.add(referencedName);
|
|
275
288
|
if (importMetadata.komaciDocImportRef !== exports.NO_KOMACI_DOC_REF) {
|
|
276
289
|
moduleMetadata.importIndexReference.set(importMetadata.komaciDocImportRef, referencedName);
|
|
@@ -295,6 +308,22 @@ function getImportTemplateKomaciDocByResourceName(resourceName, templateKomaciDo
|
|
|
295
308
|
return templateImportKomaciDoc;
|
|
296
309
|
}
|
|
297
310
|
exports.getImportTemplateKomaciDocByResourceName = getImportTemplateKomaciDocByResourceName;
|
|
311
|
+
/**
|
|
312
|
+
* multiple things can import something with the same base name before we fully process ast
|
|
313
|
+
* this makes sure we get import metadata for the right namespace.
|
|
314
|
+
* @param name the import name
|
|
315
|
+
* @param namespace the namespace to insure we get from
|
|
316
|
+
* @param moduleMetadata module metadata
|
|
317
|
+
* @returns the import if we could find it
|
|
318
|
+
*/
|
|
319
|
+
function getImportFromNamespace(name, namespace, moduleMetadata) {
|
|
320
|
+
let importMetadata = moduleMetadata.importsByName.get(name);
|
|
321
|
+
if (importMetadata?.resourceName !== namespace) {
|
|
322
|
+
importMetadata = moduleMetadata.importsByName.get(`${name}-${namespace}`);
|
|
323
|
+
}
|
|
324
|
+
return importMetadata;
|
|
325
|
+
}
|
|
326
|
+
exports.getImportFromNamespace = getImportFromNamespace;
|
|
298
327
|
/**
|
|
299
328
|
* pull all needful import metadata we can from the ast
|
|
300
329
|
* for the most part, we can grab data from the komaci document for imports but sometimes
|
|
@@ -311,15 +340,45 @@ exports.getImportTemplateKomaciDocByResourceName = getImportTemplateKomaciDocByR
|
|
|
311
340
|
const collectImportMetadataFromAst = (ast, moduleMetadata) => {
|
|
312
341
|
(0, exports.traverseAstImports)(ast, (lookupName, referencedName, resourceName, originalImportName) => {
|
|
313
342
|
const namespace = (0, exports.reconcileNamespace)(resourceName, moduleMetadata);
|
|
314
|
-
|
|
343
|
+
const existingImportMetadata = getImportFromNamespace(lookupName, resourceName, moduleMetadata);
|
|
344
|
+
if (!namespace.originalNames.has(originalImportName || referencedName)) {
|
|
315
345
|
(0, exports.addNewImportFromAst)(referencedName, namespace, moduleMetadata, originalImportName);
|
|
316
346
|
}
|
|
317
347
|
else {
|
|
348
|
+
const importMetadata = (0, exports.findOtherAlias)(resourceName, originalImportName || referencedName, moduleMetadata);
|
|
349
|
+
if (importMetadata) {
|
|
350
|
+
moduleMetadata.importsByName.set(referencedName, importMetadata);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
if (existingImportMetadata &&
|
|
354
|
+
existingImportMetadata.komaciDocImportRef !== exports.NO_KOMACI_DOC_REF &&
|
|
355
|
+
(!existingImportMetadata.importAlias ||
|
|
356
|
+
existingImportMetadata.importAlias ===
|
|
357
|
+
`${existingImportMetadata.name}-${resourceName}` ||
|
|
358
|
+
existingImportMetadata.importAlias === `namespace-${resourceName}`) &&
|
|
359
|
+
existingImportMetadata.name !== referencedName) {
|
|
318
360
|
(0, exports.updateAliasForImport)(lookupName, referencedName, namespace, moduleMetadata, originalImportName);
|
|
319
361
|
}
|
|
320
362
|
});
|
|
321
363
|
};
|
|
322
364
|
exports.collectImportMetadataFromAst = collectImportMetadataFromAst;
|
|
365
|
+
/**
|
|
366
|
+
* Find the other import metadata object that references the same import with a different alias
|
|
367
|
+
* @param resourceName import resource path
|
|
368
|
+
* @param importedName the name as it comes from the import, an exported name, `default` or `*`
|
|
369
|
+
* @param moduleMetadata module metadata for this component
|
|
370
|
+
* @returns the import metadata if it is found
|
|
371
|
+
*/
|
|
372
|
+
const findOtherAlias = (resourceName, importedName, moduleMetadata) => {
|
|
373
|
+
for (const importMetadata of moduleMetadata.importsByName.values()) {
|
|
374
|
+
if (importMetadata.resourceName === resourceName &&
|
|
375
|
+
importMetadata.name === importedName) {
|
|
376
|
+
return importMetadata;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
return undefined;
|
|
380
|
+
};
|
|
381
|
+
exports.findOtherAlias = findOtherAlias;
|
|
323
382
|
/**
|
|
324
383
|
* From a given adg, collect as much metadata as possible ONLY from the komaci document
|
|
325
384
|
*
|
package/build/types.d.ts
CHANGED
|
@@ -56,6 +56,8 @@ export declare type ImportDetail = {
|
|
|
56
56
|
resourceName: string;
|
|
57
57
|
/** The names of the specific things imported */
|
|
58
58
|
names: Set<string>;
|
|
59
|
+
/** unique un-aliased names for all of the things imported. can include the specials like default and * */
|
|
60
|
+
originalNames: Set<string>;
|
|
59
61
|
/** If this import is a namespace */
|
|
60
62
|
isNamespaceSpecifier: boolean;
|
|
61
63
|
/** If this import contains a default specifier */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@komaci/common-shared",
|
|
3
|
-
"version": "244.1.
|
|
3
|
+
"version": "244.1.3",
|
|
4
4
|
"description": "Assets that are shared across Komaci commonjs packages",
|
|
5
5
|
"homepage": "https://komaci.dev/",
|
|
6
6
|
"repository": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"build/komaci-mapping.json"
|
|
30
30
|
],
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@komaci/types": "244.1.
|
|
32
|
+
"@komaci/types": "244.1.3"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@babel/core": "^7.9.0",
|