@empathyco/x-adapter-platform 0.2.0-alpha.0 → 1.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/mappers/response/search-response.mapper.js.map +1 -1
- package/dist/cjs/schemas/banner.schema.js.map +1 -1
- package/dist/cjs/schemas/promoted.schema.js.map +1 -1
- package/dist/cjs/schemas/redirection.schema.js.map +1 -1
- package/dist/cjs/schemas/result.schema.js.map +1 -1
- package/dist/cjs/types/response.types.js.map +1 -1
- package/dist/esm/mappers/response/search-response.mapper.js.map +1 -1
- package/dist/esm/schemas/banner.schema.js.map +1 -1
- package/dist/esm/schemas/promoted.schema.js.map +1 -1
- package/dist/esm/schemas/redirection.schema.js.map +1 -1
- package/dist/esm/schemas/result.schema.js.map +1 -1
- package/dist/esm/types/response.types.js.map +1 -1
- package/dist/types/types/response.types.d.ts +2 -2
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-response.mapper.js","sourceRoot":"","sources":["../../../../src/mappers/response/search-response.mapper.ts"],"names":[],"mappings":";;;AAAA,8DAA6F;AAC7F,gDAA2D;
|
|
1
|
+
{"version":3,"file":"search-response.mapper.js","sourceRoot":"","sources":["../../../../src/mappers/response/search-response.mapper.ts"],"names":[],"mappings":";;;AAAA,8DAA6F;AAC7F,gDAA2D;AAE3D,+DAAkE;AAClE,6DAAgE;AAChE,mEAAsE;AACtE,+DAAkE;AAClE,yEAA4E;AAE/D,QAAA,oBAAoB,GAAmD;IAClF,OAAO,EAAE;QACP,KAAK,EAAE,iBAAiB;QACxB,UAAU,EAAE,mCAAmB;KAChC;IACD,MAAM,EAAE;QACN,KAAK,EAAE,gBAAgB;QACvB,UAAU,EAAE,iCAAkB;KAC/B;IACD,YAAY,EAAE,kBAAkB;IAChC,UAAU,EAAE,sBAAsB;IAClC,OAAO,EAAE;QACP,KAAK,EAAE,gBAAgB;QACvB,UAAU,EAAE,mCAAmB;KAChC;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,kBAAkB;QACzB,UAAU,EAAE,uCAAqB;KAClC;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,gBAAgB;QACvB,UAAU,EAAE,6CAAwB;KACrC;IACD,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,WAAC,OAAA,IAAA,+BAAqB,EAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,0CAAE,KAAK,CAAC,CAAA,EAAA;CAC9E,CAAC;AAEW,QAAA,2BAA2B,GAAG,IAAA,oCAAmB,EAAC,4BAAoB,CAAC,CAAC;AAExE,QAAA,oBAAoB,GAAG,IAAA,oCAAmB,EACrD,mCAA2B,CAC5B,CAAC","sourcesContent":["import { createMutableSchema, Schema, schemaMapperFactory } from '@empathyco/x-adapter-next';\nimport { getTaggingInfoFromUrl } from '@empathyco/x-utils';\nimport { PlatformSearchResponse, SearchResponse } from '../../types/response.types';\nimport { resultMutableSchema } from '../../schemas/result.schema';\nimport { facetMutableSchema } from '../../schemas/facet.schema';\nimport { promotedMutableSchema } from '../../schemas/promoted.schema';\nimport { bannerMutableSchema } from '../../schemas/banner.schema';\nimport { redirectionMutableSchema } from '../../schemas/redirection.schema';\n\nexport const searchResponseSchema: Schema<PlatformSearchResponse, SearchResponse> = {\n results: {\n $path: 'catalog.content',\n $subSchema: resultMutableSchema\n },\n facets: {\n $path: 'catalog.facets',\n $subSchema: facetMutableSchema\n },\n totalResults: 'catalog.numFound',\n spellcheck: 'catalog.spellchecked',\n banners: {\n $path: 'banner.content',\n $subSchema: bannerMutableSchema\n },\n promoted: {\n $path: 'promoted.content',\n $subSchema: promotedMutableSchema\n },\n redirections: {\n $path: 'direct.content',\n $subSchema: redirectionMutableSchema\n },\n queryTagging: ({ catalog }) => getTaggingInfoFromUrl(catalog?.tagging?.query)\n};\n\nexport const mutableSearchResponseSchema = createMutableSchema(searchResponseSchema);\n\nexport const searchResponseMapper = schemaMapperFactory<PlatformSearchResponse, SearchResponse>(\n mutableSearchResponseSchema\n);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.schema.js","sourceRoot":"","sources":["../../../src/schemas/banner.schema.ts"],"names":[],"mappings":";;;AAAA,8DAAwE;AAExE,gDAA2D;AAG9C,QAAA,YAAY,GAAmC;IAC1D,EAAE,EAAE,IAAI;IACR,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ;IACzB,OAAO,EAAE;QACP,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,WAAC,OAAA,IAAA,+BAAqB,EAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"banner.schema.js","sourceRoot":"","sources":["../../../src/schemas/banner.schema.ts"],"names":[],"mappings":";;;AAAA,8DAAwE;AAExE,gDAA2D;AAG9C,QAAA,YAAY,GAAmC;IAC1D,EAAE,EAAE,IAAI;IACR,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ;IACzB,OAAO,EAAE;QACP,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,WAAC,OAAA,IAAA,+BAAqB,EAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,EAAE,CAAC,CAAA,EAAA;KACpE;CACF,CAAC;AAEW,QAAA,mBAAmB,GAAG,IAAA,oCAAmB,EAAC,oBAAY,CAAC,CAAC","sourcesContent":["import { createMutableSchema, Schema } from '@empathyco/x-adapter-next';\nimport { Banner } from '@empathyco/x-types';\nimport { getTaggingInfoFromUrl } from '@empathyco/x-utils';\nimport { PlatformBanner } from '../types/models.types';\n\nexport const bannerSchema: Schema<PlatformBanner, Banner> = {\n id: 'id',\n title: 'title',\n url: 'url',\n image: 'image_url',\n modelName: () => 'Banner',\n tagging: {\n query: ({ tagging }) => getTaggingInfoFromUrl(tagging?.query ?? '')\n }\n};\n\nexport const bannerMutableSchema = createMutableSchema(bannerSchema);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promoted.schema.js","sourceRoot":"","sources":["../../../src/schemas/promoted.schema.ts"],"names":[],"mappings":";;;AACA,8DAAwE;AACxE,gDAA2D;AAG9C,QAAA,cAAc,GAAuC;IAChE,EAAE,EAAE,IAAI;IACR,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,GAAG,EAAE,CAAC,UAAU;IAC3B,OAAO,EAAE;QACP,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,WAAC,OAAA,IAAA,+BAAqB,EAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"promoted.schema.js","sourceRoot":"","sources":["../../../src/schemas/promoted.schema.ts"],"names":[],"mappings":";;;AACA,8DAAwE;AACxE,gDAA2D;AAG9C,QAAA,cAAc,GAAuC;IAChE,EAAE,EAAE,IAAI;IACR,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,GAAG,EAAE,CAAC,UAAU;IAC3B,OAAO,EAAE;QACP,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,WAAC,OAAA,IAAA,+BAAqB,EAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,EAAE,CAAC,CAAA,EAAA;KACpE;CACF,CAAC;AAEW,QAAA,qBAAqB,GAAG,IAAA,oCAAmB,EAAC,sBAAc,CAAC,CAAC","sourcesContent":["import { Promoted } from '@empathyco/x-types';\nimport { createMutableSchema, Schema } from '@empathyco/x-adapter-next';\nimport { getTaggingInfoFromUrl } from '@empathyco/x-utils';\nimport { PlatformPromoted } from '../types/models.types';\n\nexport const promotedSchema: Schema<PlatformPromoted, Promoted> = {\n id: 'id',\n url: 'url',\n title: 'title',\n image: 'image_url',\n modelName: () => 'Promoted',\n tagging: {\n query: ({ tagging }) => getTaggingInfoFromUrl(tagging?.query ?? '')\n }\n};\n\nexport const promotedMutableSchema = createMutableSchema(promotedSchema);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redirection.schema.js","sourceRoot":"","sources":["../../../src/schemas/redirection.schema.ts"],"names":[],"mappings":";;;AAAA,8DAAwE;AAExE,gDAA2D;AAG3D,MAAM,iBAAiB,GAA6C;IAClE,EAAE,EAAE,IAAI;IACR,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,GAAG,EAAE,CAAC,aAAa;IAC9B,OAAO,EAAE;QACP,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,WAAC,OAAA,IAAA,+BAAqB,EAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"redirection.schema.js","sourceRoot":"","sources":["../../../src/schemas/redirection.schema.ts"],"names":[],"mappings":";;;AAAA,8DAAwE;AAExE,gDAA2D;AAG3D,MAAM,iBAAiB,GAA6C;IAClE,EAAE,EAAE,IAAI;IACR,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,GAAG,EAAE,CAAC,aAAa;IAC9B,OAAO,EAAE;QACP,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,WAAC,OAAA,IAAA,+BAAqB,EAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,EAAE,CAAC,CAAA,EAAA;KACpE;CACF,CAAC;AAEW,QAAA,wBAAwB,GAAG,IAAA,oCAAmB,EAAC,iBAAiB,CAAC,CAAC","sourcesContent":["import { createMutableSchema, Schema } from '@empathyco/x-adapter-next';\nimport { Redirection } from '@empathyco/x-types';\nimport { getTaggingInfoFromUrl } from '@empathyco/x-utils';\nimport { PlatformRedirection } from '../types/models.types';\n\nconst redirectionSchema: Schema<PlatformRedirection, Redirection> = {\n id: 'id',\n url: 'url',\n modelName: () => 'Redirection',\n tagging: {\n click: ({ tagging }) => getTaggingInfoFromUrl(tagging?.click ?? '')\n }\n};\n\nexport const redirectionMutableSchema = createMutableSchema(redirectionSchema);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.schema.js","sourceRoot":"","sources":["../../../src/schemas/result.schema.ts"],"names":[],"mappings":";;;AAAA,8DAAwE;AAExE,gDAA2D;AAG9C,QAAA,mBAAmB,GAAqC;IACnE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,IAAA,+BAAqB,EAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"result.schema.js","sourceRoot":"","sources":["../../../src/schemas/result.schema.ts"],"names":[],"mappings":";;;AAAA,8DAAwE;AAExE,gDAA2D;AAG9C,QAAA,mBAAmB,GAAqC;IACnE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,IAAA,+BAAqB,EAAC,QAAQ,CAAC;IAC3D,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,IAAA,+BAAqB,EAAC,QAAQ,CAAC;IAC3D,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,IAAA,+BAAqB,EAAC,KAAK,CAAC;CACnD,CAAC;AAEW,QAAA,0BAA0B,GAAG,IAAA,oCAAmB,EAAC,2BAAmB,CAAC,CAAC;AAEtE,QAAA,YAAY,GAAmC;IAC1D,EAAE,EAAE,IAAI;IACR,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;QACpB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9B,CAAC;IACD,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,UAAU,EAAE;QACV,KAAK,EAAE,IAAI;KACZ;IACD,MAAM,EAAE;QACN,KAAK,EAAE,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE;YAC3B,OAAO,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACtD,CAAC;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE,OAAO;QACd,aAAa,EAAE,OAAO;QACtB,WAAW,EAAE,GAAG,EAAE,CAAC,KAAK;KACzB;IACD,IAAI,EAAE,GAAG,EAAE,CAAC,SAAS;IACrB,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ;IACzB,YAAY,EAAE,GAAG,EAAE,CAAC,KAAK;IACzB,OAAO,EAAE;QACP,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE,kCAA0B;KACvC;CACF,CAAC;AAEW,QAAA,mBAAmB,GAAG,IAAA,oCAAmB,EAAC,oBAAY,CAAC,CAAC","sourcesContent":["import { createMutableSchema, Schema } from '@empathyco/x-adapter-next';\nimport { Result, Tagging } from '@empathyco/x-types';\nimport { getTaggingInfoFromUrl } from '@empathyco/x-utils';\nimport { PlatformResult, PlatformTagging } from '../types/models.types';\n\nexport const resultTaggingSchema: Schema<PlatformTagging, Tagging> = {\n add2cart: ({ add2cart }) => getTaggingInfoFromUrl(add2cart),\n checkout: ({ checkout }) => getTaggingInfoFromUrl(checkout),\n click: ({ click }) => getTaggingInfoFromUrl(click)\n};\n\nexport const resultTaggingMutableSchema = createMutableSchema(resultTaggingSchema);\n\nexport const resultSchema: Schema<PlatformResult, Result> = {\n id: 'id',\n images: ({ image }) => {\n return image ? [image] : [];\n },\n name: 'name',\n url: 'url',\n identifier: {\n value: 'id'\n },\n rating: {\n value: ({ averageRating }) => {\n return averageRating ? Number(averageRating) : null;\n }\n },\n price: {\n value: 'price',\n originalValue: 'price',\n hasDiscount: () => false\n },\n type: () => 'Default',\n modelName: () => 'Result',\n isWishlisted: () => false,\n tagging: {\n $path: 'tagging',\n $subSchema: resultTaggingMutableSchema\n }\n};\n\nexport const resultMutableSchema = createMutableSchema(resultSchema);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.types.js","sourceRoot":"","sources":["../../../src/types/response.types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n Banner,\n NextQuery,\n Promoted,\n Redirection,\n RelatedTag,\n Result,\n Suggestion,\n
|
|
1
|
+
{"version":3,"file":"response.types.js","sourceRoot":"","sources":["../../../src/types/response.types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n Banner,\n NextQuery,\n Promoted,\n Redirection,\n RelatedTag,\n Result,\n Suggestion,\n TaggingRequest\n} from '@empathyco/x-types';\n\nimport {\n Contentable,\n PlatformBanner,\n PlatformCatalog,\n PlatformNextQuery,\n PlatformPromoted,\n PlatformRedirection,\n PlatformRelatedTag,\n PlatformResult,\n PlatformSuggestion\n} from './models.types';\n\nexport interface PlatformSearchResponse {\n banner: Contentable<PlatformBanner>;\n catalog: PlatformCatalog;\n direct: Contentable<PlatformRedirection>;\n promoted: Contentable<PlatformPromoted>;\n}\n\nexport interface SearchResponse {\n results: Result[];\n facets: any[];\n totalResults: number;\n spellcheck: string;\n banners: Banner[];\n promoted: Promoted[];\n redirections: Redirection[];\n queryTagging: TaggingRequest;\n}\n\nexport interface PlatformEmpathizeResponse {\n topTrends: {\n content: PlatformSuggestion[];\n spellcheck?: string;\n };\n}\n\nexport interface EmpathizeResponse {\n suggestions: Suggestion[];\n spellcheck?: string;\n}\n\nexport interface PlatformTopClickedResponse {\n topclicked: {\n content: PlatformResult[];\n numFound: number;\n };\n}\n\nexport interface TopClickedResponse {\n results: Result[];\n}\n\nexport interface NextQueriesResponse {\n nextQueries: NextQuery[];\n}\n\nexport interface PlatformNextQueriesResponse {\n data: {\n nextqueries: PlatformNextQuery[];\n };\n}\n\nexport interface RelatedTagsResponse {\n relatedTags: RelatedTag[];\n}\n\nexport interface PlatformRelatedTagsResponse {\n data: {\n relatedtags: PlatformRelatedTag[];\n };\n status: number;\n}\n\nexport interface PlatformSkuSearchResponse {\n catalog: {\n content: PlatformResult[];\n tagging: {\n query: string;\n };\n };\n}\n\nexport interface SkuSearchResponse {\n results: Result[];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-response.mapper.js","sourceRoot":"","sources":["../../../../src/mappers/response/search-response.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAU,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"search-response.mapper.js","sourceRoot":"","sources":["../../../../src/mappers/response/search-response.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAU,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,MAAM,CAAC,MAAM,oBAAoB,GAAmD;IAClF,OAAO,EAAE;QACP,KAAK,EAAE,iBAAiB;QACxB,UAAU,EAAE,mBAAmB;KAChC;IACD,MAAM,EAAE;QACN,KAAK,EAAE,gBAAgB;QACvB,UAAU,EAAE,kBAAkB;KAC/B;IACD,YAAY,EAAE,kBAAkB;IAChC,UAAU,EAAE,sBAAsB;IAClC,OAAO,EAAE;QACP,KAAK,EAAE,gBAAgB;QACvB,UAAU,EAAE,mBAAmB;KAChC;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,kBAAkB;QACzB,UAAU,EAAE,qBAAqB;KAClC;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,gBAAgB;QACvB,UAAU,EAAE,wBAAwB;KACrC;IACD,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,WAAC,OAAA,qBAAqB,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,0CAAE,KAAK,CAAC,CAAA,EAAA;CAC9E,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;AAErF,MAAM,CAAC,MAAM,oBAAoB,GAAG,mBAAmB,CACrD,2BAA2B,CAC5B,CAAC","sourcesContent":["import { createMutableSchema, Schema, schemaMapperFactory } from '@empathyco/x-adapter-next';\nimport { getTaggingInfoFromUrl } from '@empathyco/x-utils';\nimport { PlatformSearchResponse, SearchResponse } from '../../types/response.types';\nimport { resultMutableSchema } from '../../schemas/result.schema';\nimport { facetMutableSchema } from '../../schemas/facet.schema';\nimport { promotedMutableSchema } from '../../schemas/promoted.schema';\nimport { bannerMutableSchema } from '../../schemas/banner.schema';\nimport { redirectionMutableSchema } from '../../schemas/redirection.schema';\n\nexport const searchResponseSchema: Schema<PlatformSearchResponse, SearchResponse> = {\n results: {\n $path: 'catalog.content',\n $subSchema: resultMutableSchema\n },\n facets: {\n $path: 'catalog.facets',\n $subSchema: facetMutableSchema\n },\n totalResults: 'catalog.numFound',\n spellcheck: 'catalog.spellchecked',\n banners: {\n $path: 'banner.content',\n $subSchema: bannerMutableSchema\n },\n promoted: {\n $path: 'promoted.content',\n $subSchema: promotedMutableSchema\n },\n redirections: {\n $path: 'direct.content',\n $subSchema: redirectionMutableSchema\n },\n queryTagging: ({ catalog }) => getTaggingInfoFromUrl(catalog?.tagging?.query)\n};\n\nexport const mutableSearchResponseSchema = createMutableSchema(searchResponseSchema);\n\nexport const searchResponseMapper = schemaMapperFactory<PlatformSearchResponse, SearchResponse>(\n mutableSearchResponseSchema\n);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.schema.js","sourceRoot":"","sources":["../../../src/schemas/banner.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAU,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,MAAM,CAAC,MAAM,YAAY,GAAmC;IAC1D,EAAE,EAAE,IAAI;IACR,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ;IACzB,OAAO,EAAE;QACP,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,WAAC,OAAA,qBAAqB,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"banner.schema.js","sourceRoot":"","sources":["../../../src/schemas/banner.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAU,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,MAAM,CAAC,MAAM,YAAY,GAAmC;IAC1D,EAAE,EAAE,IAAI;IACR,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ;IACzB,OAAO,EAAE;QACP,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,WAAC,OAAA,qBAAqB,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,EAAE,CAAC,CAAA,EAAA;KACpE;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import { createMutableSchema, Schema } from '@empathyco/x-adapter-next';\nimport { Banner } from '@empathyco/x-types';\nimport { getTaggingInfoFromUrl } from '@empathyco/x-utils';\nimport { PlatformBanner } from '../types/models.types';\n\nexport const bannerSchema: Schema<PlatformBanner, Banner> = {\n id: 'id',\n title: 'title',\n url: 'url',\n image: 'image_url',\n modelName: () => 'Banner',\n tagging: {\n query: ({ tagging }) => getTaggingInfoFromUrl(tagging?.query ?? '')\n }\n};\n\nexport const bannerMutableSchema = createMutableSchema(bannerSchema);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promoted.schema.js","sourceRoot":"","sources":["../../../src/schemas/promoted.schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAU,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,MAAM,CAAC,MAAM,cAAc,GAAuC;IAChE,EAAE,EAAE,IAAI;IACR,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,GAAG,EAAE,CAAC,UAAU;IAC3B,OAAO,EAAE;QACP,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,WAAC,OAAA,qBAAqB,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"promoted.schema.js","sourceRoot":"","sources":["../../../src/schemas/promoted.schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAU,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,MAAM,CAAC,MAAM,cAAc,GAAuC;IAChE,EAAE,EAAE,IAAI;IACR,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,GAAG,EAAE,CAAC,UAAU;IAC3B,OAAO,EAAE;QACP,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,WAAC,OAAA,qBAAqB,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,EAAE,CAAC,CAAA,EAAA;KACpE;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CAAC,cAAc,CAAC,CAAC","sourcesContent":["import { Promoted } from '@empathyco/x-types';\nimport { createMutableSchema, Schema } from '@empathyco/x-adapter-next';\nimport { getTaggingInfoFromUrl } from '@empathyco/x-utils';\nimport { PlatformPromoted } from '../types/models.types';\n\nexport const promotedSchema: Schema<PlatformPromoted, Promoted> = {\n id: 'id',\n url: 'url',\n title: 'title',\n image: 'image_url',\n modelName: () => 'Promoted',\n tagging: {\n query: ({ tagging }) => getTaggingInfoFromUrl(tagging?.query ?? '')\n }\n};\n\nexport const promotedMutableSchema = createMutableSchema(promotedSchema);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redirection.schema.js","sourceRoot":"","sources":["../../../src/schemas/redirection.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAU,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,MAAM,iBAAiB,GAA6C;IAClE,EAAE,EAAE,IAAI;IACR,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,GAAG,EAAE,CAAC,aAAa;IAC9B,OAAO,EAAE;QACP,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,WAAC,OAAA,qBAAqB,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"redirection.schema.js","sourceRoot":"","sources":["../../../src/schemas/redirection.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAU,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,MAAM,iBAAiB,GAA6C;IAClE,EAAE,EAAE,IAAI;IACR,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,GAAG,EAAE,CAAC,aAAa;IAC9B,OAAO,EAAE;QACP,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,WAAC,OAAA,qBAAqB,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,EAAE,CAAC,CAAA,EAAA;KACpE;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,mBAAmB,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["import { createMutableSchema, Schema } from '@empathyco/x-adapter-next';\nimport { Redirection } from '@empathyco/x-types';\nimport { getTaggingInfoFromUrl } from '@empathyco/x-utils';\nimport { PlatformRedirection } from '../types/models.types';\n\nconst redirectionSchema: Schema<PlatformRedirection, Redirection> = {\n id: 'id',\n url: 'url',\n modelName: () => 'Redirection',\n tagging: {\n click: ({ tagging }) => getTaggingInfoFromUrl(tagging?.click ?? '')\n }\n};\n\nexport const redirectionMutableSchema = createMutableSchema(redirectionSchema);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.schema.js","sourceRoot":"","sources":["../../../src/schemas/result.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAU,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,MAAM,CAAC,MAAM,mBAAmB,GAAqC;IACnE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,qBAAqB,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"result.schema.js","sourceRoot":"","sources":["../../../src/schemas/result.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAU,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,MAAM,CAAC,MAAM,mBAAmB,GAAqC;IACnE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,qBAAqB,CAAC,QAAQ,CAAC;IAC3D,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,qBAAqB,CAAC,QAAQ,CAAC;IAC3D,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,qBAAqB,CAAC,KAAK,CAAC;CACnD,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,mBAAmB,CAAC,mBAAmB,CAAC,CAAC;AAEnF,MAAM,CAAC,MAAM,YAAY,GAAmC;IAC1D,EAAE,EAAE,IAAI;IACR,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;QACpB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9B,CAAC;IACD,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,UAAU,EAAE;QACV,KAAK,EAAE,IAAI;KACZ;IACD,MAAM,EAAE;QACN,KAAK,EAAE,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE;YAC3B,OAAO,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACtD,CAAC;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE,OAAO;QACd,aAAa,EAAE,OAAO;QACtB,WAAW,EAAE,GAAG,EAAE,CAAC,KAAK;KACzB;IACD,IAAI,EAAE,GAAG,EAAE,CAAC,SAAS;IACrB,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ;IACzB,YAAY,EAAE,GAAG,EAAE,CAAC,KAAK;IACzB,OAAO,EAAE;QACP,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE,0BAA0B;KACvC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import { createMutableSchema, Schema } from '@empathyco/x-adapter-next';\nimport { Result, Tagging } from '@empathyco/x-types';\nimport { getTaggingInfoFromUrl } from '@empathyco/x-utils';\nimport { PlatformResult, PlatformTagging } from '../types/models.types';\n\nexport const resultTaggingSchema: Schema<PlatformTagging, Tagging> = {\n add2cart: ({ add2cart }) => getTaggingInfoFromUrl(add2cart),\n checkout: ({ checkout }) => getTaggingInfoFromUrl(checkout),\n click: ({ click }) => getTaggingInfoFromUrl(click)\n};\n\nexport const resultTaggingMutableSchema = createMutableSchema(resultTaggingSchema);\n\nexport const resultSchema: Schema<PlatformResult, Result> = {\n id: 'id',\n images: ({ image }) => {\n return image ? [image] : [];\n },\n name: 'name',\n url: 'url',\n identifier: {\n value: 'id'\n },\n rating: {\n value: ({ averageRating }) => {\n return averageRating ? Number(averageRating) : null;\n }\n },\n price: {\n value: 'price',\n originalValue: 'price',\n hasDiscount: () => false\n },\n type: () => 'Default',\n modelName: () => 'Result',\n isWishlisted: () => false,\n tagging: {\n $path: 'tagging',\n $subSchema: resultTaggingMutableSchema\n }\n};\n\nexport const resultMutableSchema = createMutableSchema(resultSchema);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.types.js","sourceRoot":"","sources":["../../../src/types/response.types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n Banner,\n NextQuery,\n Promoted,\n Redirection,\n RelatedTag,\n Result,\n Suggestion,\n
|
|
1
|
+
{"version":3,"file":"response.types.js","sourceRoot":"","sources":["../../../src/types/response.types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n Banner,\n NextQuery,\n Promoted,\n Redirection,\n RelatedTag,\n Result,\n Suggestion,\n TaggingRequest\n} from '@empathyco/x-types';\n\nimport {\n Contentable,\n PlatformBanner,\n PlatformCatalog,\n PlatformNextQuery,\n PlatformPromoted,\n PlatformRedirection,\n PlatformRelatedTag,\n PlatformResult,\n PlatformSuggestion\n} from './models.types';\n\nexport interface PlatformSearchResponse {\n banner: Contentable<PlatformBanner>;\n catalog: PlatformCatalog;\n direct: Contentable<PlatformRedirection>;\n promoted: Contentable<PlatformPromoted>;\n}\n\nexport interface SearchResponse {\n results: Result[];\n facets: any[];\n totalResults: number;\n spellcheck: string;\n banners: Banner[];\n promoted: Promoted[];\n redirections: Redirection[];\n queryTagging: TaggingRequest;\n}\n\nexport interface PlatformEmpathizeResponse {\n topTrends: {\n content: PlatformSuggestion[];\n spellcheck?: string;\n };\n}\n\nexport interface EmpathizeResponse {\n suggestions: Suggestion[];\n spellcheck?: string;\n}\n\nexport interface PlatformTopClickedResponse {\n topclicked: {\n content: PlatformResult[];\n numFound: number;\n };\n}\n\nexport interface TopClickedResponse {\n results: Result[];\n}\n\nexport interface NextQueriesResponse {\n nextQueries: NextQuery[];\n}\n\nexport interface PlatformNextQueriesResponse {\n data: {\n nextqueries: PlatformNextQuery[];\n };\n}\n\nexport interface RelatedTagsResponse {\n relatedTags: RelatedTag[];\n}\n\nexport interface PlatformRelatedTagsResponse {\n data: {\n relatedtags: PlatformRelatedTag[];\n };\n status: number;\n}\n\nexport interface PlatformSkuSearchResponse {\n catalog: {\n content: PlatformResult[];\n tagging: {\n query: string;\n };\n };\n}\n\nexport interface SkuSearchResponse {\n results: Result[];\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Banner, NextQuery, Promoted, Redirection, RelatedTag, Result, Suggestion,
|
|
1
|
+
import { Banner, NextQuery, Promoted, Redirection, RelatedTag, Result, Suggestion, TaggingRequest } from '@empathyco/x-types';
|
|
2
2
|
import { Contentable, PlatformBanner, PlatformCatalog, PlatformNextQuery, PlatformPromoted, PlatformRedirection, PlatformRelatedTag, PlatformResult, PlatformSuggestion } from './models.types';
|
|
3
3
|
export interface PlatformSearchResponse {
|
|
4
4
|
banner: Contentable<PlatformBanner>;
|
|
@@ -14,7 +14,7 @@ export interface SearchResponse {
|
|
|
14
14
|
banners: Banner[];
|
|
15
15
|
promoted: Promoted[];
|
|
16
16
|
redirections: Redirection[];
|
|
17
|
-
queryTagging:
|
|
17
|
+
queryTagging: TaggingRequest;
|
|
18
18
|
}
|
|
19
19
|
export interface PlatformEmpathizeResponse {
|
|
20
20
|
topTrends: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empathyco/x-adapter-platform",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-alpha.0",
|
|
4
4
|
"description": "A search client for the Empathy Platform API",
|
|
5
5
|
"author": "Empathy Systems Corporation S.L.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"prepublishOnly": "npm run build"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@empathyco/x-adapter-next": "^0.2.0-alpha.
|
|
36
|
-
"@empathyco/x-types": "^10.0.0-alpha.
|
|
37
|
-
"@empathyco/x-utils": "^
|
|
35
|
+
"@empathyco/x-adapter-next": "^0.2.0-alpha.22",
|
|
36
|
+
"@empathyco/x-types": "^10.0.0-alpha.22",
|
|
37
|
+
"@empathyco/x-utils": "^1.0.0-alpha.0",
|
|
38
38
|
"tslib": "~2.3.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "e15e3879b1d1ef2a104427f66b3df2647a06860d"
|
|
52
52
|
}
|