@daffodil/product 0.81.1 → 0.82.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/driver/interfaces/product-service.interface.d.ts +2 -0
- package/driver/magento/injection-tokens/transforms/product/token.d.ts +1 -2
- package/driver/shopify/product.service.d.ts +3 -26
- package/driver/shopify/public_api.d.ts +2 -0
- package/driver/shopify/queries/gql/get-all-products.d.ts +6 -0
- package/driver/shopify/queries/gql/get-product-by-url.d.ts +8 -0
- package/driver/shopify/queries/gql/get-product.d.ts +6 -0
- package/driver/shopify/queries/gql/public_api.d.ts +3 -0
- package/driver/shopify/queries/public_api.d.ts +3 -0
- package/driver/shopify/queries/response.types.d.ts +6 -0
- package/driver/shopify/queries/variables.types.d.ts +9 -0
- package/driver/shopify/transforms/public_api.d.ts +1 -0
- package/driver/shopify/transforms/shopify-daff-product-transform.d.ts +9 -0
- package/fesm2022/daffodil-product-driver-in-memory.mjs +10 -10
- package/fesm2022/daffodil-product-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-product-driver-magento-testing.mjs +24 -24
- package/fesm2022/daffodil-product-driver-magento-testing.mjs.map +1 -1
- package/fesm2022/daffodil-product-driver-magento.mjs +19 -19
- package/fesm2022/daffodil-product-driver-magento.mjs.map +1 -1
- package/fesm2022/daffodil-product-driver-shopify.mjs +162 -69
- package/fesm2022/daffodil-product-driver-shopify.mjs.map +1 -1
- package/fesm2022/daffodil-product-driver-testing.mjs +7 -7
- package/fesm2022/daffodil-product-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-product-driver.mjs.map +1 -1
- package/fesm2022/daffodil-product-routing.mjs +16 -16
- package/fesm2022/daffodil-product-routing.mjs.map +1 -1
- package/fesm2022/daffodil-product-state-testing.mjs +16 -16
- package/fesm2022/daffodil-product-state.mjs +28 -28
- package/fesm2022/daffodil-product-state.mjs.map +1 -1
- package/fesm2022/daffodil-product-testing.mjs +19 -19
- package/fesm2022/daffodil-product-testing.mjs.map +1 -1
- package/package.json +1 -1
- package/state/reducers/injection-tokens/config.token.d.ts +1 -2
- package/state/reducers/injection-tokens/extra.token.d.ts +1 -2
- package/state/reducers/injection-tokens/meta.token.d.ts +1 -2
- package/state/reducers/injection-tokens/reducers.token.d.ts +1 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-product-driver-shopify.mjs","sources":["../../../libs/product/driver/shopify/src/product.service.ts","../../../libs/product/driver/shopify/src/product-driver.module.ts","../../../libs/product/driver/shopify/src/daffodil-product-driver-shopify.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Apollo,\n gql,\n} from 'apollo-angular';\nimport {\n Observable,\n of,\n} from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport { daffArrayToDict } from '@daffodil/core';\nimport {\n DaffProduct,\n DaffProductTypeEnum,\n} from '@daffodil/product';\nimport {\n DaffProductDriverResponse,\n DaffProductServiceInterface,\n} from '@daffodil/product/driver';\n\ninterface GetAllProductsResponse {\n shop?: ShopGraph;\n}\n\ninterface GetAProductResponse {\n node: ProductNode;\n}\n\ninterface ShopGraph {\n products?: ProductGraph;\n}\n\ninterface ProductGraph {\n edges: ProductEdge[];\n}\n\ninterface ProductEdge {\n node: ProductNode;\n}\n\ninterface ProductNode {\n __typename?: 'Product';\n id: string;\n title?: string;\n price?: string;\n}\n\ninterface Variables {\n first: number;\n};\n\n\n/**\n * GraphQL query object for getting all products.\n */\nexport const GetAllProductsQuery = gql`\n query ShopifyGetAllProducts($length: Int) {\n shop {\n products(first: $length) {\n edges {\n node {\n id\n title\n }\n }\n }\n }\n }\n`;\n\n/**\n * GraphQL query object for getting a product by ID.\n */\nexport const GetAProduct = gql`\n query ShopifyGetAProduct($id: ID!){\n node(id: $id) {\n id\n ... on Product {\n title\n }\n }\n }\n`;\n\n/**\n * Transforms a ProductNode into a different object.\n *\n * @param node - ProductNode object\n * @returns A Product object\n */\nexport const DaffShopifyProductTransformer = (node: ProductNode): DaffProduct => ({\n id: node.id,\n url: null,\n name: node.title,\n images: [],\n thumbnail: null,\n type: DaffProductTypeEnum.Simple,\n price: null,\n discount: null,\n in_stock: true,\n});\n\n/**\n * A service for getting DaffProducts from apollo shopify product requests.\n *\n * @inheritdoc\n * @Param apollo\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffShopifyProductService implements DaffProductServiceInterface {\n\n defaultLength = 20;\n\n constructor(private apollo: Apollo) {}\n\n getByUrl(url: DaffProduct['url']): Observable<DaffProductDriverResponse> {\n // TODO: implement\n return of({\n id: null,\n products: [],\n });\n }\n\n getAll(): Observable<DaffProduct[]> {\n return this.apollo.query<GetAllProductsResponse>({\n query: GetAllProductsQuery,\n variables: {\n length: this.defaultLength,\n },\n }).pipe(\n map(result => result.data.shop.products.edges.map(edge => DaffShopifyProductTransformer(edge.node))),\n );\n }\n\n //todo: add actual getBestSellers apollo call. Right now, it just makes the getAll() call\n getBestSellers(): Observable<DaffProduct[]> {\n return this.apollo.query<GetAllProductsResponse>({\n query: GetAllProductsQuery,\n variables: {\n length: this.defaultLength,\n },\n }).pipe(\n map(result => result.data.shop.products.edges.map(edge => DaffShopifyProductTransformer(edge.node))),\n );\n }\n\n get(productId: string): Observable<DaffProductDriverResponse> {\n return this.apollo.query<GetAProductResponse>({\n query: GetAProduct,\n variables: {\n id: productId,\n },\n }).pipe(\n map(result => ({\n id: productId,\n products: [DaffShopifyProductTransformer(result.data.node)],\n })),\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffProductDriver } from '@daffodil/product/driver';\n\nimport { DaffShopifyProductService } from './product.service';\n\n/**\n * A module that provides the {@link DaffProductDriver} as the {@link DaffShopifyProductService}.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffProductShopifyDriverModule {\n static forRoot(): ModuleWithProviders<DaffProductShopifyDriverModule> {\n return {\n ngModule: DaffProductShopifyDriverModule,\n providers: [\n provideDaffProductDriver(DaffShopifyProductService),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAkDC;AAGD;;AAEG;AACI,MAAM,mBAAmB,GAAG,GAAG,CAAA;;;;;;;;;;;;;CAarC;AAED;;AAEG;AACI,MAAM,WAAW,GAAG,GAAG,CAAA;;;;;;;;;CAS7B;AAED;;;;;AAKG;AACI,MAAM,6BAA6B,GAAG,CAAC,IAAiB,MAAmB;IAChF,EAAE,EAAE,IAAI,CAAC,EAAE;AACX,IAAA,GAAG,EAAE,IAAI;IACT,IAAI,EAAE,IAAI,CAAC,KAAK;AAChB,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,SAAS,EAAE,IAAI;IACf,IAAI,EAAE,mBAAmB,CAAC,MAAM;AAChC,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,QAAQ,EAAE,IAAI;AACf,CAAA,CAAC;AAEF;;;;;AAKG;MAIU,yBAAyB,CAAA;AAIpC,IAAA,WAAA,CAAoB,MAAc,EAAA;QAAd,IAAM,CAAA,MAAA,GAAN,MAAM;QAF1B,IAAa,CAAA,aAAA,GAAG,EAAE;;AAIlB,IAAA,QAAQ,CAAC,GAAuB,EAAA;;AAE9B,QAAA,OAAO,EAAE,CAAC;AACR,YAAA,EAAE,EAAE,IAAI;AACR,YAAA,QAAQ,EAAE,EAAE;AACb,SAAA,CAAC;;IAGJ,MAAM,GAAA;AACJ,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAyB;AAC/C,YAAA,KAAK,EAAE,mBAAmB;AAC1B,YAAA,SAAS,EAAE;gBACT,MAAM,EAAE,IAAI,CAAC,aAAa;AAC3B,aAAA;AACF,SAAA,CAAC,CAAC,IAAI,CACL,GAAG,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAA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AA;kBAHrC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACrGD;;AAEG;MAMU,8BAA8B,CAAA;AACzC,IAAA,OAAO,OAAO,GAAA;QACZ,OAAO;AACL,YAAA,QAAQ,EAAE,8BAA8B;AACxC,YAAA,SAAS,EAAE;gBACT,wBAAwB,CAAC,yBAAyB,CAAC;AACpD,aAAA;SACF;;iIAPQ,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAA9B,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,YAHvC,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,YAHvC,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAGH,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAL1C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA;;;ACjBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-product-driver-shopify.mjs","sources":["../../../libs/product/driver/shopify/src/queries/gql/get-all-products.ts","../../../libs/product/driver/shopify/src/queries/gql/get-product-by-url.ts","../../../libs/product/driver/shopify/src/queries/gql/get-product.ts","../../../libs/product/driver/shopify/src/queries/response.types.ts","../../../libs/product/driver/shopify/src/transforms/shopify-daff-product-transform.ts","../../../libs/product/driver/shopify/src/product.service.ts","../../../libs/product/driver/shopify/src/product-driver.module.ts","../../../libs/product/driver/shopify/src/daffodil-product-driver-shopify.ts"],"sourcesContent":["import { gql } from 'apollo-angular';\n\nimport { ShopifyProductAllResponse } from '../response.types';\nimport { ShopifyProductAllVariables } from '../variables.types';\n\n/**\n * GraphQL query object for getting all products.\n */\nexport const getAllProducts = gql<ShopifyProductAllResponse, ShopifyProductAllVariables>`\n\tquery ShopifyGetAllProducts($length: Int) {\n\t\tproducts(first: $length) {\n\t\t\tnodes {\n\t\t\t\thandle\n\t\t\t\tonlineStoreUrl\n\t\t\t\tavailableForSale\n\t\t\t\tpriceRange {\n\t\t\t\t\tmaxVariantPrice {\n\t\t\t\t\t\tamount\n\t\t\t\t\t\tcurrencyCode\n\t\t\t\t\t}\n\t\t\t\t\tminVariantPrice {\n\t\t\t\t\t\tamount\n\t\t\t\t\t\tcurrencyCode\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tid\n\t\t\t\ttitle\n\t\t\t\tdescription\n\t\t\t\timages(first: 1) {\n\t\t\t\t\tnodes {\n\t\t\t\t\t\tid\n\t\t\t\t\t\turl\n\t\t\t\t\t\taltText\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { ShopifyProductSingleResponse } from '../response.types';\nimport { ShopifyProductUrlVariables } from '../variables.types';\n\n/**\n * GraphQL query object for getting a product by URL.\n *\n * The DaffLocatable url is transformed into a Shopify product handle for querying.\n */\nexport const getProductByUrl = gql<ShopifyProductSingleResponse, ShopifyProductUrlVariables>`\n query ShopifyGetProductByURL($handle: String!) {\n\t product(handle: $handle) {\n\t\t handle\n\t\t id\n\t\t title\n\t\t description\n\t\t availableForSale\n\t\t priceRange {\n\t\t\t maxVariantPrice {\n\t\t\t\t amount\n\t\t\t\t currencyCode\n\t\t\t }\n\t\t\t minVariantPrice {\n\t\t\t\t\t\tamount\n\t\t\t\t\t\tcurrencyCode\n\t\t\t }\n\t\t }\n\t\t images(first: 1) {\n\t\t\t nodes {\n\t\t\t\t id\n\t\t\t\t url\n\t\t\t\t altText\n\t\t\t }\n\t\t }\n\t\t onlineStoreUrl\n\t }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { ShopifyProductSingleResponse } from '../response.types';\nimport { ShopifyProductIDVariables } from '../variables.types';\n\n/**\n * GraphQL query object for getting a single product by ID.\n */\nexport const getProduct = gql<ShopifyProductSingleResponse, ShopifyProductIDVariables>`\n query ShopifyGetAProduct($id: ID!) {\n\t product(id: $id) {\n\t\t handle\n\t\t id\n\t\t title\n\t\t description\n\t\t availableForSale\n\t\t priceRange {\n\t\t\t maxVariantPrice {\n\t\t\t\t amount\n\t\t\t\t currencyCode\n\t\t\t }\n\t\t\t minVariantPrice {\n\t\t\t\t\t\tamount\n\t\t\t\t\t\tcurrencyCode\n\t\t\t }\n\t\t }\n\t\t images(first: 1) {\n\t\t\t nodes {\n\t\t\t\t id\n\t\t\t\t url\n\t\t\t\t altText\n\t\t\t }\n\t\t }\n\t\t onlineStoreUrl\n\t }\n }\n`;\n","import {\n ShopifyProductNode,\n ShopifyProductGraph,\n} from '@daffodil/driver/shopify';\n\nexport interface ShopifyProductAllResponse {\n products?: ShopifyProductGraph;\n}\n\nexport interface ShopifyProductSingleResponse extends ShopifyProductNode {};\n","import { ShopifyProductNode } from '@daffodil/driver/shopify';\nimport {\n DaffProduct,\n DaffProductTypeEnum,\n} from '@daffodil/product';\n\n\n/**\n * Transforms a ProductNode into a different object.\n *\n * @param node - ProductNode object\n * @returns A Product object\n */\nexport const daffShopifyProductTransformer = (node: ShopifyProductNode): DaffProduct => ({\n name: node.title,\n images: node.images.nodes.map(imageNode => ({\n id: imageNode.id,\n url: imageNode.url,\n label: imageNode.altText ?? '',\n })),\n thumbnail: {\n url: node.images.nodes[0]?.url,\n label: node.images.nodes[0]?.altText ?? '',\n id: node.images.nodes[0]?.id,\n },\n id: node.id,\n url: `/${node.handle}`,\n type: DaffProductTypeEnum.Simple,\n price: node.priceRange.maxVariantPrice.amount,\n in_stock: node.availableForSale,\n description: node.description,\n});\n","import { Injectable } from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport {\n shopifyIdTransformer,\n shopifyUrlTransformer,\n} from '@daffodil/driver/shopify';\nimport { DaffProduct } from '@daffodil/product';\nimport {\n DaffProductDriverResponse,\n DaffProductServiceInterface,\n} from '@daffodil/product/driver';\n\nimport {\n getAllProducts,\n getProduct,\n getProductByUrl,\n} from './queries/public_api';\nimport { daffShopifyProductTransformer } from './transforms/public_api';\n\n/**\n * A service for getting DaffProducts {@link DaffProduct} from apollo shopify product requests.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffShopifyProductService\nimplements DaffProductServiceInterface {\n defaultLength = 20;\n\n constructor(private apollo: Apollo) {}\n\n getAll(): Observable<DaffProduct[]> {\n return this.apollo\n .query({\n query: getAllProducts,\n variables: {\n length: this.defaultLength,\n },\n })\n .pipe(\n map((result) => {\n const nodes = result.data?.products?.nodes || [];\n return nodes.map((node) => daffShopifyProductTransformer(node));\n }),\n );\n }\n\n // todo: implement getBestSellers\n // todo: move to separate getBestSellers module\n getBestSellers(): Observable<DaffProduct[]> {\n return this.getAll();\n }\n\n get(productId: DaffProduct['id']): Observable<DaffProductDriverResponse> {\n return this.apollo\n .query({\n query: getProduct,\n variables: { id: shopifyIdTransformer(productId, 'Product') },\n })\n .pipe(\n map((result) => {\n const productNode = result.data;\n return {\n id: productNode.id,\n products: [daffShopifyProductTransformer(productNode)],\n };\n }),\n );\n }\n\n getByUrl(url: DaffProduct['url']): Observable<DaffProductDriverResponse> {\n return this.apollo\n .query({\n query: getProductByUrl,\n variables: { handle: shopifyUrlTransformer(url) },\n })\n .pipe(\n map((result) => {\n const productNode = result.data;\n return {\n id: productNode.id,\n products: [daffShopifyProductTransformer(productNode)],\n };\n }),\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffProductDriver } from '@daffodil/product/driver';\n\nimport { DaffShopifyProductService } from './product.service';\n\n/**\n * A module that provides the {@link DaffProductDriver} as the {@link DaffShopifyProductService}.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffProductShopifyDriverModule {\n static forRoot(): ModuleWithProviders<DaffProductShopifyDriverModule> {\n return {\n ngModule: DaffProductShopifyDriverModule,\n providers: [\n provideDaffProductDriver(DaffShopifyProductService),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAKA;;AAEG;AACI,MAAM,cAAc,GAAG,GAAG,CAAuD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACHxF;;;;AAIG;AACI,MAAM,eAAe,GAAG,GAAG,CAA0D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACL5F;;AAEG;AACI,MAAM,UAAU,GAAG,GAAG,CAAyD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACCX;;ACF3E;;;;;AAKG;MACU,6BAA6B,GAAG,CAAC,IAAwB,MAAmB;IACvF,IAAI,EAAE,IAAI,CAAC,KAAK;AAChB,IAAA,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,KAAK;QAC1C,EAAE,EAAE,SAAS,CAAC,EAAE;QAChB,GAAG,EAAE,SAAS,CAAC,GAAG;AAClB,QAAA,KAAK,EAAE,SAAS,CAAC,OAAO,IAAI,EAAE;AAC/B,KAAA,CAAC,CAAC;AACH,IAAA,SAAS,EAAE;QACT,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG;AAC9B,QAAA,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,E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A,QAAQ,EAAE,8BAA8B;AACxC,YAAA,SAAS,EAAE;gBACT,wBAAwB,CAAC,yBAAyB,CAAC;AACpD,aAAA;SACF;;iIAPQ,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAA9B,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,YAHvC,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,YAHvC,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAGH,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAL1C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA;;;ACjBD;;AAEG;;;;"}
|
|
@@ -50,10 +50,10 @@ class DaffTestingProductService {
|
|
|
50
50
|
products: [product],
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
54
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
53
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffTestingProductService, deps: [{ token: i1.DaffProductExtensionFactory }, { token: i1.DaffProductImageFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
54
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffTestingProductService, providedIn: 'root' }); }
|
|
55
55
|
}
|
|
56
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffTestingProductService, decorators: [{
|
|
57
57
|
type: Injectable,
|
|
58
58
|
args: [{
|
|
59
59
|
providedIn: 'root',
|
|
@@ -72,13 +72,13 @@ class DaffProductTestingDriverModule {
|
|
|
72
72
|
],
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
76
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.
|
|
75
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductTestingDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
76
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: DaffProductTestingDriverModule, imports: [CommonModule,
|
|
77
77
|
DaffProductTestingModule] }); }
|
|
78
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.
|
|
78
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductTestingDriverModule, imports: [CommonModule,
|
|
79
79
|
DaffProductTestingModule] }); }
|
|
80
80
|
}
|
|
81
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductTestingDriverModule, decorators: [{
|
|
82
82
|
type: NgModule,
|
|
83
83
|
args: [{
|
|
84
84
|
imports: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-product-driver-testing.mjs","sources":["../../../libs/product/driver/testing/src/drivers/product.service.ts","../../../libs/product/driver/testing/src/drivers/product-driver.module.ts","../../../libs/product/driver/testing/src/daffodil-product-driver-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport {
|
|
1
|
+
{"version":3,"file":"daffodil-product-driver-testing.mjs","sources":["../../../libs/product/driver/testing/src/drivers/product.service.ts","../../../libs/product/driver/testing/src/drivers/product-driver.module.ts","../../../libs/product/driver/testing/src/daffodil-product-driver-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport { DaffProduct } from '@daffodil/product';\nimport {\n DaffProductDriverResponse,\n DaffProductServiceInterface,\n} from '@daffodil/product/driver';\nimport {\n DaffProductImageFactory,\n DaffProductExtensionFactory,\n} from '@daffodil/product/testing';\n\n/**\n * The product testing driver to mock the backend product service.\n *\n * @inheritdoc\n * @param productFactory - A DaffProductFactory instance\n * @param productImageFactory - A DaffProductImageFactory instance\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffTestingProductService implements DaffProductServiceInterface {\n\n constructor(\n private productFactory: DaffProductExtensionFactory,\n private productImageFactory: DaffProductImageFactory,\n ) {}\n\n getAll(): Observable<DaffProduct[]> {\n return of([\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n ]);\n }\n\n getBestSellers(): Observable<DaffProduct[]> {\n return of([\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n ]);\n }\n\n get(productId: DaffProduct['id']): Observable<DaffProductDriverResponse> {\n return of({\n id: productId,\n products: [\n this.productFactory.create({ images: this.productImageFactory.createMany(5) }),\n ],\n });\n }\n\n getByUrl(url: DaffProduct['url']): Observable<DaffProductDriverResponse> {\n const product = this.productFactory.create({ images: this.productImageFactory.createMany(5), url });\n return of({\n id: product.id,\n products: [product],\n });\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffProductDriver } from '@daffodil/product/driver';\nimport { DaffProductTestingModule } from '@daffodil/product/testing';\n\nimport { DaffTestingProductService } from './product.service';\n\n/**\n * Module for providing the {@link DaffProductTestingService} driver as the {@link DaffProductDriver}.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffProductTestingModule,\n ],\n})\nexport class DaffProductTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffProductTestingDriverModule> {\n return {\n ngModule: DaffProductTestingDriverModule,\n providers: [\n provideDaffProductDriver(DaffTestingProductService),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAgBA;;;;;;AAMG;MAIU,yBAAyB,CAAA;IAEpC,WACU,CAAA,cAA2C,EAC3C,mBAA4C,EAAA;QAD5C,IAAc,CAAA,cAAA,GAAd,cAAc;QACd,IAAmB,CAAA,mBAAA,GAAnB,mBAAmB;;IAG7B,MAAM,GAAA;AACJ,QAAA,OAAO,EAAE,CAAC;AACR,YAAA,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC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Q,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAA9B,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,YAJvC,YAAY;YACZ,wBAAwB,CAAA,EAAA,CAAA,CAAA;AAGf,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,YAJvC,YAAY;YACZ,wBAAwB,CAAA,EAAA,CAAA,CAAA;;2FAGf,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAN1C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,wBAAwB;AACzB,qBAAA;AACF,iBAAA;;;ACnBD;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-product-driver.mjs","sources":["../../../libs/product/driver/src/interfaces/product-service.interface.ts","../../../libs/product/driver/src/errors/codes.enum.ts","../../../libs/product/driver/src/errors/product-not-found.ts","../../../libs/product/driver/src/errors/map.ts","../../../libs/product/driver/src/daffodil-product-driver.ts"],"sourcesContent":["import { Observable } from 'rxjs';\n\nimport { createSingletonInjectionToken } from '@daffodil/core';\nimport { DaffProduct } from '@daffodil/product';\n\nimport { DaffProductDriverResponse } from '../models/response.interface';\n\nexport const {\n /**\n * Injection token that serves as a placeholder for any service that implements the DaffProductServiceInterface.\n */\n token: DaffProductDriver,\n /**\n * Provider function for {@link DaffProductDriver}.\n */\n provider: provideDaffProductDriver,\n} = createSingletonInjectionToken<DaffProductServiceInterface>('DaffProductDriver');\n\n\n/**\n * An interface for any Product service drivers.\n */\nexport interface DaffProductServiceInterface<T extends DaffProduct = DaffProduct> {\n /**\n * Get all products.\n */\n getAll(): Observable<T[]>;\n /**\n * Get best selling products.\n *\n * @deprecated in favor of `@daffodil/related-products/driver` and `@daffodil/upsell-products/driver`. Deprecated in version 0.81.0. Will be removed in version 0.84.0.\n */\n getBestSellers(): Observable<T[]>;\n /**\n * Get a product by Id.\n *\n * @param productId - A string of the product ID.\n */\n get(productId: T['id']): Observable<DaffProductDriverResponse<T>>;\n /**\n * Get a product by URL.\n *\n * @param url - A string of the product URL.\n */\n getByUrl(url: DaffProduct['url']): Observable<DaffProductDriverResponse<T>>;\n}\n","export enum DaffProductDriverErrorCodes {\n PRODUCT_NOT_FOUND = 'DAFF_PRODUCT_NOT_FOUND',\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffProductDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when the requested product cannot be found.\n */\nexport class DaffProductNotFoundError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffProductDriverErrorCodes.PRODUCT_NOT_FOUND;\n\n constructor(message?: string) {\n super(message);\n }\n}\n","import { DaffProductDriverErrorCodes } from './codes.enum';\nimport { DaffProductNotFoundError } from './product-not-found';\n\n/**\n * A mapping from error codes to error class constructors.\n */\nexport const DaffProductDriverErrorMap = {\n [DaffProductDriverErrorCodes.PRODUCT_NOT_FOUND]: DaffProductNotFoundError,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAOa,MAAA;AACX;;AAEG;AACH,KAAK,EAAE,iBAAiB;AACxB;;AAEG;AACH,QAAQ,EAAE,wBAAwB,GACnC,GAAG,6BAA6B,CAA8B,mBAAmB;;IChBtE;AAAZ,CAAA,UAAY,2BAA2B,EAAA;AACrC,IAAA,2BAAA,CAAA,mBAAA,CAAA,GAAA,wBAA4C;AAC9C,CAAC,EAFW,2BAA2B,KAA3B,2BAA2B,GAEtC,EAAA,CAAA,CAAA;;ACKD;;AAEG;AACG,MAAO,wBAAyB,SAAQ,oBAAoB,CAAA;AAGhE,IAAA,WAAA,CAAY,OAAgB,EAAA;QAC1B,KAAK,CAAC,OAAO,CAAC;AAHA,QAAA,IAAA,CAAA,IAAI,GAAW,2BAA2B,CAAC,iBAAiB;;AAK7E;;ACbD;;AAEG;AACU,MAAA,yBAAyB,GAAG;AACvC,IAAA,CAAC,2BAA2B,CAAC,iBAAiB,GAAG,wBAAwB;;;ACP3E;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-product-driver.mjs","sources":["../../../libs/product/driver/src/interfaces/product-service.interface.ts","../../../libs/product/driver/src/errors/codes.enum.ts","../../../libs/product/driver/src/errors/product-not-found.ts","../../../libs/product/driver/src/errors/map.ts","../../../libs/product/driver/src/daffodil-product-driver.ts"],"sourcesContent":["import { Observable } from 'rxjs';\n\nimport { createSingletonInjectionToken } from '@daffodil/core';\nimport { DaffProduct } from '@daffodil/product';\n\nimport { DaffProductDriverResponse } from '../models/response.interface';\n\nexport const {\n /**\n * Injection token that serves as a placeholder for any service that implements the DaffProductServiceInterface.\n */\n token: DaffProductDriver,\n /**\n * Provider function for {@link DaffProductDriver}.\n */\n provider: provideDaffProductDriver,\n} = createSingletonInjectionToken<DaffProductServiceInterface>('DaffProductDriver');\n\n\n/**\n * An interface for any Product service drivers.\n */\nexport interface DaffProductServiceInterface<T extends DaffProduct = DaffProduct> {\n /**\n * Get all products.\n */\n getAll(): Observable<T[]>;\n /**\n * Get best selling products.\n *\n * @deprecated in favor of `@daffodil/related-products/driver` and `@daffodil/upsell-products/driver`. Deprecated in version 0.81.0. Will be removed in version 0.84.0.\n */\n getBestSellers(): Observable<T[]>;\n /**\n * Get a product by Id.\n *\n * @param productId - A string of the product ID.\n */\n get(productId: T['id']): Observable<DaffProductDriverResponse<T>>;\n /**\n * Get a product by URL.\n *\n * @param url - A string of the product URL.\n *\n * See {@link DaffLocatable} for more information on the requirements for the url argument of {@link DaffProduct}.\n */\n getByUrl(url: DaffProduct['url']): Observable<DaffProductDriverResponse<T>>;\n}\n","export enum DaffProductDriverErrorCodes {\n PRODUCT_NOT_FOUND = 'DAFF_PRODUCT_NOT_FOUND',\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffProductDriverErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when the requested product cannot be found.\n */\nexport class DaffProductNotFoundError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffProductDriverErrorCodes.PRODUCT_NOT_FOUND;\n\n constructor(message?: string) {\n super(message);\n }\n}\n","import { DaffProductDriverErrorCodes } from './codes.enum';\nimport { DaffProductNotFoundError } from './product-not-found';\n\n/**\n * A mapping from error codes to error class constructors.\n */\nexport const DaffProductDriverErrorMap = {\n [DaffProductDriverErrorCodes.PRODUCT_NOT_FOUND]: DaffProductNotFoundError,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAOa,MAAA;AACX;;AAEG;AACH,KAAK,EAAE,iBAAiB;AACxB;;AAEG;AACH,QAAQ,EAAE,wBAAwB,GACnC,GAAG,6BAA6B,CAA8B,mBAAmB;;IChBtE;AAAZ,CAAA,UAAY,2BAA2B,EAAA;AACrC,IAAA,2BAAA,CAAA,mBAAA,CAAA,GAAA,wBAA4C;AAC9C,CAAC,EAFW,2BAA2B,KAA3B,2BAA2B,GAEtC,EAAA,CAAA,CAAA;;ACKD;;AAEG;AACG,MAAO,wBAAyB,SAAQ,oBAAoB,CAAA;AAGhE,IAAA,WAAA,CAAY,OAAgB,EAAA;QAC1B,KAAK,CAAC,OAAO,CAAC;AAHA,QAAA,IAAA,CAAA,IAAI,GAAW,2BAA2B,CAAC,iBAAiB;;AAK7E;;ACbD;;AAEG;AACU,MAAA,yBAAyB,GAAG;AACvC,IAAA,CAAC,2BAA2B,CAAC,iBAAiB,GAAG,wBAAwB;;;ACP3E;;AAEG;;;;"}
|
|
@@ -24,10 +24,10 @@ class DaffProductPageIdResolver {
|
|
|
24
24
|
this.store.dispatch(new DaffProductPageLoad(route.paramMap.get('id')));
|
|
25
25
|
return isPlatformBrowser(this.platformId) ? of(true) : this.dispatcher.pipe(ofType(DaffProductPageActionTypes.ProductPageLoadSuccessAction, DaffProductPageActionTypes.ProductPageLoadFailureAction), map(() => true), take(1));
|
|
26
26
|
}
|
|
27
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
28
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
27
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductPageIdResolver, deps: [{ token: PLATFORM_ID }, { token: i1.Store }, { token: i1.ActionsSubject }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
28
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductPageIdResolver, providedIn: 'root' }); }
|
|
29
29
|
}
|
|
30
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductPageIdResolver, decorators: [{
|
|
31
31
|
type: Injectable,
|
|
32
32
|
args: [{
|
|
33
33
|
providedIn: 'root',
|
|
@@ -54,10 +54,10 @@ class DaffProductPageUrlResolver {
|
|
|
54
54
|
this.store.dispatch(new DaffProductPageLoadByUrl(this.urlNormalizer.normalize(state.url)));
|
|
55
55
|
return isPlatformBrowser(this.platformId) ? of(true) : this.dispatcher.pipe(ofType(DaffProductPageActionTypes.ProductPageLoadSuccessAction, DaffProductPageActionTypes.ProductPageLoadFailureAction), map(() => true), take(1));
|
|
56
56
|
}
|
|
57
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
58
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
57
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductPageUrlResolver, deps: [{ token: PLATFORM_ID }, { token: i1.Store }, { token: i1.ActionsSubject }, { token: i2.DaffRoutingUriNormalizer }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
58
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductPageUrlResolver, providedIn: 'root' }); }
|
|
59
59
|
}
|
|
60
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductPageUrlResolver, decorators: [{
|
|
61
61
|
type: Injectable,
|
|
62
62
|
args: [{
|
|
63
63
|
providedIn: 'root',
|
|
@@ -176,10 +176,10 @@ class DaffProductGetCollectionRequestFromRoute {
|
|
|
176
176
|
}
|
|
177
177
|
return request;
|
|
178
178
|
}
|
|
179
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
180
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
179
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductGetCollectionRequestFromRoute, deps: [{ token: DAFF_PRODUCT_ROUTING_CONFIG }, { token: DAFF_PRODUCT_ROUTING_DISCRETE_FILTER_PARAMS }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
180
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductGetCollectionRequestFromRoute }); }
|
|
181
181
|
}
|
|
182
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
182
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductGetCollectionRequestFromRoute, decorators: [{
|
|
183
183
|
type: Injectable
|
|
184
184
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
185
185
|
type: Inject,
|
|
@@ -216,10 +216,10 @@ class DaffProductGetQueryParamsFromRequest {
|
|
|
216
216
|
return acc;
|
|
217
217
|
}, trimmedQueryParams);
|
|
218
218
|
}
|
|
219
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
220
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
219
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductGetQueryParamsFromRequest, deps: [{ token: DAFF_PRODUCT_ROUTING_CONFIG }, { token: DAFF_PRODUCT_ROUTING_DISCRETE_FILTER_PARAMS }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
220
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductGetQueryParamsFromRequest }); }
|
|
221
221
|
}
|
|
222
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
222
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductGetQueryParamsFromRequest, decorators: [{
|
|
223
223
|
type: Injectable
|
|
224
224
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
225
225
|
type: Inject,
|
|
@@ -269,14 +269,14 @@ class DaffProductRoutingModule {
|
|
|
269
269
|
],
|
|
270
270
|
};
|
|
271
271
|
}
|
|
272
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
273
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.
|
|
274
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.
|
|
272
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
273
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: DaffProductRoutingModule }); }
|
|
274
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductRoutingModule, providers: [
|
|
275
275
|
DaffProductGetCollectionRequestFromRoute,
|
|
276
276
|
DaffProductGetQueryParamsFromRequest,
|
|
277
277
|
] }); }
|
|
278
278
|
}
|
|
279
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
279
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductRoutingModule, decorators: [{
|
|
280
280
|
type: NgModule,
|
|
281
281
|
args: [{
|
|
282
282
|
providers: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-product-routing.mjs","sources":["../../../libs/product/routing/src/resolvers/product-page-id/product-page-id.resolver.ts","../../../libs/product/routing/src/resolvers/product-page-url/product-page-url.resolver.ts","../../../libs/product/routing/src/config/default.ts","../../../libs/product/routing/src/config/token.ts","../../../libs/product/routing/src/constants/collection-request-fields.ts","../../../libs/product/routing/src/discrete-filter-params/token.ts","../../../libs/product/routing/src/services/get-request-from-route.service.ts","../../../libs/product/routing/src/services/get-query-params-from-request.service.ts","../../../libs/product/routing/src/effects/collection.effects.ts","../../../libs/product/routing/src/module.ts","../../../libs/product/routing/src/daffodil-product-routing.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\nimport { ActivatedRouteSnapshot } from '@angular/router';\nimport { ofType } from '@ngrx/effects';\nimport {\n ActionsSubject,\n Store,\n} from '@ngrx/store';\nimport {\n Observable,\n of,\n} from 'rxjs';\nimport {\n map,\n take,\n} from 'rxjs/operators';\n\nimport {\n DaffProductStateRootSlice,\n DaffProductPageLoad,\n DaffProductPageActionTypes,\n} from '@daffodil/product/state';\n\n/**\n * Resolves product data for product pages, and will only resolve the url after a product request succeeds or fails. This resolver expects a url\n * of the form `some/url/{id}` where `{id}` is the product id.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffProductPageIdResolver {\n constructor(\n @Inject(PLATFORM_ID) private platformId: string,\n private store: Store<DaffProductStateRootSlice>,\n private dispatcher: ActionsSubject,\n ) { }\n\n resolve(route: ActivatedRouteSnapshot): Observable<boolean> {\n this.store.dispatch(new DaffProductPageLoad(route.paramMap.get('id')));\n\n return isPlatformBrowser(this.platformId) ? of(true) : this.dispatcher.pipe(\n ofType(DaffProductPageActionTypes.ProductPageLoadSuccessAction, DaffProductPageActionTypes.ProductPageLoadFailureAction),\n map(() => true),\n take(1),\n );\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n RouterStateSnapshot,\n} from '@angular/router';\nimport { ofType } from '@ngrx/effects';\nimport {\n ActionsSubject,\n Store,\n} from '@ngrx/store';\nimport {\n Observable,\n of,\n} from 'rxjs';\nimport {\n map,\n take,\n} from 'rxjs/operators';\n\nimport { DaffRoutingUriNormalizer } from '@daffodil/core/routing';\nimport {\n DaffProductStateRootSlice,\n DaffProductPageLoadByUrl,\n DaffProductPageActionTypes,\n} from '@daffodil/product/state';\n\n/**\n * Resolves product data for product pages, and will only resolve the url\n * after a product request succeeds or fails. This resolver will take a full\n * a url of the form `some/url.html(secondary:outlet)?query=param#fragment` and attempt to resolve a product from it.\n * Assumes that the URL to be resolved is the primary outlet.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffProductPageUrlResolver {\n constructor(\n @Inject(PLATFORM_ID) private platformId: string,\n private store: Store<DaffProductStateRootSlice>,\n private dispatcher: ActionsSubject,\n private urlNormalizer: DaffRoutingUriNormalizer,\n ) { }\n\n resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> {\n this.store.dispatch(\n new DaffProductPageLoadByUrl(this.urlNormalizer.normalize(state.url)),\n );\n\n return isPlatformBrowser(this.platformId) ? of(true) : this.dispatcher.pipe(\n ofType(DaffProductPageActionTypes.ProductPageLoadSuccessAction, DaffProductPageActionTypes.ProductPageLoadFailureAction),\n map(() => true),\n take(1),\n );\n }\n}\n","import {\n inject,\n InjectionToken,\n} from '@angular/core';\n\nimport {\n DaffBase64Service,\n DaffBase64ServiceToken,\n} from '@daffodil/core';\n\nimport { DaffProductRoutingConfig } from './interface';\n\nexport const DAFF_PRODUCT_ROUTING_QUERY_PARAM_REQUEST_MAP: DaffProductRoutingConfig['params'] = {\n filterRequests: 'filters',\n appliedSortOption: 'sortOption',\n appliedSortDirection: 'sortDir',\n currentPage: 'page',\n pageSize: 'size',\n};\n\n/**\n * The default configuration for the {@link DaffProductRoutingConfig}.\n */\nexport const daffProductRoutingConfigDefaultFactory = (base64: DaffBase64Service): DaffProductRoutingConfig => ({\n params: DAFF_PRODUCT_ROUTING_QUERY_PARAM_REQUEST_MAP,\n transforms: {\n pageSize: {\n request: str => Number(str),\n queryParam: pageSize => String(pageSize),\n },\n currentPage: {\n request: str => Number(str),\n queryParam: currentPage => String(currentPage),\n },\n filterRequests: {\n request: base64Str => JSON.parse(base64.decode(base64Str)),\n queryParam: filterRequests => base64.encode(JSON.stringify(filterRequests)),\n },\n },\n});\n\nexport const DAFF_PRODUCT_ROUTING_CONFIG_DEFAULT = new InjectionToken<DaffProductRoutingConfig>(\n 'DAFF_PRODUCT_ROUTING_CONFIG_DEFAULT',\n { factory: () => daffProductRoutingConfigDefaultFactory(inject(DaffBase64ServiceToken)) },\n);\n","import { createConfigInjectionToken } from '@daffodil/core';\n\nimport { DAFF_PRODUCT_ROUTING_CONFIG_DEFAULT } from './default';\nimport { DaffProductRoutingConfig } from './interface';\n\nexport const {\n /**\n * The token used to provide @daffodil/product/routing config data.\n */\n token: DAFF_PRODUCT_ROUTING_CONFIG,\n /**\n * Provides the {@link DAFF_PRODUCT_ROUTING_CONFIG} token.\n */\n provider: provideDaffProductRoutingConfig,\n} = createConfigInjectionToken<DaffProductRoutingConfig>(DAFF_PRODUCT_ROUTING_CONFIG_DEFAULT, 'DAFF_PRODUCT_ROUTING_CONFIG');\n\n","import { DaffCollectionRequest } from '@daffodil/core';\n\n/**\n * A list of request fields that can be transformed to and from query params.\n */\nexport const DAFF_PRODUCT_COLLECTION_REQUEST_FIELDS: (keyof DaffCollectionRequest)[] = [\n 'filterRequests',\n 'appliedSortOption',\n 'appliedSortDirection',\n 'currentPage',\n 'pageSize',\n];\n","import { ValueProvider } from '@angular/core';\n\nimport { createMultiInjectionToken } from '@daffodil/core';\nimport {\n DaffRoutingQueryParamFilter,\n daffRoutingQueryParamFilterRequestEqualBuilder,\n} from '@daffodil/core/routing';\n\nexport const {\n /**\n * A list of product filter requests that are contained directly in query params,\n * with a one-to-one mapping between filters and query params.\n * This is constrasted to {@link DaffCollectionRequestQueryParams#filterRequests}\n * which remains the actual canonical source of truth of the filter requests.\n * The discrete filter params persist in the URL as long as the corresponding filter remains applied.\n */\n token: DAFF_PRODUCT_ROUTING_DISCRETE_FILTER_PARAMS,\n} = createMultiInjectionToken<DaffRoutingQueryParamFilter>(\n 'DAFF_PRODUCT_ROUTING_DISCRETE_FILTER_PARAMS',\n { providedIn: 'any' },\n);\n\n/**\n * A multi-provider for {@link DAFF_PRODUCT_ROUTING_DISCRETE_FILTER_PARAMS}.\n *\n * @param queryParam Defaults to `filterName`.\n * @param builder Defaults to {@link daffRoutingQueryParamFilterRequestEqualBuilder}.\n */\nexport function daffProductRoutingProvideDiscreteFilterParam(filterName: DaffRoutingQueryParamFilter['filterName'], queryParam?: DaffRoutingQueryParamFilter['queryParam'], builder?: DaffRoutingQueryParamFilter['builder']): ValueProvider {\n return {\n provide: DAFF_PRODUCT_ROUTING_DISCRETE_FILTER_PARAMS,\n useValue: {\n filterName,\n queryParam: queryParam || filterName,\n builder: builder || daffRoutingQueryParamFilterRequestEqualBuilder,\n },\n multi: true,\n };\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { ParamMap } from '@angular/router';\n\nimport {\n DaffCollectionRequest,\n DaffFilterRequest,\n} from '@daffodil/core';\nimport {\n DaffRoutingQueryParamFilter,\n daffRoutingQueryParamFilterRequestEqualBuilder,\n} from '@daffodil/core/routing';\n\nimport {\n DaffProductRoutingConfig,\n DAFF_PRODUCT_ROUTING_CONFIG,\n} from '../config/public_api';\nimport { DAFF_PRODUCT_COLLECTION_REQUEST_FIELDS } from '../constants/public_api';\nimport { DAFF_PRODUCT_ROUTING_DISCRETE_FILTER_PARAMS } from '../discrete-filter-params/public_api';\n\n/**\n * Builds a {@link DaffCollectionRequest} from the query params of the passed route.\n * Its behavior can be configured via the {@link DAFF_PRODUCT_COLLECTION_QUERY_PARAMS} and\n * {@link DAFF_PRODUCT_COLLECTION_QUERY_PARAM_TRANSFORMS} injection tokens.\n */\n@Injectable()\nexport class DaffProductGetCollectionRequestFromRoute {\n constructor(\n @Inject(DAFF_PRODUCT_ROUTING_CONFIG) private config: DaffProductRoutingConfig,\n @Inject(DAFF_PRODUCT_ROUTING_DISCRETE_FILTER_PARAMS) private discreteFilters: DaffRoutingQueryParamFilter[],\n ) {}\n\n getRequest(queryParamMap: ParamMap): DaffCollectionRequest {\n const request = DAFF_PRODUCT_COLLECTION_REQUEST_FIELDS.reduce<DaffCollectionRequest>((acc, field) => {\n const qp = this.config.params[field] || field;\n if (queryParamMap.has(qp)) {\n const qpVal = queryParamMap.get(qp);\n // no idea why field needs to be typecasted\n acc[(<string>field)] = this.config.transforms?.[field]?.request?.(qpVal) || qpVal;\n }\n return acc;\n }, {});\n const filterRequests = this.discreteFilters.reduce<DaffFilterRequest[]>(\n (acc, { filterName, builder, queryParam }) =>\n queryParamMap.has(queryParam)\n ? [\n ...acc,\n builder(filterName, queryParamMap.getAll(queryParam)),\n ]\n : acc,\n request.filterRequests || [],\n );\n // add discrete filter params to the list of requests\n if (filterRequests.length > 0) {\n request.filterRequests = filterRequests;\n }\n\n return request;\n }\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { Params } from '@angular/router';\n\nimport {\n DaffCollectionRequest,\n daffArrayToDict,\n} from '@daffodil/core';\nimport { DaffRoutingQueryParamFilter } from '@daffodil/core/routing';\n\nimport {\n DaffProductRoutingConfig,\n DAFF_PRODUCT_ROUTING_CONFIG,\n} from '../config/public_api';\nimport { DAFF_PRODUCT_COLLECTION_REQUEST_FIELDS } from '../constants/public_api';\nimport { DAFF_PRODUCT_ROUTING_DISCRETE_FILTER_PARAMS } from '../discrete-filter-params/public_api';\n\n/**\n * Builds a query param map from a {@link DaffCollectionRequest}.\n * Its behavior can be configured via the {@link DAFF_PRODUCT_ROUTING_CONFIG} injection token.\n */\n@Injectable()\nexport class DaffProductGetQueryParamsFromRequest {\n constructor(\n @Inject(DAFF_PRODUCT_ROUTING_CONFIG) private config: DaffProductRoutingConfig,\n @Inject(DAFF_PRODUCT_ROUTING_DISCRETE_FILTER_PARAMS) private discreteFilters: DaffRoutingQueryParamFilter[],\n ) {}\n\n getQueryParams(request: DaffCollectionRequest): Params {\n const filterRequests = daffArrayToDict(request.filterRequests, (fr) => fr.name);\n // Specifically sets filter names missing from the filter requests to undefined\n // in order to remove them from the URL\n const trimmedQueryParams = this.discreteFilters.reduce(\n (acc, { filterName, queryParam }) => {\n if (!filterRequests[filterName]) {\n acc[queryParam] = undefined;\n }\n return acc;\n },\n {},\n );\n\n return DAFF_PRODUCT_COLLECTION_REQUEST_FIELDS.reduce<Params>((acc, field) => {\n const val = request[field];\n if (val) {\n acc[this.config.params[field] || field] = this.config.transforms?.[field]?.queryParam?.(val) || String(val);\n }\n return acc;\n }, trimmedQueryParams);\n }\n}\n","import {\n ActivatedRoute,\n Router,\n} from '@angular/router';\nimport {\n Actions,\n createEffect,\n ofType,\n} from '@ngrx/effects';\nimport { Action } from '@ngrx/store';\nimport { EMPTY } from 'rxjs';\nimport {\n switchMap,\n map,\n withLatestFrom,\n tap,\n} from 'rxjs/operators';\n\nimport {\n DaffCollectionRequest,\n daffFiltersToRequests,\n} from '@daffodil/core';\nimport { DaffCollectionFacadeInterface } from '@daffodil/core/state';\n\nimport { DaffProductGetQueryParamsFromRequest } from '../services/public_api';\n\n/**\n * An abstract class that provides an effect for modifying the browser URL.\n */\nexport abstract class DaffProductRoutingCollectionEffects {\n constructor(\n private actions$: Actions,\n private router: Router,\n private actionTypes: string[],\n private facade: DaffCollectionFacadeInterface,\n private getQueryParams: DaffProductGetQueryParamsFromRequest,\n private route: ActivatedRoute,\n ) {}\n\n /**\n * Updates the URL according to the product collection request in state.\n */\n update$ = createEffect(() => this.actions$.pipe(\n ofType(...this.actionTypes),\n withLatestFrom(this.facade.metadata$),\n map(([action, metadata]): [Action, DaffCollectionRequest] => [\n action,\n {\n filterRequests: daffFiltersToRequests(metadata.filters),\n appliedSortOption: metadata.appliedSortOption,\n appliedSortDirection: metadata.appliedSortDirection,\n currentPage: metadata.currentPage,\n pageSize: metadata.pageSize,\n },\n ]),\n tap(([action, request]) => this.router.navigate(\n [],\n {\n relativeTo: this.route,\n queryParams: this.getQueryParams.getQueryParams(request),\n queryParamsHandling: 'merge',\n },\n )),\n switchMap(() => EMPTY),\n ), { dispatch: false });\n}\n","import {\n ModuleWithProviders,\n NgModule,\n} from '@angular/core';\n\nimport {\n DaffProductRoutingConfig,\n provideDaffProductRoutingConfig,\n} from './config/public_api';\nimport {\n DaffProductGetCollectionRequestFromRoute,\n DaffProductGetQueryParamsFromRequest,\n} from './services/public_api';\n\n@NgModule({\n providers: [\n DaffProductGetCollectionRequestFromRoute,\n DaffProductGetQueryParamsFromRequest,\n ],\n})\nexport class DaffProductRoutingModule {\n static withConfig(config?: DaffProductRoutingConfig): ModuleWithProviders<DaffProductRoutingModule> {\n return {\n ngModule: DaffProductRoutingModule,\n providers: [\n provideDaffProductRoutingConfig(config),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AA2BA;;;AAGG;MAIU,yBAAyB,CAAA;AACpC,IAAA,WAAA,CAC+B,UAAkB,EACvC,KAAuC,EACvC,UAA0B,EAAA;QAFL,IAAU,CAAA,UAAA,GAAV,UAAU;QAC/B,IAAK,CAAA,KAAA,GAAL,KAAK;QACL,IAAU,CAAA,UAAA,GAAV,UAAU;;AAGpB,IAAA,OAAO,CAAC,KAA6B,EAAA;AACnC,QAAA,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,mBAAmB,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QAEtE,OAAO,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CACzE,MAAM,CAAC,0BAA0B,CAAC,4BAA4B,EAAE,0BAA0B,CAAC,4BAA4B,CAAC,EAC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wBACxC,oCAAoC;AACrC,qBAAA;AACF,iBAAA;;;ACnBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-product-routing.mjs","sources":["../../../libs/product/routing/src/resolvers/product-page-id/product-page-id.resolver.ts","../../../libs/product/routing/src/resolvers/product-page-url/product-page-url.resolver.ts","../../../libs/product/routing/src/config/default.ts","../../../libs/product/routing/src/config/token.ts","../../../libs/product/routing/src/constants/collection-request-fields.ts","../../../libs/product/routing/src/discrete-filter-params/token.ts","../../../libs/product/routing/src/services/get-request-from-route.service.ts","../../../libs/product/routing/src/services/get-query-params-from-request.service.ts","../../../libs/product/routing/src/effects/collection.effects.ts","../../../libs/product/routing/src/module.ts","../../../libs/product/routing/src/daffodil-product-routing.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\nimport { ActivatedRouteSnapshot } from '@angular/router';\nimport { ofType } from '@ngrx/effects';\nimport {\n ActionsSubject,\n Store,\n} from '@ngrx/store';\nimport {\n Observable,\n of,\n} from 'rxjs';\nimport {\n map,\n take,\n} from 'rxjs/operators';\n\nimport {\n DaffProductStateRootSlice,\n DaffProductPageLoad,\n DaffProductPageActionTypes,\n} from '@daffodil/product/state';\n\n/**\n * Resolves product data for product pages, and will only resolve the url after a product request succeeds or fails. This resolver expects a url\n * of the form `some/url/{id}` where `{id}` is the product id.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffProductPageIdResolver {\n constructor(\n @Inject(PLATFORM_ID) private platformId: string,\n private store: Store<DaffProductStateRootSlice>,\n private dispatcher: ActionsSubject,\n ) { }\n\n resolve(route: ActivatedRouteSnapshot): Observable<boolean> {\n this.store.dispatch(new DaffProductPageLoad(route.paramMap.get('id')));\n\n return isPlatformBrowser(this.platformId) ? of(true) : this.dispatcher.pipe(\n ofType(DaffProductPageActionTypes.ProductPageLoadSuccessAction, DaffProductPageActionTypes.ProductPageLoadFailureAction),\n map(() => true),\n take(1),\n );\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n RouterStateSnapshot,\n} from '@angular/router';\nimport { ofType } from '@ngrx/effects';\nimport {\n ActionsSubject,\n Store,\n} from '@ngrx/store';\nimport {\n Observable,\n of,\n} from 'rxjs';\nimport {\n map,\n take,\n} from 'rxjs/operators';\n\nimport { DaffRoutingUriNormalizer } from '@daffodil/core/routing';\nimport {\n DaffProductStateRootSlice,\n DaffProductPageLoadByUrl,\n DaffProductPageActionTypes,\n} from '@daffodil/product/state';\n\n/**\n * Resolves product data for product pages, and will only resolve the url\n * after a product request succeeds or fails. This resolver will take a full\n * a url of the form `some/url.html(secondary:outlet)?query=param#fragment` and attempt to resolve a product from it.\n * Assumes that the URL to be resolved is the primary outlet.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffProductPageUrlResolver {\n constructor(\n @Inject(PLATFORM_ID) private platformId: string,\n private store: Store<DaffProductStateRootSlice>,\n private dispatcher: ActionsSubject,\n private urlNormalizer: DaffRoutingUriNormalizer,\n ) { }\n\n resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> {\n this.store.dispatch(\n new DaffProductPageLoadByUrl(this.urlNormalizer.normalize(state.url)),\n );\n\n return isPlatformBrowser(this.platformId) ? of(true) : this.dispatcher.pipe(\n ofType(DaffProductPageActionTypes.ProductPageLoadSuccessAction, DaffProductPageActionTypes.ProductPageLoadFailureAction),\n map(() => true),\n take(1),\n );\n }\n}\n","import {\n inject,\n InjectionToken,\n} from '@angular/core';\n\nimport {\n DaffBase64Service,\n DaffBase64ServiceToken,\n} from '@daffodil/core';\n\nimport { DaffProductRoutingConfig } from './interface';\n\nexport const DAFF_PRODUCT_ROUTING_QUERY_PARAM_REQUEST_MAP: DaffProductRoutingConfig['params'] = {\n filterRequests: 'filters',\n appliedSortOption: 'sortOption',\n appliedSortDirection: 'sortDir',\n currentPage: 'page',\n pageSize: 'size',\n};\n\n/**\n * The default configuration for the {@link DaffProductRoutingConfig}.\n */\nexport const daffProductRoutingConfigDefaultFactory = (base64: DaffBase64Service): DaffProductRoutingConfig => ({\n params: DAFF_PRODUCT_ROUTING_QUERY_PARAM_REQUEST_MAP,\n transforms: {\n pageSize: {\n request: str => Number(str),\n queryParam: pageSize => String(pageSize),\n },\n currentPage: {\n request: str => Number(str),\n queryParam: currentPage => String(currentPage),\n },\n filterRequests: {\n request: base64Str => JSON.parse(base64.decode(base64Str)),\n queryParam: filterRequests => base64.encode(JSON.stringify(filterRequests)),\n },\n },\n});\n\nexport const DAFF_PRODUCT_ROUTING_CONFIG_DEFAULT = new InjectionToken<DaffProductRoutingConfig>(\n 'DAFF_PRODUCT_ROUTING_CONFIG_DEFAULT',\n { factory: () => daffProductRoutingConfigDefaultFactory(inject(DaffBase64ServiceToken)) },\n);\n","import { createConfigInjectionToken } from '@daffodil/core';\n\nimport { DAFF_PRODUCT_ROUTING_CONFIG_DEFAULT } from './default';\nimport { DaffProductRoutingConfig } from './interface';\n\nexport const {\n /**\n * The token used to provide @daffodil/product/routing config data.\n */\n token: DAFF_PRODUCT_ROUTING_CONFIG,\n /**\n * Provides the {@link DAFF_PRODUCT_ROUTING_CONFIG} token.\n */\n provider: provideDaffProductRoutingConfig,\n} = createConfigInjectionToken<DaffProductRoutingConfig>(DAFF_PRODUCT_ROUTING_CONFIG_DEFAULT, 'DAFF_PRODUCT_ROUTING_CONFIG');\n\n","import { DaffCollectionRequest } from '@daffodil/core';\n\n/**\n * A list of request fields that can be transformed to and from query params.\n */\nexport const DAFF_PRODUCT_COLLECTION_REQUEST_FIELDS: (keyof DaffCollectionRequest)[] = [\n 'filterRequests',\n 'appliedSortOption',\n 'appliedSortDirection',\n 'currentPage',\n 'pageSize',\n];\n","import { ValueProvider } from '@angular/core';\n\nimport { createMultiInjectionToken } from '@daffodil/core';\nimport {\n DaffRoutingQueryParamFilter,\n daffRoutingQueryParamFilterRequestEqualBuilder,\n} from '@daffodil/core/routing';\n\nexport const {\n /**\n * A list of product filter requests that are contained directly in query params,\n * with a one-to-one mapping between filters and query params.\n * This is constrasted to {@link DaffCollectionRequestQueryParams#filterRequests}\n * which remains the actual canonical source of truth of the filter requests.\n * The discrete filter params persist in the URL as long as the corresponding filter remains applied.\n */\n token: DAFF_PRODUCT_ROUTING_DISCRETE_FILTER_PARAMS,\n} = createMultiInjectionToken<DaffRoutingQueryParamFilter>(\n 'DAFF_PRODUCT_ROUTING_DISCRETE_FILTER_PARAMS',\n { providedIn: 'any' },\n);\n\n/**\n * A multi-provider for {@link DAFF_PRODUCT_ROUTING_DISCRETE_FILTER_PARAMS}.\n *\n * @param queryParam Defaults to `filterName`.\n * @param builder Defaults to {@link daffRoutingQueryParamFilterRequestEqualBuilder}.\n */\nexport function daffProductRoutingProvideDiscreteFilterParam(filterName: DaffRoutingQueryParamFilter['filterName'], queryParam?: DaffRoutingQueryParamFilter['queryParam'], builder?: DaffRoutingQueryParamFilter['builder']): ValueProvider {\n return {\n provide: DAFF_PRODUCT_ROUTING_DISCRETE_FILTER_PARAMS,\n useValue: {\n filterName,\n queryParam: queryParam || filterName,\n builder: builder || daffRoutingQueryParamFilterRequestEqualBuilder,\n },\n multi: true,\n };\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { ParamMap } from '@angular/router';\n\nimport {\n DaffCollectionRequest,\n DaffFilterRequest,\n} from '@daffodil/core';\nimport { DaffRoutingQueryParamFilter } from '@daffodil/core/routing';\n\nimport {\n DaffProductRoutingConfig,\n DAFF_PRODUCT_ROUTING_CONFIG,\n} from '../config/public_api';\nimport { DAFF_PRODUCT_COLLECTION_REQUEST_FIELDS } from '../constants/public_api';\nimport { DAFF_PRODUCT_ROUTING_DISCRETE_FILTER_PARAMS } from '../discrete-filter-params/public_api';\n\n/**\n * Builds a {@link DaffCollectionRequest} from the query params of the passed route.\n * Its behavior can be configured via the {@link DAFF_PRODUCT_COLLECTION_QUERY_PARAMS} and\n * {@link DAFF_PRODUCT_COLLECTION_QUERY_PARAM_TRANSFORMS} injection tokens.\n */\n@Injectable()\nexport class DaffProductGetCollectionRequestFromRoute {\n constructor(\n @Inject(DAFF_PRODUCT_ROUTING_CONFIG) private config: DaffProductRoutingConfig,\n @Inject(DAFF_PRODUCT_ROUTING_DISCRETE_FILTER_PARAMS) private discreteFilters: DaffRoutingQueryParamFilter[],\n ) {}\n\n getRequest(queryParamMap: ParamMap): DaffCollectionRequest {\n const request = DAFF_PRODUCT_COLLECTION_REQUEST_FIELDS.reduce<DaffCollectionRequest>((acc, field) => {\n const qp = this.config.params[field] || field;\n if (queryParamMap.has(qp)) {\n const qpVal = queryParamMap.get(qp);\n // no idea why field needs to be typecasted\n acc[(<string>field)] = this.config.transforms?.[field]?.request?.(qpVal) || qpVal;\n }\n return acc;\n }, {});\n const filterRequests = this.discreteFilters.reduce<DaffFilterRequest[]>(\n (acc, { filterName, builder, queryParam }) =>\n queryParamMap.has(queryParam)\n ? [\n ...acc,\n builder(filterName, queryParamMap.getAll(queryParam)),\n ]\n : acc,\n request.filterRequests || [],\n );\n // add discrete filter params to the list of requests\n if (filterRequests.length > 0) {\n request.filterRequests = filterRequests;\n }\n\n return request;\n }\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { Params } from '@angular/router';\n\nimport {\n DaffCollectionRequest,\n daffArrayToDict,\n} from '@daffodil/core';\nimport { DaffRoutingQueryParamFilter } from '@daffodil/core/routing';\n\nimport {\n DaffProductRoutingConfig,\n DAFF_PRODUCT_ROUTING_CONFIG,\n} from '../config/public_api';\nimport { DAFF_PRODUCT_COLLECTION_REQUEST_FIELDS } from '../constants/public_api';\nimport { DAFF_PRODUCT_ROUTING_DISCRETE_FILTER_PARAMS } from '../discrete-filter-params/public_api';\n\n/**\n * Builds a query param map from a {@link DaffCollectionRequest}.\n * Its behavior can be configured via the {@link DAFF_PRODUCT_ROUTING_CONFIG} injection token.\n */\n@Injectable()\nexport class DaffProductGetQueryParamsFromRequest {\n constructor(\n @Inject(DAFF_PRODUCT_ROUTING_CONFIG) private config: DaffProductRoutingConfig,\n @Inject(DAFF_PRODUCT_ROUTING_DISCRETE_FILTER_PARAMS) private discreteFilters: DaffRoutingQueryParamFilter[],\n ) {}\n\n getQueryParams(request: DaffCollectionRequest): Params {\n const filterRequests = daffArrayToDict(request.filterRequests, (fr) => fr.name);\n // Specifically sets filter names missing from the filter requests to undefined\n // in order to remove them from the URL\n const trimmedQueryParams = this.discreteFilters.reduce(\n (acc, { filterName, queryParam }) => {\n if (!filterRequests[filterName]) {\n acc[queryParam] = undefined;\n }\n return acc;\n },\n {},\n );\n\n return DAFF_PRODUCT_COLLECTION_REQUEST_FIELDS.reduce<Params>((acc, field) => {\n const val = request[field];\n if (val) {\n acc[this.config.params[field] || field] = this.config.transforms?.[field]?.queryParam?.(val) || String(val);\n }\n return acc;\n }, trimmedQueryParams);\n }\n}\n","import {\n ActivatedRoute,\n Router,\n} from '@angular/router';\nimport {\n Actions,\n createEffect,\n ofType,\n} from '@ngrx/effects';\nimport { Action } from '@ngrx/store';\nimport { EMPTY } from 'rxjs';\nimport {\n switchMap,\n map,\n withLatestFrom,\n tap,\n} from 'rxjs/operators';\n\nimport {\n DaffCollectionRequest,\n daffFiltersToRequests,\n} from '@daffodil/core';\nimport { DaffCollectionFacadeInterface } from '@daffodil/core/state';\n\nimport { DaffProductGetQueryParamsFromRequest } from '../services/public_api';\n\n/**\n * An abstract class that provides an effect for modifying the browser URL.\n */\nexport abstract class DaffProductRoutingCollectionEffects {\n constructor(\n private actions$: Actions,\n private router: Router,\n private actionTypes: string[],\n private facade: DaffCollectionFacadeInterface,\n private getQueryParams: DaffProductGetQueryParamsFromRequest,\n private route: ActivatedRoute,\n ) {}\n\n /**\n * Updates the URL according to the product collection request in state.\n */\n update$ = createEffect(() => this.actions$.pipe(\n ofType(...this.actionTypes),\n withLatestFrom(this.facade.metadata$),\n map(([action, metadata]): [Action, DaffCollectionRequest] => [\n action,\n {\n filterRequests: daffFiltersToRequests(metadata.filters),\n appliedSortOption: metadata.appliedSortOption,\n appliedSortDirection: metadata.appliedSortDirection,\n currentPage: metadata.currentPage,\n pageSize: metadata.pageSize,\n },\n ]),\n tap(([action, request]) => this.router.navigate(\n [],\n {\n relativeTo: this.route,\n queryParams: this.getQueryParams.getQueryParams(request),\n queryParamsHandling: 'merge',\n },\n )),\n switchMap(() => EMPTY),\n ), { dispatch: false });\n}\n","import {\n ModuleWithProviders,\n NgModule,\n} from '@angular/core';\n\nimport {\n DaffProductRoutingConfig,\n provideDaffProductRoutingConfig,\n} from './config/public_api';\nimport {\n DaffProductGetCollectionRequestFromRoute,\n DaffProductGetQueryParamsFromRequest,\n} from './services/public_api';\n\n@NgModule({\n providers: [\n DaffProductGetCollectionRequestFromRoute,\n DaffProductGetQueryParamsFromRequest,\n ],\n})\nexport class DaffProductRoutingModule {\n static withConfig(config?: DaffProductRoutingConfig): ModuleWithProviders<DaffProductRoutingModule> {\n return {\n ngModule: DaffProductRoutingModule,\n providers: [\n provideDaffProductRoutingConfig(config),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AA2BA;;;AAGG;MAIU,yBAAyB,CAAA;AACpC,IAAA,WAAA,CAC+B,UAAkB,EACvC,KAAuC,EACvC,UAA0B,EAAA;QAFL,IAAU,CAAA,UAAA,GAAV,UAAU;QAC/B,IAAK,CAAA,KAAA,GAAL,KAAK;QACL,IAAU,CAAA,UAAA,GAAV,UAAU;;AAGpB,IAAA,OAAO,CAAC,KAA6B,EAAA;AACnC,QAAA,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,mBAAmB,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QAEtE,OAAO,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,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FAEU,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBANpC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;wBACT,wCAAwC;wBACxC,oCAAoC;AACrC,qBAAA;AACF,iBAAA;;;ACnBD;;AAEG;;;;"}
|
|
@@ -13,10 +13,10 @@ class MockDaffBestSellersFacade {
|
|
|
13
13
|
this.bestSellers$ = new BehaviorSubject([]);
|
|
14
14
|
}
|
|
15
15
|
dispatch(action) { }
|
|
16
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
17
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
16
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MockDaffBestSellersFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
17
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MockDaffBestSellersFacade, providedIn: 'root' }); }
|
|
18
18
|
}
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MockDaffBestSellersFacade, decorators: [{
|
|
20
20
|
type: Injectable,
|
|
21
21
|
args: [{ providedIn: 'root' }]
|
|
22
22
|
}] });
|
|
@@ -48,10 +48,10 @@ class MockDaffProductFacade {
|
|
|
48
48
|
}
|
|
49
49
|
dispatch(action) { }
|
|
50
50
|
;
|
|
51
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
52
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
51
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MockDaffProductFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
52
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MockDaffProductFacade, providedIn: 'root' }); }
|
|
53
53
|
}
|
|
54
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
54
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MockDaffProductFacade, decorators: [{
|
|
55
55
|
type: Injectable,
|
|
56
56
|
args: [{ providedIn: 'root' }]
|
|
57
57
|
}] });
|
|
@@ -66,10 +66,10 @@ class MockDaffProductGridFacade {
|
|
|
66
66
|
}
|
|
67
67
|
dispatch(action) { }
|
|
68
68
|
;
|
|
69
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
70
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
69
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MockDaffProductGridFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
70
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MockDaffProductGridFacade, providedIn: 'root' }); }
|
|
71
71
|
}
|
|
72
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
72
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MockDaffProductGridFacade, decorators: [{
|
|
73
73
|
type: Injectable,
|
|
74
74
|
args: [{ providedIn: 'root' }]
|
|
75
75
|
}] });
|
|
@@ -89,25 +89,25 @@ class MockDaffProductPageFacade {
|
|
|
89
89
|
}
|
|
90
90
|
dispatch(action) { }
|
|
91
91
|
;
|
|
92
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
93
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
92
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MockDaffProductPageFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
93
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MockDaffProductPageFacade, providedIn: 'root' }); }
|
|
94
94
|
}
|
|
95
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: MockDaffProductPageFacade, decorators: [{
|
|
96
96
|
type: Injectable,
|
|
97
97
|
args: [{ providedIn: 'root' }]
|
|
98
98
|
}] });
|
|
99
99
|
|
|
100
100
|
class DaffProductStateTestingModule {
|
|
101
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
102
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.
|
|
103
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.
|
|
101
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductStateTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
102
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: DaffProductStateTestingModule }); }
|
|
103
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductStateTestingModule, providers: [
|
|
104
104
|
{ provide: DaffProductFacade, useExisting: MockDaffProductFacade },
|
|
105
105
|
{ provide: DaffProductGridFacade, useExisting: MockDaffProductGridFacade },
|
|
106
106
|
{ provide: DaffBestSellersFacade, useExisting: MockDaffBestSellersFacade },
|
|
107
107
|
{ provide: DaffProductPageFacade, useExisting: MockDaffProductPageFacade },
|
|
108
108
|
] }); }
|
|
109
109
|
}
|
|
110
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductStateTestingModule, decorators: [{
|
|
111
111
|
type: NgModule,
|
|
112
112
|
args: [{
|
|
113
113
|
providers: [
|
|
@@ -259,10 +259,10 @@ class DaffBestSellersEffects {
|
|
|
259
259
|
this.loadBestSellers$ = createEffect(() => this.actions$.pipe(ofType(DaffBestSellersActionTypes.BestSellersLoadAction), switchMap((action) => this.driver.getBestSellers()
|
|
260
260
|
.pipe(map((resp) => new DaffBestSellersLoadSuccess(resp)), catchError((error) => of(new DaffBestSellersLoadFailure(this.errorMatcher(error))))))));
|
|
261
261
|
}
|
|
262
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
263
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
262
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffBestSellersEffects, deps: [{ token: i1.Actions }, { token: DaffProductDriver }, { token: DAFF_PRODUCT_ERROR_MATCHER }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
263
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffBestSellersEffects }); }
|
|
264
264
|
}
|
|
265
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
265
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffBestSellersEffects, decorators: [{
|
|
266
266
|
type: Injectable
|
|
267
267
|
}], ctorParameters: () => [{ type: i1.Actions }, { type: undefined, decorators: [{
|
|
268
268
|
type: Inject,
|
|
@@ -292,10 +292,10 @@ class DaffProductGridEffects {
|
|
|
292
292
|
this.loadAll$ = createEffect(() => this.actions$.pipe(ofType(DaffProductGridActionTypes.ProductGridLoadAction), switchMap((action) => this.driver.getAll()
|
|
293
293
|
.pipe(map((resp) => new DaffProductGridLoadSuccess(resp)), catchError((error) => of(new DaffProductGridLoadFailure(this.errorMatcher(error))))))));
|
|
294
294
|
}
|
|
295
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
296
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
295
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductGridEffects, deps: [{ token: i1.Actions }, { token: DaffProductDriver }, { token: DAFF_PRODUCT_ERROR_MATCHER }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
296
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductGridEffects }); }
|
|
297
297
|
}
|
|
298
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
298
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductGridEffects, decorators: [{
|
|
299
299
|
type: Injectable
|
|
300
300
|
}], ctorParameters: () => [{ type: i1.Actions }, { type: undefined, decorators: [{
|
|
301
301
|
type: Inject,
|
|
@@ -325,10 +325,10 @@ class DaffProductEffects {
|
|
|
325
325
|
this.load$ = createEffect(() => this.actions$.pipe(ofType(DaffProductActionTypes.ProductLoadAction), switchMap((action) => this.driver.get(action.payload)
|
|
326
326
|
.pipe(map((resp) => new DaffProductLoadSuccess(resp)), catchError((error) => of(new DaffProductLoadFailure(this.errorMatcher(error))))))));
|
|
327
327
|
}
|
|
328
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
329
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
328
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductEffects, deps: [{ token: i1.Actions }, { token: DaffProductDriver }, { token: DAFF_PRODUCT_ERROR_MATCHER }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
329
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductEffects }); }
|
|
330
330
|
}
|
|
331
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
331
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductEffects, decorators: [{
|
|
332
332
|
type: Injectable
|
|
333
333
|
}], ctorParameters: () => [{ type: i1.Actions }, { type: undefined, decorators: [{
|
|
334
334
|
type: Inject,
|
|
@@ -512,10 +512,10 @@ class DaffBestSellersFacade {
|
|
|
512
512
|
dispatch(action) {
|
|
513
513
|
this.store.dispatch(action);
|
|
514
514
|
}
|
|
515
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
516
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
515
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffBestSellersFacade, deps: [{ token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
516
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffBestSellersFacade, providedIn: 'root' }); }
|
|
517
517
|
}
|
|
518
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
518
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffBestSellersFacade, decorators: [{
|
|
519
519
|
type: Injectable,
|
|
520
520
|
args: [{
|
|
521
521
|
providedIn: 'root',
|
|
@@ -556,10 +556,10 @@ class DaffProductFacade {
|
|
|
556
556
|
dispatch(action) {
|
|
557
557
|
this.store.dispatch(action);
|
|
558
558
|
}
|
|
559
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
560
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
559
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductFacade, deps: [{ token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
560
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductFacade, providedIn: 'root' }); }
|
|
561
561
|
}
|
|
562
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
562
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductFacade, decorators: [{
|
|
563
563
|
type: Injectable,
|
|
564
564
|
args: [{
|
|
565
565
|
providedIn: 'root',
|
|
@@ -586,10 +586,10 @@ class DaffProductPageFacade {
|
|
|
586
586
|
dispatch(action) {
|
|
587
587
|
this.store.dispatch(action);
|
|
588
588
|
}
|
|
589
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
590
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
589
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductPageFacade, deps: [{ token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
590
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductPageFacade, providedIn: 'root' }); }
|
|
591
591
|
}
|
|
592
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
592
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductPageFacade, decorators: [{
|
|
593
593
|
type: Injectable,
|
|
594
594
|
args: [{
|
|
595
595
|
providedIn: 'root',
|
|
@@ -611,10 +611,10 @@ class DaffProductGridFacade {
|
|
|
611
611
|
dispatch(action) {
|
|
612
612
|
this.store.dispatch(action);
|
|
613
613
|
}
|
|
614
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
615
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
614
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductGridFacade, deps: [{ token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
615
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductGridFacade, providedIn: 'root' }); }
|
|
616
616
|
}
|
|
617
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
617
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductGridFacade, decorators: [{
|
|
618
618
|
type: Injectable,
|
|
619
619
|
args: [{
|
|
620
620
|
providedIn: 'root',
|
|
@@ -824,10 +824,10 @@ class DaffProductPageEffects {
|
|
|
824
824
|
this.loadByUrl$ = createEffect(() => this.actions$.pipe(ofType(DaffProductPageActionTypes.ProductPageLoadByUrlAction), switchMap((action) => this.driver.getByUrl(action.payload)
|
|
825
825
|
.pipe(map((resp) => new DaffProductPageLoadSuccess(resp)), catchError((error) => of(new DaffProductPageLoadFailure(this.errorMatcher(error))))))));
|
|
826
826
|
}
|
|
827
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
828
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.
|
|
827
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductPageEffects, deps: [{ token: i1.Actions }, { token: DaffProductDriver }, { token: DAFF_PRODUCT_ERROR_MATCHER }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
828
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductPageEffects }); }
|
|
829
829
|
}
|
|
830
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
830
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductPageEffects, decorators: [{
|
|
831
831
|
type: Injectable
|
|
832
832
|
}], ctorParameters: () => [{ type: i1.Actions }, { type: undefined, decorators: [{
|
|
833
833
|
type: Inject,
|
|
@@ -876,9 +876,9 @@ provider: provideDaffProductReducers, } = createSingleInjectionToken('DAFF_PRODU
|
|
|
876
876
|
* A module that provides the default reducers and effects for the product redux state.
|
|
877
877
|
*/
|
|
878
878
|
class DaffProductStateModule {
|
|
879
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.
|
|
880
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.
|
|
881
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.
|
|
879
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
880
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: DaffProductStateModule, imports: [i1$1.StoreFeatureModule, i1.EffectsFeatureModule] }); }
|
|
881
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductStateModule, imports: [StoreModule.forFeature(DAFF_PRODUCT_STORE_FEATURE_KEY, DAFF_PRODUCT_REDUCERS, DAFF_PRODUCT_STORE_CONFIG),
|
|
882
882
|
EffectsModule.forFeature([
|
|
883
883
|
DaffProductGridEffects,
|
|
884
884
|
DaffProductEffects,
|
|
@@ -886,7 +886,7 @@ class DaffProductStateModule {
|
|
|
886
886
|
DaffBestSellersEffects,
|
|
887
887
|
])] }); }
|
|
888
888
|
}
|
|
889
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.
|
|
889
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffProductStateModule, decorators: [{
|
|
890
890
|
type: NgModule,
|
|
891
891
|
args: [{
|
|
892
892
|
imports: [
|