@daffodil/driver 0.90.0 → 0.92.3-rc.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/README.md +16 -1
- package/fesm2022/daffodil-driver-hubspot-testing.mjs +3 -3
- package/fesm2022/daffodil-driver-hubspot-testing.mjs.map +1 -1
- package/fesm2022/daffodil-driver-in-memory.mjs +100 -9
- package/fesm2022/daffodil-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-driver-magento-testing.mjs +9 -9
- package/fesm2022/daffodil-driver-magento-testing.mjs.map +1 -1
- package/fesm2022/daffodil-driver-magento.mjs +359 -281
- package/fesm2022/daffodil-driver-magento.mjs.map +1 -1
- package/fesm2022/daffodil-driver-shopify-testing.mjs +128 -53
- package/fesm2022/daffodil-driver-shopify-testing.mjs.map +1 -1
- package/fesm2022/daffodil-driver-shopify.mjs +1440 -1432
- package/fesm2022/daffodil-driver-shopify.mjs.map +1 -1
- package/fesm2022/daffodil-driver.mjs +3 -3
- package/fesm2022/daffodil-driver.mjs.map +1 -1
- package/in-memory/index.d.ts +80 -3
- package/magento/index.d.ts +112 -36
- package/package.json +1 -1
- package/shopify/index.d.ts +4318 -3116
- package/shopify/testing/index.d.ts +101 -36
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-driver-magento.mjs","sources":["../../../libs/driver/magento/src/schema/schema.ts","../../../libs/driver/magento/src/apollo/create-http-link.ts","../../../libs/driver/magento/src/apollo/possible-types.ts","../../../libs/driver/magento/src/apollo/type-policies.ts","../../../libs/driver/magento/src/graphql/cache.service.ts","../../../libs/driver/magento/src/provider.ts","../../../libs/driver/magento/src/errors/error.class.ts","../../../libs/driver/magento/src/errors/transform-graphql.ts","../../../libs/driver/magento/src/errors/transform.ts","../../../libs/driver/magento/src/models/sort.enum.ts","../../../libs/driver/magento/src/graphql/cacheable-operations/cacheable-operations-token.ts","../../../libs/driver/magento/src/graphql/cacheable-operations/apollo-cacheable-operations-link-generator.ts","../../../libs/driver/magento/src/graphql/type-policies.ts","../../../libs/driver/magento/src/graphql/cache-header/cache-header-apollo-link.ts","../../../libs/driver/magento/src/transforms/responses/page-info.ts","../../../libs/driver/magento/src/transforms/responses/sort-direction.ts","../../../libs/driver/magento/src/transforms/requests/sort-direction.ts","../../../libs/driver/magento/src/fragments/page-info.ts","../../../libs/driver/magento/src/fragments/money.ts","../../../libs/driver/magento/src/magento.module.ts","../../../libs/driver/magento/src/daffodil-driver-magento.ts"],"sourcesContent":["import introspectionQueryResultData from './introspection.json';\n\nexport const schema = introspectionQueryResultData;\n","import { inject } from '@angular/core';\nimport {\n ApolloLink,\n UriFunction,\n} from '@apollo/client/core';\nimport { HttpLink } from 'apollo-angular/http';\n\n/**\n * Creates an Apollo HTTP link for GraphQL requests.\n *\n * @param url - The Shopify Storefront API endpoint URL for GraphQL requests.\n * @returns An ApolloLink instance configured with the provided URL.\n */\nexport function createHttpLink(url: string | UriFunction): ApolloLink {\n const httpLink = inject(HttpLink);\n return httpLink.create({ uri: url });\n}\n","/**\n * Magento GraphQL possible types configuration for Apollo Client.\n *\n * This object defines the possible concrete types for each GraphQL interface\n * used in Magento's GraphQL API. Apollo Client uses this information for\n * proper fragment matching and union/interface type resolution.\n *\n * When Apollo Client encounters a GraphQL interface or union type in a query,\n * it needs to know which concrete types can implement that interface to\n * properly cache and normalize the data.\n *\n * @example\n * ```typescript\n * new InMemoryCache({\n * possibleTypes: MAGENTO_POSSIBLE_TYPES\n * })\n * ```\n */\nexport const MAGENTO_POSSIBLE_TYPES = {\n CartAddressInterface: [\n 'BillingCartAddress',\n 'ShippingCartAddress',\n ],\n CartItemInterface: [\n 'SimpleCartItem',\n 'VirtualCartItem',\n 'DownloadableCartItem',\n 'BundleCartItem',\n 'ConfigurableCartItem',\n ],\n ProductInterface: [\n 'VirtualProduct',\n 'SimpleProduct',\n 'DownloadableProduct',\n 'BundleProduct',\n 'GroupedProduct',\n 'ConfigurableProduct',\n ],\n CategoryInterface: [\n 'CategoryTree',\n ],\n MediaGalleryInterface: [\n 'ProductImage',\n 'ProductVideo',\n ],\n ProductLinksInterface: [\n 'ProductLinks',\n ],\n CreditMemoItemInterface: [\n 'DownloadableCreditMemoItem',\n 'BundleCreditMemoItem',\n 'CreditMemoItem',\n ],\n OrderItemInterface: [\n 'DownloadableOrderItem',\n 'BundleOrderItem',\n 'OrderItem',\n ],\n InvoiceItemInterface: [\n 'DownloadableInvoiceItem',\n 'BundleInvoiceItem',\n 'InvoiceItem',\n ],\n ShipmentItemInterface: [\n 'BundleShipmentItem',\n 'ShipmentItem',\n ],\n AggregationOptionInterface: [\n 'AggregationOption',\n ],\n LayerFilterItemInterface: [\n 'LayerFilterItem',\n 'SwatchLayerFilterItem',\n ],\n PhysicalProductInterface: [\n 'SimpleProduct',\n 'BundleProduct',\n 'GroupedProduct',\n 'ConfigurableProduct',\n ],\n CustomizableOptionInterface: [\n 'CustomizableAreaOption',\n 'CustomizableDateOption',\n 'CustomizableDropDownOption',\n 'CustomizableMultipleOption',\n 'CustomizableFieldOption',\n 'CustomizableFileOption',\n 'CustomizableRadioOption',\n 'CustomizableCheckboxOption',\n ],\n CustomizableProductInterface: [\n 'VirtualProduct',\n 'SimpleProduct',\n 'DownloadableProduct',\n 'BundleProduct',\n 'ConfigurableProduct',\n ],\n SwatchDataInterface: [\n 'ImageSwatchData',\n 'TextSwatchData',\n 'ColorSwatchData',\n ],\n SwatchLayerFilterItemInterface: [\n 'SwatchLayerFilterItem',\n ],\n};\n","/**\n * Custom type policies that allow us to have more granular control\n * over how ApolloClient reads from and writes to the cache.\n *\n * https://www.apollographql.com/docs/react/caching/cache-configuration/#typepolicy-fields\n * https://www.apollographql.com/docs/react/caching/cache-field-behavior/\n */\n\nimport { TypePolicies } from '@apollo/client/cache';\n\nconst typePolicies: TypePolicies = {\n // Query/Mutation are \"types\" just like \"Cart\".\n Query: {\n fields: {\n cart: {\n // Replaces @connection(key: \"Cart\")\n keyArgs: () => 'Cart',\n },\n customer: {\n keyArgs: () => 'Customer',\n },\n customerCart: {\n keyArgs: () => 'Cart',\n },\n customerWishlistProducts: {\n read: existing => existing || [],\n },\n },\n },\n AppliedGiftCard: {\n keyFields: ['code'],\n },\n AvailablePaymentMethod: {\n keyFields: ['code'],\n },\n AvailableShippingMethod: {\n // The combination of these fields makes an instance of\n // AvailableShippingMethod unique.\n keyFields: ['carrier_code', 'method_code'],\n },\n Breadcrumb: {\n // Uses provided fields on the object as the `uid`.\n keyFields: ['category_uid'],\n },\n Cart: {\n keyFields: () => 'Cart',\n fields: {\n applied_gift_cards: {\n\n merge(existing, incoming) {\n return incoming;\n },\n },\n available_payment_methods: {\n\n merge(existing, incoming) {\n return incoming;\n },\n },\n items: {\n\n merge(existing, incoming) {\n return incoming;\n },\n },\n prices: {\n // `merge: true` can be used for an object field.\n merge: true,\n },\n shipping_addresses: {\n merge(existing = [], incoming, { readField, mergeObjects }) {\n // street makes these things unique\n const mergeResult = new Set();\n const streetToIndex = new Map();\n\n existing.forEach((existingShippingAddress, index) => {\n // Use readField instead of existingShippingAddress.street directly because it will follow cache references.\n const street = readField(\n 'street',\n existingShippingAddress,\n );\n streetToIndex.set(street, index);\n });\n\n incoming.forEach(incomingShippingAddress => {\n const street = readField(\n 'street',\n incomingShippingAddress,\n );\n\n if (streetToIndex.has(street)) {\n const targetIndex = streetToIndex.get(street);\n const existingShippingAddress =\n existing[targetIndex];\n const merged = mergeObjects(\n existingShippingAddress,\n incomingShippingAddress,\n );\n mergeResult.add(merged);\n } else {\n // We do not have an address with this street yet, add it on to the end.\n streetToIndex.set(street, streetToIndex.size);\n mergeResult.add(incomingShippingAddress);\n }\n });\n\n return Array.from(mergeResult);\n },\n },\n },\n },\n Customer: {\n keyFields: () => 'Customer',\n merge: true,\n fields: {\n addresses: {\n merge(existing, incoming) {\n return incoming;\n },\n read(cachedAddresses, { toReference }) {\n if (cachedAddresses) {\n return cachedAddresses.map(address => {\n // Update v2 identifiers to new references. Previous\n // entries had `id: CustomerAddress:1` which caused\n // v3's lookup to fail. If we find a legacy id,\n // point it at the object using a reference.\n if (\n address.id &&\n address.id.includes('CustomerAddress')\n ) {\n return toReference(address.id);\n } else {\n return address;\n }\n });\n }\n // If there are no cached addresses that's fine - the schema\n // shows that it is a nullable field.\n },\n },\n orders: {\n keyArgs: ['filter'],\n },\n },\n },\n CustomerAddress: {\n fields: {\n street: {\n\n merge(existing, incoming) {\n return incoming;\n },\n },\n },\n },\n CustomerPaymentTokens: {\n keyFields: () => 'CustomerPaymentTokens',\n fields: {\n items: {\n\n merge(existing, incoming) {\n return incoming;\n },\n },\n },\n },\n Currency: {\n merge: true,\n },\n ProductImage: {\n keyFields: ['url'],\n },\n ConfigurableProductOptions: {\n keyFields: ['uid'],\n },\n SelectedConfigurableOption: {\n // id alone is not enough to identify a selected option as it can refer\n // to something like \"size\" where value_id refers to \"large\".\n // TODO: Use configurable_product_option_uid for ConfigurableWishlistItem when available in 2.4.5\n keyFields: fields => fields.configurable_product_option_uid\n ? [\n 'configurable_product_option_uid',\n 'configurable_product_option_value_uid',\n ]\n : ['id', 'value_id'],\n },\n SelectedPaymentMethod: {\n keyFields: ['code'],\n },\n ShippingCartAddress: {\n keyFields: ['street'],\n fields: {\n available_shipping_methods: {\n merge(existing = [], incoming, { readField, mergeObjects }) {\n // carrier_code + method_code makes these things unique\n const mergeResult = new Set();\n const carrierToIndex = new Map();\n\n existing.forEach((existingShippingMethod, index) => {\n // Use readField because it will follow cache references.\n const carrierCode = readField(\n 'carrier_code',\n existingShippingMethod,\n );\n const methodCode = readField(\n 'method_code',\n existingShippingMethod,\n );\n const carrierKey = `${carrierCode}|${methodCode}`;\n carrierToIndex.set(carrierKey, index);\n });\n\n incoming.forEach(incomingShippingMethod => {\n // Use readField because it will follow cache references.\n const carrierCode = readField(\n 'carrier_code',\n incomingShippingMethod,\n );\n const methodCode = readField(\n 'method_code',\n incomingShippingMethod,\n );\n const carrierKey = `${carrierCode}|${methodCode}`;\n if (carrierToIndex.has(carrierKey)) {\n const targetIndex = carrierToIndex.get(carrierKey);\n const existingShippingMethod =\n existing[targetIndex];\n const merged = mergeObjects(\n existingShippingMethod,\n incomingShippingMethod,\n );\n mergeResult.add(merged);\n } else {\n // We do not have a method with this key yet, add it on to the end.\n carrierToIndex.set(carrierKey, carrierToIndex.size);\n mergeResult.add(incomingShippingMethod);\n }\n });\n\n return Array.from(mergeResult);\n },\n },\n country: {\n merge: true,\n },\n region: {\n merge: true,\n },\n selected_shipping_method: {\n merge: true,\n },\n },\n },\n CategoryTree: {\n keyFields: ['uid'],\n fields: {\n children: {\n merge(existing, incoming) {\n return incoming;\n },\n },\n },\n },\n Wishlist: {\n keyFields: ({ id }) => `CustomerWishlist:${id}`,\n fields: {\n items_v2: {\n keyArgs: false,\n merge: false,\n },\n },\n },\n WishlistItem: {\n keyFields: ({ id }) => `CustomerWishlistItem:${id}`,\n },\n WishlistItems: {\n fields: {\n items: {\n merge: (existing = [], incoming, { variables }) => {\n if (variables) {\n const { currentPage = 1 } = variables;\n // reset cache collection if we're on the first page\n\n if (currentPage === 1) {\n return incoming;\n }\n }\n\n return [...existing, ...incoming];\n },\n },\n },\n },\n SimpleWishlistItem: {\n keyFields: ({ id }) => `CustomerSimpleWishlistItem:${id}`,\n },\n VirtualWishlistItem: {\n keyFields: ({ id }) => `CustomerVirtualWishlistItem:${id}`,\n },\n DownloadableWishlistItem: {\n keyFields: ({ id }) => `CustomerDownloadableWishlistItem:${id}`,\n },\n BundleWishlistItem: {\n keyFields: ({ id }) => `CustomerBundleWishlistItem:${id}`,\n },\n GroupedProductWishlistItem: {\n keyFields: ({ id }) => `CustomerGroupedProductWishlistItem:${id}`,\n },\n ConfigurableWishlistItem: {\n keyFields: ({ id }) => `CustomerConfigurableWishlistItem:${id}`,\n },\n GiftCardWishlistItem: {\n keyFields: ({ id }) => `CustomerGiftCardWishlistItem:${id}`,\n },\n SimpleProduct: {\n keyFields: ['uid'],\n },\n ConfigurableProduct: {\n keyFields: ['uid'],\n },\n BundleProduct: {\n keyFields: ['uid'],\n },\n GroupedProduct: {\n keyFields: ['uid'],\n },\n VirtualProduct: {\n keyFields: ['uid'],\n },\n CartItemInterface: {\n keyFields: ['uid'],\n },\n StoreConfig: {\n keyFields: ['store_code'],\n },\n};\n\nexport default typePolicies;\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffDriverHttpClientCacheServiceInterface } from '@daffodil/driver';\n\n/**\n * Interacts with the Apollo client.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffDriverHttpClientCacheMagentoService implements DaffDriverHttpClientCacheServiceInterface {\n constructor(\n @Inject(PLATFORM_ID) private platformId: string,\n ) {}\n\n reset(): void {\n if (isPlatformBrowser(this.platformId)) {\n location.reload();\n }\n }\n}\n","import {\n inject,\n InjectionToken,\n Provider,\n} from '@angular/core';\nimport {\n from,\n InMemoryCache,\n PossibleTypesMap,\n TypePolicies,\n UriFunction,\n} from '@apollo/client/core';\nimport { provideApollo } from 'apollo-angular';\n\nimport { provideDaffDriverHttpClientCacheService } from '@daffodil/driver';\n\nimport { createHttpLink } from './apollo/create-http-link';\nimport { MAGENTO_POSSIBLE_TYPES } from './apollo/possible-types';\nimport typePolicies from './apollo/type-policies';\nimport { DaffDriverHttpClientCacheMagentoService } from './graphql/cache.service';\n\nexport interface DaffMagentoDriverConfig {\n possibleTypes: PossibleTypesMap;\n typePolicies: TypePolicies;\n}\n\n/**\n * Sets up the Magento Daffodil driver configuration for Magento's GraphQl API.\n *\n * Under the hood, this creates an Apollo Client configuration.\n *\n * @param endpoint - The Magento store domain (e.g. \"https://www.my-store.com/graphql\") or an injection token for a string or function that returns a string\n */\nexport function provideMagentoDriver(endpoint: string | InjectionToken<string | UriFunction>, options: DaffMagentoDriverConfig = {\n possibleTypes: MAGENTO_POSSIBLE_TYPES,\n typePolicies,\n}): Provider[] {\n return [\n provideApollo(() => ({\n link: from([\n createHttpLink(typeof endpoint === 'string' ? endpoint : inject(endpoint)),\n ]),\n cache: new InMemoryCache({ typePolicies: options.typePolicies, possibleTypes: options.possibleTypes }),\n })),\n provideDaffDriverHttpClientCacheService(DaffDriverHttpClientCacheMagentoService),\n ];\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_DRIVER_MAGENTO_ERROR_CODE = 'DAFF_DRIVER_MAGENTO_ERROR';\n\n/**\n * A very general error thrown when a more specific error type cannot be determined.\n */\nexport class DaffDriverMagentoError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_DRIVER_MAGENTO_ERROR_CODE;\n\n constructor(message?: string) {\n super(message);\n }\n}\n","import { GraphQLFormattedError } from 'graphql';\n\nimport {\n DaffError,\n DaffErrorCodeMap,\n} from '@daffodil/core';\n\nimport { DaffDriverMagentoError } from './error.class';\n\nexport function daffMagentoTransformGraphQlError<T extends DaffErrorCodeMap>(\n error: GraphQLFormattedError,\n map: T,\n): DaffError {\n const ErrorClass = map[<string>error?.extensions?.category] || DaffDriverMagentoError;\n\n return new ErrorClass(error.message) ;\n};\n","import { ApolloError } from '@apollo/client/core';\n\nimport {\n DaffError,\n DaffErrorCodeMap,\n daffIsError,\n} from '@daffodil/core';\nimport { DaffDriverNetworkError } from '@daffodil/driver';\n\nimport { DaffDriverMagentoError } from './error.class';\nimport { daffMagentoTransformGraphQlError } from './transform-graphql';\n\n/**\n * Transforms the passed error according to the lookup in the passed map.\n */\n// TODO: return array of errors\nexport function daffTransformMagentoError<T extends DaffErrorCodeMap>(error: any, map: T): DaffError {\n if (error.graphQLErrors?.length > 0) {\n return (<ApolloError>error).graphQLErrors.map(err => daffMagentoTransformGraphQlError<T>(err, map))[0];\n } else if (error.networkError) {\n return new DaffDriverNetworkError((<ApolloError>error).networkError.message);\n } else if (daffIsError(error)) {\n return error;\n } else {\n return new DaffDriverMagentoError(error.message);\n }\n};\n","export enum MagentoSortEnum {\n ASC = 'ASC',\n DESC = 'DESC'\n}\n","import { createMultiInjectionToken } from '@daffodil/core';\n\nexport const {\n /**\n * A multi-provider injection token of the operation names of magento queries that should\n * be cached. This is needed because queries need to be converted into GET queries in order for Magento\n * to cache them. This token should be used by daffodil driver platform modules to register operation names that are cacheable, and is\n * intended for internal daffodil use only.\n */\n token: DAFF_MAGENTO_CACHEABLE_OPERATIONS,\n /**\n * Adds many operation names to the list of cacheable Magento operations. Use only with Angular 9+.\n */\n provider: provideManyDaffMagentoCacheableOperations,\n} = createMultiInjectionToken<string>('DAFF_MAGENTO_CACHEABLE_OPERATIONS');\n\n/**\n * Adds an operation name to the list of cacheable Magento operations. Use only with Angular 9+.\n */\nexport function provideDaffMagentoCacheableOperation(operationName: string) {\n return {\n provide: DAFF_MAGENTO_CACHEABLE_OPERATIONS,\n useValue: operationName,\n multi: true,\n };\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { ApolloLink } from '@apollo/client/core';\n\nimport { DaffApolloLinkGenerator } from '@daffodil/core/graphql';\n\nimport { DAFF_MAGENTO_CACHEABLE_OPERATIONS } from './cacheable-operations-token';\n\n/**\n * A service that will convert cacheable apollo operations into a format that Magento will understand as cacheable.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoApolloCacheableOperationsLinkGenerator implements DaffApolloLinkGenerator {\n constructor(\n @Inject(DAFF_MAGENTO_CACHEABLE_OPERATIONS) private apolloGetRequests: string[],\n ) {}\n\n getLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if(this.apolloGetRequests.indexOf(operation.operationName) > -1) {\n operation.setContext({ method: 'GET' });\n }\n return forward(operation);\n });\n }\n}\n","import { TypePolicies } from '@apollo/client/core';\n\n/**\n * Custom type policies that allow us to have more granular control\n * over how ApolloClient reads from and writes to the cache.\n *\n * This is applicable to Magento 2.4.3 and up.\n * Heavily based on https://github.com/magento/pwa-studio/blob/99270701b2b607551f2e5881af272ed48ba7064c/packages/peregrine/lib/Apollo/policies/index.js.\n *\n * https://www.apollographql.com/docs/react/caching/cache-configuration/#typepolicy-fields\n * https://www.apollographql.com/docs/react/caching/cache-field-behavior/\n */\nexport const DAFF_MAGENTO_2_4_3_TYPE_POLICIES: TypePolicies = {\n Query: {\n fields: {\n cart: {\n // Replaces @connection(key: \"Cart\")\n keyArgs: () => 'Cart',\n },\n customer: {\n keyArgs: () => 'Customer',\n },\n customerCart: {\n keyArgs: () => 'Cart',\n },\n },\n },\n AppliedGiftCard: {\n keyFields: ['code'],\n },\n AvailablePaymentMethod: {\n keyFields: ['code'],\n },\n AvailableShippingMethod: {\n // The combination of these fields makes an instance of\n // AvailableShippingMethod unique.\n keyFields: ['carrier_code', 'method_code'],\n },\n Breadcrumb: {\n // Uses provided fields on the object as the `id`.\n keyFields: ['category_uid'],\n },\n Cart: {\n keyFields: () => 'Cart',\n fields: {\n applied_gift_cards: {\n merge: (existing, incoming) => incoming,\n },\n available_payment_methods: {\n merge: (existing, incoming) => incoming,\n },\n items: {\n merge: (existing, incoming) => incoming,\n },\n prices: {\n // `merge: true` can be used for an object field.\n merge: true,\n },\n shipping_addresses: {\n merge:(existing = [], incoming, { readField, mergeObjects }) => {\n // street makes these things unique\n const mergeResult = new Set();\n const streetToIndex = new Map();\n\n existing.forEach((existingShippingAddress, index) => {\n // Use readField instead of existingShippingAddress.street directly because it will follow cache references.\n const street = readField(\n 'street',\n existingShippingAddress,\n );\n streetToIndex.set(street, index);\n });\n\n incoming.forEach(incomingShippingAddress => {\n const street = readField(\n 'street',\n incomingShippingAddress,\n );\n\n if (streetToIndex.has(street)) {\n const targetIndex = streetToIndex.get(street);\n const existingShippingAddress = existing[targetIndex];\n const merged = mergeObjects(\n existingShippingAddress,\n incomingShippingAddress,\n );\n mergeResult.add(merged);\n } else {\n // We do not have an address with this street yet, add it on to the end.\n streetToIndex.set(street, streetToIndex.size);\n mergeResult.add(incomingShippingAddress);\n }\n });\n\n return Array.from(mergeResult);\n },\n },\n },\n },\n Customer: {\n keyFields: () => 'Customer',\n fields: {\n addresses: {\n merge: (existing, incoming) => incoming,\n read: (cachedAddresses, { toReference }) => {\n if (cachedAddresses) {\n return cachedAddresses.map(address => {\n // Update v2 identifiers to new references. Previous\n // entries had `id: CustomerAddress:1` which caused\n // v3's lookup to fail. If we find a legacy id,\n // point it at the object using a reference.\n if (address.id?.includes('CustomerAddress')) {\n return toReference(address.id);\n } else {\n return address;\n }\n });\n }\n // If there are no cached addresses that's fine - the schema\n // shows that it is a nullable field.\n },\n },\n orders: {\n keyArgs: ['filter'],\n // TODO: write merge function that handles pagination\n // items: {\n // merge: true,\n // },\n },\n },\n },\n CustomerAddress: {\n fields: {\n street: {\n merge: (existing, incoming) => incoming,\n },\n },\n },\n CustomerPaymentTokens: {\n keyFields: () => 'CustomerPaymentTokens',\n fields: {\n items: {\n merge: (existing, incoming) => incoming,\n },\n },\n },\n ProductImage: {\n keyFields: ['url'],\n },\n SelectedConfigurableOption: {\n // id alone is not enough to identify a selected option as it can refer\n // to something like \"size\" where value_id refers to \"large\".\n keyFields: ['id', 'value_id'],\n },\n SelectedPaymentMethod: {\n keyFields: ['code'],\n },\n ShippingCartAddress: {\n keyFields: ['street'],\n fields: {\n available_shipping_methods: {\n merge: (existing = [], incoming, { readField, mergeObjects }) => {\n // carrier_code + method_code makes these things unique\n const mergeResult = new Set();\n const carrierToIndex = new Map();\n\n existing.forEach((existingShippingMethod, index) => {\n // Use readField because it will follow cache references.\n const carrierCode = readField(\n 'carrier_code',\n existingShippingMethod,\n );\n const methodCode = readField(\n 'method_code',\n existingShippingMethod,\n );\n const carrierKey = `${carrierCode}|${methodCode}`;\n carrierToIndex.set(carrierKey, index);\n });\n\n incoming.forEach(incomingShippingMethod => {\n // Use readField because it will follow cache references.\n const carrierCode = readField(\n 'carrier_code',\n incomingShippingMethod,\n );\n const methodCode = readField(\n 'method_code',\n incomingShippingMethod,\n );\n const carrierKey = `${carrierCode}|${methodCode}`;\n if (carrierToIndex.has(carrierKey)) {\n const targetIndex = carrierToIndex.get(carrierKey);\n const existingShippingMethod = existing[targetIndex];\n const merged = mergeObjects(\n existingShippingMethod,\n incomingShippingMethod,\n );\n mergeResult.add(merged);\n } else {\n // We do not have a method with this key yet, add it on to the end.\n carrierToIndex.set(carrierKey, carrierToIndex.size);\n mergeResult.add(incomingShippingMethod);\n }\n });\n\n return Array.from(mergeResult);\n },\n },\n country: {\n merge: true,\n },\n region: {\n merge: true,\n },\n selected_shipping_method: {\n merge: true,\n },\n },\n },\n CategoryTree: {\n fields: {\n children: {\n merge: (existing, incoming) => incoming,\n },\n },\n },\n Wishlist: {\n keyFields: ({ id }) => `CustomerWishlist:${id}`,\n },\n WishlistItem: {\n keyFields: ({ id }) => `CustomerWishlistItem:${id}`,\n },\n SimpleWishlistItem: {\n keyFields: ({ id }) => `CustomerSimpleWishlistItem:${id}`,\n },\n VirtualWishlistItem: {\n keyFields: ({ id }) => `CustomerVirtualWishlistItem:${id}`,\n },\n DownloadableWishlistItem: {\n keyFields: ({ id }) => `CustomerDownloadableWishlistItem:${id}`,\n },\n BundleWishlistItem: {\n keyFields: ({ id }) => `CustomerBundleWishlistItem:${id}`,\n },\n GroupedProductWishlistItem: {\n keyFields: ({ id }) => `CustomerGroupedProductWishlistItem:${id}`,\n },\n ConfigurableWishlistItem: {\n keyFields: ({ id }) => `CustomerConfigurableWishlistItem:${id}`,\n },\n GiftCardWishlistItem: {\n keyFields: ({ id }) => `CustomerGiftCardWishlistItem:${id}`,\n },\n};\n","import { Injectable } from '@angular/core';\nimport { ApolloLink } from '@apollo/client/core';\n\nimport { DaffApolloLinkGenerator } from '@daffodil/core/graphql';\n\nexport const MAGENTO_CUSTOMER_CACHE_ID_HEADER = 'X-Magento-Cache-Id';\n\n/**\n * Stores and sets the Magento cache ID header.\n * This will set the `X-Magento-Cache-Id` header from the most recent value encountered\n * on a response, if there was a response with that header set.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoCacheHeaderApolloLinkGenerator implements DaffApolloLinkGenerator {\n private _cacheHeader?: string;\n\n getLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if (this._cacheHeader) {\n operation.setContext({\n headers: {\n ...operation.getContext().headers,\n [MAGENTO_CUSTOMER_CACHE_ID_HEADER]: this._cacheHeader,\n },\n });\n }\n return forward(operation).map((response) => {\n const { headers } = operation.getContext().response;\n if (headers.get(MAGENTO_CUSTOMER_CACHE_ID_HEADER)) {\n this._cacheHeader = headers.get(MAGENTO_CUSTOMER_CACHE_ID_HEADER);\n }\n return response;\n });\n });\n }\n}\n","import { DaffCollectionMetadata } from '@daffodil/core';\n\nimport { MagentoSearchResultPageInfo } from '../../models/public_api';\n\nexport function magentoPageInfoTransform(pageInfo: MagentoSearchResultPageInfo): Pick<DaffCollectionMetadata, 'pageSize' | 'currentPage' | 'totalPages'> {\n return {\n pageSize: pageInfo.page_size,\n currentPage: pageInfo.current_page,\n totalPages: pageInfo.total_pages,\n };\n}\n","import { DaffSortDirectionEnum } from '@daffodil/core';\n\nimport { MagentoSortEnum } from '../../models/public_api';\n\nconst map = <const>{\n [MagentoSortEnum.ASC]: DaffSortDirectionEnum.Ascending,\n [MagentoSortEnum.DESC]: DaffSortDirectionEnum.Descending,\n};\n\nexport function magentoSortDirectionResponseTransform(direction: MagentoSortEnum): DaffSortDirectionEnum {\n return map[direction];\n}\n","import { DaffSortDirectionEnum } from '@daffodil/core';\n\nimport { MagentoSortEnum } from '../../models/public_api';\n\nconst map = <const>{\n [DaffSortDirectionEnum.Ascending]: MagentoSortEnum.ASC,\n [DaffSortDirectionEnum.Descending]: MagentoSortEnum.DESC,\n};\n\nexport function magentoSortDirectionRequestTransform(direction: DaffSortDirectionEnum): MagentoSortEnum {\n return map[direction];\n}\n","import { gql } from 'apollo-angular';\n\nexport const magentoSearchResultPageInfoFragment = gql`\n fragment magentoSearchResultPageInfo on SearchResultPageInfo {\n page_size\n current_page\n total_pages\n }\n`;\n","import { gql } from 'apollo-angular';\n\nexport const magentoMoneyFragment = gql`\n fragment moneyFragment on Money {\n value\n currency\n }\n`;\n","import { NgModule } from '@angular/core';\n\nimport { provideDaffDriverHttpClientCacheService } from '@daffodil/driver';\n\nimport { DaffDriverHttpClientCacheMagentoService } from './graphql/cache.service';\n\n/**\n * @deprecated in favor of {@link provideMagentoDriver} Deprecated in version 0.88.0. Will be removed in version 0.91.0.\n */\n@NgModule({\n providers: [\n provideDaffDriverHttpClientCacheService(DaffDriverHttpClientCacheMagentoService),\n ],\n})\nexport class DaffDriverMagentoModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAM,MAAM,GAAG;;ACKtB;;;;;AAKG;AACG,SAAU,cAAc,CAAC,GAAyB,EAAA;AACtD,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IACjC,OAAO,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACtC;;AChBA;;;;;;;;;;;;;;;;;AAiBG;AACI,MAAM,sBAAsB,GAAG;AACpC,IAAA,oBAAoB,EAAE;QACpB,oBAAoB;QACpB,qBAAqB;AACtB,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,gBAAgB;QAChB,iBAAiB;QACjB,sBAAsB;QACtB,gBAAgB;QAChB,sBAAsB;AACvB,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,gBAAgB;QAChB,eAAe;QACf,qBAAqB;QACrB,eAAe;QACf,gBAAgB;QAChB,qBAAqB;AACtB,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,cAAc;AACf,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,cAAc;QACd,cAAc;AACf,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,cA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CAAC;AACvB;;ACPA,MAAM,GAAG,GAAU;AACjB,IAAA,CAAC,qBAAqB,CAAC,SAAS,GAAG,eAAe,CAAC,GAAG;AACtD,IAAA,CAAC,qBAAqB,CAAC,UAAU,GAAG,eAAe,CAAC,IAAI;CACzD;AAEK,SAAU,oCAAoC,CAAC,SAAgC,EAAA;AACnF,IAAA,OAAO,GAAG,CAAC,SAAS,CAAC;AACvB;;ACTO,MAAM,mCAAmC,GAAG,GAAG,CAAA;;;;;;;;ACA/C,MAAM,oBAAoB,GAAG,GAAG,CAAA;;;;;;;ACIvC;;AAEG;MAMU,uBAAuB,CAAA;8GAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAvB,uBAAuB,EAAA,CAAA,CAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,EAAA,SAAA,EAJvB;YACT,uCAAuC,CAAC,uCAAuC,CAAC;AACjF,SAAA,EAAA,CAAA,CAAA;;2FAEU,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBALnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;wBACT,uCAAuC,CAAC,uCAAuC,CAAC;AACjF,qBAAA;AACF,iBAAA;;;ACbD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-driver-magento.mjs","sources":["../../../libs/driver/magento/src/schema/schema.ts","../../../libs/driver/magento/src/apollo/type-policies.ts","../../../libs/driver/magento/src/features/kind.enum.ts","../../../libs/driver/magento/src/features/make-feature.ts","../../../libs/driver/magento/src/features/apollo-options.ts","../../../libs/driver/magento/src/graphql/cacheable-operations/cacheable-operations-token.ts","../../../libs/driver/magento/src/graphql/cacheable-operations/apollo-cacheable-operations-link-generator.ts","../../../libs/driver/magento/src/graphql/type-policies.ts","../../../libs/driver/magento/src/graphql/cache.service.ts","../../../libs/driver/magento/src/graphql/cache-header/cache-header-apollo-link.ts","../../../libs/driver/magento/src/features/cacheable-operations.ts","../../../libs/driver/magento/src/features/error-handler.ts","../../../libs/driver/magento/src/features/transfer-state.ts","../../../libs/driver/magento/src/provider.ts","../../../libs/driver/magento/src/errors/error.class.ts","../../../libs/driver/magento/src/errors/transform-graphql.ts","../../../libs/driver/magento/src/errors/transform.ts","../../../libs/driver/magento/src/models/sort.enum.ts","../../../libs/driver/magento/src/transforms/responses/page-info.ts","../../../libs/driver/magento/src/transforms/responses/sort-direction.ts","../../../libs/driver/magento/src/transforms/requests/sort-direction.ts","../../../libs/driver/magento/src/fragments/page-info.ts","../../../libs/driver/magento/src/fragments/money.ts","../../../libs/driver/magento/src/daffodil-driver-magento.ts"],"sourcesContent":["import introspectionQueryResultData from './introspection.json';\n\nexport const MAGENTO_POSSIBLE_TYPES = introspectionQueryResultData;\n\n/**\n * @deprecated Prefer {@link MAGENTO_POSSIBLE_TYPES} instead. Deprecated in version 0.91.0. Will be removed in version 0.94.0.\n */\nexport { MAGENTO_POSSIBLE_TYPES as schema };\n","/**\n * Custom type policies that allow us to have more granular control\n * over how ApolloClient reads from and writes to the cache.\n *\n * https://www.apollographql.com/docs/react/caching/cache-configuration/#typepolicy-fields\n * https://www.apollographql.com/docs/react/caching/cache-field-behavior/\n */\n\nimport { TypePolicies } from '@apollo/client/cache';\n\nconst typePolicies: TypePolicies = {\n // Query/Mutation are \"types\" just like \"Cart\".\n Query: {\n fields: {\n cart: {\n // Replaces @connection(key: \"Cart\")\n keyArgs: () => 'Cart',\n },\n customer: {\n keyArgs: () => 'Customer',\n },\n customerCart: {\n keyArgs: () => 'Cart',\n },\n customerWishlistProducts: {\n read: existing => existing || [],\n },\n },\n },\n AppliedGiftCard: {\n keyFields: ['code'],\n },\n AvailablePaymentMethod: {\n keyFields: ['code'],\n },\n AvailableShippingMethod: {\n // The combination of these fields makes an instance of\n // AvailableShippingMethod unique.\n keyFields: ['carrier_code', 'method_code'],\n },\n Breadcrumb: {\n // Uses provided fields on the object as the `uid`.\n keyFields: ['category_uid'],\n },\n Cart: {\n keyFields: () => 'Cart',\n fields: {\n applied_gift_cards: {\n\n merge(existing, incoming) {\n return incoming;\n },\n },\n available_payment_methods: {\n\n merge(existing, incoming) {\n return incoming;\n },\n },\n items: {\n\n merge(existing, incoming) {\n return incoming;\n },\n },\n prices: {\n // `merge: true` can be used for an object field.\n merge: true,\n },\n shipping_addresses: {\n merge(existing = [], incoming, { readField, mergeObjects }) {\n // street makes these things unique\n const mergeResult = new Set();\n const streetToIndex = new Map();\n\n existing.forEach((existingShippingAddress, index) => {\n // Use readField instead of existingShippingAddress.street directly because it will follow cache references.\n const street = readField(\n 'street',\n existingShippingAddress,\n );\n streetToIndex.set(street, index);\n });\n\n incoming.forEach(incomingShippingAddress => {\n const street = readField(\n 'street',\n incomingShippingAddress,\n );\n\n if (streetToIndex.has(street)) {\n const targetIndex = streetToIndex.get(street);\n const existingShippingAddress =\n existing[targetIndex];\n const merged = mergeObjects(\n existingShippingAddress,\n incomingShippingAddress,\n );\n mergeResult.add(merged);\n } else {\n // We do not have an address with this street yet, add it on to the end.\n streetToIndex.set(street, streetToIndex.size);\n mergeResult.add(incomingShippingAddress);\n }\n });\n\n return Array.from(mergeResult);\n },\n },\n },\n },\n Customer: {\n keyFields: () => 'Customer',\n merge: true,\n fields: {\n addresses: {\n merge(existing, incoming) {\n return incoming;\n },\n read(cachedAddresses, { toReference }) {\n if (cachedAddresses) {\n return cachedAddresses.map(address => {\n // Update v2 identifiers to new references. Previous\n // entries had `id: CustomerAddress:1` which caused\n // v3's lookup to fail. If we find a legacy id,\n // point it at the object using a reference.\n if (\n address.id &&\n address.id.includes('CustomerAddress')\n ) {\n return toReference(address.id);\n } else {\n return address;\n }\n });\n }\n // If there are no cached addresses that's fine - the schema\n // shows that it is a nullable field.\n },\n },\n orders: {\n keyArgs: ['filter'],\n },\n },\n },\n CustomerAddress: {\n fields: {\n street: {\n\n merge(existing, incoming) {\n return incoming;\n },\n },\n },\n },\n CustomerPaymentTokens: {\n keyFields: () => 'CustomerPaymentTokens',\n fields: {\n items: {\n\n merge(existing, incoming) {\n return incoming;\n },\n },\n },\n },\n Currency: {\n merge: true,\n },\n ProductImage: {\n keyFields: ['url'],\n },\n ConfigurableProductOptions: {\n keyFields: ['uid'],\n },\n SelectedConfigurableOption: {\n // id alone is not enough to identify a selected option as it can refer\n // to something like \"size\" where value_id refers to \"large\".\n // TODO: Use configurable_product_option_uid for ConfigurableWishlistItem when available in 2.4.5\n keyFields: fields => fields.configurable_product_option_uid\n ? [\n 'configurable_product_option_uid',\n 'configurable_product_option_value_uid',\n ]\n : ['id', 'value_id'],\n },\n SelectedPaymentMethod: {\n keyFields: ['code'],\n },\n ShippingCartAddress: {\n keyFields: ['street'],\n fields: {\n available_shipping_methods: {\n merge(existing = [], incoming, { readField, mergeObjects }) {\n // carrier_code + method_code makes these things unique\n const mergeResult = new Set();\n const carrierToIndex = new Map();\n\n existing.forEach((existingShippingMethod, index) => {\n // Use readField because it will follow cache references.\n const carrierCode = readField(\n 'carrier_code',\n existingShippingMethod,\n );\n const methodCode = readField(\n 'method_code',\n existingShippingMethod,\n );\n const carrierKey = `${carrierCode}|${methodCode}`;\n carrierToIndex.set(carrierKey, index);\n });\n\n incoming.forEach(incomingShippingMethod => {\n // Use readField because it will follow cache references.\n const carrierCode = readField(\n 'carrier_code',\n incomingShippingMethod,\n );\n const methodCode = readField(\n 'method_code',\n incomingShippingMethod,\n );\n const carrierKey = `${carrierCode}|${methodCode}`;\n if (carrierToIndex.has(carrierKey)) {\n const targetIndex = carrierToIndex.get(carrierKey);\n const existingShippingMethod =\n existing[targetIndex];\n const merged = mergeObjects(\n existingShippingMethod,\n incomingShippingMethod,\n );\n mergeResult.add(merged);\n } else {\n // We do not have a method with this key yet, add it on to the end.\n carrierToIndex.set(carrierKey, carrierToIndex.size);\n mergeResult.add(incomingShippingMethod);\n }\n });\n\n return Array.from(mergeResult);\n },\n },\n country: {\n merge: true,\n },\n region: {\n merge: true,\n },\n selected_shipping_method: {\n merge: true,\n },\n },\n },\n CategoryTree: {\n keyFields: ['uid'],\n fields: {\n children: {\n merge(existing, incoming) {\n return incoming;\n },\n },\n },\n },\n Wishlist: {\n keyFields: ({ id }) => `CustomerWishlist:${id}`,\n fields: {\n items_v2: {\n keyArgs: false,\n merge: false,\n },\n },\n },\n WishlistItem: {\n keyFields: ({ id }) => `CustomerWishlistItem:${id}`,\n },\n WishlistItems: {\n fields: {\n items: {\n merge: (existing = [], incoming, { variables }) => {\n if (variables) {\n const { currentPage = 1 } = variables;\n // reset cache collection if we're on the first page\n\n if (currentPage === 1) {\n return incoming;\n }\n }\n\n return [...existing, ...incoming];\n },\n },\n },\n },\n SimpleWishlistItem: {\n keyFields: ({ id }) => `CustomerSimpleWishlistItem:${id}`,\n },\n VirtualWishlistItem: {\n keyFields: ({ id }) => `CustomerVirtualWishlistItem:${id}`,\n },\n DownloadableWishlistItem: {\n keyFields: ({ id }) => `CustomerDownloadableWishlistItem:${id}`,\n },\n BundleWishlistItem: {\n keyFields: ({ id }) => `CustomerBundleWishlistItem:${id}`,\n },\n GroupedProductWishlistItem: {\n keyFields: ({ id }) => `CustomerGroupedProductWishlistItem:${id}`,\n },\n ConfigurableWishlistItem: {\n keyFields: ({ id }) => `CustomerConfigurableWishlistItem:${id}`,\n },\n GiftCardWishlistItem: {\n keyFields: ({ id }) => `CustomerGiftCardWishlistItem:${id}`,\n },\n SimpleProduct: {\n keyFields: ['uid'],\n },\n ConfigurableProduct: {\n keyFields: ['uid'],\n },\n BundleProduct: {\n keyFields: ['uid'],\n },\n GroupedProduct: {\n keyFields: ['uid'],\n },\n VirtualProduct: {\n keyFields: ['uid'],\n },\n CartItemInterface: {\n keyFields: ['uid'],\n },\n StoreConfig: {\n keyFields: ['store_code'],\n },\n};\n\nexport default typePolicies;\n","/**\n * A non-exhaustive list of feature kinds that exist for {@link provideMagentoDriver}.\n */\nexport enum MagentoDriverFeatureKind {\n CacheableOperations = 'DaffMagentoDriverCacheableOperationsFeature',\n CacheHeader = 'DaffMagentoDriverCacheHeaderFeature',\n ErrorHandler = 'DaffMagentoDriverErrorHandlerFeature',\n TransferState = 'DaffMagentoDriverTransferStateFeature',\n ExtraApolloOptions = 'DaffMagentoDriverExtraApolloOptionsFeature',\n}\n","import {\n Provider,\n EnvironmentProviders,\n} from '@angular/core';\n\nimport { MagentoDriverFeatureKind } from './kind.enum';\nimport { MagentoDriverFeature } from './type';\n\n/**\n * Creates a magento driver feature for {@link provideMagentoDriver}.\n */\nexport function makeMagentoDriverFeature(\n kind: MagentoDriverFeatureKind | string,\n providers: Array<Provider | EnvironmentProviders>,\n): MagentoDriverFeature {\n return { ɵkind: kind, ɵproviders: providers };\n}\n","import type { ApolloClientOptions } from '@apollo/client/core';\n\nimport { createSingleInjectionToken } from '@daffodil/core';\n\nimport { MagentoDriverFeatureKind } from './kind.enum';\nimport { makeMagentoDriverFeature } from './make-feature';\nimport { MagentoDriverFeature } from './type';\n\n/**\n * Apollo client options except link and cache, creation of which is done by {@link provideMagentoDriver}.\n */\nexport type DaffDriverMagentoExtraApolloOptions = Omit<ApolloClientOptions<any>, 'link' | 'cache'>;\n\nexport const {\n /**\n * A token to hold {@link DaffDriverMagentoExtraApolloOptions}.\n */\n token: DAFF_DRIVER_MAGENTO_EXTRA_APOLLO_OPTIONS,\n /**\n * A provider for {@link DAFF_DRIVER_MAGENTO_EXTRA_APOLLO_OPTIONS}.\n */\n provider: provideDaffDriverMagentoExtraApolloOptions,\n /**\n * A factory provider for {@link DAFF_DRIVER_MAGENTO_EXTRA_APOLLO_OPTIONS}.\n */\n factoryProvider: provideDaffDriverMagentoExtraApolloOptionsFactory,\n} = createSingleInjectionToken<DaffDriverMagentoExtraApolloOptions>('DAFF_DRIVER_MAGENTO_EXTRA_APOLLO_OPTIONS', {\n factory: () => ({}),\n});\n\n/**\n * A {@link provideMagentoDriver} feature that allow specifying {@link DaffDriverMagentoExtraApolloOptions}.\n */\nexport const withDaffDriverMagentoExtraApolloOptions = (options: DaffDriverMagentoExtraApolloOptions): MagentoDriverFeature => makeMagentoDriverFeature(MagentoDriverFeatureKind.TransferState, [\n provideDaffDriverMagentoExtraApolloOptions(options),\n]);\n","import { createMultiInjectionToken } from '@daffodil/core';\n\nexport const {\n /**\n * A multi-provider injection token of the operation names of magento queries that should\n * be cached. This is needed because queries need to be converted into GET queries in order for Magento\n * to cache them. This token should be used by daffodil driver platform modules to register operation names that are cacheable, and is\n * intended for internal daffodil use only.\n */\n token: DAFF_MAGENTO_CACHEABLE_OPERATIONS,\n /**\n * Adds many operation names to the list of cacheable Magento operations. Use only with Angular 9+.\n */\n provider: provideManyDaffMagentoCacheableOperations,\n} = createMultiInjectionToken<string>('DAFF_MAGENTO_CACHEABLE_OPERATIONS');\n\n/**\n * Adds an operation name to the list of cacheable Magento operations. Use only with Angular 9+.\n */\nexport function provideDaffMagentoCacheableOperation(operationName: string) {\n return {\n provide: DAFF_MAGENTO_CACHEABLE_OPERATIONS,\n useValue: operationName,\n multi: true,\n };\n}\n","import {\n inject,\n Inject,\n Injectable,\n makeEnvironmentProviders,\n} from '@angular/core';\nimport { ApolloLink } from '@apollo/client/core';\n\nimport {\n DaffApolloLinkGenerator,\n provideDaffApolloRequestHandlerFactories,\n} from '@daffodil/core/graphql';\n\nimport { DAFF_MAGENTO_CACHEABLE_OPERATIONS } from './cacheable-operations-token';\n\n/**\n * A request handler provider that will convert cacheable apollo operations into a format that Magento will understand as cacheable.\n */\nexport const provideDaffMagentoApolloCacheableOperations = () => makeEnvironmentProviders([\n provideDaffApolloRequestHandlerFactories(() => {\n const cacheableOperations = inject(DAFF_MAGENTO_CACHEABLE_OPERATIONS);\n return (operation, forward) => {\n if (cacheableOperations.indexOf(operation.operationName) > -1) {\n operation.setContext({ method: 'GET' });\n }\n return forward(operation);\n };\n }),\n]);\n\n/**\n * A service that will convert cacheable apollo operations into a format that Magento will understand as cacheable.\n *\n * @inheritdoc\n * @deprecated Prefer using {@link provideDaffMagentoApolloCacheableOperations} instead. Deprecated in version 0.91.0. Will be removed in version 0.94.0.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoApolloCacheableOperationsLinkGenerator implements DaffApolloLinkGenerator {\n constructor(\n @Inject(DAFF_MAGENTO_CACHEABLE_OPERATIONS) private apolloGetRequests: string[],\n ) {}\n\n getLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if(this.apolloGetRequests.indexOf(operation.operationName) > -1) {\n operation.setContext({ method: 'GET' });\n }\n return forward(operation);\n });\n }\n}\n","import { TypePolicies } from '@apollo/client/core';\n\n/**\n * Custom type policies that allow us to have more granular control\n * over how ApolloClient reads from and writes to the cache.\n *\n * This is applicable to Magento 2.4.3 and up.\n * Heavily based on https://github.com/magento/pwa-studio/blob/99270701b2b607551f2e5881af272ed48ba7064c/packages/peregrine/lib/Apollo/policies/index.js.\n *\n * https://www.apollographql.com/docs/react/caching/cache-configuration/#typepolicy-fields\n * https://www.apollographql.com/docs/react/caching/cache-field-behavior/\n */\nexport const DAFF_MAGENTO_2_4_3_TYPE_POLICIES: TypePolicies = {\n Query: {\n fields: {\n cart: {\n // Replaces @connection(key: \"Cart\")\n keyArgs: () => 'Cart',\n },\n customer: {\n keyArgs: () => 'Customer',\n },\n customerCart: {\n keyArgs: () => 'Cart',\n },\n },\n },\n AppliedGiftCard: {\n keyFields: ['code'],\n },\n AvailablePaymentMethod: {\n keyFields: ['code'],\n },\n AvailableShippingMethod: {\n // The combination of these fields makes an instance of\n // AvailableShippingMethod unique.\n keyFields: ['carrier_code', 'method_code'],\n },\n Breadcrumb: {\n // Uses provided fields on the object as the `id`.\n keyFields: ['category_uid'],\n },\n Cart: {\n keyFields: () => 'Cart',\n fields: {\n applied_gift_cards: {\n merge: (existing, incoming) => incoming,\n },\n available_payment_methods: {\n merge: (existing, incoming) => incoming,\n },\n items: {\n merge: (existing, incoming) => incoming,\n },\n prices: {\n // `merge: true` can be used for an object field.\n merge: true,\n },\n shipping_addresses: {\n merge:(existing = [], incoming, { readField, mergeObjects }) => {\n // street makes these things unique\n const mergeResult = new Set();\n const streetToIndex = new Map();\n\n existing.forEach((existingShippingAddress, index) => {\n // Use readField instead of existingShippingAddress.street directly because it will follow cache references.\n const street = readField(\n 'street',\n existingShippingAddress,\n );\n streetToIndex.set(street, index);\n });\n\n incoming.forEach(incomingShippingAddress => {\n const street = readField(\n 'street',\n incomingShippingAddress,\n );\n\n if (streetToIndex.has(street)) {\n const targetIndex = streetToIndex.get(street);\n const existingShippingAddress = existing[targetIndex];\n const merged = mergeObjects(\n existingShippingAddress,\n incomingShippingAddress,\n );\n mergeResult.add(merged);\n } else {\n // We do not have an address with this street yet, add it on to the end.\n streetToIndex.set(street, streetToIndex.size);\n mergeResult.add(incomingShippingAddress);\n }\n });\n\n return Array.from(mergeResult);\n },\n },\n },\n },\n Customer: {\n keyFields: () => 'Customer',\n fields: {\n addresses: {\n merge: (existing, incoming) => incoming,\n read: (cachedAddresses, { toReference }) => {\n if (cachedAddresses) {\n return cachedAddresses.map(address => {\n // Update v2 identifiers to new references. Previous\n // entries had `id: CustomerAddress:1` which caused\n // v3's lookup to fail. If we find a legacy id,\n // point it at the object using a reference.\n if (address.id?.includes('CustomerAddress')) {\n return toReference(address.id);\n } else {\n return address;\n }\n });\n }\n // If there are no cached addresses that's fine - the schema\n // shows that it is a nullable field.\n },\n },\n orders: {\n keyArgs: ['filter'],\n // TODO: write merge function that handles pagination\n // items: {\n // merge: true,\n // },\n },\n },\n },\n CustomerAddress: {\n fields: {\n street: {\n merge: (existing, incoming) => incoming,\n },\n },\n },\n CustomerPaymentTokens: {\n keyFields: () => 'CustomerPaymentTokens',\n fields: {\n items: {\n merge: (existing, incoming) => incoming,\n },\n },\n },\n ProductImage: {\n keyFields: ['url'],\n },\n SelectedConfigurableOption: {\n // id alone is not enough to identify a selected option as it can refer\n // to something like \"size\" where value_id refers to \"large\".\n keyFields: ['id', 'value_id'],\n },\n SelectedPaymentMethod: {\n keyFields: ['code'],\n },\n ShippingCartAddress: {\n keyFields: ['street'],\n fields: {\n available_shipping_methods: {\n merge: (existing = [], incoming, { readField, mergeObjects }) => {\n // carrier_code + method_code makes these things unique\n const mergeResult = new Set();\n const carrierToIndex = new Map();\n\n existing.forEach((existingShippingMethod, index) => {\n // Use readField because it will follow cache references.\n const carrierCode = readField(\n 'carrier_code',\n existingShippingMethod,\n );\n const methodCode = readField(\n 'method_code',\n existingShippingMethod,\n );\n const carrierKey = `${carrierCode}|${methodCode}`;\n carrierToIndex.set(carrierKey, index);\n });\n\n incoming.forEach(incomingShippingMethod => {\n // Use readField because it will follow cache references.\n const carrierCode = readField(\n 'carrier_code',\n incomingShippingMethod,\n );\n const methodCode = readField(\n 'method_code',\n incomingShippingMethod,\n );\n const carrierKey = `${carrierCode}|${methodCode}`;\n if (carrierToIndex.has(carrierKey)) {\n const targetIndex = carrierToIndex.get(carrierKey);\n const existingShippingMethod = existing[targetIndex];\n const merged = mergeObjects(\n existingShippingMethod,\n incomingShippingMethod,\n );\n mergeResult.add(merged);\n } else {\n // We do not have a method with this key yet, add it on to the end.\n carrierToIndex.set(carrierKey, carrierToIndex.size);\n mergeResult.add(incomingShippingMethod);\n }\n });\n\n return Array.from(mergeResult);\n },\n },\n country: {\n merge: true,\n },\n region: {\n merge: true,\n },\n selected_shipping_method: {\n merge: true,\n },\n },\n },\n CategoryTree: {\n fields: {\n children: {\n merge: (existing, incoming) => incoming,\n },\n },\n },\n Wishlist: {\n keyFields: ({ id }) => `CustomerWishlist:${id}`,\n },\n WishlistItem: {\n keyFields: ({ id }) => `CustomerWishlistItem:${id}`,\n },\n SimpleWishlistItem: {\n keyFields: ({ id }) => `CustomerSimpleWishlistItem:${id}`,\n },\n VirtualWishlistItem: {\n keyFields: ({ id }) => `CustomerVirtualWishlistItem:${id}`,\n },\n DownloadableWishlistItem: {\n keyFields: ({ id }) => `CustomerDownloadableWishlistItem:${id}`,\n },\n BundleWishlistItem: {\n keyFields: ({ id }) => `CustomerBundleWishlistItem:${id}`,\n },\n GroupedProductWishlistItem: {\n keyFields: ({ id }) => `CustomerGroupedProductWishlistItem:${id}`,\n },\n ConfigurableWishlistItem: {\n keyFields: ({ id }) => `CustomerConfigurableWishlistItem:${id}`,\n },\n GiftCardWishlistItem: {\n keyFields: ({ id }) => `CustomerGiftCardWishlistItem:${id}`,\n },\n};\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffDriverHttpClientCacheServiceInterface } from '@daffodil/driver';\n\n/**\n * Interacts with the Apollo client.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffDriverHttpClientCacheMagentoService implements DaffDriverHttpClientCacheServiceInterface {\n constructor(\n @Inject(PLATFORM_ID) private platformId: string,\n ) {}\n\n reset(): void {\n if (isPlatformBrowser(this.platformId)) {\n location.reload();\n }\n }\n}\n","import {\n Injectable,\n makeEnvironmentProviders,\n} from '@angular/core';\nimport { ApolloLink } from '@apollo/client/core';\n\nimport {\n DaffApolloLinkGenerator,\n provideDaffApolloRequestHandlerFactories,\n} from '@daffodil/core/graphql';\n\nexport const MAGENTO_CUSTOMER_CACHE_ID_HEADER = 'X-Magento-Cache-Id';\n\n/**\n * Stores and sets the Magento cache ID header.\n * This will set the `X-Magento-Cache-Id` header from the most recent value encountered\n * on a response, if there was a response with that header set.\n */\nexport const provideDaffMagentoCacheHeader = () => makeEnvironmentProviders([\n provideDaffApolloRequestHandlerFactories(() => {\n let cacheHeader: string | undefined;\n return (operation, forward) => {\n if (cacheHeader) {\n operation.setContext({\n headers: {\n ...operation.getContext().headers,\n [MAGENTO_CUSTOMER_CACHE_ID_HEADER]: cacheHeader,\n },\n });\n }\n return forward(operation).map((response) => {\n const { headers } = operation.getContext().response;\n if (headers.get(MAGENTO_CUSTOMER_CACHE_ID_HEADER)) {\n cacheHeader = headers.get(MAGENTO_CUSTOMER_CACHE_ID_HEADER);\n }\n return response;\n });\n };\n }),\n]);\n\n/**\n * Stores and sets the Magento cache ID header.\n * This will set the `X-Magento-Cache-Id` header from the most recent value encountered\n * on a response, if there was a response with that header set.\n *\n * @inheritdoc\n * @deprecated Prefer using {@link provideDaffMagentoCacheHeader} instead. Deprecated in version 0.91.0. Will be removed in version 0.94.0.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoCacheHeaderApolloLinkGenerator implements DaffApolloLinkGenerator {\n private _cacheHeader?: string;\n\n getLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n if (this._cacheHeader) {\n operation.setContext({\n headers: {\n ...operation.getContext().headers,\n [MAGENTO_CUSTOMER_CACHE_ID_HEADER]: this._cacheHeader,\n },\n });\n }\n return forward(operation).map((response) => {\n const { headers } = operation.getContext().response;\n if (headers.get(MAGENTO_CUSTOMER_CACHE_ID_HEADER)) {\n this._cacheHeader = headers.get(MAGENTO_CUSTOMER_CACHE_ID_HEADER);\n }\n return response;\n });\n });\n }\n}\n","import { makeEnvironmentProviders } from '@angular/core';\n\nimport { MagentoDriverFeatureKind } from './kind.enum';\nimport { makeMagentoDriverFeature } from './make-feature';\nimport { MagentoDriverFeature } from './type';\nimport {\n provideDaffMagentoApolloCacheableOperations,\n provideManyDaffMagentoCacheableOperations,\n} from '../graphql/public_api';\n\n/**\n * A {@link provideMagentoDriver} feature that sets up {@link provideDaffMagentoApolloCacheableOperations}.\n */\nexport const withOperationCache = (...extraOperations: Array<string>): MagentoDriverFeature => makeMagentoDriverFeature(MagentoDriverFeatureKind.CacheableOperations, [\n provideDaffMagentoApolloCacheableOperations(),\n makeEnvironmentProviders(provideManyDaffMagentoCacheableOperations(...extraOperations)),\n]);\n","import type { ErrorHandler } from '@apollo/client/link/error';\n\nimport { createSingleInjectionToken } from '@daffodil/core';\n\nimport { MagentoDriverFeatureKind } from './kind.enum';\nimport { makeMagentoDriverFeature } from './make-feature';\nimport { MagentoDriverFeature } from './type';\n\nexport const {\n /**\n * Holds the error handler for {@link provideMagentoDriver}.\n */\n token: DAFF_DRIVER_MAGENTO_ERROR_HANDLER,\n /**\n * Provider function for {@link DAFF_DRIVER_MAGENTO_ERROR_HANDLER}.\n */\n provider: provideDaffDriverMagentoErrorHandler,\n} = createSingleInjectionToken<ErrorHandler>('DAFF_DRIVER_MAGENTO_ERROR_HANDLER', {\n factory: () => ({ graphQLErrors, networkError }) => {\n if (graphQLErrors) {\n graphQLErrors.map(({ message, locations, path }) =>\n console.error(\n `[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`,\n ),\n );\n }\n if (networkError) {\n console.error(`[Network error]: ${networkError}`);\n }\n },\n});\n\n/**\n * A {@link provideMagentoDriver} feature that specifies the error handler.\n */\nexport const withDaffDriverMagentoErrorHandler = (handler: ErrorHandler): MagentoDriverFeature => makeMagentoDriverFeature(MagentoDriverFeatureKind.ErrorHandler, [\n provideDaffDriverMagentoErrorHandler(handler),\n]);\n","import {\n inject,\n makeEnvironmentProviders,\n provideAppInitializer,\n TransferState,\n type EnvironmentProviders,\n type StateKey,\n} from '@angular/core';\nimport { NormalizedCacheObject } from '@apollo/client/cache';\nimport { Apollo } from 'apollo-angular';\n\nimport { createSingleInjectionToken } from '@daffodil/core';\n\nimport { MagentoDriverFeatureKind } from './kind.enum';\nimport { makeMagentoDriverFeature } from './make-feature';\nimport { MagentoDriverFeature } from './type';\n\nexport const {\n /**\n * Holds the `StateKey` with which {@link provideMagentoDriver} can use to transfer Apollo state from the server to the client.\n */\n token: DAFF_DRIVER_MAGENTO_TRANSFER_STATE_KEY,\n /**\n * Provider for {@link DAFF_DRIVER_MAGENTO_TRANSFER_STATE_KEY}.\n */\n provider: provideDaffDriverMagentoTransferStateKey,\n} = createSingleInjectionToken<StateKey<any>>('DAFF_DRIVER_MAGENTO_TRANSFER_STATE_KEY');\n\n/**\n * A {@link provideMagentoDriver} feature that sets up transfer state with the specified key.\n *\n * @param stateKey The key under which the Apollo state is stored.\n */\nexport const withDaffDriverMagentoTransferState = <T extends StateKey<any> = StateKey<any>>(stateKey: T): MagentoDriverFeature => makeMagentoDriverFeature(MagentoDriverFeatureKind.TransferState, [\n provideDaffDriverMagentoTransferStateKey(stateKey),\n]);\n\n/**\n * Holds the logic for hydrating the Apollo cache with the server's transferred state.\n * It is recommended to use {@link withDaffDriverMagentoTransferState} with {@link provideMagentoDriver}\n * to provide this functionality automatically.\n */\nexport const provideDaffDriverMagentoTransferState = (): EnvironmentProviders => makeEnvironmentProviders([\n provideAppInitializer(() => {\n const cache = inject(Apollo).client.cache;\n const transferState = inject(TransferState);\n const stateKey = inject(DAFF_DRIVER_MAGENTO_TRANSFER_STATE_KEY);\n const hasStateKey = transferState.hasKey(stateKey);\n if (hasStateKey) {\n const state = transferState.get<NormalizedCacheObject>(\n stateKey,\n null,\n );\n cache.restore(state);\n } else {\n transferState.onSerialize(stateKey, () => cache.extract());\n }\n }),\n]);\n","import {\n EnvironmentProviders,\n inject,\n InjectionToken,\n makeEnvironmentProviders,\n} from '@angular/core';\nimport {\n from,\n InMemoryCache,\n PossibleTypesMap,\n TypePolicies,\n} from '@apollo/client/core';\nimport { onError } from '@apollo/client/link/error';\nimport { provideApollo } from 'apollo-angular';\nimport {\n HttpLink,\n Options as HttpOptions,\n} from 'apollo-angular/http';\n\nimport { DAFF_APOLLO_REQUEST_HANDLERS } from '@daffodil/core/graphql';\nimport { provideDaffDriverHttpClientCacheService } from '@daffodil/driver';\n\nimport typePolicies from './apollo/type-policies';\nimport {\n DAFF_DRIVER_MAGENTO_ERROR_HANDLER,\n DAFF_DRIVER_MAGENTO_EXTRA_APOLLO_OPTIONS,\n MagentoDriverFeatureKind,\n MagentoDriverFeature,\n provideDaffDriverMagentoTransferState,\n} from './features/public_api';\nimport { DaffDriverHttpClientCacheMagentoService } from './graphql/cache.service';\nimport {\n provideDaffMagentoApolloCacheableOperations,\n provideDaffMagentoCacheHeader,\n} from './graphql/public_api';\nimport { MAGENTO_POSSIBLE_TYPES } from './schema/schema';\n\nexport interface DaffMagentoDriverConfig extends HttpOptions {\n possibleTypes?: PossibleTypesMap;\n typePolicies?: TypePolicies;\n}\n\n/**\n * Sets up the Magento Daffodil driver configuration for Magento's GraphQl API.\n *\n * Under the hood, this creates an Apollo Client configuration.\n *\n * @param endpoint - The Magento store domain (e.g. \"https://www.my-store.com/graphql\") or an injection token for a string or function that returns a string\n */\nexport function provideMagentoDriver(options: DaffMagentoDriverConfig | InjectionToken<DaffMagentoDriverConfig>, ...features: Array<MagentoDriverFeature>): EnvironmentProviders {\n const providers = [\n ...features.flatMap(({ ɵproviders }) => ɵproviders),\n provideApollo(() => {\n const opts: DaffMagentoDriverConfig = {\n possibleTypes: MAGENTO_POSSIBLE_TYPES.possibleTypes,\n typePolicies,\n ...(options instanceof InjectionToken ? inject(options) : options),\n };\n return {\n ...inject(DAFF_DRIVER_MAGENTO_EXTRA_APOLLO_OPTIONS),\n link: from([\n ...inject(DAFF_APOLLO_REQUEST_HANDLERS),\n onError(inject(DAFF_DRIVER_MAGENTO_ERROR_HANDLER)),\n inject(HttpLink).create(opts),\n ]),\n cache: new InMemoryCache({ typePolicies: opts.typePolicies, possibleTypes: opts.possibleTypes }),\n };\n }),\n provideDaffDriverHttpClientCacheService(DaffDriverHttpClientCacheMagentoService),\n\n // enable caching by default\n provideDaffMagentoApolloCacheableOperations(),\n provideDaffMagentoCacheHeader(),\n ];\n\n if (features.find(({ ɵkind }) => ɵkind === MagentoDriverFeatureKind.TransferState)) {\n providers.push(provideDaffDriverMagentoTransferState());\n }\n\n return makeEnvironmentProviders(providers);\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_DRIVER_MAGENTO_ERROR_CODE = 'DAFF_DRIVER_MAGENTO_ERROR';\n\n/**\n * A very general error thrown when a more specific error type cannot be determined.\n */\nexport class DaffDriverMagentoError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_DRIVER_MAGENTO_ERROR_CODE;\n\n constructor(message?: string) {\n super(message);\n }\n}\n","import { GraphQLFormattedError } from 'graphql';\n\nimport {\n DaffError,\n DaffErrorCodeMap,\n} from '@daffodil/core';\n\nimport { DaffDriverMagentoError } from './error.class';\n\nexport function daffMagentoTransformGraphQlError<T extends DaffErrorCodeMap>(\n error: GraphQLFormattedError,\n map: T,\n): DaffError {\n const ErrorClass = map[<string>error?.extensions?.category] || DaffDriverMagentoError;\n\n return new ErrorClass(error.message) ;\n};\n","import { ApolloError } from '@apollo/client/core';\n\nimport {\n DaffError,\n DaffErrorCodeMap,\n daffIsError,\n} from '@daffodil/core';\nimport { DaffDriverNetworkError } from '@daffodil/driver';\n\nimport { DaffDriverMagentoError } from './error.class';\nimport { daffMagentoTransformGraphQlError } from './transform-graphql';\n\n/**\n * Transforms the passed error according to the lookup in the passed map.\n */\n// TODO: return array of errors\nexport function daffTransformMagentoError<T extends DaffErrorCodeMap>(error: any, map: T): DaffError {\n if (error.graphQLErrors?.length > 0) {\n return (<ApolloError>error).graphQLErrors.map(err => daffMagentoTransformGraphQlError<T>(err, map))[0];\n } else if (error.networkError) {\n return new DaffDriverNetworkError((<ApolloError>error).networkError.message);\n } else if (daffIsError(error)) {\n return error;\n } else {\n return new DaffDriverMagentoError(error.message);\n }\n};\n","export enum MagentoSortEnum {\n ASC = 'ASC',\n DESC = 'DESC'\n}\n","import { DaffCollectionMetadata } from '@daffodil/core';\n\nimport { MagentoSearchResultPageInfo } from '../../models/public_api';\n\nexport function magentoPageInfoTransform(pageInfo: MagentoSearchResultPageInfo): Pick<DaffCollectionMetadata, 'pageSize' | 'currentPage' | 'totalPages'> {\n return {\n pageSize: pageInfo.page_size,\n currentPage: pageInfo.current_page,\n totalPages: pageInfo.total_pages,\n };\n}\n","import { DaffSortDirectionEnum } from '@daffodil/core';\n\nimport { MagentoSortEnum } from '../../models/public_api';\n\nconst map = <const>{\n [MagentoSortEnum.ASC]: DaffSortDirectionEnum.Ascending,\n [MagentoSortEnum.DESC]: DaffSortDirectionEnum.Descending,\n};\n\nexport function magentoSortDirectionResponseTransform(direction: MagentoSortEnum): DaffSortDirectionEnum {\n return map[direction];\n}\n","import { DaffSortDirectionEnum } from '@daffodil/core';\n\nimport { MagentoSortEnum } from '../../models/public_api';\n\nconst map = <const>{\n [DaffSortDirectionEnum.Ascending]: MagentoSortEnum.ASC,\n [DaffSortDirectionEnum.Descending]: MagentoSortEnum.DESC,\n};\n\nexport function magentoSortDirectionRequestTransform(direction: DaffSortDirectionEnum): MagentoSortEnum {\n return map[direction];\n}\n","import { gql } from 'apollo-angular';\n\nexport const magentoSearchResultPageInfoFragment = gql`\n fragment magentoSearchResultPageInfo on SearchResultPageInfo {\n page_size\n current_page\n total_pages\n }\n`;\n","import { gql } from 'apollo-angular';\n\nexport const magentoMoneyFragment = gql`\n fragment moneyFragment on Money {\n value\n currency\n }\n`;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAM,sBAAsB,GAAG;;ACFtC;;;;;;AAMG;AAIH,MAAM,YAAY,GAAiB;;AAEjC,IAAA,KAAK,EAAE;AACL,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE;;AAEJ,gBAAA,OAAO,EAAE,MAAM,MAAM;AACtB,aAAA;AACD,YAAA,QAAQ,EAAE;AACR,gBAAA,OAAO,EAAE,MAAM,UAAU;AAC1B,aAAA;AACD,YAAA,YAAY,EAAE;AACZ,gBAAA,OAAO,EAAE,MAAM,MAAM;AACtB,aAAA;AACD,YAAA,wBAAwB,EAAE;AACxB,gB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
3
|
import { DaffModelFactory } from '@daffodil/core/testing';
|
|
4
4
|
import { faker } from '@faker-js/faker/locale/en_US';
|
|
5
|
-
import {
|
|
5
|
+
import { ShopifyCurrencyCode, shopifyHandleTransformer, shopifyIdTransformer, shopifyImageTransformer } from '@daffodil/driver/shopify';
|
|
6
6
|
|
|
7
|
-
class
|
|
7
|
+
class MockShopifyPageInfo {
|
|
8
8
|
constructor() {
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
9
|
+
this.endCursor = faker.lorem.word();
|
|
10
|
+
this.hasNextPage = faker.datatype.boolean();
|
|
11
|
+
this.hasPreviousPage = faker.datatype.boolean();
|
|
12
|
+
this.startCursor = faker.lorem.word();
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
|
-
class
|
|
15
|
+
class ShopifyPageInfoFactory extends DaffModelFactory {
|
|
15
16
|
constructor() {
|
|
16
|
-
super(
|
|
17
|
+
super(MockShopifyPageInfo);
|
|
17
18
|
}
|
|
18
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
19
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
19
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ShopifyPageInfoFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
20
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ShopifyPageInfoFactory, providedIn: 'root' }); }
|
|
20
21
|
}
|
|
21
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ShopifyPageInfoFactory, decorators: [{
|
|
22
23
|
type: Injectable,
|
|
23
24
|
args: [{
|
|
24
25
|
providedIn: 'root',
|
|
25
26
|
}]
|
|
26
27
|
}], ctorParameters: () => [] });
|
|
27
28
|
|
|
28
|
-
class
|
|
29
|
-
constructor(
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
29
|
+
class MockShopifyImageNode {
|
|
30
|
+
constructor() {
|
|
31
|
+
this.id = '';
|
|
32
|
+
this.url = faker.image.url();
|
|
33
|
+
this.altText = faker.lorem.words(5);
|
|
34
|
+
this.originalSrc = faker.image.url();
|
|
35
|
+
this.src = faker.image.url();
|
|
36
|
+
this.transformedSrc = faker.image.url();
|
|
32
37
|
}
|
|
33
38
|
}
|
|
34
|
-
class
|
|
35
|
-
constructor(
|
|
36
|
-
super(
|
|
39
|
+
class ShopifyImageNodeFactory extends DaffModelFactory {
|
|
40
|
+
constructor() {
|
|
41
|
+
super(MockShopifyImageNode);
|
|
37
42
|
}
|
|
38
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
39
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
43
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ShopifyImageNodeFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
44
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ShopifyImageNodeFactory, providedIn: 'root' }); }
|
|
40
45
|
}
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ShopifyImageNodeFactory, decorators: [{
|
|
42
47
|
type: Injectable,
|
|
43
48
|
args: [{
|
|
44
49
|
providedIn: 'root',
|
|
45
50
|
}]
|
|
46
|
-
}], ctorParameters: () => [
|
|
51
|
+
}], ctorParameters: () => [] });
|
|
47
52
|
|
|
48
53
|
class MockShopifyMoney {
|
|
49
54
|
constructor() {
|
|
50
55
|
this.amount = parseFloat(faker.commerce.price());
|
|
51
|
-
this.currencyCode = faker.helpers.objectValue(
|
|
56
|
+
this.currencyCode = faker.helpers.objectValue(ShopifyCurrencyCode);
|
|
52
57
|
}
|
|
53
58
|
}
|
|
54
59
|
class ShopifyMoneyFactory extends DaffModelFactory {
|
|
55
60
|
constructor() {
|
|
56
61
|
super(MockShopifyMoney);
|
|
57
62
|
}
|
|
58
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
59
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
63
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ShopifyMoneyFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
64
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ShopifyMoneyFactory, providedIn: 'root' }); }
|
|
60
65
|
}
|
|
61
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ShopifyMoneyFactory, decorators: [{
|
|
62
67
|
type: Injectable,
|
|
63
68
|
args: [{
|
|
64
69
|
providedIn: 'root',
|
|
65
70
|
}]
|
|
66
71
|
}], ctorParameters: () => [] });
|
|
67
72
|
|
|
68
|
-
class
|
|
73
|
+
class MockShopifyProductVariantsPriceRange {
|
|
69
74
|
constructor(shopifyMoneyFactory) {
|
|
70
75
|
this.shopifyMoneyFactory = shopifyMoneyFactory;
|
|
71
76
|
this.maxVariantPrice = this.shopifyMoneyFactory.create();
|
|
72
77
|
this.minVariantPrice = this.shopifyMoneyFactory.create();
|
|
73
78
|
}
|
|
74
79
|
}
|
|
75
|
-
class
|
|
80
|
+
class ShopifyProductVariantsPriceRangeFactory extends DaffModelFactory {
|
|
76
81
|
constructor(shopifyMoneyFactory) {
|
|
77
|
-
super(
|
|
82
|
+
super(MockShopifyProductVariantsPriceRange, shopifyMoneyFactory);
|
|
78
83
|
}
|
|
79
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
80
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
84
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ShopifyProductVariantsPriceRangeFactory, deps: [{ token: ShopifyMoneyFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
85
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ShopifyProductVariantsPriceRangeFactory, providedIn: 'root' }); }
|
|
81
86
|
}
|
|
82
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
87
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ShopifyProductVariantsPriceRangeFactory, decorators: [{
|
|
83
88
|
type: Injectable,
|
|
84
89
|
args: [{
|
|
85
90
|
providedIn: 'root',
|
|
@@ -87,56 +92,126 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
87
92
|
}], ctorParameters: () => [{ type: ShopifyMoneyFactory }] });
|
|
88
93
|
|
|
89
94
|
class MockShopifyProductNode {
|
|
90
|
-
constructor(
|
|
91
|
-
this.
|
|
92
|
-
this.
|
|
93
|
-
this.
|
|
95
|
+
constructor(shopifyProductVariantsPriceRangeFactory, shopifyImageNodeFactory) {
|
|
96
|
+
this.shopifyProductVariantsPriceRangeFactory = shopifyProductVariantsPriceRangeFactory;
|
|
97
|
+
this.shopifyImageNodeFactory = shopifyImageNodeFactory;
|
|
98
|
+
this.availableForSale = faker.datatype.boolean();
|
|
99
|
+
this.collections = null;
|
|
100
|
+
this.compareAtPriceRange = this.shopifyProductVariantsPriceRangeFactory.create();
|
|
101
|
+
this.createdAt = faker.date.past();
|
|
102
|
+
this.description = faker.commerce.productDescription();
|
|
103
|
+
this.descriptionHtml = faker.commerce.productDescription();
|
|
94
104
|
this.handle = shopifyHandleTransformer(faker.commerce.productName());
|
|
95
105
|
this.id = shopifyIdTransformer(`${faker.number.int({ min: 100000000000 })}`, 'Product');
|
|
96
|
-
this.
|
|
106
|
+
this.images = {
|
|
107
|
+
edges: [],
|
|
108
|
+
nodes: this.shopifyImageNodeFactory.createMany().map(node => shopifyImageTransformer(node, 'ProductImage')),
|
|
109
|
+
pageInfo: {
|
|
110
|
+
hasNextPage: false,
|
|
111
|
+
hasPreviousPage: false,
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
this.isGiftCard = faker.datatype.boolean();
|
|
115
|
+
this.media = null;
|
|
116
|
+
this.metafields = [];
|
|
97
117
|
this.onlineStoreUrl = faker.internet.domainName();
|
|
98
|
-
this.
|
|
99
|
-
this.priceRange = this.
|
|
100
|
-
this.
|
|
118
|
+
this.options = [];
|
|
119
|
+
this.priceRange = this.shopifyProductVariantsPriceRangeFactory.create();
|
|
120
|
+
this.productType = faker.commerce.productMaterial();
|
|
121
|
+
this.publishedAt = faker.date.past();
|
|
122
|
+
this.requiresSellingPlan = faker.datatype.boolean();
|
|
123
|
+
this.sellingPlanGroups = null;
|
|
124
|
+
this.seo = {};
|
|
125
|
+
this.tags = [];
|
|
126
|
+
this.title = faker.commerce.productName();
|
|
127
|
+
this.updatedAt = faker.date.past();
|
|
128
|
+
this.variants = null;
|
|
129
|
+
this.adjacentVariants = null;
|
|
130
|
+
this.vendor = faker.company.name();
|
|
101
131
|
}
|
|
102
132
|
}
|
|
103
133
|
class ShopifyProductNodeFactory extends DaffModelFactory {
|
|
104
|
-
constructor(
|
|
105
|
-
super(MockShopifyProductNode,
|
|
134
|
+
constructor(shopifyProductVariantsPriceRangeFactory, shopifyImageNodeFactory) {
|
|
135
|
+
super(MockShopifyProductNode, shopifyProductVariantsPriceRangeFactory, shopifyImageNodeFactory);
|
|
106
136
|
}
|
|
107
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
108
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
137
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ShopifyProductNodeFactory, deps: [{ token: ShopifyProductVariantsPriceRangeFactory }, { token: ShopifyImageNodeFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
138
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ShopifyProductNodeFactory, providedIn: 'root' }); }
|
|
109
139
|
}
|
|
110
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
140
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ShopifyProductNodeFactory, decorators: [{
|
|
111
141
|
type: Injectable,
|
|
112
142
|
args: [{
|
|
113
143
|
providedIn: 'root',
|
|
114
144
|
}]
|
|
115
|
-
}], ctorParameters: () => [{ type:
|
|
145
|
+
}], ctorParameters: () => [{ type: ShopifyProductVariantsPriceRangeFactory }, { type: ShopifyImageNodeFactory }] });
|
|
116
146
|
|
|
117
147
|
class MockShopifyProductGraph {
|
|
118
|
-
constructor(shopifyProductNodeFactory) {
|
|
148
|
+
constructor(shopifyProductNodeFactory, shopifyPageInfoFactory) {
|
|
119
149
|
this.shopifyProductNodeFactory = shopifyProductNodeFactory;
|
|
150
|
+
this.shopifyPageInfoFactory = shopifyPageInfoFactory;
|
|
120
151
|
this.nodes = this.shopifyProductNodeFactory.createMany();
|
|
152
|
+
this.edges = [];
|
|
153
|
+
this.filters = [];
|
|
154
|
+
this.pageInfo = this.shopifyPageInfoFactory.create();
|
|
121
155
|
}
|
|
122
156
|
}
|
|
123
157
|
class ShopifyProductGraphFactory extends DaffModelFactory {
|
|
124
|
-
constructor(shopifyProductNodeFactory) {
|
|
125
|
-
super(MockShopifyProductGraph, shopifyProductNodeFactory);
|
|
158
|
+
constructor(shopifyProductNodeFactory, shopifyPageInfoFactory) {
|
|
159
|
+
super(MockShopifyProductGraph, shopifyProductNodeFactory, shopifyPageInfoFactory);
|
|
160
|
+
}
|
|
161
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ShopifyProductGraphFactory, deps: [{ token: ShopifyProductNodeFactory }, { token: ShopifyPageInfoFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
162
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ShopifyProductGraphFactory, providedIn: 'root' }); }
|
|
163
|
+
}
|
|
164
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ShopifyProductGraphFactory, decorators: [{
|
|
165
|
+
type: Injectable,
|
|
166
|
+
args: [{
|
|
167
|
+
providedIn: 'root',
|
|
168
|
+
}]
|
|
169
|
+
}], ctorParameters: () => [{ type: ShopifyProductNodeFactory }, { type: ShopifyPageInfoFactory }] });
|
|
170
|
+
|
|
171
|
+
class MockShopifyCategory {
|
|
172
|
+
constructor(shopifyProductNodeFactory, shopifyImageNodeFactory) {
|
|
173
|
+
this.shopifyProductNodeFactory = shopifyProductNodeFactory;
|
|
174
|
+
this.shopifyImageNodeFactory = shopifyImageNodeFactory;
|
|
175
|
+
this.title = faker.commerce.department();
|
|
176
|
+
this.handle = shopifyHandleTransformer(faker.commerce.department());
|
|
177
|
+
this.id = shopifyIdTransformer(`${faker.number.int({ min: 100000000000 })}`, 'Collection');
|
|
178
|
+
this.description = faker.commerce.productDescription();
|
|
179
|
+
this.descriptionHtml = faker.commerce.productDescription();
|
|
180
|
+
this.onlineStoreUrl = faker.internet.domainName();
|
|
181
|
+
this.image = shopifyImageTransformer(this.shopifyImageNodeFactory.create(), 'CollectionImage');
|
|
182
|
+
this.products = {
|
|
183
|
+
edges: [],
|
|
184
|
+
nodes: this.shopifyProductNodeFactory.createMany(),
|
|
185
|
+
filters: [],
|
|
186
|
+
pageInfo: {
|
|
187
|
+
hasNextPage: false,
|
|
188
|
+
hasPreviousPage: false,
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
this.metafield = null;
|
|
192
|
+
this.metafields = [];
|
|
193
|
+
this.seo = {};
|
|
194
|
+
this.trackingParameters = null;
|
|
195
|
+
this.updatedAt = faker.date.past();
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
class DaffCategoryDriverShopifyCategoryFactory extends DaffModelFactory {
|
|
199
|
+
constructor(shopifyProductNodeFactory, shopifyImageNodeFactory) {
|
|
200
|
+
super(MockShopifyCategory, shopifyProductNodeFactory, shopifyImageNodeFactory);
|
|
126
201
|
}
|
|
127
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
128
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
202
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryDriverShopifyCategoryFactory, deps: [{ token: ShopifyProductNodeFactory }, { token: ShopifyImageNodeFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
203
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryDriverShopifyCategoryFactory, providedIn: 'root' }); }
|
|
129
204
|
}
|
|
130
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
205
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCategoryDriverShopifyCategoryFactory, decorators: [{
|
|
131
206
|
type: Injectable,
|
|
132
207
|
args: [{
|
|
133
208
|
providedIn: 'root',
|
|
134
209
|
}]
|
|
135
|
-
}], ctorParameters: () => [{ type: ShopifyProductNodeFactory }] });
|
|
210
|
+
}], ctorParameters: () => [{ type: ShopifyProductNodeFactory }, { type: ShopifyImageNodeFactory }] });
|
|
136
211
|
|
|
137
212
|
/**
|
|
138
213
|
* Generated bundle index. Do not edit.
|
|
139
214
|
*/
|
|
140
215
|
|
|
141
|
-
export {
|
|
216
|
+
export { DaffCategoryDriverShopifyCategoryFactory, ShopifyImageNodeFactory, ShopifyMoneyFactory, ShopifyProductGraphFactory, ShopifyProductNodeFactory, ShopifyProductVariantsPriceRangeFactory };
|
|
142
217
|
//# sourceMappingURL=daffodil-driver-shopify-testing.mjs.map
|