@usereactify/search 5.60.0-beta.0 → 5.60.0-beta.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/CHANGELOG.md +16 -2
- package/dist/package.json +1 -1
- package/dist/src/components/Sensor/SensorSearchTerm.d.ts +1 -2
- package/dist/src/components/Sensor/SensorSearchTerm.js +38 -120
- package/dist/src/components/Sensor/SensorSearchTerm.js.map +1 -1
- package/dist/src/components/Sensor/Sensors.d.ts +1 -3
- package/dist/src/components/Sensor/Sensors.js +10 -29
- package/dist/src/components/Sensor/Sensors.js.map +1 -1
- package/dist/src/components/Sensor/index.d.ts +0 -2
- package/dist/src/components/Sensor/index.js +0 -4
- package/dist/src/components/Sensor/index.js.map +1 -1
- package/dist/src/search-request-builder/base-builders.d.ts +18 -0
- package/dist/src/search-request-builder/base-builders.js +184 -0
- package/dist/src/search-request-builder/base-builders.js.map +1 -0
- package/dist/src/search-request-builder/curation-builders.d.ts +2 -0
- package/dist/src/search-request-builder/curation-builders.js +44 -0
- package/dist/src/search-request-builder/curation-builders.js.map +1 -0
- package/dist/src/search-request-builder/index.d.ts +3 -0
- package/dist/src/search-request-builder/index.js +12 -0
- package/dist/src/search-request-builder/index.js.map +1 -0
- package/dist/src/search-request-builder/search-request-builder.d.ts +3 -0
- package/dist/src/search-request-builder/search-request-builder.js +54 -0
- package/dist/src/search-request-builder/search-request-builder.js.map +1 -0
- package/dist/src/search-request-builder/types.d.ts +105 -0
- package/dist/src/search-request-builder/types.js +30 -0
- package/dist/src/search-request-builder/types.js.map +1 -0
- package/dist/src/search-request-builder/utils.d.ts +27 -0
- package/dist/src/search-request-builder/utils.js +144 -0
- package/dist/src/search-request-builder/utils.js.map +1 -0
- package/dist/src/types/elastic.d.ts +6 -9
- package/dist/src/types/elastic.js.map +1 -1
- package/dist/src/types/firestore.d.ts +2 -2
- package/dist/src/types/firestore.js.map +1 -1
- package/dist/src/utility/config.d.ts +2 -2
- package/dist/src/utility/config.js +5 -8
- package/dist/src/utility/config.js.map +1 -1
- package/dist/src/utility/props.d.ts +5 -224
- package/dist/src/utility/props.js +54 -101
- package/dist/src/utility/props.js.map +1 -1
- package/dist/src/utility/server.js +1 -1
- package/dist/src/utility/server.js.map +1 -1
- package/package.json +1 -1
- package/dist/src/components/Sensor/SensorCollectionWeighted.d.ts +0 -1
- package/dist/src/components/Sensor/SensorCollectionWeighted.js +0 -21
- package/dist/src/components/Sensor/SensorCollectionWeighted.js.map +0 -1
- package/dist/src/components/Sensor/SensorSearchWeighted.d.ts +0 -1
- package/dist/src/components/Sensor/SensorSearchWeighted.js +0 -22
- package/dist/src/components/Sensor/SensorSearchWeighted.js.map +0 -1
- package/dist/src/utility/queries.d.ts +0 -393
- package/dist/src/utility/queries.js +0 -197
- package/dist/src/utility/queries.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firestore.js","sourceRoot":"","sources":["../../../src/types/firestore.ts"],"names":[],"mappings":";;;AAUA,IAAY,YAqBX;AArBD,WAAY,YAAY;IACtB,4CAA4B,CAAA;IAC5B,mCAAmB,CAAA;IACnB,yCAAyB,CAAA;IACzB,qCAAqB,CAAA;IACrB,4CAA4B,CAAA;IAC5B,kDAAkC,CAAA;IAClC,mCAAmB,CAAA;IACnB,oDAAoC,CAAA;IACpC,0DAA0C,CAAA;IAC1C,oDAAoC,CAAA;IACpC,4CAA4B,CAAA;IAC5B,4CAA4B,CAAA;IAC5B,4CAA4B,CAAA;IAC5B,qCAAqB,CAAA;IACrB,uCAAuB,CAAA;IACvB,6BAAa,CAAA;IACb,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,6BAAa,CAAA;IACb,oDAAoC,CAAA;AACtC,CAAC,EArBW,YAAY,4BAAZ,YAAY,QAqBvB;AAED,IAAY,qCAGX;AAHD,WAAY,qCAAqC;IAC/C,0DAAiB,CAAA;IACjB,qEAA4B,CAAA;AAC9B,CAAC,EAHW,qCAAqC,qDAArC,q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,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;CACV,CAAC;AA+FX,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,yCAAyB,CAAA;AAC3B,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAgBD,IAAY,cASX;AATD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,2CAAyB,CAAA;IACzB,yCAAuB,CAAA;IACvB,iCAAe,CAAA;IACf,+CAA6B,CAAA;IAC7B,yCAAuB,CAAA;IACvB,qCAAmB,CAAA;IACnB,qCAAmB,CAAA;AACrB,CAAC,EATW,cAAc,8BAAd,cAAc,QASzB;AAgED,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,oCAAqB,CAAA;IACrB,oCAAqB,CAAA;AACvB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAED,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,8BAAe,CAAA;IACf,gCAAiB,CAAA;AACnB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAsGY,QAAA,SAAS,GAAG;IACvB,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,YAAY;IACvB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,cAAc;IAC3B,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,cAAc;CACnB,CAAC","sourcesContent":["import { ShopifyProduct, ShopifyProductImage } from \"./shopify\";\n\nexport interface ResourceDocument {\n id: string;\n keywords: Array<string>;\n version?: string;\n createdAt?: string;\n updatedAt?: string;\n}\n\nexport enum ResourceType {\n ActivityLog = \"activity_log\",\n Product = \"product\",\n Collection = \"collection\",\n Curation = \"curation\",\n CurationPin = \"curation_pin\",\n CurationHiding = \"curation_hiding\",\n Callout = \"callout\",\n SettingsAccount = \"account_settings\",\n SettingsAutomation = \"automation_settings\",\n SettingsProduct = \"product_settings\",\n FilterGroup = \"filter_group\",\n FilterFacet = \"filter_facet\",\n MergedValue = \"merged_value\",\n Redirect = \"redirect\",\n Relevancy = \"relevancy\",\n Sort = \"sort\",\n Antonym = \"antonym\",\n Synonym = \"synonym\",\n Task = \"task\",\n SearchableField = \"searchable_field\",\n}\n\nexport enum MerchandisingCalloutAutofillBehaviour {\n Always = \"always\",\n MoreResults = \"more_results\",\n}\n\nexport const MerchandisingCalloutAutofillBehaviourLabel: Record<\n MerchandisingCalloutAutofillBehaviour,\n string\n> = {\n [MerchandisingCalloutAutofillBehaviour.Always]: \"Autofill always\",\n [MerchandisingCalloutAutofillBehaviour.MoreResults]: \"Autofill when there are more results\",\n};\n\nexport enum SharedStoreResource {\n Curation = \"curation\",\n Callout = \"callout\",\n FilterGroup = \"filter_group\",\n FilterFacet = \"filter_facet\",\n MergedValue = \"merged_value\",\n Redirect = \"redirect\",\n Relevancy = \"relevancy\",\n Sort = \"sort\",\n Synonym = \"synonym\",\n SettingsAccount = \"account_settings\",\n SettingsAutomation = \"automation_settings\",\n SettingsProduct = \"product_settings\",\n}\n\nexport const SharedStoreResourceLabels: Record<SharedStoreResource, string> = {\n [SharedStoreResource.Curation]: \"Curation\",\n [SharedStoreResource.Callout]: \"Callout\",\n [SharedStoreResource.FilterGroup]: \"Filter group\",\n [SharedStoreResource.FilterFacet]: \"Filter facet\",\n [SharedStoreResource.MergedValue]: \"Merged value\",\n [SharedStoreResource.Redirect]: \"Redirect\",\n [SharedStoreResource.Relevancy]: \"Relevancy\",\n [SharedStoreResource.Sort]: \"Sort\",\n [SharedStoreResource.Synonym]: \"Synonym\",\n [SharedStoreResource.SettingsAccount]: \"Settings account\",\n [SharedStoreResource.SettingsAutomation]: \"Settings automation\",\n [SharedStoreResource.SettingsProduct]: \"Settings product\",\n};\n\nexport interface Relevance extends ResourceDocument {\n field: string;\n enabled: boolean;\n importance: number;\n searchType: \"always_search\" | \"search_page\" | \"instant_search\";\n hidden?: boolean;\n}\n\nexport const DefinedFieldType = {\n Array: \"array\",\n Text: \"text\",\n Float: \"float\",\n Long: \"long\",\n Boolean: \"boolean\",\n} as const;\nexport type DefinedFieldType =\n | typeof DefinedFieldType[keyof typeof DefinedFieldType]\n | (string & {});\n\nexport interface DefinedField {\n label: string;\n name: string;\n type: DefinedFieldType;\n}\n\nexport interface Sort extends ResourceDocument {\n name: string;\n handle: string;\n field: string;\n position: number;\n enabled: boolean;\n direction: \"desc\" | \"asc\";\n visibility: \"all\" | \"search\" | \"collection\";\n hidden?: boolean;\n}\n\nexport interface FilterGroup extends ResourceDocument {\n name: string;\n handle: string;\n enabled: boolean;\n pageSize: number;\n collections: Array<string>;\n type: \"search\" | \"collection\";\n paginationType: \"pagination\" | \"load_more\" | \"next_prev\" | \"infinite_scroll\";\n inventoryVisibility: \"show_all\" | \"hide_products\" | \"hide_variants\" | \"hide_all\";\n}\n\nexport interface FilterFacet extends ResourceDocument {\n name: string;\n field: string;\n handle: string;\n position: number;\n enabled: boolean;\n keywords: Array<string>;\n customSortOrder?: string;\n displayType: \"multi\" | \"single\" | \"slider\";\n displayView: \"list\" | \"check\" | \"swatch\" | \"range\" | \"box\";\n displaySize: string;\n displaySliderStep: string;\n displaySliderPrefix: string;\n displaySliderSuffix: string;\n displayRangeOptions: Array<string>;\n settingsShowMore: boolean;\n settingsUppercase: boolean;\n settingsShowSearch: boolean;\n settingsShowFilter: boolean;\n settingsShowEmptyValues: boolean;\n settingsHideUnavailable: boolean;\n settingsCollapsedMobile: boolean;\n settingsCollapsedDesktop: boolean;\n settingsFilterLogic: \"and\" | \"or\";\n valuesShow: \"all\" | \"manual\";\n valuesManual: Array<string>;\n valuesExclude: Array<string>;\n}\n\nexport interface Redirect extends ResourceDocument {\n url: string;\n query: string;\n enabled: boolean;\n hidden?: boolean;\n}\n\nexport interface Curation extends ResourceDocument {\n title: string;\n status: CurationStatus;\n published: boolean;\n searchTerm?: string;\n longRunningTask?: boolean;\n collectionHandle?: string;\n collectionId?: string;\n type: CurationType;\n /** @deprecated */\n boosting?: {\n groupings?: BoostGrouping[];\n sortings?: BoostSorting[];\n };\n sort?: CurationSort;\n schedule?: CurationSchedule;\n scheduleEnabled?: boolean;\n scheduleTimezone?: string;\n hidden?: boolean;\n\n markets: Array<string>;\n\n boostings?: Boosting[];\n sortings?: Sorting[];\n}\n\nexport enum CurationType {\n Search = \"search\",\n Collection = \"collection\",\n}\n\nexport interface CurationSort {\n sortTag?: string;\n sortOption: string;\n sortDirection: \"asc\" | \"desc\";\n sortVariantOption?: \"option1\" | \"option2\" | \"option3\";\n}\n\nexport interface CurationSchedule {\n schedulePublish: string;\n schedulePublishEnabled: boolean;\n scheduleUnpublish: string;\n scheduleUnpublishEnabled: boolean;\n}\n\nexport enum CurationStatus {\n Draft = \"draft\",\n Publishing = \"publishing\",\n Published = \"published\",\n Error = \"error\",\n Unpublishing = \"unpublishing\",\n Resetting = \"resetting\",\n Pinning = \"pinning\",\n Sorting = \"sorting\",\n}\n\nexport interface CurationHiding {\n productId: number;\n}\n\nexport interface Market {\n id: string;\n label: string;\n enabled: boolean;\n publicationId: string;\n locationId: string;\n currencyCode?: string;\n countryCode?: string;\n}\n\n/** @deprecated This entity will be removed once the curation is fully refactored into merchandisable entities */\nexport interface BoostGrouping {\n key: string;\n value: string;\n field: string;\n position: number;\n operation: string;\n}\n\n/** @deprecated This entity will be removed once the curation is fully refactored into merchandisable entities */\nexport interface BoostSorting {\n key: string;\n field: string;\n query?: string;\n position: number;\n direction: \"asc\" | \"desc\";\n}\n\nexport interface Link {\n content: string;\n url: string;\n key: string;\n}\n\nexport interface Callout extends ResourceDocument {\n type: CalloutType;\n link: string;\n links: Array<Link>;\n // name: string;\n title: string;\n content: string;\n enabled: boolean;\n textColor: string;\n mobileImage: string;\n mobileVideo: string;\n desktopVideo: string;\n desktopImage: string;\n backgroundColor: string;\n visibility: \"desktop\" | \"mobile\" | \"all\";\n displayColumns: string; // @todo this should be a number\n displayRows: string; // @todo this should be a number\n selectedDates?: {\n end: number;\n start: number;\n };\n hidden?: boolean;\n}\n\nexport enum CalloutType {\n Standard = \"standard\",\n Autofill = \"autofill\",\n}\n\nexport enum SynonymType {\n Group = \"group\",\n Oneway = \"oneway\",\n}\nexport interface Synonym extends ResourceDocument {\n name: string;\n enabled: boolean;\n synonyms: Array<string>;\n type: SynonymType;\n hidden?: boolean;\n}\nexport interface Antonym extends ResourceDocument {\n name: string;\n enabled: boolean;\n antonyms: Array<string>;\n hidden?: boolean;\n}\n\nexport interface MergedValue extends ResourceDocument {\n name: string;\n field: string;\n enabled: boolean;\n values: Array<string>;\n hidden?: boolean;\n}\n\nexport interface Collection extends ResourceDocument {\n title: string;\n handle: string;\n shopifyId: string;\n productIds: Array<string>;\n storefrontId: string;\n legacyResourceId: number;\n syncStatus?: \"error\" | \"complete\" | \"partiallyComplete\";\n syncAt?: string;\n}\n\n// product is the shopify product with edges and nodes normalised\nexport type Product = ResourceDocument &\n Omit<\n ShopifyProduct,\n \"variants\" | \"images\" | \"media\" | \"metafields\" | \"category\" | \"unpublishedPublications\"\n > & {\n category: string;\n variants: Array<\n Omit<ShopifyProduct[\"variants\"][\"edges\"][0][\"node\"], \"presentmentPrices\"> & {\n productId?: string;\n images?: Array<ShopifyProductImage>; // from child product if this variant is from a child\n presentmentPrices: ShopifyProduct[\"variants\"][\"edges\"][0][\"node\"][\"presentmentPrices\"][\"edges\"][0][\"node\"][];\n marketPrices: Array<{\n marketId: string;\n price: {\n amount: string;\n currencyCode: string;\n };\n compareAtPrice: {\n amount: string;\n currencyCode: string;\n } | null;\n }>;\n // inventoryItem: ShopifyProduct[\"variants\"][\"edges\"][0][\"node\"][\"inventoryItem\"];\n }\n >;\n // unpublishedPublications: Array<ShopifyProduct[\"unpublishedPublications\"][\"edges\"][0][\"node\"]>\n // inventoryLevels: Array<{\n // variantId: string;\n // locationId: string;\n // locationName: string;\n // quantity: number;\n // }>;\n related?: Array<string>;\n images: Array<ShopifyProductImage>;\n media: ShopifyProduct[\"media\"][\"edges\"][0][\"node\"][];\n metafields: ShopifyProduct[\"metafields\"][\"edges\"][0][\"node\"][];\n keywords: Array<string>;\n syncStatus?: \"error\" | \"complete\" | \"partiallyComplete\";\n syncAt?: string;\n markets?: Array<string>;\n };\n\nexport interface SearchableField extends ResourceDocument {\n field: string;\n enabled: boolean;\n hidden?: boolean;\n points: number;\n allowedMistakes: number;\n mistakePenaltyPercent: number;\n synyonymEnabled: boolean;\n synonymPenaltyPercent: number;\n}\n\nexport interface Boosting {\n key: string;\n fieldName: string;\n operation: Operation;\n value: string;\n points: number;\n}\n\nexport interface Sorting {\n field: string;\n position: number;\n direction: \"asc\" | \"desc\";\n}\n\nexport const Operation = {\n Equals: \"equals\",\n NotEquals: \"not equals\",\n Contains: \"contains\",\n NotContains: \"not contains\",\n LessThan: \"less than\",\n GreaterThan: \"greater than\",\n} as const;\nexport type Operation = typeof Operation[keyof typeof Operation];\n"]}
|
|
1
|
+
{"version":3,"file":"firestore.js","sourceRoot":"","sources":["../../../src/types/firestore.ts"],"names":[],"mappings":";;;AAUA,IAAY,YAqBX;AArBD,WAAY,YAAY;IACtB,4CAA4B,CAAA;IAC5B,mCAAmB,CAAA;IACnB,yCAAyB,CAAA;IACzB,qCAAqB,CAAA;IACrB,4CAA4B,CAAA;IAC5B,kDAAkC,CAAA;IAClC,mCAAmB,CAAA;IACnB,oDAAoC,CAAA;IACpC,0DAA0C,CAAA;IAC1C,oDAAoC,CAAA;IACpC,4CAA4B,CAAA;IAC5B,4CAA4B,CAAA;IAC5B,4CAA4B,CAAA;IAC5B,qCAAqB,CAAA;IACrB,uCAAuB,CAAA;IACvB,6BAAa,CAAA;IACb,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,6BAAa,CAAA;IACb,oDAAoC,CAAA;AACtC,CAAC,EArBW,YAAY,4BAAZ,YAAY,QAqBvB;AAED,IAAY,qCAGX;AAHD,WAAY,qCAAqC;IAC/C,0DAAiB,CAAA;IACjB,qEAA4B,CAAA;AAC9B,CAAC,EAHW,qCAAqC,qDAArC,qCAAqC,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M;IACZ,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;CACV,CAAC;AA6FX,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,yCAAyB,CAAA;AAC3B,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAgBD,IAAY,cASX;AATD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,2CAAyB,CAAA;IACzB,yCAAuB,CAAA;IACvB,iCAAe,CAAA;IACf,+CAA6B,CAAA;IAC7B,yCAAuB,CAAA;IACvB,qCAAmB,CAAA;IACnB,qCAAmB,CAAA;AACrB,CAAC,EATW,cAAc,8BAAd,cAAc,QASzB;AAgED,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,oCAAqB,CAAA;IACrB,oCAAqB,CAAA;AACvB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAED,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,8BAAe,CAAA;IACf,gCAAiB,CAAA;AACnB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAmGY,QAAA,SAAS,GAAG;IACvB,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,YAAY;IACvB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,cAAc;IAC3B,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,cAAc;CACnB,CAAC","sourcesContent":["import { ShopifyProduct, ShopifyProductImage } from \"./shopify\";\n\nexport interface ResourceDocument {\n id: string;\n keywords: Array<string>;\n version?: string;\n createdAt?: string;\n updatedAt?: string;\n}\n\nexport enum ResourceType {\n ActivityLog = \"activity_log\",\n Product = \"product\",\n Collection = \"collection\",\n Curation = \"curation\",\n CurationPin = \"curation_pin\",\n CurationHiding = \"curation_hiding\",\n Callout = \"callout\",\n SettingsAccount = \"account_settings\",\n SettingsAutomation = \"automation_settings\",\n SettingsProduct = \"product_settings\",\n FilterGroup = \"filter_group\",\n FilterFacet = \"filter_facet\",\n MergedValue = \"merged_value\",\n Redirect = \"redirect\",\n Relevancy = \"relevancy\",\n Sort = \"sort\",\n Antonym = \"antonym\",\n Synonym = \"synonym\",\n Task = \"task\",\n SearchableField = \"searchable_field\",\n}\n\nexport enum MerchandisingCalloutAutofillBehaviour {\n Always = \"always\",\n MoreResults = \"more_results\",\n}\n\nexport const MerchandisingCalloutAutofillBehaviourLabel: Record<MerchandisingCalloutAutofillBehaviour, string> = {\n [MerchandisingCalloutAutofillBehaviour.Always]: \"Autofill always\",\n [MerchandisingCalloutAutofillBehaviour.MoreResults]: \"Autofill when there are more results\",\n};\n\nexport enum SharedStoreResource {\n Curation = \"curation\",\n Callout = \"callout\",\n FilterGroup = \"filter_group\",\n FilterFacet = \"filter_facet\",\n MergedValue = \"merged_value\",\n Redirect = \"redirect\",\n Relevancy = \"relevancy\",\n Sort = \"sort\",\n Synonym = \"synonym\",\n SettingsAccount = \"account_settings\",\n SettingsAutomation = \"automation_settings\",\n SettingsProduct = \"product_settings\",\n}\n\nexport const SharedStoreResourceLabels: Record<SharedStoreResource, string> = {\n [SharedStoreResource.Curation]: \"Curation\",\n [SharedStoreResource.Callout]: \"Callout\",\n [SharedStoreResource.FilterGroup]: \"Filter group\",\n [SharedStoreResource.FilterFacet]: \"Filter facet\",\n [SharedStoreResource.MergedValue]: \"Merged value\",\n [SharedStoreResource.Redirect]: \"Redirect\",\n [SharedStoreResource.Relevancy]: \"Relevancy\",\n [SharedStoreResource.Sort]: \"Sort\",\n [SharedStoreResource.Synonym]: \"Synonym\",\n [SharedStoreResource.SettingsAccount]: \"Settings account\",\n [SharedStoreResource.SettingsAutomation]: \"Settings automation\",\n [SharedStoreResource.SettingsProduct]: \"Settings product\",\n};\n\nexport interface Relevance extends ResourceDocument {\n field: string;\n enabled: boolean;\n importance: number;\n searchType: \"always_search\" | \"search_page\" | \"instant_search\";\n hidden?: boolean;\n}\n\nexport const DefinedFieldType = {\n Array: \"array\",\n Text: \"text\",\n Float: \"float\",\n Long: \"long\",\n Boolean: \"boolean\",\n} as const;\nexport type DefinedFieldType = typeof DefinedFieldType[keyof typeof DefinedFieldType] | (string & {});\n\nexport interface DefinedField {\n label: string;\n name: string;\n type: DefinedFieldType;\n}\n\nexport interface Sort extends ResourceDocument {\n name: string;\n handle: string;\n field: string;\n position: number;\n enabled: boolean;\n direction: \"desc\" | \"asc\";\n visibility: \"all\" | \"search\" | \"collection\";\n hidden?: boolean;\n}\n\nexport interface FilterGroup extends ResourceDocument {\n name: string;\n handle: string;\n enabled: boolean;\n pageSize: number;\n collections: Array<string>;\n type: \"search\" | \"collection\";\n paginationType: \"pagination\" | \"load_more\" | \"next_prev\" | \"infinite_scroll\";\n inventoryVisibility: \"show_all\" | \"hide_products\" | \"hide_variants\" | \"hide_all\";\n}\n\nexport interface FilterFacet extends ResourceDocument {\n name: string;\n field: string;\n handle: string;\n position: number;\n enabled: boolean;\n keywords: Array<string>;\n customSortOrder?: string;\n displayType: \"multi\" | \"single\" | \"slider\";\n displayView: \"list\" | \"check\" | \"swatch\" | \"range\" | \"box\";\n displaySize: string;\n displaySliderStep: string;\n displaySliderPrefix: string;\n displaySliderSuffix: string;\n displayRangeOptions: Array<string>;\n settingsShowMore: boolean;\n settingsUppercase: boolean;\n settingsShowSearch: boolean;\n settingsShowFilter: boolean;\n settingsShowEmptyValues: boolean;\n settingsHideUnavailable: boolean;\n settingsCollapsedMobile: boolean;\n settingsCollapsedDesktop: boolean;\n settingsFilterLogic: \"and\" | \"or\";\n valuesShow: \"all\" | \"manual\";\n valuesManual: Array<string>;\n valuesExclude: Array<string>;\n}\n\nexport interface Redirect extends ResourceDocument {\n url: string;\n query: string;\n enabled: boolean;\n hidden?: boolean;\n}\n\nexport interface Curation extends ResourceDocument {\n title: string;\n status: CurationStatus;\n published: boolean;\n searchTerm?: string;\n longRunningTask?: boolean;\n collectionHandle?: string;\n collectionId?: string;\n type: CurationType;\n /** @deprecated */\n boosting?: {\n groupings?: BoostGrouping[];\n sortings?: BoostSorting[];\n };\n sort?: CurationSort;\n schedule?: CurationSchedule;\n scheduleEnabled?: boolean;\n scheduleTimezone?: string;\n hidden?: boolean;\n\n markets: Array<string>;\n\n boostings?: Boosting[];\n sortings?: Sorting[];\n}\n\nexport enum CurationType {\n Search = \"search\",\n Collection = \"collection\",\n}\n\nexport interface CurationSort {\n sortTag?: string;\n sortOption: string;\n sortDirection: \"asc\" | \"desc\";\n sortVariantOption?: \"option1\" | \"option2\" | \"option3\";\n}\n\nexport interface CurationSchedule {\n schedulePublish: string;\n schedulePublishEnabled: boolean;\n scheduleUnpublish: string;\n scheduleUnpublishEnabled: boolean;\n}\n\nexport enum CurationStatus {\n Draft = \"draft\",\n Publishing = \"publishing\",\n Published = \"published\",\n Error = \"error\",\n Unpublishing = \"unpublishing\",\n Resetting = \"resetting\",\n Pinning = \"pinning\",\n Sorting = \"sorting\",\n}\n\nexport interface CurationHiding {\n productId: number;\n}\n\nexport interface Market {\n id: string;\n label: string;\n enabled: boolean;\n publicationId: string;\n locationId: string;\n currencyCode?: string;\n countryCode?: string;\n}\n\n/** @deprecated This entity will be removed once the curation is fully refactored into merchandisable entities */\nexport interface BoostGrouping {\n key: string;\n value: string;\n field: string;\n position: number;\n operation: string;\n}\n\n/** @deprecated This entity will be removed once the curation is fully refactored into merchandisable entities */\nexport interface BoostSorting {\n key: string;\n field: string;\n query?: string;\n position: number;\n direction: \"asc\" | \"desc\";\n}\n\nexport interface Link {\n content: string;\n url: string;\n key: string;\n}\n\nexport interface Callout extends ResourceDocument {\n type: CalloutType;\n link: string;\n links: Array<Link>;\n // name: string;\n title: string;\n content: string;\n enabled: boolean;\n textColor: string;\n mobileImage: string;\n mobileVideo: string;\n desktopVideo: string;\n desktopImage: string;\n backgroundColor: string;\n visibility: \"desktop\" | \"mobile\" | \"all\";\n displayColumns: string; // @todo this should be a number\n displayRows: string; // @todo this should be a number\n selectedDates?: {\n end: number;\n start: number;\n };\n hidden?: boolean;\n}\n\nexport enum CalloutType {\n Standard = \"standard\",\n Autofill = \"autofill\",\n}\n\nexport enum SynonymType {\n Group = \"group\",\n Oneway = \"oneway\",\n}\nexport interface Synonym extends ResourceDocument {\n name: string;\n enabled: boolean;\n synonyms: Array<string>;\n type: SynonymType;\n hidden?: boolean;\n}\nexport interface Antonym extends ResourceDocument {\n name: string;\n enabled: boolean;\n antonyms: Array<string>;\n hidden?: boolean;\n}\n\nexport interface MergedValue extends ResourceDocument {\n name: string;\n field: string;\n enabled: boolean;\n values: Array<string>;\n hidden?: boolean;\n}\n\nexport interface Collection extends ResourceDocument {\n title: string;\n handle: string;\n shopifyId: string;\n productIds: Array<string>;\n storefrontId: string;\n legacyResourceId: number;\n syncStatus?: \"error\" | \"complete\" | \"partiallyComplete\";\n syncAt?: string;\n}\n\n// product is the shopify product with edges and nodes normalised\nexport type Product = ResourceDocument &\n Omit<ShopifyProduct, \"variants\" | \"images\" | \"media\" | \"metafields\" | \"category\" | \"unpublishedPublications\"> & {\n category: string;\n variants: Array<\n Omit<ShopifyProduct[\"variants\"][\"edges\"][0][\"node\"], \"presentmentPrices\"> & {\n productId?: string;\n images?: Array<ShopifyProductImage>; // from child product if this variant is from a child\n presentmentPrices: ShopifyProduct[\"variants\"][\"edges\"][0][\"node\"][\"presentmentPrices\"][\"edges\"][0][\"node\"][];\n marketPrices: Array<{\n marketId: string;\n price: {\n amount: string;\n currencyCode: string;\n };\n compareAtPrice: {\n amount: string;\n currencyCode: string;\n } | null;\n }>;\n // inventoryItem: ShopifyProduct[\"variants\"][\"edges\"][0][\"node\"][\"inventoryItem\"];\n }\n >;\n // unpublishedPublications: Array<ShopifyProduct[\"unpublishedPublications\"][\"edges\"][0][\"node\"]>\n // inventoryLevels: Array<{\n // variantId: string;\n // locationId: string;\n // locationName: string;\n // quantity: number;\n // }>;\n related?: Array<string>;\n images: Array<ShopifyProductImage>;\n media: ShopifyProduct[\"media\"][\"edges\"][0][\"node\"][];\n metafields: ShopifyProduct[\"metafields\"][\"edges\"][0][\"node\"][];\n keywords: Array<string>;\n syncStatus?: \"error\" | \"complete\" | \"partiallyComplete\";\n syncAt?: string;\n markets?: Array<string>;\n };\n\nexport interface SearchableField extends ResourceDocument {\n field: string;\n enabled: boolean;\n hidden?: boolean;\n points: number;\n maxEdits: number;\n mistakePenaltyPercent: number;\n synonymEnabled: boolean;\n synonymPenaltyPercent: number;\n}\n\nexport interface Boosting {\n key: string;\n fieldName: string;\n operation: Operation;\n value: string;\n points: number;\n}\n\nexport interface Sorting {\n field: string;\n position: number;\n direction: \"asc\" | \"desc\";\n}\n\nexport const Operation = {\n Equals: \"equals\",\n NotEquals: \"not equals\",\n Contains: \"contains\",\n NotContains: \"not contains\",\n LessThan: \"less than\",\n GreaterThan: \"greater than\",\n} as const;\nexport type Operation = typeof Operation[keyof typeof Operation];\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Config } from "../types/config";
|
|
2
2
|
export declare const getConfigFromCache: () => Config | undefined;
|
|
3
|
-
export declare const getConfigFromNetwork: (shopifyPermanentDomain: string
|
|
4
|
-
export declare const getConfig: (shopifyPermanentDomain: string
|
|
3
|
+
export declare const getConfigFromNetwork: (shopifyPermanentDomain: string) => Promise<Config | undefined>;
|
|
4
|
+
export declare const getConfig: (shopifyPermanentDomain: string) => Promise<Config>;
|
|
@@ -25,27 +25,24 @@ const getConfigFromCache = () => {
|
|
|
25
25
|
return;
|
|
26
26
|
};
|
|
27
27
|
exports.getConfigFromCache = getConfigFromCache;
|
|
28
|
-
const getConfigFromNetwork = (shopifyPermanentDomain
|
|
28
|
+
const getConfigFromNetwork = (shopifyPermanentDomain) => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
29
|
var _a, _b;
|
|
30
30
|
let configFromNetwork;
|
|
31
|
-
const url = configBaseUrl || "https://config.usereactify.com/";
|
|
32
|
-
const apiUrl = new URL(url);
|
|
33
|
-
apiUrl.searchParams.set("shop", shopifyPermanentDomain);
|
|
34
31
|
try {
|
|
35
|
-
configFromNetwork = (_a = (yield fetch(
|
|
32
|
+
configFromNetwork = (_a = (yield fetch(`https://config.usereactify.com/?shop=${shopifyPermanentDomain}`).then((response) => response.json()))) === null || _a === void 0 ? void 0 : _a.body;
|
|
36
33
|
}
|
|
37
34
|
catch (error) {
|
|
38
|
-
configFromNetwork = (_b = (yield fetch(
|
|
35
|
+
configFromNetwork = (_b = (yield fetch(`https://config.usereactify.com/?shop=${shopifyPermanentDomain}`).then((response) => response.json()))) === null || _b === void 0 ? void 0 : _b.body;
|
|
39
36
|
}
|
|
40
37
|
return configFromNetwork;
|
|
41
38
|
});
|
|
42
39
|
exports.getConfigFromNetwork = getConfigFromNetwork;
|
|
43
|
-
const getConfig = (shopifyPermanentDomain
|
|
40
|
+
const getConfig = (shopifyPermanentDomain) => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
41
|
const configFromCache = (0, exports.getConfigFromCache)();
|
|
45
42
|
if (configFromCache) {
|
|
46
43
|
return configFromCache;
|
|
47
44
|
}
|
|
48
|
-
const configFromNetwork = yield (0, exports.getConfigFromNetwork)(shopifyPermanentDomain
|
|
45
|
+
const configFromNetwork = yield (0, exports.getConfigFromNetwork)(shopifyPermanentDomain);
|
|
49
46
|
if (!configFromNetwork) {
|
|
50
47
|
throw new Error("Unable to load config");
|
|
51
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/utility/config.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAEO,MAAM,kBAAkB,GAAG,GAAuB,EAAE;;IACzD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO;IACT,CAAC;IAED,MAAM,eAAe,GAEV,IAAI,CAAC,KAAK,CACnB,MAAA,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,wBAAwB,CAAC,mCAAI,MAAM,CAClE,CAAC;IAEF,IAAI,eAAe,EAAE,CAAC;QACpB,IAAI,CAAA,MAAA,eAAe,CAAC,MAAM,CAAC,KA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,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,0CAAE,IAAI,CAAC;IAC/C,CAAC;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAA,CAAC;AAdW,QAAA,oBAAoB,wBAc/B;AAEK,MAAM,SAAS,GAAG,CAAO,sBAA8B,EAAmB,EAAE;IACjF,MAAM,eAAe,GAAG,IAAA,0BAAkB,GAAE,CAAC;IAC7C,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,eAAe,CAAC;IACzB,CAAC;IAED,MAAM,iBAAiB,GAAG,MAAM,IAAA,4BAAoB,EAAC,sBAAsB,CAAC,CAAC;IAE7E,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,MAAM,CAAC,cAAc,CAAC,OAAO,CAC3B,wBAAwB,EACxB,IAAI,CAAC,SAAS,CAAC;YACb,MAAM,EAAE,iBAAiB;SAC1B,CAAC,CACH,CAAC;IACJ,CAAC;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAA,CAAC;AAtBW,QAAA,SAAS,aAsBpB","sourcesContent":["import { Config } from \"../types/config\";\n\nexport const getConfigFromCache = (): Config | undefined => {\n if (typeof window === \"undefined\") {\n return;\n }\n\n const configFromCache: {\n config: Config;\n } | null = JSON.parse(\n window.sessionStorage.getItem(\"reactify-search:config\") ?? \"null\"\n );\n\n if (configFromCache) {\n if (configFromCache.config.cache?.enabled === false) {\n return;\n }\n\n return configFromCache.config;\n }\n\n return;\n};\n\nexport const getConfigFromNetwork = async (shopifyPermanentDomain: string): Promise<Config | undefined> => {\n let configFromNetwork: Config | undefined;\n try {\n configFromNetwork = (await fetch(\n `https://config.usereactify.com/?shop=${shopifyPermanentDomain}`\n ).then((response) => response.json()))?.body;\n \n } catch (error) {\n configFromNetwork = (await fetch(\n `https://config.usereactify.com/?shop=${shopifyPermanentDomain}`\n ).then((response) => response.json()))?.body;\n }\n\n return configFromNetwork;\n};\n\nexport const getConfig = async (shopifyPermanentDomain: string): Promise<Config> => {\n const configFromCache = getConfigFromCache();\n if (configFromCache) {\n return configFromCache;\n }\n\n const configFromNetwork = await getConfigFromNetwork(shopifyPermanentDomain);\n\n if (!configFromNetwork) {\n throw new Error(\"Unable to load config\");\n }\n\n if (typeof window !== \"undefined\") {\n window.sessionStorage.setItem(\n \"reactify-search:config\",\n JSON.stringify({\n config: configFromNetwork,\n })\n );\n }\n\n return configFromNetwork;\n};\n"]}
|
|
@@ -201,235 +201,16 @@ export declare const getPropsSensorCustom: (options: GeneratePropsSensorOptions)
|
|
|
201
201
|
export declare const getPropsSensorCollection: (options: GeneratePropsSensorOptions) => {
|
|
202
202
|
source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
|
|
203
203
|
componentId: string;
|
|
204
|
-
customQuery: () =>
|
|
205
|
-
query: {
|
|
206
|
-
bool: {
|
|
207
|
-
should: ({
|
|
208
|
-
nested: {
|
|
209
|
-
path: string;
|
|
210
|
-
query: {
|
|
211
|
-
term: {
|
|
212
|
-
"collections.handle.keyword": string;
|
|
213
|
-
"curations.collectionHandle.keyword"?: undefined;
|
|
214
|
-
};
|
|
215
|
-
};
|
|
216
|
-
};
|
|
217
|
-
} | {
|
|
218
|
-
nested: {
|
|
219
|
-
path: string;
|
|
220
|
-
query: {
|
|
221
|
-
term: {
|
|
222
|
-
"curations.collectionHandle.keyword": string;
|
|
223
|
-
"collections.handle.keyword"?: undefined;
|
|
224
|
-
};
|
|
225
|
-
};
|
|
226
|
-
};
|
|
227
|
-
})[];
|
|
228
|
-
};
|
|
229
|
-
};
|
|
230
|
-
} | null;
|
|
231
|
-
} | null;
|
|
232
|
-
export declare const getPropsSensorCollectionWeighted: ({ provider, config }: GeneratePropsSensorOptions) => {
|
|
233
|
-
source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
|
|
234
|
-
componentId: string;
|
|
235
|
-
customQuery: () => {
|
|
236
|
-
query: {
|
|
237
|
-
function_score: {
|
|
238
|
-
query: {
|
|
239
|
-
bool: {
|
|
240
|
-
must: Record<string, any>[];
|
|
241
|
-
};
|
|
242
|
-
};
|
|
243
|
-
functions: ({
|
|
244
|
-
filter: {
|
|
245
|
-
wildcard: {
|
|
246
|
-
[x: string]: string;
|
|
247
|
-
};
|
|
248
|
-
bool?: undefined;
|
|
249
|
-
term?: undefined;
|
|
250
|
-
range?: undefined;
|
|
251
|
-
};
|
|
252
|
-
weight: number;
|
|
253
|
-
} | {
|
|
254
|
-
filter: {
|
|
255
|
-
bool: {
|
|
256
|
-
must_not: {
|
|
257
|
-
wildcard: {
|
|
258
|
-
[x: string]: string;
|
|
259
|
-
};
|
|
260
|
-
};
|
|
261
|
-
};
|
|
262
|
-
wildcard?: undefined;
|
|
263
|
-
term?: undefined;
|
|
264
|
-
range?: undefined;
|
|
265
|
-
};
|
|
266
|
-
weight: number;
|
|
267
|
-
} | {
|
|
268
|
-
filter: {
|
|
269
|
-
term: {
|
|
270
|
-
[x: string]: string;
|
|
271
|
-
};
|
|
272
|
-
wildcard?: undefined;
|
|
273
|
-
bool?: undefined;
|
|
274
|
-
range?: undefined;
|
|
275
|
-
};
|
|
276
|
-
weight: number;
|
|
277
|
-
} | {
|
|
278
|
-
filter: {
|
|
279
|
-
range: {
|
|
280
|
-
[x: string]: {
|
|
281
|
-
gt: number;
|
|
282
|
-
};
|
|
283
|
-
};
|
|
284
|
-
wildcard?: undefined;
|
|
285
|
-
bool?: undefined;
|
|
286
|
-
term?: undefined;
|
|
287
|
-
};
|
|
288
|
-
weight: number;
|
|
289
|
-
} | {
|
|
290
|
-
filter: {
|
|
291
|
-
range: {
|
|
292
|
-
[x: string]: {
|
|
293
|
-
lt: number;
|
|
294
|
-
};
|
|
295
|
-
};
|
|
296
|
-
wildcard?: undefined;
|
|
297
|
-
bool?: undefined;
|
|
298
|
-
term?: undefined;
|
|
299
|
-
};
|
|
300
|
-
weight: number;
|
|
301
|
-
})[];
|
|
302
|
-
score_mode: string;
|
|
303
|
-
boost_mode: string;
|
|
304
|
-
};
|
|
305
|
-
};
|
|
306
|
-
};
|
|
204
|
+
customQuery: () => import("../search-request-builder").SearchRequest;
|
|
307
205
|
} | null;
|
|
308
|
-
export declare const
|
|
206
|
+
export declare const getPropsSensorSearchTerm: (options: GeneratePropsSensorOptions & {
|
|
309
207
|
searchTerm?: string;
|
|
310
208
|
}) => {
|
|
311
209
|
source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
|
|
312
210
|
componentId: string;
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
query: {
|
|
317
|
-
bool: {
|
|
318
|
-
should: {
|
|
319
|
-
match: {
|
|
320
|
-
[x: string]: {
|
|
321
|
-
query: string;
|
|
322
|
-
fuzziness: number;
|
|
323
|
-
analyzer: string;
|
|
324
|
-
};
|
|
325
|
-
};
|
|
326
|
-
}[];
|
|
327
|
-
terms?: {
|
|
328
|
-
markets: string[];
|
|
329
|
-
} | undefined;
|
|
330
|
-
};
|
|
331
|
-
};
|
|
332
|
-
functions: ({
|
|
333
|
-
filter: {
|
|
334
|
-
wildcard: {
|
|
335
|
-
[x: string]: string;
|
|
336
|
-
};
|
|
337
|
-
bool?: undefined;
|
|
338
|
-
term?: undefined;
|
|
339
|
-
range?: undefined;
|
|
340
|
-
};
|
|
341
|
-
weight: number;
|
|
342
|
-
} | {
|
|
343
|
-
filter: {
|
|
344
|
-
bool: {
|
|
345
|
-
must_not: {
|
|
346
|
-
wildcard: {
|
|
347
|
-
[x: string]: string;
|
|
348
|
-
};
|
|
349
|
-
};
|
|
350
|
-
};
|
|
351
|
-
wildcard?: undefined;
|
|
352
|
-
term?: undefined;
|
|
353
|
-
range?: undefined;
|
|
354
|
-
};
|
|
355
|
-
weight: number;
|
|
356
|
-
} | {
|
|
357
|
-
filter: {
|
|
358
|
-
term: {
|
|
359
|
-
[x: string]: string;
|
|
360
|
-
};
|
|
361
|
-
wildcard?: undefined;
|
|
362
|
-
bool?: undefined;
|
|
363
|
-
range?: undefined;
|
|
364
|
-
};
|
|
365
|
-
weight: number;
|
|
366
|
-
} | {
|
|
367
|
-
filter: {
|
|
368
|
-
range: {
|
|
369
|
-
[x: string]: {
|
|
370
|
-
gt: number;
|
|
371
|
-
};
|
|
372
|
-
};
|
|
373
|
-
wildcard?: undefined;
|
|
374
|
-
bool?: undefined;
|
|
375
|
-
term?: undefined;
|
|
376
|
-
};
|
|
377
|
-
weight: number;
|
|
378
|
-
} | {
|
|
379
|
-
filter: {
|
|
380
|
-
range: {
|
|
381
|
-
[x: string]: {
|
|
382
|
-
lt: number;
|
|
383
|
-
};
|
|
384
|
-
};
|
|
385
|
-
wildcard?: undefined;
|
|
386
|
-
bool?: undefined;
|
|
387
|
-
term?: undefined;
|
|
388
|
-
};
|
|
389
|
-
weight: number;
|
|
390
|
-
} | {
|
|
391
|
-
filter: {
|
|
392
|
-
match: {
|
|
393
|
-
[x: string]: {
|
|
394
|
-
query: string;
|
|
395
|
-
fuzziness: number;
|
|
396
|
-
analyzer: string;
|
|
397
|
-
};
|
|
398
|
-
};
|
|
399
|
-
bool?: undefined;
|
|
400
|
-
};
|
|
401
|
-
weight: number;
|
|
402
|
-
} | {
|
|
403
|
-
filter: {
|
|
404
|
-
bool: {
|
|
405
|
-
must_not: {
|
|
406
|
-
match: {
|
|
407
|
-
[x: string]: {
|
|
408
|
-
query: string;
|
|
409
|
-
fuzziness: number;
|
|
410
|
-
analyzer: string;
|
|
411
|
-
};
|
|
412
|
-
};
|
|
413
|
-
};
|
|
414
|
-
must: {
|
|
415
|
-
match: {
|
|
416
|
-
[x: string]: {
|
|
417
|
-
query: string;
|
|
418
|
-
fuzziness: number;
|
|
419
|
-
analyzer: string;
|
|
420
|
-
};
|
|
421
|
-
};
|
|
422
|
-
};
|
|
423
|
-
};
|
|
424
|
-
match?: undefined;
|
|
425
|
-
};
|
|
426
|
-
weight: number;
|
|
427
|
-
})[];
|
|
428
|
-
score_mode: string;
|
|
429
|
-
boost_mode: string;
|
|
430
|
-
};
|
|
431
|
-
};
|
|
432
|
-
};
|
|
211
|
+
dataField: string[];
|
|
212
|
+
fieldWeights: number[];
|
|
213
|
+
customQuery: (value: string) => import("../search-request-builder").SearchRequest | null;
|
|
433
214
|
} | null;
|
|
434
215
|
export declare const getPropsSensorPublished: (options: GeneratePropsSensorOptions) => {
|
|
435
216
|
source: import("react").ComponentClass<import("@usereactify/search-internals/lib/components/basic/ReactiveComponent").ReactiveComponentProps, any>;
|
|
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.getPropsFilterSlider = exports.getPropsFilterRange = exports.getPropsFilterList = exports.getPropsShared = exports.getPropsReact = exports.getPropsResults = exports.getPropsBase = exports.getPropsSensorExplain = exports.getPropsSensorSort = exports.getPropsSensorInventoryAvailable = exports.getPropsSensorPublished = exports.
|
|
15
|
+
exports.getPropsFilterSlider = exports.getPropsFilterRange = exports.getPropsFilterList = exports.getPropsShared = exports.getPropsReact = exports.getPropsResults = exports.getPropsBase = exports.getPropsSensorExplain = exports.getPropsSensorSort = exports.getPropsSensorInventoryAvailable = exports.getPropsSensorPublished = exports.getPropsSensorSearchTerm = exports.getPropsSensorCollection = exports.getPropsSensorCustom = exports.getPropsSensors = exports.getPropsFilterGroupOption = exports.getPropsFilterGroup = void 0;
|
|
16
16
|
const search_internals_1 = require("@usereactify/search-internals");
|
|
17
17
|
const components_1 = require("../components");
|
|
18
18
|
const curation_1 = require("./curation");
|
|
@@ -20,7 +20,8 @@ const sortOption_1 = require("./sortOption");
|
|
|
20
20
|
const filters_1 = require("./filters");
|
|
21
21
|
const hooks_1 = require("../hooks");
|
|
22
22
|
const package_json_1 = __importDefault(require("../../package.json"));
|
|
23
|
-
const
|
|
23
|
+
const search_request_builder_1 = require("../search-request-builder");
|
|
24
|
+
const firestore_1 = require("../types/firestore");
|
|
24
25
|
const getPropsFilterGroup = (options) => {
|
|
25
26
|
var _a, _b;
|
|
26
27
|
return [
|
|
@@ -75,122 +76,74 @@ exports.getPropsSensorCustom = getPropsSensorCustom;
|
|
|
75
76
|
const getPropsSensorCollection = (options) => {
|
|
76
77
|
if (options.provider.mode !== "collection")
|
|
77
78
|
return null;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
componentId: "SensorCollection",
|
|
81
|
-
customQuery: () => {
|
|
82
|
-
if (options.provider.mode !== "collection")
|
|
83
|
-
return null;
|
|
84
|
-
const conditions = [];
|
|
85
|
-
const handle = options.provider.collectionHandle;
|
|
86
|
-
const market = options.provider.market;
|
|
87
|
-
if (options.provider.market) {
|
|
88
|
-
conditions.push({
|
|
89
|
-
nested: {
|
|
90
|
-
path: "curations",
|
|
91
|
-
query: {
|
|
92
|
-
bool: {
|
|
93
|
-
should: [
|
|
94
|
-
{
|
|
95
|
-
nested: {
|
|
96
|
-
path: "collections",
|
|
97
|
-
query: { term: { "collections.handle.keyword": handle } },
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
nested: {
|
|
102
|
-
path: "curations",
|
|
103
|
-
query: {
|
|
104
|
-
term: {
|
|
105
|
-
"curations.collectionHandle.keyword": handle,
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
],
|
|
111
|
-
must: [
|
|
112
|
-
{
|
|
113
|
-
nested: {
|
|
114
|
-
path: "curations",
|
|
115
|
-
query: { term: { "curations.markets.keyword": market } },
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
],
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
return {
|
|
125
|
-
query: {
|
|
126
|
-
bool: {
|
|
127
|
-
should: [
|
|
128
|
-
{
|
|
129
|
-
nested: {
|
|
130
|
-
path: "collections",
|
|
131
|
-
query: { term: { "collections.handle.keyword": handle } },
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
nested: {
|
|
136
|
-
path: "curations",
|
|
137
|
-
query: {
|
|
138
|
-
term: { "curations.collectionHandle.keyword": handle },
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
],
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
|
-
};
|
|
146
|
-
},
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
|
-
exports.getPropsSensorCollection = getPropsSensorCollection;
|
|
150
|
-
const getPropsSensorCollectionWeighted = ({ provider, config }) => {
|
|
151
|
-
if (provider.mode !== "collection")
|
|
79
|
+
const handle = options.provider.collectionHandle;
|
|
80
|
+
if (!handle)
|
|
152
81
|
return null;
|
|
153
|
-
const
|
|
154
|
-
const
|
|
82
|
+
const curation = (0, curation_1.getCuration)({ provider: options.provider, config: options.config });
|
|
83
|
+
const { baseSearchRequestMode, curationSearchRequestMode } = (0, search_request_builder_1.determineSearchRequestModes)(options.config.featureFlags);
|
|
155
84
|
return {
|
|
156
85
|
source: search_internals_1.ReactiveComponent,
|
|
157
|
-
componentId: "
|
|
86
|
+
componentId: "SensorCollection",
|
|
158
87
|
customQuery: () => {
|
|
159
|
-
|
|
160
|
-
const function_score = (0, queries_1.generateCollectionFunctionScore)({
|
|
88
|
+
const searchRequest = (0, search_request_builder_1.generateSearchRequest)({
|
|
161
89
|
collectionHandle: handle,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
90
|
+
curation: curation
|
|
91
|
+
? Object.assign(Object.assign({}, curation), { type: firestore_1.CurationType.Collection, collectionHandle: handle, keywords: [] }) : undefined,
|
|
92
|
+
market: options.provider.market,
|
|
93
|
+
baseSearchRequestMode,
|
|
94
|
+
curationSearchRequestMode,
|
|
165
95
|
});
|
|
166
|
-
return
|
|
96
|
+
return searchRequest;
|
|
167
97
|
},
|
|
168
98
|
};
|
|
169
99
|
};
|
|
170
|
-
exports.
|
|
171
|
-
const
|
|
172
|
-
if (provider.mode !== "search" && provider.mode !== "instant-search")
|
|
100
|
+
exports.getPropsSensorCollection = getPropsSensorCollection;
|
|
101
|
+
const getPropsSensorSearchTerm = (options) => {
|
|
102
|
+
if (options.provider.mode !== "search" && options.provider.mode !== "instant-search")
|
|
173
103
|
return null;
|
|
174
|
-
if (!searchTerm)
|
|
104
|
+
if (!options.searchTerm)
|
|
105
|
+
return null;
|
|
106
|
+
// ignore search fields only set for instant search
|
|
107
|
+
const searchFields = (() => {
|
|
108
|
+
if (options.provider.mode === "search") {
|
|
109
|
+
return options.config.fields.filter((field) => ["always_search", "search_page"].includes(field.searchType));
|
|
110
|
+
}
|
|
111
|
+
if (options.provider.mode === "instant-search") {
|
|
112
|
+
return options.config.fields.filter((field) => ["always_search", "instant_search"].includes(field.searchType));
|
|
113
|
+
}
|
|
114
|
+
return [];
|
|
115
|
+
})();
|
|
116
|
+
if (searchFields.length === 0)
|
|
175
117
|
return null;
|
|
176
118
|
return {
|
|
177
119
|
source: search_internals_1.ReactiveComponent,
|
|
178
|
-
componentId: "
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
120
|
+
componentId: "SensorSearchTerm",
|
|
121
|
+
dataField: searchFields.map((field) => field.field),
|
|
122
|
+
fieldWeights: searchFields.map((field) => field.importance),
|
|
123
|
+
customQuery: (value) => {
|
|
124
|
+
if (!value)
|
|
125
|
+
return null;
|
|
126
|
+
const curation = (0, curation_1.getCuration)({
|
|
127
|
+
provider: options.provider,
|
|
128
|
+
config: options.config,
|
|
129
|
+
searchTerm: options.searchTerm,
|
|
130
|
+
});
|
|
131
|
+
const { baseSearchRequestMode, curationSearchRequestMode } = (0, search_request_builder_1.determineSearchRequestModes)(options.config.featureFlags);
|
|
132
|
+
const searchRequest = (0, search_request_builder_1.generateSearchRequest)({
|
|
133
|
+
searchTerm: options.searchTerm,
|
|
134
|
+
curation: curation
|
|
135
|
+
? Object.assign(Object.assign({}, curation), { type: firestore_1.CurationType.Search, searchTerm: options.searchTerm, keywords: [] }) : undefined,
|
|
136
|
+
relevanceFields: options.config.fields.map((field) => (Object.assign(Object.assign({}, field), { enabled: true }))),
|
|
137
|
+
searchableFields: options.config.searchableFields,
|
|
138
|
+
market: options.provider.market,
|
|
139
|
+
baseSearchRequestMode: baseSearchRequestMode,
|
|
140
|
+
curationSearchRequestMode: curationSearchRequestMode,
|
|
188
141
|
});
|
|
189
|
-
return
|
|
142
|
+
return searchRequest;
|
|
190
143
|
},
|
|
191
144
|
};
|
|
192
145
|
};
|
|
193
|
-
exports.
|
|
146
|
+
exports.getPropsSensorSearchTerm = getPropsSensorSearchTerm;
|
|
194
147
|
const getPropsSensorPublished = (options) => {
|
|
195
148
|
return {
|
|
196
149
|
source: search_internals_1.ReactiveComponent,
|