@salesforce/lds-adapters-commerce-search 1.207.0 → 1.208.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/es2018/commerce-search.js +19 -56
- package/package.json +1 -1
- package/sfdc/index.js +20 -57
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { serializeStructuredKey, deepFreeze, StoreKeyMap } from '@luvio/engine';
|
|
7
|
+
import { serializeStructuredKey, deepFreeze, typeCheckScalars, typeCheckArrayOfScalars, StoreKeyMap } from '@luvio/engine';
|
|
8
8
|
|
|
9
9
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
10
|
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
@@ -467,37 +467,18 @@ function keyBuilder$2(luvio, config) {
|
|
|
467
467
|
}
|
|
468
468
|
function typeCheckConfig$1(untrustedConfig) {
|
|
469
469
|
const config = {};
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
}
|
|
482
|
-
const untrustedConfig_fields = untrustedConfig.fields;
|
|
483
|
-
if (ArrayIsArray$1(untrustedConfig_fields)) {
|
|
484
|
-
const untrustedConfig_fields_array = [];
|
|
485
|
-
for (let i = 0, arrayLength = untrustedConfig_fields.length; i < arrayLength; i++) {
|
|
486
|
-
const untrustedConfig_fields_item = untrustedConfig_fields[i];
|
|
487
|
-
if (typeof untrustedConfig_fields_item === 'string') {
|
|
488
|
-
untrustedConfig_fields_array.push(untrustedConfig_fields_item);
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
config.fields = untrustedConfig_fields_array;
|
|
492
|
-
}
|
|
493
|
-
const untrustedConfig_page = untrustedConfig.page;
|
|
494
|
-
if (typeof untrustedConfig_page === 'number' && Math.floor(untrustedConfig_page) === untrustedConfig_page) {
|
|
495
|
-
config.page = untrustedConfig_page;
|
|
496
|
-
}
|
|
497
|
-
const untrustedConfig_pageSize = untrustedConfig.pageSize;
|
|
498
|
-
if (typeof untrustedConfig_pageSize === 'number' && Math.floor(untrustedConfig_pageSize) === untrustedConfig_pageSize) {
|
|
499
|
-
config.pageSize = untrustedConfig_pageSize;
|
|
500
|
-
}
|
|
470
|
+
typeCheckScalars(untrustedConfig, config, {
|
|
471
|
+
webstoreId: 0 /* String */,
|
|
472
|
+
effectiveAccountId: 0 /* String */,
|
|
473
|
+
categoryId: 0 /* String */,
|
|
474
|
+
page: 3 /* Integer */,
|
|
475
|
+
pageSize: 3 /* Integer */,
|
|
476
|
+
searchTerm: 0 /* String */,
|
|
477
|
+
sortOrderId: 0 /* String */,
|
|
478
|
+
});
|
|
479
|
+
typeCheckArrayOfScalars(untrustedConfig, config, {
|
|
480
|
+
fields: 0 /* String */,
|
|
481
|
+
});
|
|
501
482
|
const untrustedConfig_refinements = untrustedConfig.refinements;
|
|
502
483
|
if (ArrayIsArray$1(untrustedConfig_refinements)) {
|
|
503
484
|
const untrustedConfig_refinements_array = [];
|
|
@@ -512,14 +493,6 @@ function typeCheckConfig$1(untrustedConfig) {
|
|
|
512
493
|
}
|
|
513
494
|
config.refinements = untrustedConfig_refinements_array;
|
|
514
495
|
}
|
|
515
|
-
const untrustedConfig_searchTerm = untrustedConfig.searchTerm;
|
|
516
|
-
if (typeof untrustedConfig_searchTerm === 'string') {
|
|
517
|
-
config.searchTerm = untrustedConfig_searchTerm;
|
|
518
|
-
}
|
|
519
|
-
const untrustedConfig_sortOrderId = untrustedConfig.sortOrderId;
|
|
520
|
-
if (typeof untrustedConfig_sortOrderId === 'string') {
|
|
521
|
-
config.sortOrderId = untrustedConfig_sortOrderId;
|
|
522
|
-
}
|
|
523
496
|
return config;
|
|
524
497
|
}
|
|
525
498
|
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
@@ -778,22 +751,12 @@ function keyBuilder(luvio, config) {
|
|
|
778
751
|
}
|
|
779
752
|
function typeCheckConfig(untrustedConfig) {
|
|
780
753
|
const config = {};
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
config.effectiveAccountId = untrustedConfig_effectiveAccountId;
|
|
788
|
-
}
|
|
789
|
-
const untrustedConfig_limit = untrustedConfig.limit;
|
|
790
|
-
if (typeof untrustedConfig_limit === 'number' && Math.floor(untrustedConfig_limit) === untrustedConfig_limit) {
|
|
791
|
-
config.limit = untrustedConfig_limit;
|
|
792
|
-
}
|
|
793
|
-
const untrustedConfig_searchTerm = untrustedConfig.searchTerm;
|
|
794
|
-
if (typeof untrustedConfig_searchTerm === 'string') {
|
|
795
|
-
config.searchTerm = untrustedConfig_searchTerm;
|
|
796
|
-
}
|
|
754
|
+
typeCheckScalars(untrustedConfig, config, {
|
|
755
|
+
webstoreId: 0 /* String */,
|
|
756
|
+
effectiveAccountId: 0 /* String */,
|
|
757
|
+
limit: 3 /* Integer */,
|
|
758
|
+
searchTerm: 0 /* String */,
|
|
759
|
+
});
|
|
797
760
|
return config;
|
|
798
761
|
}
|
|
799
762
|
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
package/package.json
CHANGED
package/sfdc/index.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
/* proxy-compat-disable */
|
|
15
15
|
import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
|
|
16
16
|
import { withDefaultLuvio } from 'force/ldsEngine';
|
|
17
|
-
import { serializeStructuredKey, deepFreeze, StoreKeyMap } from 'force/luvioEngine';
|
|
17
|
+
import { serializeStructuredKey, deepFreeze, typeCheckScalars, StoreKeyMap, typeCheckArrayOfScalars } from 'force/luvioEngine';
|
|
18
18
|
|
|
19
19
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
20
20
|
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
@@ -296,22 +296,12 @@ function keyBuilder$2(luvio, config) {
|
|
|
296
296
|
}
|
|
297
297
|
function typeCheckConfig$1(untrustedConfig) {
|
|
298
298
|
const config = {};
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
config.effectiveAccountId = untrustedConfig_effectiveAccountId;
|
|
306
|
-
}
|
|
307
|
-
const untrustedConfig_limit = untrustedConfig.limit;
|
|
308
|
-
if (typeof untrustedConfig_limit === 'number' && Math.floor(untrustedConfig_limit) === untrustedConfig_limit) {
|
|
309
|
-
config.limit = untrustedConfig_limit;
|
|
310
|
-
}
|
|
311
|
-
const untrustedConfig_searchTerm = untrustedConfig.searchTerm;
|
|
312
|
-
if (typeof untrustedConfig_searchTerm === 'string') {
|
|
313
|
-
config.searchTerm = untrustedConfig_searchTerm;
|
|
314
|
-
}
|
|
299
|
+
typeCheckScalars(untrustedConfig, config, {
|
|
300
|
+
webstoreId: 0 /* String */,
|
|
301
|
+
effectiveAccountId: 0 /* String */,
|
|
302
|
+
limit: 3 /* Integer */,
|
|
303
|
+
searchTerm: 0 /* String */,
|
|
304
|
+
});
|
|
315
305
|
return config;
|
|
316
306
|
}
|
|
317
307
|
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
@@ -751,37 +741,18 @@ function keyBuilder(luvio, config) {
|
|
|
751
741
|
}
|
|
752
742
|
function typeCheckConfig(untrustedConfig) {
|
|
753
743
|
const config = {};
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
}
|
|
766
|
-
const untrustedConfig_fields = untrustedConfig.fields;
|
|
767
|
-
if (ArrayIsArray$1(untrustedConfig_fields)) {
|
|
768
|
-
const untrustedConfig_fields_array = [];
|
|
769
|
-
for (let i = 0, arrayLength = untrustedConfig_fields.length; i < arrayLength; i++) {
|
|
770
|
-
const untrustedConfig_fields_item = untrustedConfig_fields[i];
|
|
771
|
-
if (typeof untrustedConfig_fields_item === 'string') {
|
|
772
|
-
untrustedConfig_fields_array.push(untrustedConfig_fields_item);
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
config.fields = untrustedConfig_fields_array;
|
|
776
|
-
}
|
|
777
|
-
const untrustedConfig_page = untrustedConfig.page;
|
|
778
|
-
if (typeof untrustedConfig_page === 'number' && Math.floor(untrustedConfig_page) === untrustedConfig_page) {
|
|
779
|
-
config.page = untrustedConfig_page;
|
|
780
|
-
}
|
|
781
|
-
const untrustedConfig_pageSize = untrustedConfig.pageSize;
|
|
782
|
-
if (typeof untrustedConfig_pageSize === 'number' && Math.floor(untrustedConfig_pageSize) === untrustedConfig_pageSize) {
|
|
783
|
-
config.pageSize = untrustedConfig_pageSize;
|
|
784
|
-
}
|
|
744
|
+
typeCheckScalars(untrustedConfig, config, {
|
|
745
|
+
webstoreId: 0 /* String */,
|
|
746
|
+
effectiveAccountId: 0 /* String */,
|
|
747
|
+
categoryId: 0 /* String */,
|
|
748
|
+
page: 3 /* Integer */,
|
|
749
|
+
pageSize: 3 /* Integer */,
|
|
750
|
+
searchTerm: 0 /* String */,
|
|
751
|
+
sortOrderId: 0 /* String */,
|
|
752
|
+
});
|
|
753
|
+
typeCheckArrayOfScalars(untrustedConfig, config, {
|
|
754
|
+
fields: 0 /* String */,
|
|
755
|
+
});
|
|
785
756
|
const untrustedConfig_refinements = untrustedConfig.refinements;
|
|
786
757
|
if (ArrayIsArray$1(untrustedConfig_refinements)) {
|
|
787
758
|
const untrustedConfig_refinements_array = [];
|
|
@@ -796,14 +767,6 @@ function typeCheckConfig(untrustedConfig) {
|
|
|
796
767
|
}
|
|
797
768
|
config.refinements = untrustedConfig_refinements_array;
|
|
798
769
|
}
|
|
799
|
-
const untrustedConfig_searchTerm = untrustedConfig.searchTerm;
|
|
800
|
-
if (typeof untrustedConfig_searchTerm === 'string') {
|
|
801
|
-
config.searchTerm = untrustedConfig_searchTerm;
|
|
802
|
-
}
|
|
803
|
-
const untrustedConfig_sortOrderId = untrustedConfig.sortOrderId;
|
|
804
|
-
if (typeof untrustedConfig_sortOrderId === 'string') {
|
|
805
|
-
config.sortOrderId = untrustedConfig_sortOrderId;
|
|
806
|
-
}
|
|
807
770
|
return config;
|
|
808
771
|
}
|
|
809
772
|
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
@@ -921,4 +884,4 @@ withDefaultLuvio((luvio) => {
|
|
|
921
884
|
});
|
|
922
885
|
|
|
923
886
|
export { getSuggestions, getSuggestions_imperative, productSearch, productSearch_imperative };
|
|
924
|
-
// version: 1.
|
|
887
|
+
// version: 1.208.1-9aaa359ad
|