@daffodil/driver 0.66.1 → 0.68.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/{esm2020 → esm2022}/http-client-cache/noop.service.mjs +4 -4
- package/{esm2020 → esm2022}/magento/graphql/cache.service.mjs +6 -6
- package/{esm2020 → esm2022}/magento/graphql/cacheable-operations/apollo-cacheable-operations-link-generator.mjs +6 -6
- package/esm2022/magento/magento.module.mjs +26 -0
- package/{esm2020 → esm2022}/magento/testing/factories/discount.factory.mjs +5 -5
- package/{esm2020 → esm2022}/magento/testing/factories/money.factory.mjs +5 -5
- package/{esm2020 → esm2022}/magento/testing/factories/page-info.factory.mjs +5 -5
- package/{fesm2015 → fesm2022}/daffodil-driver-magento-testing.mjs +12 -12
- package/{fesm2020 → fesm2022}/daffodil-driver-magento-testing.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/daffodil-driver-magento.mjs +19 -19
- package/{fesm2020 → fesm2022}/daffodil-driver-magento.mjs.map +1 -1
- package/{fesm2015 → fesm2022}/daffodil-driver.mjs +3 -3
- package/{fesm2020 → fesm2022}/daffodil-driver.mjs.map +1 -1
- package/package.json +1 -1
- package/esm2020/magento/magento.module.mjs +0 -26
- package/fesm2015/daffodil-driver-hubspot.mjs.map +0 -1
- package/fesm2015/daffodil-driver-magento-testing.mjs.map +0 -1
- package/fesm2015/daffodil-driver-magento.mjs +0 -528
- package/fesm2015/daffodil-driver-magento.mjs.map +0 -1
- package/fesm2015/daffodil-driver.mjs.map +0 -1
- package/fesm2020/daffodil-driver-hubspot.mjs +0 -56
- package/fesm2020/daffodil-driver-magento-testing.mjs +0 -79
- package/fesm2020/daffodil-driver.mjs +0 -53
- /package/{esm2020 → esm2022}/daffodil-driver.mjs +0 -0
- /package/{esm2020 → esm2022}/errors/bad-input.mjs +0 -0
- /package/{esm2020 → esm2022}/errors/codes.mjs +0 -0
- /package/{esm2020 → esm2022}/errors/network-error.class.mjs +0 -0
- /package/{esm2020 → esm2022}/errors/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/http-client-cache/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/http-client-cache/service.token.mjs +0 -0
- /package/{esm2020 → esm2022}/http-client-cache/service.type.mjs +0 -0
- /package/{esm2020 → esm2022}/hubspot/daffodil-driver-hubspot.mjs +0 -0
- /package/{esm2020 → esm2022}/hubspot/hubspot-forms.provider.mjs +0 -0
- /package/{esm2020 → esm2022}/hubspot/hubspot-forms.service.mjs +0 -0
- /package/{esm2020 → esm2022}/hubspot/index.mjs +0 -0
- /package/{esm2020 → esm2022}/hubspot/models/config.mjs +0 -0
- /package/{esm2020 → esm2022}/hubspot/models/hubspot-request.mjs +0 -0
- /package/{esm2020 → esm2022}/hubspot/models/hubspot-response.mjs +0 -0
- /package/{esm2020 → esm2022}/hubspot/transformers/json-builder.mjs +0 -0
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/daffodil-driver-magento.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/errors/error.class.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/errors/network-error.class.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/errors/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/errors/transform-graphql.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/errors/transform.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/fragments/money.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/fragments/page-info.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/fragments/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/graphql/cacheable-operations/cacheable-operations-token.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/graphql/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/graphql/type-policies.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/index.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/models/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/models/responses/discount.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/models/responses/filter-input.type.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/models/responses/money.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/models/responses/page-info.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/models/responses/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/schema/introspection.json +0 -0
- /package/{esm2020 → esm2022}/magento/schema/schema.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/testing/daffodil-driver-magento-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/testing/factories/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/testing/index.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/transforms/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/transforms/responses/page-info.mjs +0 -0
- /package/{esm2020 → esm2022}/magento/transforms/responses/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/models/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/models/response.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/public_api.mjs +0 -0
- /package/{fesm2015 → fesm2022}/daffodil-driver-hubspot.mjs +0 -0
- /package/{fesm2020 → fesm2022}/daffodil-driver-hubspot.mjs.map +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-driver-hubspot.mjs","sources":["../../../libs/driver/hubspot/src/transformers/json-builder.ts","../../../libs/driver/hubspot/src/hubspot-forms.service.ts","../../../libs/driver/hubspot/src/hubspot-forms.provider.ts","../../../libs/driver/hubspot/src/daffodil-driver-hubspot.ts"],"sourcesContent":["import { FieldValue } from '../models/hubspot-request';\n\n\nexport const jsonBuilder = (payload: Record<string, any>): FieldValue[] => Object.keys(payload).map((key) => ({ name: key, value: payload[key] }));\n","import { HttpClient } from '@angular/common/http';\nimport { Title } from '@angular/platform-browser';\nimport { Router } from '@angular/router';\nimport { Observable } from 'rxjs';\n\nimport { DaffHubspotConfig } from './models/config';\nimport { DaffHubspotRequest } from './models/hubspot-request';\nimport { HubspotResponse } from './models/hubspot-response';\nimport { jsonBuilder } from './transformers/json-builder';\n\nexport class DaffHubspotFormsService {\n\n constructor(\n private http: HttpClient,\n private document: Document,\n private route: Router,\n private title: Title,\n private config: DaffHubspotConfig) { }\n\n\n submit(payload: Record<string, any>): Observable<HubspotResponse> {\n return this.http.post<HubspotResponse>(\n this.generateUrl(this.config.portalId, this.config.guid, this.config.version),\n this.makeRequest(payload),\n );\n }\n\n private makeRequest(payload): DaffHubspotRequest {\n return {\n fields: [\n ...jsonBuilder(payload),\n ],\n context: {\n hutk: this.getCookie(),\n pageUri: this.getPageURI(),\n pageName: this.title.getTitle(),\n },\n };\n }\n\n private generateUrl(portalId: string, guid: string, version: string): string {\n if (version === undefined) {\n version = 'v3';\n }\n return 'https://api.hsforms.com/submissions/' + version + '/integration/submit/'\n + portalId + '/' + guid;\n }\n private getCookie() {\n if (!this.document) {\n return null;\n }\n const name = 'hubspotutk';\n const v = this.document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');\n return v ? v[2] : null;\n }\n private getPageURI() {\n if (!this.route) {\n return null;\n }\n return this.route.url;\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Title } from '@angular/platform-browser';\nimport { Router } from '@angular/router';\n\nimport { DaffHubspotFormsService } from './hubspot-forms.service';\nimport { DaffHubspotConfig } from './models/config';\n\n\nexport const daffHubspotFormsServiceFactory = (\n http: HttpClient,\n document: Document,\n router: Router,\n title: Title,\n config: DaffHubspotConfig,\n) => new DaffHubspotFormsService(http, document, router, title, config);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAGO,MAAM,WAAW,GAAG,CAAC,OAA4B,KAAmB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,EAAE,IAAI,EAAE,GAA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5E,cAAA,QAAQ,GAAG,GAAG,GAAG,IAAI,CAAC;KAC3B;IACO,SAAS,GAAA;AACf,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AAClB,YAAA,OAAO,IAAI,CAAC;AACb,SAAA;QACD,MAAM,IAAI,GAAG,YAAY,CAAC;AAC1B,QAAA,MAAM,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,GAAG,eAAe,CAAC,CAAC;AACzE,QAAA,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;KACxB;IACO,UAAU,GAAA;AAChB,QAAA,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;AACf,YAAA,OAAO,IAAI,CAAC;AACb,SAAA;AACD,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;KACvB;AACF;;ACrDM,MAAM,8BAA8B,GAAG,CAC5C,IAAgB,EAChB,QAAkB,EAClB,MAAc,EACd,KAAY,EACZ,MAAyB,KACtB,IAAI,uBAAuB,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;;ACdtE;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-driver-magento-testing.mjs","sources":["../../../libs/driver/magento/testing/src/factories/money.factory.ts","../../../libs/driver/magento/testing/src/factories/discount.factory.ts","../../../libs/driver/magento/testing/src/factories/page-info.factory.ts","../../../libs/driver/magento/testing/src/daffodil-driver-magento-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { MagentoMoney } from '@daffodil/driver/magento';\n\nexport class MockMagentoMoney implements MagentoMoney {\n __typename = 'Money';\n value = faker.datatype.number({ min: 1, max: 10000 });\n currency = faker.finance.currencyCode();\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoMoneyFactory extends DaffModelFactory<MagentoMoney> {\n constructor() {\n super(MockMagentoMoney);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n MagentoDiscount,\n MagentoMoney,\n} from '@daffodil/driver/magento';\n\nimport { MagentoMoneyFactory } from './money.factory';\n\nexport class MockMagentoDiscount implements MagentoDiscount {\n __typename = 'Discount';\n amount = this.money();\n label = faker.random.word();\n\n private money(): MagentoMoney {\n return (new MagentoMoneyFactory()).create();\n }\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoDiscountFactory extends DaffModelFactory<MagentoDiscount> {\n constructor() {\n super(MockMagentoDiscount);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { MagentoSearchResultPageInfo } from '@daffodil/driver/magento';\n\nclass MockMagentoSearchResultPageInfo implements MagentoSearchResultPageInfo {\n current_page = 1;\n page_size = faker.datatype.number(100);\n total_pages = faker.datatype.number(100);\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoSearchResultPageInfoFactory extends DaffModelFactory<MagentoSearchResultPageInfo> {\n constructor(){\n super(MockMagentoSearchResultPageInfo);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAMa,gBAAgB,CAAA;AAA7B,IAAA,WAAA,GAAA;AACE,QAAA,IAAU,CAAA,UAAA,GAAG,OAAO,CAAC;AACrB,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;QACtD,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;KACzC;AAAA,CAA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,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,cAFrB,MAAM,EAAA,CAAA,CAAA;2FAEP,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAHlC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;iBACnB,CAAA;;;ACjBD,MAAM,+BAA+B,CAAA;AAArC,IAAA,WAAA,GAAA;AACE,QAAA,IAAY,CAAA,YAAA,GAAI,CAAC,CAAC;QAClB,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACvC,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;KAC1C;AAAA,CAAA;AAKK,MAAO,kCAAmC,SAAQ,gBAA6C,CAAA;AACnG,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,+BAA+B,CAAC,CAAC;KACxC;;+HAHU,kCAAkC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAlC,kCAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kCAAkC,cAFjC,MAAM,EAAA,CAAA,CAAA;2FAEP,kCAAkC,EAAA,UAAA,EAAA,CAAA;kBAH9C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;iBACnB,CAAA;;;ACdD;;AAEG;;;;"}
|
|
@@ -1,528 +0,0 @@
|
|
|
1
|
-
import { DaffInheritableError, daffIsError } from '@daffodil/core';
|
|
2
|
-
import { DaffDriverNetworkError, DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE } from '@daffodil/driver';
|
|
3
|
-
import * as i0 from '@angular/core';
|
|
4
|
-
import { InjectionToken, Injectable, Inject, PLATFORM_ID, NgModule } from '@angular/core';
|
|
5
|
-
import { ApolloLink } from '@apollo/client/core';
|
|
6
|
-
import { isPlatformBrowser } from '@angular/common';
|
|
7
|
-
import { gql } from 'apollo-angular';
|
|
8
|
-
|
|
9
|
-
var possibleTypes = {
|
|
10
|
-
CartAddressInterface: [
|
|
11
|
-
"BillingCartAddress",
|
|
12
|
-
"ShippingCartAddress"
|
|
13
|
-
],
|
|
14
|
-
CartItemInterface: [
|
|
15
|
-
"SimpleCartItem",
|
|
16
|
-
"VirtualCartItem",
|
|
17
|
-
"DownloadableCartItem",
|
|
18
|
-
"BundleCartItem",
|
|
19
|
-
"ConfigurableCartItem"
|
|
20
|
-
],
|
|
21
|
-
ProductInterface: [
|
|
22
|
-
"VirtualProduct",
|
|
23
|
-
"SimpleProduct",
|
|
24
|
-
"DownloadableProduct",
|
|
25
|
-
"BundleProduct",
|
|
26
|
-
"GroupedProduct",
|
|
27
|
-
"ConfigurableProduct"
|
|
28
|
-
],
|
|
29
|
-
CategoryInterface: [
|
|
30
|
-
"CategoryTree"
|
|
31
|
-
],
|
|
32
|
-
MediaGalleryInterface: [
|
|
33
|
-
"ProductImage",
|
|
34
|
-
"ProductVideo"
|
|
35
|
-
],
|
|
36
|
-
ProductLinksInterface: [
|
|
37
|
-
"ProductLinks"
|
|
38
|
-
],
|
|
39
|
-
CreditMemoItemInterface: [
|
|
40
|
-
"DownloadableCreditMemoItem",
|
|
41
|
-
"BundleCreditMemoItem",
|
|
42
|
-
"CreditMemoItem"
|
|
43
|
-
],
|
|
44
|
-
OrderItemInterface: [
|
|
45
|
-
"DownloadableOrderItem",
|
|
46
|
-
"BundleOrderItem",
|
|
47
|
-
"OrderItem"
|
|
48
|
-
],
|
|
49
|
-
InvoiceItemInterface: [
|
|
50
|
-
"DownloadableInvoiceItem",
|
|
51
|
-
"BundleInvoiceItem",
|
|
52
|
-
"InvoiceItem"
|
|
53
|
-
],
|
|
54
|
-
ShipmentItemInterface: [
|
|
55
|
-
"BundleShipmentItem",
|
|
56
|
-
"ShipmentItem"
|
|
57
|
-
],
|
|
58
|
-
AggregationOptionInterface: [
|
|
59
|
-
"AggregationOption"
|
|
60
|
-
],
|
|
61
|
-
LayerFilterItemInterface: [
|
|
62
|
-
"LayerFilterItem",
|
|
63
|
-
"SwatchLayerFilterItem"
|
|
64
|
-
],
|
|
65
|
-
PhysicalProductInterface: [
|
|
66
|
-
"SimpleProduct",
|
|
67
|
-
"BundleProduct",
|
|
68
|
-
"GroupedProduct",
|
|
69
|
-
"ConfigurableProduct"
|
|
70
|
-
],
|
|
71
|
-
CustomizableOptionInterface: [
|
|
72
|
-
"CustomizableAreaOption",
|
|
73
|
-
"CustomizableDateOption",
|
|
74
|
-
"CustomizableDropDownOption",
|
|
75
|
-
"CustomizableMultipleOption",
|
|
76
|
-
"CustomizableFieldOption",
|
|
77
|
-
"CustomizableFileOption",
|
|
78
|
-
"CustomizableRadioOption",
|
|
79
|
-
"CustomizableCheckboxOption"
|
|
80
|
-
],
|
|
81
|
-
CustomizableProductInterface: [
|
|
82
|
-
"VirtualProduct",
|
|
83
|
-
"SimpleProduct",
|
|
84
|
-
"DownloadableProduct",
|
|
85
|
-
"BundleProduct",
|
|
86
|
-
"ConfigurableProduct"
|
|
87
|
-
],
|
|
88
|
-
SwatchDataInterface: [
|
|
89
|
-
"ImageSwatchData",
|
|
90
|
-
"TextSwatchData",
|
|
91
|
-
"ColorSwatchData"
|
|
92
|
-
],
|
|
93
|
-
SwatchLayerFilterItemInterface: [
|
|
94
|
-
"SwatchLayerFilterItem"
|
|
95
|
-
]
|
|
96
|
-
};
|
|
97
|
-
var introspectionQueryResultData = {
|
|
98
|
-
possibleTypes: possibleTypes
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
const schema = introspectionQueryResultData;
|
|
102
|
-
|
|
103
|
-
const DAFF_DRIVER_MAGENTO_ERROR_CODE = 'DAFF_DRIVER_MAGENTO_ERROR';
|
|
104
|
-
/**
|
|
105
|
-
* A very general error thrown when a more specific error type cannot be determined.
|
|
106
|
-
*/
|
|
107
|
-
class DaffDriverMagentoError extends DaffInheritableError {
|
|
108
|
-
constructor(message) {
|
|
109
|
-
super(message);
|
|
110
|
-
this.code = DAFF_DRIVER_MAGENTO_ERROR_CODE;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function daffMagentoTransformGraphQlError(error, map) {
|
|
115
|
-
const ErrorClass = map[error.extensions.category] || DaffDriverMagentoError;
|
|
116
|
-
return new ErrorClass(error.message);
|
|
117
|
-
}
|
|
118
|
-
;
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Transforms the passed error according to the lookup in the passed map.
|
|
122
|
-
*/
|
|
123
|
-
// TODO: return array of errors
|
|
124
|
-
function daffTransformMagentoError(error, map) {
|
|
125
|
-
var _a;
|
|
126
|
-
if (((_a = error.graphQLErrors) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
127
|
-
return error.graphQLErrors.map(err => daffMagentoTransformGraphQlError(err, map))[0];
|
|
128
|
-
}
|
|
129
|
-
else if (error.networkError) {
|
|
130
|
-
return new DaffDriverNetworkError(error.networkError.message);
|
|
131
|
-
}
|
|
132
|
-
else if (daffIsError(error)) {
|
|
133
|
-
return error;
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
return new DaffDriverMagentoError(error.message);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* @deprecated use {@link DaffDriverNetworkError} instead.
|
|
143
|
-
*/
|
|
144
|
-
const DAFF_DRIVER_MAGENTO_NETWORK_ERROR_CODE = 'DAFF_DRIVER_MAGENTO_NETWORK_ERROR';
|
|
145
|
-
/**
|
|
146
|
-
* An error thrown when the Magento driver encountered a problem with network connectivity.
|
|
147
|
-
*
|
|
148
|
-
* @deprecated use {@link DaffDriverNetworkError} instead.
|
|
149
|
-
*/
|
|
150
|
-
class DaffDriverMagentoNetworkError extends DaffInheritableError {
|
|
151
|
-
constructor(message) {
|
|
152
|
-
super(message);
|
|
153
|
-
this.code = DAFF_DRIVER_MAGENTO_NETWORK_ERROR_CODE;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* A multi-provider injection token of the operation names of magento queries that should
|
|
159
|
-
* be cached. This is needed because queries need to be converted into GET queries in order for Magento
|
|
160
|
-
* to cache them. This token should be used by daffodil driver platform modules to register operation names that are cacheable, and is
|
|
161
|
-
* intended for internal daffodil use only.
|
|
162
|
-
*/
|
|
163
|
-
const DAFF_MAGENTO_CACHEABLE_OPERATIONS = new InjectionToken('DAFF_MAGENTO_CACHEABLE_OPERATIONS', { factory: () => [] });
|
|
164
|
-
/**
|
|
165
|
-
* Adds an operation name to the list of cacheable Magento operations. Use only with Angular 9+.
|
|
166
|
-
*/
|
|
167
|
-
function provideDaffMagentoCacheableOperation(operationName) {
|
|
168
|
-
return {
|
|
169
|
-
provide: DAFF_MAGENTO_CACHEABLE_OPERATIONS,
|
|
170
|
-
useValue: operationName,
|
|
171
|
-
multi: true,
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Adds many operation names to the list of cacheable Magento operations. Use only with Angular 9+.
|
|
176
|
-
*/
|
|
177
|
-
function provideManyDaffMagentoCacheableOperations(...operationNames) {
|
|
178
|
-
return operationNames.map(name => ({
|
|
179
|
-
provide: DAFF_MAGENTO_CACHEABLE_OPERATIONS,
|
|
180
|
-
useValue: name,
|
|
181
|
-
multi: true,
|
|
182
|
-
}));
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* A service that will convert cacheable apollo operations into a format that Magento will understand as cacheable.
|
|
187
|
-
*
|
|
188
|
-
* @inheritdoc
|
|
189
|
-
*/
|
|
190
|
-
class DaffMagentoApolloCacheableOperationsLinkGenerator {
|
|
191
|
-
constructor(apolloGetRequests) {
|
|
192
|
-
this.apolloGetRequests = apolloGetRequests;
|
|
193
|
-
}
|
|
194
|
-
getLink() {
|
|
195
|
-
return new ApolloLink((operation, forward) => {
|
|
196
|
-
if (this.apolloGetRequests.indexOf(operation.operationName) > -1) {
|
|
197
|
-
operation.setContext({ method: 'GET' });
|
|
198
|
-
}
|
|
199
|
-
return forward(operation);
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
DaffMagentoApolloCacheableOperationsLinkGenerator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffMagentoApolloCacheableOperationsLinkGenerator, deps: [{ token: DAFF_MAGENTO_CACHEABLE_OPERATIONS }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
204
|
-
DaffMagentoApolloCacheableOperationsLinkGenerator.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffMagentoApolloCacheableOperationsLinkGenerator, providedIn: 'root' });
|
|
205
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffMagentoApolloCacheableOperationsLinkGenerator, decorators: [{
|
|
206
|
-
type: Injectable,
|
|
207
|
-
args: [{
|
|
208
|
-
providedIn: 'root',
|
|
209
|
-
}]
|
|
210
|
-
}], ctorParameters: function () {
|
|
211
|
-
return [{ type: undefined, decorators: [{
|
|
212
|
-
type: Inject,
|
|
213
|
-
args: [DAFF_MAGENTO_CACHEABLE_OPERATIONS]
|
|
214
|
-
}] }];
|
|
215
|
-
} });
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Custom type policies that allow us to have more granular control
|
|
219
|
-
* over how ApolloClient reads from and writes to the cache.
|
|
220
|
-
*
|
|
221
|
-
* This is applicable to Magento 2.4.3 and up.
|
|
222
|
-
* Heavily based on https://github.com/magento/pwa-studio/blob/99270701b2b607551f2e5881af272ed48ba7064c/packages/peregrine/lib/Apollo/policies/index.js.
|
|
223
|
-
*
|
|
224
|
-
* https://www.apollographql.com/docs/react/caching/cache-configuration/#typepolicy-fields
|
|
225
|
-
* https://www.apollographql.com/docs/react/caching/cache-field-behavior/
|
|
226
|
-
*/
|
|
227
|
-
const DAFF_MAGENTO_2_4_3_TYPE_POLICIES = {
|
|
228
|
-
Query: {
|
|
229
|
-
fields: {
|
|
230
|
-
cart: {
|
|
231
|
-
// Replaces @connection(key: "Cart")
|
|
232
|
-
keyArgs: () => 'Cart',
|
|
233
|
-
},
|
|
234
|
-
customer: {
|
|
235
|
-
keyArgs: () => 'Customer',
|
|
236
|
-
},
|
|
237
|
-
customerCart: {
|
|
238
|
-
keyArgs: () => 'Cart',
|
|
239
|
-
},
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
|
-
AppliedGiftCard: {
|
|
243
|
-
keyFields: ['code'],
|
|
244
|
-
},
|
|
245
|
-
AvailablePaymentMethod: {
|
|
246
|
-
keyFields: ['code'],
|
|
247
|
-
},
|
|
248
|
-
AvailableShippingMethod: {
|
|
249
|
-
// The combination of these fields makes an instance of
|
|
250
|
-
// AvailableShippingMethod unique.
|
|
251
|
-
keyFields: ['carrier_code', 'method_code'],
|
|
252
|
-
},
|
|
253
|
-
Breadcrumb: {
|
|
254
|
-
// Uses provided fields on the object as the `id`.
|
|
255
|
-
keyFields: ['category_uid'],
|
|
256
|
-
},
|
|
257
|
-
Cart: {
|
|
258
|
-
keyFields: () => 'Cart',
|
|
259
|
-
fields: {
|
|
260
|
-
applied_gift_cards: {
|
|
261
|
-
// eslint-disable-next-line no-unused-vars
|
|
262
|
-
merge: (existing, incoming) => incoming,
|
|
263
|
-
},
|
|
264
|
-
available_payment_methods: {
|
|
265
|
-
// eslint-disable-next-line no-unused-vars
|
|
266
|
-
merge: (existing, incoming) => incoming,
|
|
267
|
-
},
|
|
268
|
-
items: {
|
|
269
|
-
// eslint-disable-next-line no-unused-vars
|
|
270
|
-
merge: (existing, incoming) => incoming,
|
|
271
|
-
},
|
|
272
|
-
prices: {
|
|
273
|
-
// `merge: true` can be used for an object field.
|
|
274
|
-
merge: true,
|
|
275
|
-
},
|
|
276
|
-
shipping_addresses: {
|
|
277
|
-
merge: (existing = [], incoming, { readField, mergeObjects }) => {
|
|
278
|
-
// street makes these things unique
|
|
279
|
-
const mergeResult = new Set();
|
|
280
|
-
const streetToIndex = new Map();
|
|
281
|
-
existing.forEach((existingShippingAddress, index) => {
|
|
282
|
-
// Use readField instead of existingShippingAddress.street directly because it will follow cache references.
|
|
283
|
-
const street = readField('street', existingShippingAddress);
|
|
284
|
-
streetToIndex.set(street, index);
|
|
285
|
-
});
|
|
286
|
-
incoming.forEach(incomingShippingAddress => {
|
|
287
|
-
const street = readField('street', incomingShippingAddress);
|
|
288
|
-
if (streetToIndex.has(street)) {
|
|
289
|
-
const targetIndex = streetToIndex.get(street);
|
|
290
|
-
const existingShippingAddress = existing[targetIndex];
|
|
291
|
-
const merged = mergeObjects(existingShippingAddress, incomingShippingAddress);
|
|
292
|
-
mergeResult.add(merged);
|
|
293
|
-
}
|
|
294
|
-
else {
|
|
295
|
-
// We do not have an address with this street yet, add it on to the end.
|
|
296
|
-
streetToIndex.set(street, streetToIndex.size);
|
|
297
|
-
mergeResult.add(incomingShippingAddress);
|
|
298
|
-
}
|
|
299
|
-
});
|
|
300
|
-
return Array.from(mergeResult);
|
|
301
|
-
},
|
|
302
|
-
},
|
|
303
|
-
},
|
|
304
|
-
},
|
|
305
|
-
Customer: {
|
|
306
|
-
keyFields: () => 'Customer',
|
|
307
|
-
fields: {
|
|
308
|
-
addresses: {
|
|
309
|
-
merge: (existing, incoming) => incoming,
|
|
310
|
-
read: (cachedAddresses, { toReference }) => {
|
|
311
|
-
if (cachedAddresses) {
|
|
312
|
-
return cachedAddresses.map(address => {
|
|
313
|
-
var _a;
|
|
314
|
-
// Update v2 identifiers to new references. Previous
|
|
315
|
-
// entries had `id: CustomerAddress:1` which caused
|
|
316
|
-
// v3's lookup to fail. If we find a legacy id,
|
|
317
|
-
// point it at the object using a reference.
|
|
318
|
-
if ((_a = address.id) === null || _a === void 0 ? void 0 : _a.includes('CustomerAddress')) {
|
|
319
|
-
return toReference(address.id);
|
|
320
|
-
}
|
|
321
|
-
else {
|
|
322
|
-
return address;
|
|
323
|
-
}
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
// If there are no cached addresses that's fine - the schema
|
|
327
|
-
// shows that it is a nullable field.
|
|
328
|
-
},
|
|
329
|
-
},
|
|
330
|
-
orders: {
|
|
331
|
-
keyArgs: ['filter'],
|
|
332
|
-
// TODO: write merge function that handles pagination
|
|
333
|
-
// items: {
|
|
334
|
-
// merge: true,
|
|
335
|
-
// },
|
|
336
|
-
},
|
|
337
|
-
},
|
|
338
|
-
},
|
|
339
|
-
CustomerAddress: {
|
|
340
|
-
fields: {
|
|
341
|
-
street: {
|
|
342
|
-
// eslint-disable-next-line no-unused-vars
|
|
343
|
-
merge: (existing, incoming) => incoming,
|
|
344
|
-
},
|
|
345
|
-
},
|
|
346
|
-
},
|
|
347
|
-
CustomerPaymentTokens: {
|
|
348
|
-
keyFields: () => 'CustomerPaymentTokens',
|
|
349
|
-
fields: {
|
|
350
|
-
items: {
|
|
351
|
-
// eslint-disable-next-line no-unused-vars
|
|
352
|
-
merge: (existing, incoming) => incoming,
|
|
353
|
-
},
|
|
354
|
-
},
|
|
355
|
-
},
|
|
356
|
-
ProductImage: {
|
|
357
|
-
keyFields: ['url'],
|
|
358
|
-
},
|
|
359
|
-
SelectedConfigurableOption: {
|
|
360
|
-
// id alone is not enough to identify a selected option as it can refer
|
|
361
|
-
// to something like "size" where value_id refers to "large".
|
|
362
|
-
keyFields: ['id', 'value_id'],
|
|
363
|
-
},
|
|
364
|
-
SelectedPaymentMethod: {
|
|
365
|
-
keyFields: ['code'],
|
|
366
|
-
},
|
|
367
|
-
ShippingCartAddress: {
|
|
368
|
-
keyFields: ['street'],
|
|
369
|
-
fields: {
|
|
370
|
-
available_shipping_methods: {
|
|
371
|
-
merge: (existing = [], incoming, { readField, mergeObjects }) => {
|
|
372
|
-
// carrier_code + method_code makes these things unique
|
|
373
|
-
const mergeResult = new Set();
|
|
374
|
-
const carrierToIndex = new Map();
|
|
375
|
-
existing.forEach((existingShippingMethod, index) => {
|
|
376
|
-
// Use readField because it will follow cache references.
|
|
377
|
-
const carrierCode = readField('carrier_code', existingShippingMethod);
|
|
378
|
-
const methodCode = readField('method_code', existingShippingMethod);
|
|
379
|
-
const carrierKey = `${carrierCode}|${methodCode}`;
|
|
380
|
-
carrierToIndex.set(carrierKey, index);
|
|
381
|
-
});
|
|
382
|
-
incoming.forEach(incomingShippingMethod => {
|
|
383
|
-
// Use readField because it will follow cache references.
|
|
384
|
-
const carrierCode = readField('carrier_code', incomingShippingMethod);
|
|
385
|
-
const methodCode = readField('method_code', incomingShippingMethod);
|
|
386
|
-
const carrierKey = `${carrierCode}|${methodCode}`;
|
|
387
|
-
if (carrierToIndex.has(carrierKey)) {
|
|
388
|
-
const targetIndex = carrierToIndex.get(carrierKey);
|
|
389
|
-
const existingShippingMethod = existing[targetIndex];
|
|
390
|
-
const merged = mergeObjects(existingShippingMethod, incomingShippingMethod);
|
|
391
|
-
mergeResult.add(merged);
|
|
392
|
-
}
|
|
393
|
-
else {
|
|
394
|
-
// We do not have a method with this key yet, add it on to the end.
|
|
395
|
-
carrierToIndex.set(carrierKey, carrierToIndex.size);
|
|
396
|
-
mergeResult.add(incomingShippingMethod);
|
|
397
|
-
}
|
|
398
|
-
});
|
|
399
|
-
return Array.from(mergeResult);
|
|
400
|
-
},
|
|
401
|
-
},
|
|
402
|
-
country: {
|
|
403
|
-
merge: true,
|
|
404
|
-
},
|
|
405
|
-
region: {
|
|
406
|
-
merge: true,
|
|
407
|
-
},
|
|
408
|
-
selected_shipping_method: {
|
|
409
|
-
merge: true,
|
|
410
|
-
},
|
|
411
|
-
},
|
|
412
|
-
},
|
|
413
|
-
CategoryTree: {
|
|
414
|
-
fields: {
|
|
415
|
-
children: {
|
|
416
|
-
merge: (existing, incoming) => incoming,
|
|
417
|
-
},
|
|
418
|
-
},
|
|
419
|
-
},
|
|
420
|
-
Wishlist: {
|
|
421
|
-
keyFields: ({ id }) => `CustomerWishlist:${id}`,
|
|
422
|
-
},
|
|
423
|
-
WishlistItem: {
|
|
424
|
-
keyFields: ({ id }) => `CustomerWishlistItem:${id}`,
|
|
425
|
-
},
|
|
426
|
-
SimpleWishlistItem: {
|
|
427
|
-
keyFields: ({ id }) => `CustomerSimpleWishlistItem:${id}`,
|
|
428
|
-
},
|
|
429
|
-
VirtualWishlistItem: {
|
|
430
|
-
keyFields: ({ id }) => `CustomerVirtualWishlistItem:${id}`,
|
|
431
|
-
},
|
|
432
|
-
DownloadableWishlistItem: {
|
|
433
|
-
keyFields: ({ id }) => `CustomerDownloadableWishlistItem:${id}`,
|
|
434
|
-
},
|
|
435
|
-
BundleWishlistItem: {
|
|
436
|
-
keyFields: ({ id }) => `CustomerBundleWishlistItem:${id}`,
|
|
437
|
-
},
|
|
438
|
-
GroupedProductWishlistItem: {
|
|
439
|
-
keyFields: ({ id }) => `CustomerGroupedProductWishlistItem:${id}`,
|
|
440
|
-
},
|
|
441
|
-
ConfigurableWishlistItem: {
|
|
442
|
-
keyFields: ({ id }) => `CustomerConfigurableWishlistItem:${id}`,
|
|
443
|
-
},
|
|
444
|
-
GiftCardWishlistItem: {
|
|
445
|
-
keyFields: ({ id }) => `CustomerGiftCardWishlistItem:${id}`,
|
|
446
|
-
},
|
|
447
|
-
};
|
|
448
|
-
|
|
449
|
-
/**
|
|
450
|
-
* Interacts with the Apollo client.
|
|
451
|
-
*
|
|
452
|
-
* @inheritdoc
|
|
453
|
-
*/
|
|
454
|
-
class DaffDriverHttpClientCacheMagentoService {
|
|
455
|
-
constructor(platformId) {
|
|
456
|
-
this.platformId = platformId;
|
|
457
|
-
}
|
|
458
|
-
reset() {
|
|
459
|
-
if (isPlatformBrowser(this.platformId)) {
|
|
460
|
-
location.reload();
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
DaffDriverHttpClientCacheMagentoService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffDriverHttpClientCacheMagentoService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
465
|
-
DaffDriverHttpClientCacheMagentoService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffDriverHttpClientCacheMagentoService, providedIn: 'root' });
|
|
466
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffDriverHttpClientCacheMagentoService, decorators: [{
|
|
467
|
-
type: Injectable,
|
|
468
|
-
args: [{
|
|
469
|
-
providedIn: 'root',
|
|
470
|
-
}]
|
|
471
|
-
}], ctorParameters: function () {
|
|
472
|
-
return [{ type: undefined, decorators: [{
|
|
473
|
-
type: Inject,
|
|
474
|
-
args: [PLATFORM_ID]
|
|
475
|
-
}] }];
|
|
476
|
-
} });
|
|
477
|
-
|
|
478
|
-
function magentoPageInfoTransform(pageInfo) {
|
|
479
|
-
return {
|
|
480
|
-
pageSize: pageInfo.page_size,
|
|
481
|
-
currentPage: pageInfo.current_page,
|
|
482
|
-
totalPages: pageInfo.total_pages,
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
const magentoSearchResultPageInfoFragment = gql `
|
|
487
|
-
fragment magentoSearchResultPageInfo on SearchResultPageInfo {
|
|
488
|
-
page_size
|
|
489
|
-
current_page
|
|
490
|
-
total_pages
|
|
491
|
-
}
|
|
492
|
-
`;
|
|
493
|
-
|
|
494
|
-
const magentoMoneyFragment = gql `
|
|
495
|
-
fragment moneyFragment on Money {
|
|
496
|
-
value
|
|
497
|
-
currency
|
|
498
|
-
}
|
|
499
|
-
`;
|
|
500
|
-
|
|
501
|
-
class DaffDriverMagentoModule {
|
|
502
|
-
}
|
|
503
|
-
DaffDriverMagentoModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffDriverMagentoModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
504
|
-
DaffDriverMagentoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: DaffDriverMagentoModule });
|
|
505
|
-
DaffDriverMagentoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffDriverMagentoModule, providers: [
|
|
506
|
-
{
|
|
507
|
-
provide: DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE,
|
|
508
|
-
useExisting: DaffDriverHttpClientCacheMagentoService,
|
|
509
|
-
},
|
|
510
|
-
] });
|
|
511
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DaffDriverMagentoModule, decorators: [{
|
|
512
|
-
type: NgModule,
|
|
513
|
-
args: [{
|
|
514
|
-
providers: [
|
|
515
|
-
{
|
|
516
|
-
provide: DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE,
|
|
517
|
-
useExisting: DaffDriverHttpClientCacheMagentoService,
|
|
518
|
-
},
|
|
519
|
-
],
|
|
520
|
-
}]
|
|
521
|
-
}] });
|
|
522
|
-
|
|
523
|
-
/**
|
|
524
|
-
* Generated bundle index. Do not edit.
|
|
525
|
-
*/
|
|
526
|
-
|
|
527
|
-
export { DAFF_DRIVER_MAGENTO_ERROR_CODE, DAFF_DRIVER_MAGENTO_NETWORK_ERROR_CODE, DAFF_MAGENTO_2_4_3_TYPE_POLICIES, DAFF_MAGENTO_CACHEABLE_OPERATIONS, DaffDriverHttpClientCacheMagentoService, DaffDriverMagentoError, DaffDriverMagentoModule, DaffDriverMagentoNetworkError, DaffMagentoApolloCacheableOperationsLinkGenerator, daffMagentoTransformGraphQlError, daffTransformMagentoError, magentoMoneyFragment, magentoPageInfoTransform, magentoSearchResultPageInfoFragment, provideDaffMagentoCacheableOperation, provideManyDaffMagentoCacheableOperations, schema };
|
|
528
|
-
//# sourceMappingURL=daffodil-driver-magento.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-driver-magento.mjs","sources":["../../../libs/driver/magento/src/schema/schema.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/errors/network-error.class.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/transforms/responses/page-info.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 {\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\t super(message);\n }\n}\n","import { GraphQLError } 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: GraphQLError,\n map: T,\n): DaffError {\n const ErrorClass = map[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","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\n/**\n * @deprecated use {@link DaffDriverNetworkError} instead.\n */\nexport const DAFF_DRIVER_MAGENTO_NETWORK_ERROR_CODE = 'DAFF_DRIVER_MAGENTO_NETWORK_ERROR';\n\n/**\n * An error thrown when the Magento driver encountered a problem with network connectivity.\n *\n * @deprecated use {@link DaffDriverNetworkError} instead.\n */\nexport class DaffDriverMagentoNetworkError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_DRIVER_MAGENTO_NETWORK_ERROR_CODE;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import { InjectionToken } from '@angular/core';\n\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 */\nexport const DAFF_MAGENTO_CACHEABLE_OPERATIONS = new InjectionToken<string[]>('DAFF_MAGENTO_CACHEABLE_OPERATIONS', { factory: () => []});\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\n/**\n * Adds many operation names to the list of cacheable Magento operations. Use only with Angular 9+.\n */\nexport function provideManyDaffMagentoCacheableOperations(...operationNames: string[]) {\n return operationNames.map(name => ({\n provide: DAFF_MAGENTO_CACHEABLE_OPERATIONS,\n useValue: name,\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 // eslint-disable-next-line no-unused-vars\n merge: (existing, incoming) => incoming,\n },\n available_payment_methods: {\n // eslint-disable-next-line no-unused-vars\n merge: (existing, incoming) => incoming,\n },\n items: {\n // eslint-disable-next-line no-unused-vars\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 // eslint-disable-next-line no-unused-vars\n merge: (existing, incoming) => incoming,\n },\n },\n },\n CustomerPaymentTokens: {\n keyFields: () => 'CustomerPaymentTokens',\n fields: {\n items: {\n // eslint-disable-next-line no-unused-vars\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 { 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 { 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 { DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE } from '@daffodil/driver';\n\nimport { DaffDriverHttpClientCacheMagentoService } from './graphql/cache.service';\n\n@NgModule({\n providers: [\n {\n provide: DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE,\n useExisting: DaffDriverHttpClientCacheMagentoService,\n },\n ],\n})\nexport class DaffDriverMagentoModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAM,MAAM,GAAG;;ACGf,MAAM,8BAA8B,GAAG,4BAA4B;AAE1E;;AAEG;AACG,MAAO,sBAAuB,SAAQ,oBAAoB,CAAA;AAG9D,IAAA,WAAA,CAAY,OAAgB,EAAA;QAC3B,KAAK,CAAC,OAAO,CAAC,CAAC;AAHA,QAAA,IAAI,CAAA,IAAA,GAAW,8BAA8B,CAAC;KAI7D;AACF;;ACPe,SAAA,gCAAgC,CAC9C,KAAmB,EACnB,GAAM,EAAA;AAEN,IAAA,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,sBAAsB,CAAC;AAE5E,IAAA,OAAO,IAAI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AE,qCAAqC;AAC9C,4BAAA,WAAW,EAAE,uCAAuC;AACrD,yBAAA;AACF,qBAAA;iBACF,CAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-driver.mjs","sources":["../../../libs/driver/src/errors/codes.ts","../../../libs/driver/src/errors/bad-input.ts","../../../libs/driver/src/errors/network-error.class.ts","../../../libs/driver/src/http-client-cache/noop.service.ts","../../../libs/driver/src/http-client-cache/service.token.ts","../../../libs/driver/src/daffodil-driver.ts"],"sourcesContent":["export enum DaffDriverErrorCodes {\n BAD_INPUT = 'DAFF_BAD_INPUT'\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffDriverErrorCodes } from './codes';\n\nexport class DaffBadInputError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffDriverErrorCodes.BAD_INPUT;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_DRIVER_NETWORK_ERROR_CODE = 'DAFF_DRIVER_NETWORK_ERROR';\n\n/**\n * An error thrown when the a driver encounters a problem with network connectivity.\n */\nexport class DaffDriverNetworkError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_DRIVER_NETWORK_ERROR_CODE;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffDriverHttpClientCacheServiceInterface } from './service.type';\n\n/**\n * A noop service. Always does nothing for every single method.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffDriverHttpClientCacheNoopService implements DaffDriverHttpClientCacheServiceInterface {\n reset(): void {}\n}\n","import {\n InjectionToken,\n inject,\n} from '@angular/core';\n\nimport { DaffDriverHttpClientCacheNoopService } from './noop.service';\nimport { DaffDriverHttpClientCacheServiceInterface } from './service.type';\n\nexport const DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE = new InjectionToken<DaffDriverHttpClientCacheServiceInterface>('DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE', { factory: () => inject(DaffDriverHttpClientCacheNoopService) });\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAY,IAAA,qBAEX;AAFD,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,WAAA,CAAA,GAAA,gBAA4B,CAAA;AAC9B,CAAC,EAFW,oBAAoB,KAApB,oBAAoB,GAE/B,EAAA,CAAA,CAAA;;ACKK,MAAO,iBAAkB,SAAQ,oBAAoB,CAAA;AAGzD,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;AADE,QAAA,IAAO,CAAA,OAAA,GAAP,OAAO,CAAQ;AAFlB,QAAA,IAAA,CAAA,IAAI,GAAW,oBAAoB,CAAC,SAAS,CAAC;KAI7D;AACF;;ACRM,MAAM,8BAA8B,GAAG,4BAA4B;AAE1E;;AAEG;AACG,MAAO,sBAAuB,SAAQ,oBAAoB,CAAA;AAG9D,IAAA,WAAA,CAAY,OAAgB,EAAA;QAC3B,KAAK,CAAC,OAAO,CAAC,CAAC;AAHA,QAAA,IAAI,CAAA,IAAA,GAAW,8BAA8B,CAAC;KAI7D;AACF;;ACZD;;;;AAIG;MAIU,oCAAoC,CAAA;AAC/C,IAAA,KAAK,MAAW;;iIADL,oCAAoC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAApC,oCAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oCAAoC,cAFnC,MAAM,EAAA,CAAA,CAAA;2FAEP,oCAAoC,EAAA,UAAA,EAAA,CAAA;kBAHhD,UAAU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