@komaci/common-shared 244.1.0 → 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",
@@ -334,10 +335,12 @@
334
335
  "commerce_unified_checkout",
335
336
  "commerce_unified_coupons",
336
337
  "commerce_unified_promotions",
338
+ "commerce_wishlist",
337
339
  "commercecart",
338
340
  "commercepayments",
339
341
  "commercepricing",
340
342
  "commercepromotions",
343
+ "commercestorepricing",
341
344
  "commercetax",
342
345
  "commonserviceexcellence",
343
346
  "commpay_mp",
@@ -529,6 +532,7 @@
529
532
  "fsc8gs0",
530
533
  "fsc9gs0",
531
534
  "fsc_rb",
535
+ "fsccomplaintmanagement",
532
536
  "fscmainstgpu",
533
537
  "fscmainstguat",
534
538
  "fscserviceprocess",
@@ -625,6 +629,7 @@
625
629
  "interactiontest",
626
630
  "inventorypricing",
627
631
  "iot",
632
+ "ise_bots",
628
633
  "isotope",
629
634
  "jigsaw_clean",
630
635
  "jsonxform",
@@ -701,6 +706,7 @@
701
706
  "pref_center",
702
707
  "privacy_center",
703
708
  "private_industries_common",
709
+ "prm_slack",
704
710
  "process_home",
705
711
  "process_migration",
706
712
  "program_mgmt_omnistudio",
@@ -747,6 +753,8 @@
747
753
  "runtime_hcc_scalecenter",
748
754
  "runtime_hello_studio",
749
755
  "runtime_hybrid_capabilities",
756
+ "runtime_iag_base",
757
+ "runtime_iag_core",
750
758
  "runtime_incident_mgmt_components",
751
759
  "runtime_industries_actionablelist",
752
760
  "runtime_industries_actionplan",
@@ -754,15 +762,19 @@
754
762
  "runtime_industries_aisentimentresult",
755
763
  "runtime_industries_arcgraph",
756
764
  "runtime_industries_assessment",
765
+ "runtime_industries_budget",
757
766
  "runtime_industries_churn_ED",
758
767
  "runtime_industries_clause_library",
759
768
  "runtime_industries_clm",
760
769
  "runtime_industries_clm_addin",
761
770
  "runtime_industries_components",
771
+ "runtime_industries_cpq",
762
772
  "runtime_industries_documentreader",
763
773
  "runtime_industries_epc",
764
774
  "runtime_industries_eri",
765
775
  "runtime_industries_fsc",
776
+ "runtime_industries_fundraising",
777
+ "runtime_industries_fundraisingops",
766
778
  "runtime_industries_gdf",
767
779
  "runtime_industries_healthcare",
768
780
  "runtime_industries_insurance",
@@ -815,6 +827,7 @@
815
827
  "runtime_platformservices_condBuilder",
816
828
  "runtime_platformservices_transactionSecurity",
817
829
  "runtime_process_exception",
830
+ "runtime_process_optimization",
818
831
  "runtime_qtc_assetmanagement",
819
832
  "runtime_quip",
820
833
  "runtime_rbl_flows",
@@ -844,6 +857,7 @@
844
857
  "runtime_sales_hvs_test",
845
858
  "runtime_sales_insights",
846
859
  "runtime_sales_lead",
860
+ "runtime_sales_leadiq",
847
861
  "runtime_sales_linkedin",
848
862
  "runtime_sales_merge",
849
863
  "runtime_sales_multiaddedit",
@@ -873,6 +887,7 @@
873
887
  "runtime_ses_base",
874
888
  "runtime_ses_ext",
875
889
  "runtime_ufa_flows",
890
+ "runtime_web3",
876
891
  "runtime_workdotcom_qmgmt",
877
892
  "rypple_corp",
878
893
  "sales_bots",
@@ -925,11 +940,13 @@
925
940
  "setup_industries_clm_addin",
926
941
  "setup_industries_common",
927
942
  "setup_industries_comprehend",
943
+ "setup_industries_cpq",
928
944
  "setup_industries_dataprocessingengine",
929
945
  "setup_industries_decisiontable",
930
946
  "setup_industries_docgen",
931
947
  "setup_industries_documentreader",
932
948
  "setup_industries_educationcloud",
949
+ "setup_industries_grantmaking",
933
950
  "setup_industries_insurance",
934
951
  "setup_industries_mfg_common",
935
952
  "setup_industries_mfg_service",
@@ -961,6 +978,7 @@
961
978
  "setup_platform_cdc",
962
979
  "setup_platform_dsar",
963
980
  "setup_platform_dynamodbsetupwizard",
981
+ "setup_platform_eventrelay",
964
982
  "setup_platform_externalconnection",
965
983
  "setup_platform_externaldatasource",
966
984
  "setup_platform_integration",
@@ -972,6 +990,7 @@
972
990
  "setup_release_update",
973
991
  "setup_revenue_insights",
974
992
  "setup_revenue_intelligence",
993
+ "setup_sales_ai4m",
975
994
  "setup_sales_bot",
976
995
  "setup_sales_einstein",
977
996
  "setup_sales_einsteinForecasting",
@@ -1144,6 +1163,7 @@
1144
1163
  "vlocityins10",
1145
1164
  "vlocityins11",
1146
1165
  "vlocityins12",
1166
+ "vlocityins13",
1147
1167
  "vlocityins2",
1148
1168
  "vlocityins3",
1149
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.usedInPriming = true;
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
  *
@@ -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");
@@ -22,7 +22,7 @@ const initModuleMetadataObject = () => ({
22
22
  exports: {},
23
23
  templateKomaciDocMap: {},
24
24
  hasRenderFunction: false,
25
- defaultComponentId: '',
25
+ staticMetadataId: '',
26
26
  });
27
27
  exports.initModuleMetadataObject = initModuleMetadataObject;
28
28
  /**
@@ -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
- const importAlias = moduleMetadata.importsByName.has(name)
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 = moduleMetadata.importsByName.get(lookupName);
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
- moduleMetadata.importsByName.delete(lookupName);
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
- if (!moduleMetadata.importsByName.has(lookupName)) {
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 */
@@ -202,6 +204,11 @@ export declare enum FunctionTypes {
202
204
  RENDER_FUNCTION = "RenderFunction",
203
205
  ERROR = "ErrorFunction"
204
206
  }
207
+ export declare enum ModuleTypes {
208
+ BUNDLE_MODULE = "Bundle",
209
+ SCRIPT_ONLY = "ScriptOnly",
210
+ TEMPLATE_ONLY = "TemplateOnly"
211
+ }
205
212
  /**
206
213
  * Basic information needed by all function nodes
207
214
  */
@@ -280,7 +287,8 @@ export declare type ModuleMetadata = {
280
287
  [fName: string]: KomaciDocument;
281
288
  };
282
289
  hasRenderFunction: boolean;
283
- defaultComponentId: string;
290
+ staticMetadataId: string;
291
+ moduleType?: ModuleTypes.BUNDLE_MODULE | ModuleTypes.SCRIPT_ONLY | ModuleTypes.TEMPLATE_ONLY;
284
292
  };
285
293
  export declare type ImportBinding = {
286
294
  importPath: string;
package/build/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FunctionTypes = exports.UNSUPPORTED_FUNCTION = exports.PropertyTypes = exports.IdKeys = exports.PROPS = exports.CONTEXT = exports.ERROR_PREFIX = void 0;
3
+ exports.ModuleTypes = exports.FunctionTypes = exports.UNSUPPORTED_FUNCTION = exports.PropertyTypes = exports.IdKeys = exports.PROPS = exports.CONTEXT = exports.ERROR_PREFIX = void 0;
4
4
  exports.ERROR_PREFIX = '[komaci] ';
5
5
  exports.CONTEXT = 'ctx';
6
6
  exports.PROPS = 'props';
@@ -68,4 +68,10 @@ var FunctionTypes;
68
68
  FunctionTypes["RENDER_FUNCTION"] = "RenderFunction";
69
69
  FunctionTypes["ERROR"] = "ErrorFunction";
70
70
  })(FunctionTypes = exports.FunctionTypes || (exports.FunctionTypes = {}));
71
+ var ModuleTypes;
72
+ (function (ModuleTypes) {
73
+ ModuleTypes["BUNDLE_MODULE"] = "Bundle";
74
+ ModuleTypes["SCRIPT_ONLY"] = "ScriptOnly";
75
+ ModuleTypes["TEMPLATE_ONLY"] = "TemplateOnly";
76
+ })(ModuleTypes = exports.ModuleTypes || (exports.ModuleTypes = {}));
71
77
  //# sourceMappingURL=types.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@komaci/common-shared",
3
- "version": "244.1.0",
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.0"
32
+ "@komaci/types": "244.1.3"
33
33
  },
34
34
  "dependencies": {
35
35
  "@babel/core": "^7.9.0",