@daffodil/driver 0.90.0 → 0.92.3-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -1
- package/fesm2022/daffodil-driver-hubspot-testing.mjs +3 -3
- package/fesm2022/daffodil-driver-hubspot-testing.mjs.map +1 -1
- package/fesm2022/daffodil-driver-in-memory.mjs +100 -9
- package/fesm2022/daffodil-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-driver-magento-testing.mjs +9 -9
- package/fesm2022/daffodil-driver-magento-testing.mjs.map +1 -1
- package/fesm2022/daffodil-driver-magento.mjs +359 -281
- package/fesm2022/daffodil-driver-magento.mjs.map +1 -1
- package/fesm2022/daffodil-driver-shopify-testing.mjs +128 -53
- package/fesm2022/daffodil-driver-shopify-testing.mjs.map +1 -1
- package/fesm2022/daffodil-driver-shopify.mjs +1440 -1432
- package/fesm2022/daffodil-driver-shopify.mjs.map +1 -1
- package/fesm2022/daffodil-driver.mjs +3 -3
- package/fesm2022/daffodil-driver.mjs.map +1 -1
- package/in-memory/index.d.ts +80 -3
- package/magento/index.d.ts +112 -36
- package/package.json +1 -1
- package/shopify/index.d.ts +4318 -3116
- package/shopify/testing/index.d.ts +101 -36
|
@@ -33,10 +33,10 @@ class DaffDriverNetworkError extends DaffInheritableError {
|
|
|
33
33
|
*/
|
|
34
34
|
class DaffDriverHttpClientCacheNoopService {
|
|
35
35
|
reset() { }
|
|
36
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
37
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
36
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffDriverHttpClientCacheNoopService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
37
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffDriverHttpClientCacheNoopService, providedIn: 'root' }); }
|
|
38
38
|
}
|
|
39
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffDriverHttpClientCacheNoopService, decorators: [{
|
|
40
40
|
type: Injectable,
|
|
41
41
|
args: [{
|
|
42
42
|
providedIn: 'root',
|
|
@@ -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/errors/network-error.class.ts","../../../libs/driver/src/http-client-cache/noop.service.ts","../../../libs/driver/src/http-client-cache/service.token.ts","../../../libs/driver/src/daffodil-driver.ts"],"sourcesContent":["export enum DaffDriverErrorCodes {\n BAD_INPUT = 'DAFF_BAD_INPUT'\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffDriverErrorCodes } from './codes';\n\nexport class DaffBadInputError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffDriverErrorCodes.BAD_INPUT;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_DRIVER_NETWORK_ERROR_CODE = 'DAFF_DRIVER_NETWORK_ERROR';\n\n/**\n * An error thrown when the a driver encounters a problem with network connectivity.\n */\nexport class DaffDriverNetworkError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_DRIVER_NETWORK_ERROR_CODE;\n\n constructor(message?: string) {\n 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 { inject } from '@angular/core';\n\nimport { createSingletonInjectionToken } from '@daffodil/core';\n\nimport { DaffDriverHttpClientCacheNoopService } from './noop.service';\nimport { DaffDriverHttpClientCacheServiceInterface } from './service.type';\n\nexport const {\n token: DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE,\n /**\n * Provider function for {@link DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE}.\n */\n provider: provideDaffDriverHttpClientCacheService,\n} = createSingletonInjectionToken<DaffDriverHttpClientCacheServiceInterface>(\n 'DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE',\n { factory: () => inject(DaffDriverHttpClientCacheNoopService) },\n);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;IAAY;AAAZ,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,WAAA,CAAA,GAAA,gBAA4B;AAC9B,CAAC,EAFW,oBAAoB,KAApB,oBAAoB,GAAA,EAAA,CAAA,CAAA;;ACO1B,MAAO,iBAAkB,SAAQ,oBAAoB,CAAA;AAGzD,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC;QADG,IAAA,CAAA,OAAO,GAAP,OAAO;AAFV,QAAA,IAAA,CAAA,IAAI,GAAW,oBAAoB,CAAC,SAAS;IAI7D;AACD;;ACRM,MAAM,8BAA8B,GAAG;AAE9C;;AAEG;AACG,MAAO,sBAAuB,SAAQ,oBAAoB,CAAA;AAG9D,IAAA,WAAA,CAAY,OAAgB,EAAA;QAC1B,KAAK,CAAC,OAAO,CAAC;QAHA,IAAA,CAAA,IAAI,GAAW,8BAA8B;IAI7D;AACD;;ACZD;;;;AAIG;MAIU,oCAAoC,CAAA;AAC/C,IAAA,KAAK,KAAU
|
|
1
|
+
{"version":3,"file":"daffodil-driver.mjs","sources":["../../../libs/driver/src/errors/codes.ts","../../../libs/driver/src/errors/bad-input.ts","../../../libs/driver/src/errors/network-error.class.ts","../../../libs/driver/src/http-client-cache/noop.service.ts","../../../libs/driver/src/http-client-cache/service.token.ts","../../../libs/driver/src/daffodil-driver.ts"],"sourcesContent":["export enum DaffDriverErrorCodes {\n BAD_INPUT = 'DAFF_BAD_INPUT'\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffDriverErrorCodes } from './codes';\n\nexport class DaffBadInputError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffDriverErrorCodes.BAD_INPUT;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_DRIVER_NETWORK_ERROR_CODE = 'DAFF_DRIVER_NETWORK_ERROR';\n\n/**\n * An error thrown when the a driver encounters a problem with network connectivity.\n */\nexport class DaffDriverNetworkError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_DRIVER_NETWORK_ERROR_CODE;\n\n constructor(message?: string) {\n 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 { inject } from '@angular/core';\n\nimport { createSingletonInjectionToken } from '@daffodil/core';\n\nimport { DaffDriverHttpClientCacheNoopService } from './noop.service';\nimport { DaffDriverHttpClientCacheServiceInterface } from './service.type';\n\nexport const {\n token: DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE,\n /**\n * Provider function for {@link DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE}.\n */\n provider: provideDaffDriverHttpClientCacheService,\n} = createSingletonInjectionToken<DaffDriverHttpClientCacheServiceInterface>(\n 'DAFF_DRIVER_HTTP_CLIENT_CACHE_SERVICE',\n { factory: () => inject(DaffDriverHttpClientCacheNoopService) },\n);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;IAAY;AAAZ,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,WAAA,CAAA,GAAA,gBAA4B;AAC9B,CAAC,EAFW,oBAAoB,KAApB,oBAAoB,GAAA,EAAA,CAAA,CAAA;;ACO1B,MAAO,iBAAkB,SAAQ,oBAAoB,CAAA;AAGzD,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC;QADG,IAAA,CAAA,OAAO,GAAP,OAAO;AAFV,QAAA,IAAA,CAAA,IAAI,GAAW,oBAAoB,CAAC,SAAS;IAI7D;AACD;;ACRM,MAAM,8BAA8B,GAAG;AAE9C;;AAEG;AACG,MAAO,sBAAuB,SAAQ,oBAAoB,CAAA;AAG9D,IAAA,WAAA,CAAY,OAAgB,EAAA;QAC1B,KAAK,CAAC,OAAO,CAAC;QAHA,IAAA,CAAA,IAAI,GAAW,8BAA8B;IAI7D;AACD;;ACZD;;;;AAIG;MAIU,oCAAoC,CAAA;AAC/C,IAAA,KAAK,KAAU;+GADJ,oCAAoC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAApC,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oCAAoC,cAFnC,MAAM,EAAA,CAAA,CAAA;;4FAEP,oCAAoC,EAAA,UAAA,EAAA,CAAA;kBAHhD,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACJM,MAAM,EACX,KAAK,EAAE,qCAAqC;AAC5C;;AAEG;AACH,QAAQ,EAAE,uCAAuC,GAClD,GAAG,6BAA6B,CAC/B,uCAAuC,EACvC,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC,oCAAoC,CAAC,EAAE;;ACfjE;;AAEG;;;;"}
|
package/in-memory/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { ModuleWithProviders, Type, EnvironmentProviders } from '@angular/core';
|
|
2
|
+
import { ModuleWithProviders, Type, EnvironmentProviders, InjectionToken } from '@angular/core';
|
|
3
3
|
import { RequestInfo, InMemoryDbService, InMemoryBackendConfigArgs } from 'angular-in-memory-web-api';
|
|
4
4
|
import * as rxjs from 'rxjs';
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
@@ -158,5 +158,82 @@ declare class DaffInMemoryDriverModule {
|
|
|
158
158
|
*/
|
|
159
159
|
declare const provideDaffInMemoryDriver: (config?: DaffInMemoryDriverConfig, ...backends: Array<Type<DaffInMemoryBackendInterface>>) => EnvironmentProviders[];
|
|
160
160
|
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
/**
|
|
162
|
+
* Represents a routable object with a URL and type identifier.
|
|
163
|
+
* Used by in-memory drivers to enable automatic URL resolution
|
|
164
|
+
* of in-memory objects. See {@link DaffExternalRouterInMemoryDriver}
|
|
165
|
+
*/
|
|
166
|
+
interface DaffInMemoryRoutableObject {
|
|
167
|
+
/**
|
|
168
|
+
* The URL path for this routable object (e.g., "/product-123").
|
|
169
|
+
*/
|
|
170
|
+
url: string;
|
|
171
|
+
/**
|
|
172
|
+
* The type identifier for this routable object (e.g., "PRODUCTS", "NAVIGATION").
|
|
173
|
+
*/
|
|
174
|
+
type: string;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* A map of URL paths to their corresponding routable objects.
|
|
178
|
+
* The key is the URL path.
|
|
179
|
+
*/
|
|
180
|
+
type DaffInMemoryRoutableObjects = ReadonlyMap<string, DaffInMemoryRoutableObject>;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* A function that returns an array of entities with URL properties.
|
|
184
|
+
* Used to provide routable in-memory object information to the routing system.
|
|
185
|
+
*/
|
|
186
|
+
type DaffInMemoryRoutableObjectsResolver = () => Array<{
|
|
187
|
+
url: string;
|
|
188
|
+
}>;
|
|
189
|
+
/**
|
|
190
|
+
* Internal injection token that builds and provides the complete map of routable objects.
|
|
191
|
+
*
|
|
192
|
+
* This token automatically collects all registered routable object resolvers and builds
|
|
193
|
+
* a Map where the key is the URL path and the value is an object containing both the URL
|
|
194
|
+
* and its associated type. This map is used by in-memory drivers to resolve URLs to their types.
|
|
195
|
+
*
|
|
196
|
+
* @docs-private
|
|
197
|
+
*/
|
|
198
|
+
declare const DAFF_INMEMORY_ROUTABLE_OBJECTS: InjectionToken<DaffInMemoryRoutableObjects>;
|
|
199
|
+
/**
|
|
200
|
+
* Registers routable objects from an in-memory driver with the routing system.
|
|
201
|
+
*
|
|
202
|
+
* This function allows in-memory drivers to provide their entities (with URL properties)
|
|
203
|
+
* to enable automatic URL resolution. Each driver provides a resolver function that
|
|
204
|
+
* returns its entities with URL properties, along with a type identifier.
|
|
205
|
+
*
|
|
206
|
+
* The resolver function runs in an injection context, which means you can use Angular's
|
|
207
|
+
* `inject()` function within it to access services and dependencies.
|
|
208
|
+
*
|
|
209
|
+
* @param type - The type identifier for these routable objects (e.g., "PRODUCTS")
|
|
210
|
+
* @param resolver - A function that returns an array of entities with URL properties.
|
|
211
|
+
* This function runs in an injection context, allowing use of `inject()`.
|
|
212
|
+
* @returns Environment providers that register the routable objects
|
|
213
|
+
*
|
|
214
|
+
* @usageNotes
|
|
215
|
+
*
|
|
216
|
+
* ### Basic Usage
|
|
217
|
+
*
|
|
218
|
+
* In your driver package, create a resolver function:
|
|
219
|
+
*
|
|
220
|
+
* ```typescript
|
|
221
|
+
* const productResolver = (): Array<{ url: string }> => {
|
|
222
|
+
* return inject(DaffInMemoryBackendProductService).products.map((p) => ({ url: p.url }));
|
|
223
|
+
* };
|
|
224
|
+
* ```
|
|
225
|
+
*
|
|
226
|
+
* Then in your app configuration:
|
|
227
|
+
*
|
|
228
|
+
* ```typescript
|
|
229
|
+
* export const appConfig: ApplicationConfig = {
|
|
230
|
+
* providers: [
|
|
231
|
+
* provideDaffInMemoryRoutableObjects("PRODUCTS", productResolver),
|
|
232
|
+
* ]
|
|
233
|
+
* };
|
|
234
|
+
* ```
|
|
235
|
+
*/
|
|
236
|
+
declare const provideDaffInMemoryRoutableObjects: (type: string, resolver: DaffInMemoryRoutableObjectsResolver) => EnvironmentProviders;
|
|
237
|
+
|
|
238
|
+
export { DAFF_INMEMORY_ROUTABLE_OBJECTS, DAFF_IN_MEMORY_BACKENDS, DAFF_IN_MEMORY_DRIVER_CONFIG, DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT, DaffInMemoryBackendDelegate, DaffInMemoryDriverBase, DaffInMemoryDriverModule, DaffInMemoryRootBackend, provideDaffInMemoryBackends, provideDaffInMemoryDriver, provideDaffInMemoryDriverConfig, provideDaffInMemoryRoutableObjects };
|
|
239
|
+
export type { DaffInMemoryBackendInterface, DaffInMemoryDataServiceInterface, DaffInMemoryDriverConfig, DaffInMemoryMultiRouteableBackend, DaffInMemoryRoutableObject, DaffInMemoryRoutableObjects, DaffInMemoryRoutableObjectsResolver, DaffInMemoryRouteableBackend, DaffInMemorySingleRouteableBackend };
|
package/magento/index.d.ts
CHANGED
|
@@ -1,37 +1,110 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { Provider, EnvironmentProviders, StateKey, InjectionToken } from '@angular/core';
|
|
3
|
+
import { ApolloClientOptions, PossibleTypesMap, TypePolicies, ApolloLink } from '@apollo/client/core';
|
|
4
|
+
import { Options } from 'apollo-angular/http';
|
|
5
|
+
import { ErrorHandler } from '@apollo/client/link/error';
|
|
4
6
|
import { DaffErrorCodeMap, DaffError, DaffInheritableError, DaffCollectionMetadata, DaffSortDirectionEnum } from '@daffodil/core';
|
|
5
7
|
import { GraphQLFormattedError } from 'graphql';
|
|
6
8
|
import { DaffApolloLinkGenerator } from '@daffodil/core/graphql';
|
|
7
9
|
import { DaffDriverHttpClientCacheServiceInterface } from '@daffodil/driver';
|
|
8
10
|
import * as apollo_angular from 'apollo-angular';
|
|
9
11
|
|
|
10
|
-
declare const
|
|
12
|
+
declare const MAGENTO_POSSIBLE_TYPES: {
|
|
11
13
|
possibleTypes: {
|
|
14
|
+
AggregationOptionInterface: string[];
|
|
15
|
+
AttributeSelectedOptionInterface: string[];
|
|
16
|
+
AttributeValueInterface: string[];
|
|
12
17
|
CartAddressInterface: string[];
|
|
13
18
|
CartItemInterface: string[];
|
|
14
|
-
ProductInterface: string[];
|
|
15
19
|
CategoryInterface: string[];
|
|
16
|
-
MediaGalleryInterface: string[];
|
|
17
|
-
ProductLinksInterface: string[];
|
|
18
20
|
CreditMemoItemInterface: string[];
|
|
19
|
-
|
|
21
|
+
CustomAttributeMetadataInterface: string[];
|
|
22
|
+
CustomAttributeOptionInterface: string[];
|
|
23
|
+
CustomizableOptionInterface: string[];
|
|
24
|
+
CustomizableProductInterface: string[];
|
|
25
|
+
Error: string[];
|
|
26
|
+
ErrorInterface: string[];
|
|
20
27
|
InvoiceItemInterface: string[];
|
|
21
|
-
ShipmentItemInterface: string[];
|
|
22
|
-
AggregationOptionInterface: string[];
|
|
23
28
|
LayerFilterItemInterface: string[];
|
|
29
|
+
MediaGalleryInterface: string[];
|
|
30
|
+
OrderItemInterface: string[];
|
|
24
31
|
PhysicalProductInterface: string[];
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
ProductInterface: string[];
|
|
33
|
+
ProductLinksInterface: string[];
|
|
34
|
+
RoutableInterface: string[];
|
|
35
|
+
ShipmentItemInterface: string[];
|
|
27
36
|
SwatchDataInterface: string[];
|
|
28
37
|
SwatchLayerFilterItemInterface: string[];
|
|
38
|
+
WishlistItemInterface: string[];
|
|
29
39
|
};
|
|
30
40
|
};
|
|
31
41
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
42
|
+
/**
|
|
43
|
+
* A non-exhaustive list of feature kinds that exist for {@link provideMagentoDriver}.
|
|
44
|
+
*/
|
|
45
|
+
declare enum MagentoDriverFeatureKind {
|
|
46
|
+
CacheableOperations = "DaffMagentoDriverCacheableOperationsFeature",
|
|
47
|
+
CacheHeader = "DaffMagentoDriverCacheHeaderFeature",
|
|
48
|
+
ErrorHandler = "DaffMagentoDriverErrorHandlerFeature",
|
|
49
|
+
TransferState = "DaffMagentoDriverTransferStateFeature",
|
|
50
|
+
ExtraApolloOptions = "DaffMagentoDriverExtraApolloOptionsFeature"
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* A feature for {@link provideMagentoDriver}.
|
|
55
|
+
*/
|
|
56
|
+
interface MagentoDriverFeature {
|
|
57
|
+
ɵkind: MagentoDriverFeatureKind | string;
|
|
58
|
+
ɵproviders: Array<Provider | EnvironmentProviders>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Apollo client options except link and cache, creation of which is done by {@link provideMagentoDriver}.
|
|
63
|
+
*/
|
|
64
|
+
type DaffDriverMagentoExtraApolloOptions = Omit<ApolloClientOptions<any>, 'link' | 'cache'>;
|
|
65
|
+
declare const DAFF_DRIVER_MAGENTO_EXTRA_APOLLO_OPTIONS: _angular_core.InjectionToken<DaffDriverMagentoExtraApolloOptions>;
|
|
66
|
+
declare const provideDaffDriverMagentoExtraApolloOptions: <R extends DaffDriverMagentoExtraApolloOptions = DaffDriverMagentoExtraApolloOptions>(value: R) => _angular_core.ValueProvider;
|
|
67
|
+
declare const provideDaffDriverMagentoExtraApolloOptionsFactory: <R extends DaffDriverMagentoExtraApolloOptions = DaffDriverMagentoExtraApolloOptions>(factory: () => R) => _angular_core.FactoryProvider;
|
|
68
|
+
/**
|
|
69
|
+
* A {@link provideMagentoDriver} feature that allow specifying {@link DaffDriverMagentoExtraApolloOptions}.
|
|
70
|
+
*/
|
|
71
|
+
declare const withDaffDriverMagentoExtraApolloOptions: (options: DaffDriverMagentoExtraApolloOptions) => MagentoDriverFeature;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* A {@link provideMagentoDriver} feature that sets up {@link provideDaffMagentoApolloCacheableOperations}.
|
|
75
|
+
*/
|
|
76
|
+
declare const withOperationCache: (...extraOperations: Array<string>) => MagentoDriverFeature;
|
|
77
|
+
|
|
78
|
+
declare const DAFF_DRIVER_MAGENTO_ERROR_HANDLER: _angular_core.InjectionToken<ErrorHandler>;
|
|
79
|
+
declare const provideDaffDriverMagentoErrorHandler: <R extends ErrorHandler = ErrorHandler>(value: R) => _angular_core.ValueProvider;
|
|
80
|
+
/**
|
|
81
|
+
* A {@link provideMagentoDriver} feature that specifies the error handler.
|
|
82
|
+
*/
|
|
83
|
+
declare const withDaffDriverMagentoErrorHandler: (handler: ErrorHandler) => MagentoDriverFeature;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Creates a magento driver feature for {@link provideMagentoDriver}.
|
|
87
|
+
*/
|
|
88
|
+
declare function makeMagentoDriverFeature(kind: MagentoDriverFeatureKind | string, providers: Array<Provider | EnvironmentProviders>): MagentoDriverFeature;
|
|
89
|
+
|
|
90
|
+
declare const DAFF_DRIVER_MAGENTO_TRANSFER_STATE_KEY: _angular_core.InjectionToken<StateKey<any>>;
|
|
91
|
+
declare const provideDaffDriverMagentoTransferStateKey: <R extends StateKey<any> = StateKey<any>>(value: R) => _angular_core.ValueProvider;
|
|
92
|
+
/**
|
|
93
|
+
* A {@link provideMagentoDriver} feature that sets up transfer state with the specified key.
|
|
94
|
+
*
|
|
95
|
+
* @param stateKey The key under which the Apollo state is stored.
|
|
96
|
+
*/
|
|
97
|
+
declare const withDaffDriverMagentoTransferState: <T extends StateKey<any> = StateKey<any>>(stateKey: T) => MagentoDriverFeature;
|
|
98
|
+
/**
|
|
99
|
+
* Holds the logic for hydrating the Apollo cache with the server's transferred state.
|
|
100
|
+
* It is recommended to use {@link withDaffDriverMagentoTransferState} with {@link provideMagentoDriver}
|
|
101
|
+
* to provide this functionality automatically.
|
|
102
|
+
*/
|
|
103
|
+
declare const provideDaffDriverMagentoTransferState: () => EnvironmentProviders;
|
|
104
|
+
|
|
105
|
+
interface DaffMagentoDriverConfig extends Options {
|
|
106
|
+
possibleTypes?: PossibleTypesMap;
|
|
107
|
+
typePolicies?: TypePolicies;
|
|
35
108
|
}
|
|
36
109
|
/**
|
|
37
110
|
* Sets up the Magento Daffodil driver configuration for Magento's GraphQl API.
|
|
@@ -40,7 +113,7 @@ interface DaffMagentoDriverConfig {
|
|
|
40
113
|
*
|
|
41
114
|
* @param endpoint - The Magento store domain (e.g. "https://www.my-store.com/graphql") or an injection token for a string or function that returns a string
|
|
42
115
|
*/
|
|
43
|
-
declare function provideMagentoDriver(
|
|
116
|
+
declare function provideMagentoDriver(options: DaffMagentoDriverConfig | InjectionToken<DaffMagentoDriverConfig>, ...features: Array<MagentoDriverFeature>): EnvironmentProviders;
|
|
44
117
|
|
|
45
118
|
/**
|
|
46
119
|
* Transforms the passed error according to the lookup in the passed map.
|
|
@@ -89,26 +162,31 @@ declare enum MagentoSortEnum {
|
|
|
89
162
|
DESC = "DESC"
|
|
90
163
|
}
|
|
91
164
|
|
|
165
|
+
/**
|
|
166
|
+
* A request handler provider that will convert cacheable apollo operations into a format that Magento will understand as cacheable.
|
|
167
|
+
*/
|
|
168
|
+
declare const provideDaffMagentoApolloCacheableOperations: () => _angular_core.EnvironmentProviders;
|
|
92
169
|
/**
|
|
93
170
|
* A service that will convert cacheable apollo operations into a format that Magento will understand as cacheable.
|
|
94
171
|
*
|
|
95
172
|
* @inheritdoc
|
|
173
|
+
* @deprecated Prefer using {@link provideDaffMagentoApolloCacheableOperations} instead. Deprecated in version 0.91.0. Will be removed in version 0.94.0.
|
|
96
174
|
*/
|
|
97
175
|
declare class DaffMagentoApolloCacheableOperationsLinkGenerator implements DaffApolloLinkGenerator {
|
|
98
176
|
private apolloGetRequests;
|
|
99
177
|
constructor(apolloGetRequests: string[]);
|
|
100
178
|
getLink(): ApolloLink;
|
|
101
|
-
static ɵfac:
|
|
102
|
-
static ɵprov:
|
|
179
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DaffMagentoApolloCacheableOperationsLinkGenerator, never>;
|
|
180
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<DaffMagentoApolloCacheableOperationsLinkGenerator>;
|
|
103
181
|
}
|
|
104
182
|
|
|
105
|
-
declare const DAFF_MAGENTO_CACHEABLE_OPERATIONS:
|
|
106
|
-
declare const provideManyDaffMagentoCacheableOperations: <R extends string = string>(...values: R[]) => Array<
|
|
183
|
+
declare const DAFF_MAGENTO_CACHEABLE_OPERATIONS: _angular_core.InjectionToken<string[]>;
|
|
184
|
+
declare const provideManyDaffMagentoCacheableOperations: <R extends string = string>(...values: R[]) => Array<_angular_core.ValueProvider>;
|
|
107
185
|
/**
|
|
108
186
|
* Adds an operation name to the list of cacheable Magento operations. Use only with Angular 9+.
|
|
109
187
|
*/
|
|
110
188
|
declare function provideDaffMagentoCacheableOperation(operationName: string): {
|
|
111
|
-
provide:
|
|
189
|
+
provide: _angular_core.InjectionToken<string[]>;
|
|
112
190
|
useValue: string;
|
|
113
191
|
multi: boolean;
|
|
114
192
|
};
|
|
@@ -134,23 +212,30 @@ declare class DaffDriverHttpClientCacheMagentoService implements DaffDriverHttpC
|
|
|
134
212
|
private platformId;
|
|
135
213
|
constructor(platformId: string);
|
|
136
214
|
reset(): void;
|
|
137
|
-
static ɵfac:
|
|
138
|
-
static ɵprov:
|
|
215
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DaffDriverHttpClientCacheMagentoService, never>;
|
|
216
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<DaffDriverHttpClientCacheMagentoService>;
|
|
139
217
|
}
|
|
140
218
|
|
|
141
219
|
declare const MAGENTO_CUSTOMER_CACHE_ID_HEADER = "X-Magento-Cache-Id";
|
|
220
|
+
/**
|
|
221
|
+
* Stores and sets the Magento cache ID header.
|
|
222
|
+
* This will set the `X-Magento-Cache-Id` header from the most recent value encountered
|
|
223
|
+
* on a response, if there was a response with that header set.
|
|
224
|
+
*/
|
|
225
|
+
declare const provideDaffMagentoCacheHeader: () => _angular_core.EnvironmentProviders;
|
|
142
226
|
/**
|
|
143
227
|
* Stores and sets the Magento cache ID header.
|
|
144
228
|
* This will set the `X-Magento-Cache-Id` header from the most recent value encountered
|
|
145
229
|
* on a response, if there was a response with that header set.
|
|
146
230
|
*
|
|
147
231
|
* @inheritdoc
|
|
232
|
+
* @deprecated Prefer using {@link provideDaffMagentoCacheHeader} instead. Deprecated in version 0.91.0. Will be removed in version 0.94.0.
|
|
148
233
|
*/
|
|
149
234
|
declare class DaffMagentoCacheHeaderApolloLinkGenerator implements DaffApolloLinkGenerator {
|
|
150
235
|
private _cacheHeader?;
|
|
151
236
|
getLink(): ApolloLink;
|
|
152
|
-
static ɵfac:
|
|
153
|
-
static ɵprov:
|
|
237
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DaffMagentoCacheHeaderApolloLinkGenerator, never>;
|
|
238
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<DaffMagentoCacheHeaderApolloLinkGenerator>;
|
|
154
239
|
}
|
|
155
240
|
|
|
156
241
|
declare function magentoPageInfoTransform(pageInfo: MagentoSearchResultPageInfo): Pick<DaffCollectionMetadata, 'pageSize' | 'currentPage' | 'totalPages'>;
|
|
@@ -163,14 +248,5 @@ declare const magentoSearchResultPageInfoFragment: apollo_angular.TypedDocumentN
|
|
|
163
248
|
|
|
164
249
|
declare const magentoMoneyFragment: apollo_angular.TypedDocumentNode<unknown, unknown>;
|
|
165
250
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
*/
|
|
169
|
-
declare class DaffDriverMagentoModule {
|
|
170
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffDriverMagentoModule, never>;
|
|
171
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffDriverMagentoModule, never, never, never>;
|
|
172
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<DaffDriverMagentoModule>;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export { DAFF_DRIVER_MAGENTO_ERROR_CODE, DAFF_MAGENTO_2_4_3_TYPE_POLICIES, DAFF_MAGENTO_CACHEABLE_OPERATIONS, DaffDriverHttpClientCacheMagentoService, DaffDriverMagentoError, DaffDriverMagentoModule, DaffMagentoApolloCacheableOperationsLinkGenerator, DaffMagentoCacheHeaderApolloLinkGenerator, MAGENTO_CUSTOMER_CACHE_ID_HEADER, MagentoSortEnum, daffMagentoTransformGraphQlError, daffTransformMagentoError, magentoMoneyFragment, magentoPageInfoTransform, magentoSearchResultPageInfoFragment, magentoSortDirectionRequestTransform, magentoSortDirectionResponseTransform, provideDaffMagentoCacheableOperation, provideMagentoDriver, provideManyDaffMagentoCacheableOperations, schema };
|
|
176
|
-
export type { MagentoDiscount, MagentoFilterInput, MagentoMoney, MagentoSearchResultPageInfo };
|
|
251
|
+
export { DAFF_DRIVER_MAGENTO_ERROR_CODE, DAFF_DRIVER_MAGENTO_ERROR_HANDLER, DAFF_DRIVER_MAGENTO_EXTRA_APOLLO_OPTIONS, DAFF_DRIVER_MAGENTO_TRANSFER_STATE_KEY, DAFF_MAGENTO_2_4_3_TYPE_POLICIES, DAFF_MAGENTO_CACHEABLE_OPERATIONS, DaffDriverHttpClientCacheMagentoService, DaffDriverMagentoError, DaffMagentoApolloCacheableOperationsLinkGenerator, DaffMagentoCacheHeaderApolloLinkGenerator, MAGENTO_CUSTOMER_CACHE_ID_HEADER, MAGENTO_POSSIBLE_TYPES, MagentoDriverFeatureKind, MagentoSortEnum, daffMagentoTransformGraphQlError, daffTransformMagentoError, magentoMoneyFragment, magentoPageInfoTransform, magentoSearchResultPageInfoFragment, magentoSortDirectionRequestTransform, magentoSortDirectionResponseTransform, makeMagentoDriverFeature, provideDaffDriverMagentoErrorHandler, provideDaffDriverMagentoExtraApolloOptions, provideDaffDriverMagentoExtraApolloOptionsFactory, provideDaffDriverMagentoTransferState, provideDaffDriverMagentoTransferStateKey, provideDaffMagentoApolloCacheableOperations, provideDaffMagentoCacheHeader, provideDaffMagentoCacheableOperation, provideMagentoDriver, provideManyDaffMagentoCacheableOperations, MAGENTO_POSSIBLE_TYPES as schema, withDaffDriverMagentoErrorHandler, withDaffDriverMagentoExtraApolloOptions, withDaffDriverMagentoTransferState, withOperationCache };
|
|
252
|
+
export type { DaffDriverMagentoExtraApolloOptions, DaffMagentoDriverConfig, MagentoDiscount, MagentoDriverFeature, MagentoFilterInput, MagentoMoney, MagentoSearchResultPageInfo };
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@daffodil/driver","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/driver"]}}},"version":"0.
|
|
1
|
+
{"name":"@daffodil/driver","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/driver"]}}},"version":"0.92.3-rc.0","description":"Base driver interfaces and utilities for connecting Daffodil to ecommerce platforms. Part of the Daffodil ecommerce framework.","repository":{"type":"git","url":"https://github.com/graycoreio/daffodil"},"author":"Graycore LLC","license":"MIT","bugs":{"url":"https://github.com/graycoreio/daffodil/issues"},"homepage":"https://github.com/graycoreio/daffodil","optionalDependencies":{"angular-in-memory-web-api":"^0.20.0"},"peerDependencies":{"@angular/common":"^20.0.0","@angular/core":"^20.0.0","rxjs":"^7.0.0"},"module":"fesm2022/daffodil-driver.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","default":"./fesm2022/daffodil-driver.mjs"},"./hubspot":{"types":"./hubspot/index.d.ts","default":"./fesm2022/daffodil-driver-hubspot.mjs"},"./in-memory":{"types":"./in-memory/index.d.ts","default":"./fesm2022/daffodil-driver-in-memory.mjs"},"./magento":{"types":"./magento/index.d.ts","default":"./fesm2022/daffodil-driver-magento.mjs"},"./shopify":{"types":"./shopify/index.d.ts","default":"./fesm2022/daffodil-driver-shopify.mjs"},"./hubspot/testing":{"types":"./hubspot/testing/index.d.ts","default":"./fesm2022/daffodil-driver-hubspot-testing.mjs"},"./magento/testing":{"types":"./magento/testing/index.d.ts","default":"./fesm2022/daffodil-driver-magento-testing.mjs"},"./shopify/testing":{"types":"./shopify/testing/index.d.ts","default":"./fesm2022/daffodil-driver-shopify-testing.mjs"}},"sideEffects":false,"dependencies":{"tslib":"^2.6.2"}}
|