@daffodil/driver 0.90.0 → 0.91.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 CHANGED
@@ -1,3 +1,18 @@
1
1
  # @daffodil/driver
2
2
 
3
- The `@daffodil/driver` package currently just holds driver config files.
3
+ The `@daffodil/driver` package provides core driver interfaces, models, and utilities for integrating Daffodil with various ecommerce platforms.
4
+
5
+ ## Available drivers
6
+
7
+ - **[Magento/MageOS](/libs/driver/guides/magento.md)** - GraphQL integration with Magento 2.x and MageOS
8
+ - **Shopify** - GraphQL integration with Shopify Storefront API
9
+ - **In-Memory** - Mock driver with fake data for testing and development
10
+
11
+ ## What's included
12
+
13
+ This package contains:
14
+ - Driver interface definitions and models
15
+ - HTTP client caching utilities
16
+ - Error handling for driver operations
17
+ - Configuration utilities for platform-specific drivers
18
+
@@ -1,7 +1,7 @@
1
1
  import { createServicesInjectionToken, observe, createConfigInjectionToken } from '@daffodil/core';
2
2
  import { STATUS, HttpClientInMemoryWebApiModule } from 'angular-in-memory-web-api';
3
3
  import * as i0 from '@angular/core';
4
- import { Inject, Injectable, importProvidersFrom, NgModule, makeEnvironmentProviders } from '@angular/core';
4
+ import { Inject, Injectable, importProvidersFrom, NgModule, makeEnvironmentProviders, InjectionToken, inject } from '@angular/core';
5
5
  import { combineLatest, take, map } from 'rxjs';
6
6
 
7
7
  const {
@@ -168,9 +168,100 @@ const provideDaffInMemoryDriver = (config = DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT
168
168
  ];
169
169
  };
170
170
 
171
+ /**
172
+ * Multi-injection token for routable object resolvers.
173
+ *
174
+ * Each in-memory driver (e.g., product, navigation) can register a resolver
175
+ * that provides its entities with URL properties. This token collects all
176
+ * such resolvers so they can be processed together to build the routing map.
177
+ *
178
+ * @docs-private
179
+ */
180
+ const DAFF_INMEMORY_ROUTABLE_OBJECTS_RESOLVER = new InjectionToken('DAFF_INMEMORY_ROUTABLE_OBJECTS_RESOLVER', {
181
+ providedIn: 'root',
182
+ factory: () => [],
183
+ });
184
+ /**
185
+ * Internal injection token that builds and provides the complete map of routable objects.
186
+ *
187
+ * This token automatically collects all registered routable object resolvers and builds
188
+ * a Map where the key is the URL path and the value is an object containing both the URL
189
+ * and its associated type. This map is used by in-memory drivers to resolve URLs to their types.
190
+ *
191
+ * @docs-private
192
+ */
193
+ const DAFF_INMEMORY_ROUTABLE_OBJECTS = new InjectionToken('DAFF_INMEMORY_ROUTABLE_OBJECTS', {
194
+ providedIn: 'root',
195
+ factory: () => {
196
+ const resolvers = inject(DAFF_INMEMORY_ROUTABLE_OBJECTS_RESOLVER, { optional: true }) || [];
197
+ const map = new Map();
198
+ if (!Array.isArray(resolvers)) {
199
+ throw new Error('DAFF_INMEMORY_ROUTABLE_OBJECTS_RESOLVER must be an array');
200
+ }
201
+ resolvers.forEach((entry) => {
202
+ const entities = entry.resolver();
203
+ entities.forEach(entity => {
204
+ if (map.has(entity.url)) {
205
+ const existing = map.get(entity.url);
206
+ console.warn(`[@daffodil/driver/in-memory] Duplicate entity URL detected: "${entity.url}". ` +
207
+ `Already registered with type "${existing?.type}", attempting to register again with type "${entry.type}". ` +
208
+ `The first registration will be used.`);
209
+ return;
210
+ }
211
+ map.set(entity.url, { url: entity.url, type: entry.type });
212
+ });
213
+ });
214
+ return map;
215
+ },
216
+ });
217
+ /**
218
+ * Registers routable objects from an in-memory driver with the routing system.
219
+ *
220
+ * This function allows in-memory drivers to provide their entities (with URL properties)
221
+ * to enable automatic URL resolution. Each driver provides a resolver function that
222
+ * returns its entities with URL properties, along with a type identifier.
223
+ *
224
+ * The resolver function runs in an injection context, which means you can use Angular's
225
+ * `inject()` function within it to access services and dependencies.
226
+ *
227
+ * @param type - The type identifier for these routable objects (e.g., "PRODUCTS")
228
+ * @param resolver - A function that returns an array of entities with URL properties.
229
+ * This function runs in an injection context, allowing use of `inject()`.
230
+ * @returns Environment providers that register the routable objects
231
+ *
232
+ * @usageNotes
233
+ *
234
+ * ### Basic Usage
235
+ *
236
+ * In your driver package, create a resolver function:
237
+ *
238
+ * ```typescript
239
+ * const productResolver = (): Array<{ url: string }> => {
240
+ * return inject(DaffInMemoryBackendProductService).products.map((p) => ({ url: p.url }));
241
+ * };
242
+ * ```
243
+ *
244
+ * Then in your app configuration:
245
+ *
246
+ * ```typescript
247
+ * export const appConfig: ApplicationConfig = {
248
+ * providers: [
249
+ * provideDaffInMemoryRoutableObjects("PRODUCTS", productResolver),
250
+ * ]
251
+ * };
252
+ * ```
253
+ */
254
+ const provideDaffInMemoryRoutableObjects = (type, resolver) => makeEnvironmentProviders([
255
+ {
256
+ provide: DAFF_INMEMORY_ROUTABLE_OBJECTS_RESOLVER,
257
+ useValue: { type, resolver },
258
+ multi: true,
259
+ },
260
+ ]);
261
+
171
262
  /**
172
263
  * Generated bundle index. Do not edit.
173
264
  */
174
265
 
175
- export { DAFF_IN_MEMORY_BACKENDS, DAFF_IN_MEMORY_DRIVER_CONFIG, DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT, DaffInMemoryBackendDelegate, DaffInMemoryDriverBase, DaffInMemoryDriverModule, DaffInMemoryRootBackend, provideDaffInMemoryBackends, provideDaffInMemoryDriver, provideDaffInMemoryDriverConfig };
266
+ 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 };
176
267
  //# sourceMappingURL=daffodil-driver-in-memory.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-driver-in-memory.mjs","sources":["../../../libs/driver/in-memory/src/backend/backends.token.ts","../../../libs/driver/in-memory/src/backend/delegate.class.ts","../../../libs/driver/in-memory/src/backend/root.service.ts","../../../libs/driver/in-memory/src/driver/base.class.ts","../../../libs/driver/in-memory/src/config/default.ts","../../../libs/driver/in-memory/src/config/token.ts","../../../libs/driver/in-memory/src/module.ts","../../../libs/driver/in-memory/src/provider.ts","../../../libs/driver/in-memory/src/daffodil-driver-in-memory.ts"],"sourcesContent":["import { createServicesInjectionToken } from '@daffodil/core';\n\nimport { DaffInMemoryBackendInterface } from './type';\n\nexport const {\n /**\n * A token that holds the currently loaded in-memory backends.\n */\n token: DAFF_IN_MEMORY_BACKENDS,\n /**\n * Provide backend classes to {@link DAFF_IN_MEMORY_BACKENDS}.\n */\n provider: provideDaffInMemoryBackends,\n} = createServicesInjectionToken<DaffInMemoryBackendInterface>('DAFF_IN_MEMORY_BACKENDS');\n","import {\n RequestInfo,\n STATUS,\n} from 'angular-in-memory-web-api';\nimport { Observable } from 'rxjs';\n\nimport { DaffInMemoryDataServiceInterface } from './data-service.type';\nimport { DaffInMemoryRouteableBackend } from './routeable.type';\nimport { DaffInMemoryDriverConfig } from '../public_api';\n\nenum Method {\n GET = 'get',\n POST = 'post',\n PUT = 'put',\n DELETE = 'delete',\n}\n\n/**\n * An class that automatically delegates requests to in-memory backends.\n *\n * @inheritdoc\n */\nexport class DaffInMemoryBackendDelegate implements DaffInMemoryDataServiceInterface {\n\n constructor(\n protected backends: Array<DaffInMemoryRouteableBackend>,\n protected config: DaffInMemoryDriverConfig,\n ) {}\n\n protected delegateRequest(reqInfo: RequestInfo, method: Method): Observable<any> {\n const backend = this.backends.find((b) => 'collectionName' in b ? b.collectionName === reqInfo.collectionName : b.canHandle(reqInfo.collectionName));\n const request = backend?.[method];\n\n if(request) {\n // allow child backends to return nully values\n // which will fall back to default request behavior (https://github.com/angular/angular/tree/main/packages/misc/angular-in-memory-web-api#http-request-handling)\n return request.call(backend, reqInfo);\n }\n\n if(!this.config.passThroughUnknownRequests) {\n return reqInfo.utils.createResponse$(() => ({\n status: STATUS.NOT_FOUND,\n statusText: `Backend ${reqInfo.collectionName} not found or does not support the ${method} request method`,\n }));\n }\n\n return undefined;\n }\n\n get?(reqInfo: RequestInfo): Observable<any> {\n return this.delegateRequest(reqInfo, Method.GET);\n }\n\n post?(reqInfo: RequestInfo): Observable<any> {\n return this.delegateRequest(reqInfo, Method.POST);\n }\n\n put?(reqInfo: RequestInfo): Observable<any> {\n return this.delegateRequest(reqInfo, Method.PUT);\n }\n\n delete?(reqInfo: RequestInfo): Observable<any> {\n return this.delegateRequest(reqInfo, Method.DELETE);\n }\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfo,\n} from 'angular-in-memory-web-api';\nimport {\n combineLatest,\n map,\n take,\n} from 'rxjs';\n\nimport { observe } from '@daffodil/core';\n\nimport { DAFF_IN_MEMORY_BACKENDS } from './backends.token';\nimport { DaffInMemoryDataServiceInterface } from './data-service.type';\nimport { DaffInMemoryBackendDelegate } from './delegate.class';\nimport { DaffInMemoryBackendInterface } from './type';\nimport {\n DAFF_IN_MEMORY_DRIVER_CONFIG,\n DaffInMemoryDriverConfig,\n} from '../public_api';\n\n/**\n * An in-memory backend that automatically delegates requests to backends provided to {@link DAFF_IN_MEMORY_BACKENDS}.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryRootBackend extends DaffInMemoryBackendDelegate implements DaffInMemoryDataServiceInterface, InMemoryDbService {\n constructor(\n @Inject(DAFF_IN_MEMORY_BACKENDS) private _backends: Array<DaffInMemoryBackendInterface>,\n @Inject(DAFF_IN_MEMORY_DRIVER_CONFIG) private _config: DaffInMemoryDriverConfig,\n ) {\n super(_backends, _config);\n }\n\n createDb(reqInfo?: RequestInfo) {\n return combineLatest(this._backends.map(observe)).pipe(\n take(1),\n map((backends) => backends.reduce((db, backend) => ({\n ...db,\n ...backend.createDb(reqInfo),\n }), {})),\n );\n }\n}\n","import { InMemoryBackendConfigArgs } from 'angular-in-memory-web-api';\n\n/**\n * The base class for in-memory drivers.\n */\nexport abstract class DaffInMemoryDriverBase {\n /**\n * The URL of the corresponding backend.\n * Does not include a trailing slash, it is of the form: `/<api base>/<collection name>`.\n */\n protected readonly url = `/${this.config.apiBase}/${this.collectionName}`;\n\n constructor(\n private config: InMemoryBackendConfigArgs,\n private collectionName: string,\n ) {}\n}\n","import { DaffInMemoryDriverConfig } from './type';\n\nexport const DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT: DaffInMemoryDriverConfig = {\n apiBase: 'api',\n passThroughUnknownRequests: false,\n};\n","import { createConfigInjectionToken } from '@daffodil/core';\n\nimport { DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT } from './default';\nimport { DaffInMemoryDriverConfig } from './type';\n\nexport const {\n token: DAFF_IN_MEMORY_DRIVER_CONFIG,\n /**\n * Provider function for {@link DAFF_IN_MEMORY_DRIVER_CONFIG}.\n */\n provider: provideDaffInMemoryDriverConfig,\n} = createConfigInjectionToken<DaffInMemoryDriverConfig>(DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT, 'DAFF_IN_MEMORY_DRIVER_CONFIG');\n","import {\n NgModule,\n ModuleWithProviders,\n importProvidersFrom,\n} from '@angular/core';\nimport { HttpClientInMemoryWebApiModule } from 'angular-in-memory-web-api';\n\nimport { DaffInMemoryRootBackend } from './backend/public_api';\nimport {\n DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT,\n DaffInMemoryDriverConfig,\n provideDaffInMemoryDriverConfig,\n} from './config/public_api';\n\n/**\n * Sets up the angular in memory web API with the {@link DaffInMemoryRootBackend}.\n */\n@NgModule()\nexport class DaffInMemoryDriverModule {\n static forRoot(config: DaffInMemoryDriverConfig = DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT): ModuleWithProviders<DaffInMemoryDriverModule> {\n return {\n ngModule: DaffInMemoryDriverModule,\n providers: [\n importProvidersFrom(HttpClientInMemoryWebApiModule.forRoot(DaffInMemoryRootBackend, config)),\n provideDaffInMemoryDriverConfig(config),\n ],\n };\n }\n}\n","import {\n EnvironmentProviders,\n importProvidersFrom,\n makeEnvironmentProviders,\n Type,\n} from '@angular/core';\nimport { HttpClientInMemoryWebApiModule } from 'angular-in-memory-web-api';\n\nimport {\n DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT,\n DaffInMemoryBackendInterface,\n DaffInMemoryDriverConfig,\n DaffInMemoryRootBackend,\n provideDaffInMemoryBackends,\n provideDaffInMemoryDriverConfig,\n} from './public_api';\n\n/**\n * Configures the Angular in-memory web API with Daffodil backend services.\n *\n * @example\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideDaffInMemoryDriver(\n * { delay: 300 },\n * DaffProductInMemoryBackendService,\n * DaffCartInMemoryBackendService\n * )\n * ]\n * });\n * ```\n */\nexport const provideDaffInMemoryDriver = (config: DaffInMemoryDriverConfig = DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT, ...backends: Array<Type<DaffInMemoryBackendInterface>>): EnvironmentProviders[] => {\n config = { ...DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT,...config };\n return [\n importProvidersFrom(HttpClientInMemoryWebApiModule.forRoot(DaffInMemoryRootBackend, { ...config, passThruUnknownUrl: config.passThroughUnknownRequests })),\n makeEnvironmentProviders([\n provideDaffInMemoryDriverConfig(config),\n provideDaffInMemoryBackends(...backends),\n ]),\n ];\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAIO,MAAM;AACX;;AAEG;AACH,KAAK,EAAE,uBAAuB;AAC9B;;AAEG;AACH,QAAQ,EAAE,2BAA2B,GACtC,GAAG,4BAA4B,CAA+B,yBAAyB;;ACHxF,IAAK,MAKJ;AALD,CAAA,UAAK,MAAM,EAAA;AACT,IAAA,MAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACX,IAAA,MAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,MAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AAC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AA,EAAA,CAAA;kBADpC;;;ACAD;;;;;;;;;;;;;;;AAeG;AACI,MAAM,yBAAyB,GAAG,CAAC,MAAA,GAAmC,oCAAoC,EAAE,GAAG,QAAmD,KAA4B;IACnM,MAAM,GAAG,EAAE,GAAG,oCAAoC,EAAC,GAAG,MAAM,EAAE;IAC9D,OAAO;AACL,QAAA,mBAAmB,CAAC,8BAA8B,CAAC,OAAO,CAAC,uBAAuB,EAAE,EAAE,GAAG,MAAM,EAAE,kBAAkB,EAAE,MAAM,CAAC,0BAA0B,EAAE,CAAC,CAAC;AAC1J,QAAA,wBAAwB,CAAC;YACvB,+BAA+B,CAAC,MAAM,CAAC;YACvC,2BAA2B,CAAC,GAAG,QAAQ,CAAC;SACzC,CAAC;KACH;AACH;;AC1CA;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-driver-in-memory.mjs","sources":["../../../libs/driver/in-memory/src/backend/backends.token.ts","../../../libs/driver/in-memory/src/backend/delegate.class.ts","../../../libs/driver/in-memory/src/backend/root.service.ts","../../../libs/driver/in-memory/src/driver/base.class.ts","../../../libs/driver/in-memory/src/config/default.ts","../../../libs/driver/in-memory/src/config/token.ts","../../../libs/driver/in-memory/src/module.ts","../../../libs/driver/in-memory/src/provider.ts","../../../libs/driver/in-memory/src/routing/provider.ts","../../../libs/driver/in-memory/src/daffodil-driver-in-memory.ts"],"sourcesContent":["import { createServicesInjectionToken } from '@daffodil/core';\n\nimport { DaffInMemoryBackendInterface } from './type';\n\nexport const {\n /**\n * A token that holds the currently loaded in-memory backends.\n */\n token: DAFF_IN_MEMORY_BACKENDS,\n /**\n * Provide backend classes to {@link DAFF_IN_MEMORY_BACKENDS}.\n */\n provider: provideDaffInMemoryBackends,\n} = createServicesInjectionToken<DaffInMemoryBackendInterface>('DAFF_IN_MEMORY_BACKENDS');\n","import {\n RequestInfo,\n STATUS,\n} from 'angular-in-memory-web-api';\nimport { Observable } from 'rxjs';\n\nimport { DaffInMemoryDataServiceInterface } from './data-service.type';\nimport { DaffInMemoryRouteableBackend } from './routeable.type';\nimport { DaffInMemoryDriverConfig } from '../public_api';\n\nenum Method {\n GET = 'get',\n POST = 'post',\n PUT = 'put',\n DELETE = 'delete',\n}\n\n/**\n * An class that automatically delegates requests to in-memory backends.\n *\n * @inheritdoc\n */\nexport class DaffInMemoryBackendDelegate implements DaffInMemoryDataServiceInterface {\n\n constructor(\n protected backends: Array<DaffInMemoryRouteableBackend>,\n protected config: DaffInMemoryDriverConfig,\n ) {}\n\n protected delegateRequest(reqInfo: RequestInfo, method: Method): Observable<any> {\n const backend = this.backends.find((b) => 'collectionName' in b ? b.collectionName === reqInfo.collectionName : b.canHandle(reqInfo.collectionName));\n const request = backend?.[method];\n\n if(request) {\n // allow child backends to return nully values\n // which will fall back to default request behavior (https://github.com/angular/angular/tree/main/packages/misc/angular-in-memory-web-api#http-request-handling)\n return request.call(backend, reqInfo);\n }\n\n if(!this.config.passThroughUnknownRequests) {\n return reqInfo.utils.createResponse$(() => ({\n status: STATUS.NOT_FOUND,\n statusText: `Backend ${reqInfo.collectionName} not found or does not support the ${method} request method`,\n }));\n }\n\n return undefined;\n }\n\n get?(reqInfo: RequestInfo): Observable<any> {\n return this.delegateRequest(reqInfo, Method.GET);\n }\n\n post?(reqInfo: RequestInfo): Observable<any> {\n return this.delegateRequest(reqInfo, Method.POST);\n }\n\n put?(reqInfo: RequestInfo): Observable<any> {\n return this.delegateRequest(reqInfo, Method.PUT);\n }\n\n delete?(reqInfo: RequestInfo): Observable<any> {\n return this.delegateRequest(reqInfo, Method.DELETE);\n }\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport {\n InMemoryDbService,\n RequestInfo,\n} from 'angular-in-memory-web-api';\nimport {\n combineLatest,\n map,\n take,\n} from 'rxjs';\n\nimport { observe } from '@daffodil/core';\n\nimport { DAFF_IN_MEMORY_BACKENDS } from './backends.token';\nimport { DaffInMemoryDataServiceInterface } from './data-service.type';\nimport { DaffInMemoryBackendDelegate } from './delegate.class';\nimport { DaffInMemoryBackendInterface } from './type';\nimport {\n DAFF_IN_MEMORY_DRIVER_CONFIG,\n DaffInMemoryDriverConfig,\n} from '../public_api';\n\n/**\n * An in-memory backend that automatically delegates requests to backends provided to {@link DAFF_IN_MEMORY_BACKENDS}.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryRootBackend extends DaffInMemoryBackendDelegate implements DaffInMemoryDataServiceInterface, InMemoryDbService {\n constructor(\n @Inject(DAFF_IN_MEMORY_BACKENDS) private _backends: Array<DaffInMemoryBackendInterface>,\n @Inject(DAFF_IN_MEMORY_DRIVER_CONFIG) private _config: DaffInMemoryDriverConfig,\n ) {\n super(_backends, _config);\n }\n\n createDb(reqInfo?: RequestInfo) {\n return combineLatest(this._backends.map(observe)).pipe(\n take(1),\n map((backends) => backends.reduce((db, backend) => ({\n ...db,\n ...backend.createDb(reqInfo),\n }), {})),\n );\n }\n}\n","import { InMemoryBackendConfigArgs } from 'angular-in-memory-web-api';\n\n/**\n * The base class for in-memory drivers.\n */\nexport abstract class DaffInMemoryDriverBase {\n /**\n * The URL of the corresponding backend.\n * Does not include a trailing slash, it is of the form: `/<api base>/<collection name>`.\n */\n protected readonly url = `/${this.config.apiBase}/${this.collectionName}`;\n\n constructor(\n private config: InMemoryBackendConfigArgs,\n private collectionName: string,\n ) {}\n}\n","import { DaffInMemoryDriverConfig } from './type';\n\nexport const DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT: DaffInMemoryDriverConfig = {\n apiBase: 'api',\n passThroughUnknownRequests: false,\n};\n","import { createConfigInjectionToken } from '@daffodil/core';\n\nimport { DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT } from './default';\nimport { DaffInMemoryDriverConfig } from './type';\n\nexport const {\n token: DAFF_IN_MEMORY_DRIVER_CONFIG,\n /**\n * Provider function for {@link DAFF_IN_MEMORY_DRIVER_CONFIG}.\n */\n provider: provideDaffInMemoryDriverConfig,\n} = createConfigInjectionToken<DaffInMemoryDriverConfig>(DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT, 'DAFF_IN_MEMORY_DRIVER_CONFIG');\n","import {\n NgModule,\n ModuleWithProviders,\n importProvidersFrom,\n} from '@angular/core';\nimport { HttpClientInMemoryWebApiModule } from 'angular-in-memory-web-api';\n\nimport { DaffInMemoryRootBackend } from './backend/public_api';\nimport {\n DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT,\n DaffInMemoryDriverConfig,\n provideDaffInMemoryDriverConfig,\n} from './config/public_api';\n\n/**\n * Sets up the angular in memory web API with the {@link DaffInMemoryRootBackend}.\n */\n@NgModule()\nexport class DaffInMemoryDriverModule {\n static forRoot(config: DaffInMemoryDriverConfig = DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT): ModuleWithProviders<DaffInMemoryDriverModule> {\n return {\n ngModule: DaffInMemoryDriverModule,\n providers: [\n importProvidersFrom(HttpClientInMemoryWebApiModule.forRoot(DaffInMemoryRootBackend, config)),\n provideDaffInMemoryDriverConfig(config),\n ],\n };\n }\n}\n","import {\n EnvironmentProviders,\n importProvidersFrom,\n makeEnvironmentProviders,\n Type,\n} from '@angular/core';\nimport { HttpClientInMemoryWebApiModule } from 'angular-in-memory-web-api';\n\nimport {\n DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT,\n DaffInMemoryBackendInterface,\n DaffInMemoryDriverConfig,\n DaffInMemoryRootBackend,\n provideDaffInMemoryBackends,\n provideDaffInMemoryDriverConfig,\n} from './public_api';\n\n/**\n * Configures the Angular in-memory web API with Daffodil backend services.\n *\n * @example\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideDaffInMemoryDriver(\n * { delay: 300 },\n * DaffProductInMemoryBackendService,\n * DaffCartInMemoryBackendService\n * )\n * ]\n * });\n * ```\n */\nexport const provideDaffInMemoryDriver = (config: DaffInMemoryDriverConfig = DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT, ...backends: Array<Type<DaffInMemoryBackendInterface>>): EnvironmentProviders[] => {\n config = { ...DAFF_IN_MEMORY_DRIVER_CONFIG_DEFAULT,...config };\n return [\n importProvidersFrom(HttpClientInMemoryWebApiModule.forRoot(DaffInMemoryRootBackend, { ...config, passThruUnknownUrl: config.passThroughUnknownRequests })),\n makeEnvironmentProviders([\n provideDaffInMemoryDriverConfig(config),\n provideDaffInMemoryBackends(...backends),\n ]),\n ];\n};\n","import {\n EnvironmentProviders,\n inject,\n InjectionToken,\n makeEnvironmentProviders,\n} from '@angular/core';\n\nimport {\n DaffInMemoryRoutableObject,\n DaffInMemoryRoutableObjects,\n} from './routable-object';\n\n/**\n * A function that returns an array of entities with URL properties.\n * Used to provide routable in-memory object information to the routing system.\n */\nexport type DaffInMemoryRoutableObjectsResolver = () => Array<{ url: string }>;\n\n/**\n * Multi-injection token for routable object resolvers.\n *\n * Each in-memory driver (e.g., product, navigation) can register a resolver\n * that provides its entities with URL properties. This token collects all\n * such resolvers so they can be processed together to build the routing map.\n *\n * @docs-private\n */\nconst DAFF_INMEMORY_ROUTABLE_OBJECTS_RESOLVER = new InjectionToken<{ type: string; resolver: DaffInMemoryRoutableObjectsResolver }[]>(\n 'DAFF_INMEMORY_ROUTABLE_OBJECTS_RESOLVER', {\n providedIn: 'root',\n factory: () => [],\n },\n);\n\n/**\n * Internal injection token that builds and provides the complete map of routable objects.\n *\n * This token automatically collects all registered routable object resolvers and builds\n * a Map where the key is the URL path and the value is an object containing both the URL\n * and its associated type. This map is used by in-memory drivers to resolve URLs to their types.\n *\n * @docs-private\n */\nexport const DAFF_INMEMORY_ROUTABLE_OBJECTS = new InjectionToken<DaffInMemoryRoutableObjects>(\n 'DAFF_INMEMORY_ROUTABLE_OBJECTS',\n {\n providedIn: 'root',\n factory: () => {\n const resolvers = inject(DAFF_INMEMORY_ROUTABLE_OBJECTS_RESOLVER, { optional: true }) || [];\n const map = new Map<string, DaffInMemoryRoutableObject>();\n\n if (!Array.isArray(resolvers)) {\n throw new Error('DAFF_INMEMORY_ROUTABLE_OBJECTS_RESOLVER must be an array');\n }\n\n resolvers.forEach((entry) => {\n const entities = entry.resolver();\n entities.forEach(entity => {\n if (map.has(entity.url)) {\n const existing = map.get(entity.url);\n console.warn(\n `[@daffodil/driver/in-memory] Duplicate entity URL detected: \"${entity.url}\". ` +\n `Already registered with type \"${existing?.type}\", attempting to register again with type \"${entry.type}\". ` +\n `The first registration will be used.`,\n );\n return;\n }\n map.set(entity.url, { url: entity.url, type: entry.type });\n });\n });\n\n return map;\n },\n },\n);\n\n/**\n * Registers routable objects from an in-memory driver with the routing system.\n *\n * This function allows in-memory drivers to provide their entities (with URL properties)\n * to enable automatic URL resolution. Each driver provides a resolver function that\n * returns its entities with URL properties, along with a type identifier.\n *\n * The resolver function runs in an injection context, which means you can use Angular's\n * `inject()` function within it to access services and dependencies.\n *\n * @param type - The type identifier for these routable objects (e.g., \"PRODUCTS\")\n * @param resolver - A function that returns an array of entities with URL properties.\n * This function runs in an injection context, allowing use of `inject()`.\n * @returns Environment providers that register the routable objects\n *\n * @usageNotes\n *\n * ### Basic Usage\n *\n * In your driver package, create a resolver function:\n *\n * ```typescript\n * const productResolver = (): Array<{ url: string }> => {\n * return inject(DaffInMemoryBackendProductService).products.map((p) => ({ url: p.url }));\n * };\n * ```\n *\n * Then in your app configuration:\n *\n * ```typescript\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideDaffInMemoryRoutableObjects(\"PRODUCTS\", productResolver),\n * ]\n * };\n * ```\n */\nexport const provideDaffInMemoryRoutableObjects = (\n type: string,\n resolver: DaffInMemoryRoutableObjectsResolver,\n): EnvironmentProviders => makeEnvironmentProviders([\n {\n provide: DAFF_INMEMORY_ROUTABLE_OBJECTS_RESOLVER,\n useValue: { type, resolver },\n multi: true,\n },\n]);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAIO,MAAM;AACX;;AAEG;AACH,KAAK,EAAE,uBAAuB;AAC9B;;AAEG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