@daffodil/driver 0.57.0 → 0.58.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/http-client-cache/noop.service.mjs +19 -0
- package/esm2020/http-client-cache/public_api.mjs +4 -0
- package/esm2020/http-client-cache/service.token.mjs +4 -0
- package/esm2020/http-client-cache/service.type.mjs +2 -0
- package/esm2020/magento/graphql/cache.service.mjs +30 -0
- package/esm2020/magento/graphql/public_api.mjs +2 -1
- package/esm2020/magento/magento.module.mjs +26 -0
- package/esm2020/magento/public_api.mjs +2 -1
- package/esm2020/public_api.mjs +2 -1
- package/fesm2015/daffodil-driver-magento.mjs +55 -2
- package/fesm2015/daffodil-driver-magento.mjs.map +1 -1
- package/fesm2015/daffodil-driver.mjs +22 -1
- package/fesm2015/daffodil-driver.mjs.map +1 -1
- package/fesm2020/daffodil-driver-magento.mjs +53 -2
- package/fesm2020/daffodil-driver-magento.mjs.map +1 -1
- package/fesm2020/daffodil-driver.mjs +22 -1
- package/fesm2020/daffodil-driver.mjs.map +1 -1
- package/http-client-cache/noop.service.d.ts +12 -0
- package/http-client-cache/public_api.d.ts +3 -0
- package/http-client-cache/service.token.d.ts +3 -0
- package/http-client-cache/service.type.d.ts +10 -0
- package/magento/graphql/cache.service.d.ts +14 -0
- package/magento/graphql/public_api.d.ts +1 -0
- package/magento/magento.module.d.ts +6 -0
- package/magento/public_api.d.ts +1 -0
- package/package.json +1 -1
- package/public_api.d.ts +1 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* A noop service. Always does nothing for every single method.
|
|
5
|
+
*
|
|
6
|
+
* @inheritdoc
|
|
7
|
+
*/
|
|
8
|
+
export class DaffDriverHttpClientCacheNoopService {
|
|
9
|
+
reset() { }
|
|
10
|
+
}
|
|
11
|
+
DaffDriverHttpClientCacheNoopService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverHttpClientCacheNoopService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
12
|
+
DaffDriverHttpClientCacheNoopService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverHttpClientCacheNoopService, providedIn: 'root' });
|
|
13
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverHttpClientCacheNoopService, decorators: [{
|
|
14
|
+
type: Injectable,
|
|
15
|
+
args: [{
|
|
16
|
+
providedIn: 'root',
|
|
17
|
+
}]
|
|
18
|
+
}] });
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9vcC5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vbGlicy9kcml2ZXIvc3JjL2h0dHAtY2xpZW50LWNhY2hlL25vb3Auc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDOztBQUkzQzs7OztHQUlHO0FBSUgsTUFBTSxPQUFPLG9DQUFvQztJQUMvQyxLQUFLLEtBQVUsQ0FBQzs7aUlBREwsb0NBQW9DO3FJQUFwQyxvQ0FBb0MsY0FGbkMsTUFBTTsyRkFFUCxvQ0FBb0M7a0JBSGhELFVBQVU7bUJBQUM7b0JBQ1YsVUFBVSxFQUFFLE1BQU07aUJBQ25CIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgSW5qZWN0YWJsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG5pbXBvcnQgeyBEYWZmRHJpdmVySHR0cENsaWVudENhY2hlU2VydmljZUludGVyZmFjZSB9IGZyb20gJy4vc2VydmljZS50eXBlJztcblxuLyoqXG4gKiBBIG5vb3Agc2VydmljZS4gQWx3YXlzIGRvZXMgbm90aGluZyBmb3IgZXZlcnkgc2luZ2xlIG1ldGhvZC5cbiAqXG4gKiBAaW5oZXJpdGRvY1xuICovXG5ASW5qZWN0YWJsZSh7XG4gIHByb3ZpZGVkSW46ICdyb290Jyxcbn0pXG5leHBvcnQgY2xhc3MgRGFmZkRyaXZlckh0dHBDbGllbnRDYWNoZU5vb3BTZXJ2aWNlIGltcGxlbWVudHMgRGFmZkRyaXZlckh0dHBDbGllbnRDYWNoZVNlcnZpY2VJbnRlcmZhY2Uge1xuICByZXNldCgpOiB2b2lkIHt9XG59XG4iXX0=
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export * from './noop.service';
|
|
2
|
+
export * from './service.token';
|
|
3
|
+
export * from './service.type';
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYnMvZHJpdmVyL3NyYy9odHRwLWNsaWVudC1jYWNoZS9wdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsZ0JBQWdCLENBQUM7QUFDL0IsY0FBYyxpQkFBaUIsQ0FBQztBQUNoQyxjQUFjLGdCQUFnQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9ub29wLnNlcnZpY2UnO1xuZXhwb3J0ICogZnJvbSAnLi9zZXJ2aWNlLnRva2VuJztcbmV4cG9ydCAqIGZyb20gJy4vc2VydmljZS50eXBlJztcbiJdfQ==
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InjectionToken, inject, } from '@angular/core';
|
|
2
|
+
import { DaffDriverHttpClientCacheNoopService } from './noop.service';
|
|
3
|
+
export const DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE = new InjectionToken('DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE', { factory: () => inject(DaffDriverHttpClientCacheNoopService) });
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmljZS50b2tlbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYnMvZHJpdmVyL3NyYy9odHRwLWNsaWVudC1jYWNoZS9zZXJ2aWNlLnRva2VuLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxjQUFjLEVBQ2QsTUFBTSxHQUNQLE1BQU0sZUFBZSxDQUFDO0FBRXZCLE9BQU8sRUFBRSxvQ0FBb0MsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBR3RFLE1BQU0sQ0FBQyxNQUFNLHFDQUFxQyxHQUFHLElBQUksY0FBYyxDQUE0Qyx1Q0FBdUMsRUFBRSxFQUFFLE9BQU8sRUFBRSxHQUFHLEVBQUUsQ0FBQyxNQUFNLENBQUMsb0NBQW9DLENBQUMsRUFBRSxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge1xuICBJbmplY3Rpb25Ub2tlbixcbiAgaW5qZWN0LFxufSBmcm9tICdAYW5ndWxhci9jb3JlJztcblxuaW1wb3J0IHsgRGFmZkRyaXZlckh0dHBDbGllbnRDYWNoZU5vb3BTZXJ2aWNlIH0gZnJvbSAnLi9ub29wLnNlcnZpY2UnO1xuaW1wb3J0IHsgRGFmZkRyaXZlckh0dHBDbGllbnRDYWNoZVNlcnZpY2VJbnRlcmZhY2UgfSBmcm9tICcuL3NlcnZpY2UudHlwZSc7XG5cbmV4cG9ydCBjb25zdCBEQUZGX0RSSVZFUl9IVFRQX0NMSUVOVF9DQUNIRV9TRVJWSUNFID0gbmV3IEluamVjdGlvblRva2VuPERhZmZEcml2ZXJIdHRwQ2xpZW50Q2FjaGVTZXJ2aWNlSW50ZXJmYWNlPignREFGRl9EUklWRVJfSFRUUF9DTElFTlRfQ0FDSEVfU0VSVklDRScsIHsgZmFjdG9yeTogKCkgPT4gaW5qZWN0KERhZmZEcml2ZXJIdHRwQ2xpZW50Q2FjaGVOb29wU2VydmljZSkgfSk7XG4iXX0=
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmljZS50eXBlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vbGlicy9kcml2ZXIvc3JjL2h0dHAtY2xpZW50LWNhY2hlL3NlcnZpY2UudHlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBBIHNlcnZpY2UgZm9yIGludGVyYWN0aW5nIHdpdGggdGhlIHJlcXVlc3QgY2FjaGUgb2YgdGhlIEhUVFAgY2xpZW50IGN1cnJlbnRseSBpbiB1c2UuXG4gKiBUaGlzIGhhcyBub3RoaW5nIHRvIGRvIHdpdGggbG9jYWwgc3RvcmFnZSBvciBhbnkga2luZCBvZiBwZXJzaXN0ZW50IGNsaWVudCBkYXRhLlxuICovXG5leHBvcnQgaW50ZXJmYWNlIERhZmZEcml2ZXJIdHRwQ2xpZW50Q2FjaGVTZXJ2aWNlSW50ZXJmYWNlIHtcbiAgLyoqXG4gICAqIFJlc2V0cyB0aGUgY2xpZW50J3MgY2FjaGUgc3RvcmUgdG8gdGhlIGluaXRpYWwgc3RhdGUuXG4gICAqL1xuICByZXNldCgpOiB2b2lkO1xufVxuIl19
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
2
|
+
import { Inject, Injectable, PLATFORM_ID, } from '@angular/core';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Interacts with the Apollo client.
|
|
6
|
+
*
|
|
7
|
+
* @inheritdoc
|
|
8
|
+
*/
|
|
9
|
+
export class DaffDriverHttpClientCacheMagentoService {
|
|
10
|
+
constructor(platformId) {
|
|
11
|
+
this.platformId = platformId;
|
|
12
|
+
}
|
|
13
|
+
reset() {
|
|
14
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
15
|
+
location.reload();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
DaffDriverHttpClientCacheMagentoService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverHttpClientCacheMagentoService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
20
|
+
DaffDriverHttpClientCacheMagentoService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverHttpClientCacheMagentoService, providedIn: 'root' });
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverHttpClientCacheMagentoService, decorators: [{
|
|
22
|
+
type: Injectable,
|
|
23
|
+
args: [{
|
|
24
|
+
providedIn: 'root',
|
|
25
|
+
}]
|
|
26
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
27
|
+
type: Inject,
|
|
28
|
+
args: [PLATFORM_ID]
|
|
29
|
+
}] }]; } });
|
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvZHJpdmVyL21hZ2VudG8vc3JjL2dyYXBocWwvY2FjaGUuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFB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dHRwQ2xpZW50Q2FjaGVNYWdlbnRvU2VydmljZSBpbXBsZW1lbnRzIERhZmZEcml2ZXJIdHRwQ2xpZW50Q2FjaGVTZXJ2aWNlSW50ZXJmYWNlIHtcbiAgY29uc3RydWN0b3IoXG4gICAgQEluamVjdChQTEFURk9STV9JRCkgcHJpdmF0ZSBwbGF0Zm9ybUlkOiBzdHJpbmcsXG4gICkge31cblxuICByZXNldCgpOiB2b2lkIHtcbiAgICBpZiAoaXNQbGF0Zm9ybUJyb3dzZXIodGhpcy5wbGF0Zm9ybUlkKSkge1xuICAgICAgbG9jYXRpb24ucmVsb2FkKCk7XG4gICAgfVxuICB9XG59XG4iXX0=
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { DaffMagentoApolloCacheableOperationsLinkGenerator } from './cacheable-operations/apollo-cacheable-operations-link-generator';
|
|
2
2
|
export * from './cacheable-operations/cacheable-operations-token';
|
|
3
3
|
export * from './type-policies';
|
|
4
|
-
|
|
4
|
+
export * from './cache.service';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvZHJpdmVyL21hZ2VudG8vc3JjL2dyYXBocWwvcHVibGljX2FwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsaURBQWlELEVBQUUsTUFBTSxtRUFBbUUsQ0FBQztBQUN0SSxjQUFjLG1EQUFtRCxDQUFDO0FBQ2xFLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyxpQkFBaUIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB7IERhZmZNYWdlbnRvQXBvbGxvQ2FjaGVhYmxlT3BlcmF0aW9uc0xpbmtHZW5lcmF0b3IgfSBmcm9tICcuL2NhY2hlYWJsZS1vcGVyYXRpb25zL2Fwb2xsby1jYWNoZWFibGUtb3BlcmF0aW9ucy1saW5rLWdlbmVyYXRvcic7XG5leHBvcnQgKiBmcm9tICcuL2NhY2hlYWJsZS1vcGVyYXRpb25zL2NhY2hlYWJsZS1vcGVyYXRpb25zLXRva2VuJztcbmV4cG9ydCAqIGZyb20gJy4vdHlwZS1wb2xpY2llcyc7XG5leHBvcnQgKiBmcm9tICcuL2NhY2hlLnNlcnZpY2UnO1xuIl19
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE } from '@daffodil/driver';
|
|
3
|
+
import { DaffDriverHttpClientCacheMagentoService } from './graphql/cache.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export class DaffDriverMagentoModule {
|
|
6
|
+
}
|
|
7
|
+
DaffDriverMagentoModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverMagentoModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
8
|
+
DaffDriverMagentoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverMagentoModule });
|
|
9
|
+
DaffDriverMagentoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverMagentoModule, providers: [
|
|
10
|
+
{
|
|
11
|
+
provide: DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE,
|
|
12
|
+
useExisting: DaffDriverHttpClientCacheMagentoService,
|
|
13
|
+
},
|
|
14
|
+
] });
|
|
15
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverMagentoModule, decorators: [{
|
|
16
|
+
type: NgModule,
|
|
17
|
+
args: [{
|
|
18
|
+
providers: [
|
|
19
|
+
{
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HJpdmVyJztcblxuaW1wb3J0IHsgRGFmZkRyaXZlckh0dHBDbGllbnRDYWNoZU1hZ2VudG9TZXJ2aWNlIH0gZnJvbSAnLi9ncmFwaHFsL2NhY2hlLnNlcnZpY2UnO1xuXG5ATmdNb2R1bGUoe1xuICBwcm92aWRlcnM6IFtcbiAgICB7XG4gICAgICBwcm92aWRlOiBEQUZGX0RSSVZFUl9IVFRQX0NMSUVOVF9DQUNIRV9TRVJWSUNFLFxuICAgICAgdXNlRXhpc3Rpbmc6IERhZmZEcml2ZXJIdHRwQ2xpZW50Q2FjaGVNYWdlbnRvU2VydmljZSxcbiAgICB9LFxuICBdLFxufSlcbmV4cG9ydCBjbGFzcyBEYWZmRHJpdmVyTWFnZW50b01vZHVsZSB7fVxuIl19
|
|
@@ -4,4 +4,5 @@ export * from './models/public_api';
|
|
|
4
4
|
export * from './graphql/public_api';
|
|
5
5
|
export * from './transforms/public_api';
|
|
6
6
|
export * from './fragments/public_api';
|
|
7
|
-
|
|
7
|
+
export * from './magento.module';
|
|
8
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYnMvZHJpdmVyL21hZ2VudG8vc3JjL3B1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE1BQU0sRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBRXpDLGNBQWMscUJBQXFCLENBQUM7QUFDcEMsY0FBYyxxQkFBcUIsQ0FBQztBQUNwQyxjQUFjLHNCQUFzQixDQUFDO0FBQ3JDLGNBQWMseUJBQXlCLENBQUM7QUFDeEMsY0FBYyx3QkFBd0IsQ0FBQztBQUN2QyxjQUFjLGtCQUFrQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgc2NoZW1hIH0gZnJvbSAnLi9zY2hlbWEvc2NoZW1hJztcblxuZXhwb3J0ICogZnJvbSAnLi9lcnJvcnMvcHVibGljX2FwaSc7XG5leHBvcnQgKiBmcm9tICcuL21vZGVscy9wdWJsaWNfYXBpJztcbmV4cG9ydCAqIGZyb20gJy4vZ3JhcGhxbC9wdWJsaWNfYXBpJztcbmV4cG9ydCAqIGZyb20gJy4vdHJhbnNmb3Jtcy9wdWJsaWNfYXBpJztcbmV4cG9ydCAqIGZyb20gJy4vZnJhZ21lbnRzL3B1YmxpY19hcGknO1xuZXhwb3J0ICogZnJvbSAnLi9tYWdlbnRvLm1vZHVsZSc7XG4iXX0=
|
package/esm2020/public_api.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export * from './errors/public_api';
|
|
2
2
|
export * from './models/public_api';
|
|
3
|
-
|
|
3
|
+
export * from './http-client-cache/public_api';
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYnMvZHJpdmVyL3NyYy9wdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMscUJBQXFCLENBQUM7QUFDcEMsY0FBYyxxQkFBcUIsQ0FBQztBQUNwQyxjQUFjLGdDQUFnQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9lcnJvcnMvcHVibGljX2FwaSc7XG5leHBvcnQgKiBmcm9tICcuL21vZGVscy9wdWJsaWNfYXBpJztcbmV4cG9ydCAqIGZyb20gJy4vaHR0cC1jbGllbnQtY2FjaGUvcHVibGljX2FwaSc7XG4iXX0=
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { DaffInheritableError, daffIsError } from '@daffodil/core';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken, Injectable, Inject } from '@angular/core';
|
|
3
|
+
import { InjectionToken, Injectable, Inject, PLATFORM_ID, NgModule } from '@angular/core';
|
|
4
4
|
import { ApolloLink } from '@apollo/client/core';
|
|
5
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
5
6
|
import { gql } from 'apollo-angular';
|
|
7
|
+
import { DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE } from '@daffodil/driver';
|
|
6
8
|
|
|
7
9
|
var possibleTypes = {
|
|
8
10
|
CartAddressInterface: [
|
|
@@ -439,6 +441,35 @@ const DAFF_MAGENTO_2_4_3_TYPE_POLICIES = {
|
|
|
439
441
|
},
|
|
440
442
|
};
|
|
441
443
|
|
|
444
|
+
/**
|
|
445
|
+
* Interacts with the Apollo client.
|
|
446
|
+
*
|
|
447
|
+
* @inheritdoc
|
|
448
|
+
*/
|
|
449
|
+
class DaffDriverHttpClientCacheMagentoService {
|
|
450
|
+
constructor(platformId) {
|
|
451
|
+
this.platformId = platformId;
|
|
452
|
+
}
|
|
453
|
+
reset() {
|
|
454
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
455
|
+
location.reload();
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
DaffDriverHttpClientCacheMagentoService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverHttpClientCacheMagentoService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
460
|
+
DaffDriverHttpClientCacheMagentoService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverHttpClientCacheMagentoService, providedIn: 'root' });
|
|
461
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverHttpClientCacheMagentoService, decorators: [{
|
|
462
|
+
type: Injectable,
|
|
463
|
+
args: [{
|
|
464
|
+
providedIn: 'root',
|
|
465
|
+
}]
|
|
466
|
+
}], ctorParameters: function () {
|
|
467
|
+
return [{ type: undefined, decorators: [{
|
|
468
|
+
type: Inject,
|
|
469
|
+
args: [PLATFORM_ID]
|
|
470
|
+
}] }];
|
|
471
|
+
} });
|
|
472
|
+
|
|
442
473
|
function magentoPageInfoTransform(pageInfo) {
|
|
443
474
|
return {
|
|
444
475
|
pageSize: pageInfo.page_size,
|
|
@@ -462,9 +493,31 @@ const magentoMoneyFragment = gql `
|
|
|
462
493
|
}
|
|
463
494
|
`;
|
|
464
495
|
|
|
496
|
+
class DaffDriverMagentoModule {
|
|
497
|
+
}
|
|
498
|
+
DaffDriverMagentoModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverMagentoModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
499
|
+
DaffDriverMagentoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverMagentoModule });
|
|
500
|
+
DaffDriverMagentoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverMagentoModule, providers: [
|
|
501
|
+
{
|
|
502
|
+
provide: DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE,
|
|
503
|
+
useExisting: DaffDriverHttpClientCacheMagentoService,
|
|
504
|
+
},
|
|
505
|
+
] });
|
|
506
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverMagentoModule, decorators: [{
|
|
507
|
+
type: NgModule,
|
|
508
|
+
args: [{
|
|
509
|
+
providers: [
|
|
510
|
+
{
|
|
511
|
+
provide: DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE,
|
|
512
|
+
useExisting: DaffDriverHttpClientCacheMagentoService,
|
|
513
|
+
},
|
|
514
|
+
],
|
|
515
|
+
}]
|
|
516
|
+
}] });
|
|
517
|
+
|
|
465
518
|
/**
|
|
466
519
|
* Generated bundle index. Do not edit.
|
|
467
520
|
*/
|
|
468
521
|
|
|
469
|
-
export { DAFF_DRIVER_MAGENTO_ERROR_CODE, DAFF_DRIVER_MAGENTO_NETWORK_ERROR_CODE, DAFF_MAGENTO_2_4_3_TYPE_POLICIES, DAFF_MAGENTO_CACHEABLE_OPERATIONS, DaffDriverMagentoError, DaffDriverMagentoNetworkError, DaffMagentoApolloCacheableOperationsLinkGenerator, daffMagentoTransformGraphQlError, daffTransformMagentoError, magentoMoneyFragment, magentoPageInfoTransform, magentoSearchResultPageInfoFragment, provideDaffMagentoCacheableOperation, provideManyDaffMagentoCacheableOperations, schema };
|
|
522
|
+
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 };
|
|
470
523
|
//# sourceMappingURL=daffodil-driver-magento.mjs.map
|
|
@@ -1 +1 @@
|
|
|
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/network-error.class.ts","../../../libs/driver/magento/src/errors/transform-graphql.ts","../../../libs/driver/magento/src/errors/transform.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/transforms/responses/page-info.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 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 {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\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 */\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 { 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';\n\nimport { DaffDriverMagentoError } from './error.class';\nimport { DaffDriverMagentoNetworkError } from './network-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 DaffDriverMagentoNetworkError((<ApolloError>error).networkError.message);\n } else if (daffIsError(error)) {\n return error;\n } else {\n return new DaffDriverMagentoError(error.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 { 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","/**\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;;ACXM,MAAM,sCAAsC,GAAG,oCAAoC;AAE1F;;AAEG;AACG,MAAO,6BAA8B,SAAQ,oBAAoB,CAAA;AAGrE,IAAA,WAAA,CAAY,OAAgB,EAAA;QAC3B,KAAK,CAAC,OAAO,CAAC,CAAC;AAHA,QAAA,IAAI,CAAA,IAAA,GAAW,sC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AAA,EAAE,CAAE,CAAA;AAC3D,KAAA;AACD,IAAA,wBAAwB,EAAE;QACxB,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,CAAoC,iCAAA,EAAA,EAAE,CAAE,CAAA;AAChE,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,CAA8B,2BAAA,EAAA,EAAE,CAAE,CAAA;AAC1D,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,CAAsC,mCAAA,EAAA,EAAE,CAAE,CAAA;AAClE,KAAA;AACD,IAAA,wBAAwB,EAAE;QACxB,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,CAAoC,iCAAA,EAAA,EAAE,CAAE,CAAA;AAChE,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,CAAgC,6BAAA,EAAA,EAAE,CAAE,CAAA;AAC5D,KAAA;;;AC9PG,SAAU,wBAAwB,CAAC,QAAqC,EAAA;IAC5E,OAAO;QACL,QAAQ,EAAE,QAAQ,CAAC,SAAS;QAC5B,WAAW,EAAE,QAAQ,CAAC,YAAY;QAClC,UAAU,EAAE,QAAQ,CAAC,WAAW;KACjC,CAAC;AACJ;;ACRO,MAAM,mCAAmC,GAAG,GAAG,CAAA,CAAA;;;;;;;;ACA/C,MAAM,oBAAoB,GAAG,GAAG,CAAA,CAAA;;;;;;;ACFvC;;AAEG;;;;"}
|
|
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/network-error.class.ts","../../../libs/driver/magento/src/errors/transform-graphql.ts","../../../libs/driver/magento/src/errors/transform.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 {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\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 */\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 { 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';\n\nimport { DaffDriverMagentoError } from './error.class';\nimport { DaffDriverMagentoNetworkError } from './network-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 DaffDriverMagentoNetworkError((<ApolloError>error).networkError.message);\n } else if (daffIsError(error)) {\n return error;\n } else {\n return new DaffDriverMagentoError(error.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;;ACXM,MAAM,sCAAsC,GAAG,oCAAoC;AAE1F;;AAEG;AACG,MAAO,6BAA8B,SAAQ,oBAAoB,CAAA;AAGrE,IAAA,WAAA,CAAY,OAAgB,EAAA;QAC3B,KAAK,CAAC,OAAO,CAAC,CAAC;AAHA,QAAA,IAAI,CAAA,IAAA,GAAW,sCAAsC,CAAC;KAIrE;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,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAE;AACxC,CAAC;AAAA;;ACJD;;AAEG;AACH;AACgB,SAAA,yBAAyB,CAA6B,KAAU,EAAE,GAAM,EAAA;;IACtF,IAAI,CAAA,MAAA,KAAK,CAAC,aAAa,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,MAAM,IAAG,CAAC,EAAE;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;;ACRO,MAAM,mCAAmC,GAAG,GAAG,CAAA,CAAA;;;;;;;;ACA/C,MAAM,oBAAoB,GAAG,GAAG,CAAA,CAAA;;;;;;;MCY1B,uBAAuB,CAAA;;oHAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;qHAAvB,uBAAuB,EAAA,CAAA,CAAA;AAAvB,uBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,EAPvB,SAAA,EAAA;AACT,QAAA;AACE,YAAA,OAAO,EAAE,qCAAqC;AAC9C,YAAA,WAAW,EAAE,uCAAuC;AACrD,SAAA;AACF,KAAA,EAAA,CAAA,CAAA;2FAEU,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBARnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,qCAAqC;AAC9C,4BAAA,WAAW,EAAE,uCAAuC;AACrD,yBAAA;AACF,qBAAA;iBACF,CAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { DaffInheritableError } from '@daffodil/core';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Injectable, InjectionToken, inject } from '@angular/core';
|
|
2
4
|
|
|
3
5
|
var DaffDriverErrorCodes;
|
|
4
6
|
(function (DaffDriverErrorCodes) {
|
|
@@ -13,9 +15,28 @@ class DaffBadInputError extends DaffInheritableError {
|
|
|
13
15
|
}
|
|
14
16
|
}
|
|
15
17
|
|
|
18
|
+
/**
|
|
19
|
+
* A noop service. Always does nothing for every single method.
|
|
20
|
+
*
|
|
21
|
+
* @inheritdoc
|
|
22
|
+
*/
|
|
23
|
+
class DaffDriverHttpClientCacheNoopService {
|
|
24
|
+
reset() { }
|
|
25
|
+
}
|
|
26
|
+
DaffDriverHttpClientCacheNoopService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverHttpClientCacheNoopService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
27
|
+
DaffDriverHttpClientCacheNoopService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverHttpClientCacheNoopService, providedIn: 'root' });
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverHttpClientCacheNoopService, decorators: [{
|
|
29
|
+
type: Injectable,
|
|
30
|
+
args: [{
|
|
31
|
+
providedIn: 'root',
|
|
32
|
+
}]
|
|
33
|
+
}] });
|
|
34
|
+
|
|
35
|
+
const DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE = new InjectionToken('DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE', { factory: () => inject(DaffDriverHttpClientCacheNoopService) });
|
|
36
|
+
|
|
16
37
|
/**
|
|
17
38
|
* Generated bundle index. Do not edit.
|
|
18
39
|
*/
|
|
19
40
|
|
|
20
|
-
export { DaffBadInputError, DaffDriverErrorCodes };
|
|
41
|
+
export { DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE, DaffBadInputError, DaffDriverErrorCodes, DaffDriverHttpClientCacheNoopService };
|
|
21
42
|
//# sourceMappingURL=daffodil-driver.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-driver.mjs","sources":["../../../libs/driver/src/errors/codes.ts","../../../libs/driver/src/errors/bad-input.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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"daffodil-driver.mjs","sources":["../../../libs/driver/src/errors/codes.ts","../../../libs/driver/src/errors/bad-input.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 { 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;;ACTD;;;;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;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;iBACnB,CAAA;;;MCHY,qCAAqC,GAAG,IAAI,cAAc,CAA4C,uCAAuC,EAAE,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC,oCAAoC,CAAC,EAAE;;ACR3N;;AAEG;;;;"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { DaffInheritableError, daffIsError } from '@daffodil/core';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken, Injectable, Inject } from '@angular/core';
|
|
3
|
+
import { InjectionToken, Injectable, Inject, PLATFORM_ID, NgModule } from '@angular/core';
|
|
4
4
|
import { ApolloLink } from '@apollo/client/core';
|
|
5
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
5
6
|
import { gql } from 'apollo-angular';
|
|
7
|
+
import { DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE } from '@daffodil/driver';
|
|
6
8
|
|
|
7
9
|
var possibleTypes = {
|
|
8
10
|
CartAddressInterface: [
|
|
@@ -435,6 +437,33 @@ const DAFF_MAGENTO_2_4_3_TYPE_POLICIES = {
|
|
|
435
437
|
},
|
|
436
438
|
};
|
|
437
439
|
|
|
440
|
+
/**
|
|
441
|
+
* Interacts with the Apollo client.
|
|
442
|
+
*
|
|
443
|
+
* @inheritdoc
|
|
444
|
+
*/
|
|
445
|
+
class DaffDriverHttpClientCacheMagentoService {
|
|
446
|
+
constructor(platformId) {
|
|
447
|
+
this.platformId = platformId;
|
|
448
|
+
}
|
|
449
|
+
reset() {
|
|
450
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
451
|
+
location.reload();
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
DaffDriverHttpClientCacheMagentoService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverHttpClientCacheMagentoService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
456
|
+
DaffDriverHttpClientCacheMagentoService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverHttpClientCacheMagentoService, providedIn: 'root' });
|
|
457
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverHttpClientCacheMagentoService, decorators: [{
|
|
458
|
+
type: Injectable,
|
|
459
|
+
args: [{
|
|
460
|
+
providedIn: 'root',
|
|
461
|
+
}]
|
|
462
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
463
|
+
type: Inject,
|
|
464
|
+
args: [PLATFORM_ID]
|
|
465
|
+
}] }]; } });
|
|
466
|
+
|
|
438
467
|
function magentoPageInfoTransform(pageInfo) {
|
|
439
468
|
return {
|
|
440
469
|
pageSize: pageInfo.page_size,
|
|
@@ -458,9 +487,31 @@ const magentoMoneyFragment = gql `
|
|
|
458
487
|
}
|
|
459
488
|
`;
|
|
460
489
|
|
|
490
|
+
class DaffDriverMagentoModule {
|
|
491
|
+
}
|
|
492
|
+
DaffDriverMagentoModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverMagentoModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
493
|
+
DaffDriverMagentoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverMagentoModule });
|
|
494
|
+
DaffDriverMagentoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverMagentoModule, providers: [
|
|
495
|
+
{
|
|
496
|
+
provide: DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE,
|
|
497
|
+
useExisting: DaffDriverHttpClientCacheMagentoService,
|
|
498
|
+
},
|
|
499
|
+
] });
|
|
500
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverMagentoModule, decorators: [{
|
|
501
|
+
type: NgModule,
|
|
502
|
+
args: [{
|
|
503
|
+
providers: [
|
|
504
|
+
{
|
|
505
|
+
provide: DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE,
|
|
506
|
+
useExisting: DaffDriverHttpClientCacheMagentoService,
|
|
507
|
+
},
|
|
508
|
+
],
|
|
509
|
+
}]
|
|
510
|
+
}] });
|
|
511
|
+
|
|
461
512
|
/**
|
|
462
513
|
* Generated bundle index. Do not edit.
|
|
463
514
|
*/
|
|
464
515
|
|
|
465
|
-
export { DAFF_DRIVER_MAGENTO_ERROR_CODE, DAFF_DRIVER_MAGENTO_NETWORK_ERROR_CODE, DAFF_MAGENTO_2_4_3_TYPE_POLICIES, DAFF_MAGENTO_CACHEABLE_OPERATIONS, DaffDriverMagentoError, DaffDriverMagentoNetworkError, DaffMagentoApolloCacheableOperationsLinkGenerator, daffMagentoTransformGraphQlError, daffTransformMagentoError, magentoMoneyFragment, magentoPageInfoTransform, magentoSearchResultPageInfoFragment, provideDaffMagentoCacheableOperation, provideManyDaffMagentoCacheableOperations, schema };
|
|
516
|
+
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 };
|
|
466
517
|
//# sourceMappingURL=daffodil-driver-magento.mjs.map
|
|
@@ -1 +1 @@
|
|
|
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/network-error.class.ts","../../../libs/driver/magento/src/errors/transform-graphql.ts","../../../libs/driver/magento/src/errors/transform.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/transforms/responses/page-info.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 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 {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\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 */\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 { 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';\n\nimport { DaffDriverMagentoError } from './error.class';\nimport { DaffDriverMagentoNetworkError } from './network-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 DaffDriverMagentoNetworkError((<ApolloError>error).networkError.message);\n } else if (daffIsError(error)) {\n return error;\n } else {\n return new DaffDriverMagentoError(error.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 { 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","/**\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;QAHA,IAAI,CAAA,IAAA,GAAW,8BAA8B,CAAC;KAI7D;AACF;;ACXM,MAAM,sCAAsC,GAAG,oCAAoC;AAE1F;;AAEG;AACG,MAAO,6BAA8B,SAAQ,oBAAoB,CAAA;AAGrE,IAAA,WAAA,CAAY,OAAgB,EAAA;QAC3B,KAAK,CAAC,OAAO,CAAC,CAAC;QAHA,IAAI,CAAA,IAAA,GAAW,sCAAsC,CAAC;KAIrE;AACF;;ACPe,SAAA,gCAAgC,CAC9C,KAAmB,EACnB,GAAM,EAAA;AAEN,IAAA,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC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,CAAE,CAAA;AAC1D,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,CAAsC,mCAAA,EAAA,EAAE,CAAE,CAAA;AAClE,KAAA;AACD,IAAA,wBAAwB,EAAE;QACxB,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,CAAoC,iCAAA,EAAA,EAAE,CAAE,CAAA;AAChE,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,CAAgC,6BAAA,EAAA,EAAE,CAAE,CAAA;AAC5D,KAAA;;;AC9PG,SAAU,wBAAwB,CAAC,QAAqC,EAAA;IAC5E,OAAO;QACL,QAAQ,EAAE,QAAQ,CAAC,SAAS;QAC5B,WAAW,EAAE,QAAQ,CAAC,YAAY;QAClC,UAAU,EAAE,QAAQ,CAAC,WAAW;KACjC,CAAC;AACJ;;ACRO,MAAM,mCAAmC,GAAG,GAAG,CAAA,CAAA;;;;;;;;ACA/C,MAAM,oBAAoB,GAAG,GAAG,CAAA,CAAA;;;;;;;ACFvC;;AAEG;;;;"}
|
|
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/network-error.class.ts","../../../libs/driver/magento/src/errors/transform-graphql.ts","../../../libs/driver/magento/src/errors/transform.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 {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\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 */\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 { 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';\n\nimport { DaffDriverMagentoError } from './error.class';\nimport { DaffDriverMagentoNetworkError } from './network-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 DaffDriverMagentoNetworkError((<ApolloError>error).networkError.message);\n } else if (daffIsError(error)) {\n return error;\n } else {\n return new DaffDriverMagentoError(error.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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,EAPvB,SAAA,EAAA;AACT,QAAA;AACE,YAAA,OAAO,EAAE,qCAAqC;AAC9C,YAAA,WAAW,EAAE,uCAAuC;AACrD,SAAA;AACF,KAAA,EAAA,CAAA,CAAA;2FAEU,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBARnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,qCAAqC;AAC9C,4BAAA,WAAW,EAAE,uCAAuC;AACrD,yBAAA;AACF,qBAAA;AACF,iBAAA,CAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { DaffInheritableError } from '@daffodil/core';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Injectable, InjectionToken, inject } from '@angular/core';
|
|
2
4
|
|
|
3
5
|
var DaffDriverErrorCodes;
|
|
4
6
|
(function (DaffDriverErrorCodes) {
|
|
@@ -13,9 +15,28 @@ class DaffBadInputError extends DaffInheritableError {
|
|
|
13
15
|
}
|
|
14
16
|
}
|
|
15
17
|
|
|
18
|
+
/**
|
|
19
|
+
* A noop service. Always does nothing for every single method.
|
|
20
|
+
*
|
|
21
|
+
* @inheritdoc
|
|
22
|
+
*/
|
|
23
|
+
class DaffDriverHttpClientCacheNoopService {
|
|
24
|
+
reset() { }
|
|
25
|
+
}
|
|
26
|
+
DaffDriverHttpClientCacheNoopService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverHttpClientCacheNoopService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
27
|
+
DaffDriverHttpClientCacheNoopService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverHttpClientCacheNoopService, providedIn: 'root' });
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffDriverHttpClientCacheNoopService, decorators: [{
|
|
29
|
+
type: Injectable,
|
|
30
|
+
args: [{
|
|
31
|
+
providedIn: 'root',
|
|
32
|
+
}]
|
|
33
|
+
}] });
|
|
34
|
+
|
|
35
|
+
const DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE = new InjectionToken('DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE', { factory: () => inject(DaffDriverHttpClientCacheNoopService) });
|
|
36
|
+
|
|
16
37
|
/**
|
|
17
38
|
* Generated bundle index. Do not edit.
|
|
18
39
|
*/
|
|
19
40
|
|
|
20
|
-
export { DaffBadInputError, DaffDriverErrorCodes };
|
|
41
|
+
export { DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE, DaffBadInputError, DaffDriverErrorCodes, DaffDriverHttpClientCacheNoopService };
|
|
21
42
|
//# sourceMappingURL=daffodil-driver.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-driver.mjs","sources":["../../../libs/driver/src/errors/codes.ts","../../../libs/driver/src/errors/bad-input.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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"daffodil-driver.mjs","sources":["../../../libs/driver/src/errors/codes.ts","../../../libs/driver/src/errors/bad-input.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 { 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":";;;;IAAY,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;QADE,IAAO,CAAA,OAAA,GAAP,OAAO,CAAQ;AAFlB,QAAA,IAAA,CAAA,IAAI,GAAW,oBAAoB,CAAC,SAAS,CAAC;KAI7D;AACF;;ACTD;;;;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;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;MCHY,qCAAqC,GAAG,IAAI,cAAc,CAA4C,uCAAuC,EAAE,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC,oCAAoC,CAAC,EAAE;;ACR3N;;AAEG;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DaffDriverHttpClientCacheServiceInterface } from './service.type';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* A noop service. Always does nothing for every single method.
|
|
5
|
+
*
|
|
6
|
+
* @inheritdoc
|
|
7
|
+
*/
|
|
8
|
+
export declare class DaffDriverHttpClientCacheNoopService implements DaffDriverHttpClientCacheServiceInterface {
|
|
9
|
+
reset(): void;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffDriverHttpClientCacheNoopService, never>;
|
|
11
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffDriverHttpClientCacheNoopService>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A service for interacting with the request cache of the HTTP client currently in use.
|
|
3
|
+
* This has nothing to do with local storage or any kind of persistent client data.
|
|
4
|
+
*/
|
|
5
|
+
export interface DaffDriverHttpClientCacheServiceInterface {
|
|
6
|
+
/**
|
|
7
|
+
* Resets the client's cache store to the initial state.
|
|
8
|
+
*/
|
|
9
|
+
reset(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DaffDriverHttpClientCacheServiceInterface } from '@daffodil/driver';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Interacts with the Apollo client.
|
|
5
|
+
*
|
|
6
|
+
* @inheritdoc
|
|
7
|
+
*/
|
|
8
|
+
export declare class DaffDriverHttpClientCacheMagentoService implements DaffDriverHttpClientCacheServiceInterface {
|
|
9
|
+
private platformId;
|
|
10
|
+
constructor(platformId: string);
|
|
11
|
+
reset(): void;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffDriverHttpClientCacheMagentoService, never>;
|
|
13
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffDriverHttpClientCacheMagentoService>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class DaffDriverMagentoModule {
|
|
3
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffDriverMagentoModule, never>;
|
|
4
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffDriverMagentoModule, never, never, never>;
|
|
5
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffDriverMagentoModule>;
|
|
6
|
+
}
|
package/magento/public_api.d.ts
CHANGED
package/package.json
CHANGED
package/public_api.d.ts
CHANGED