@daffodil/external-router 0.94.1 → 0.95.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.
Files changed (34) hide show
  1. package/fesm2022/daffodil-external-router-driver-in-memory.mjs +70 -88
  2. package/fesm2022/daffodil-external-router-driver-in-memory.mjs.map +1 -1
  3. package/fesm2022/daffodil-external-router-driver-magento-2.4.1.mjs +117 -118
  4. package/fesm2022/daffodil-external-router-driver-magento-2.4.1.mjs.map +1 -1
  5. package/fesm2022/daffodil-external-router-driver-magento-2.4.2.mjs +117 -118
  6. package/fesm2022/daffodil-external-router-driver-magento-2.4.2.mjs.map +1 -1
  7. package/fesm2022/daffodil-external-router-driver-magento-2.4.3.mjs +216 -266
  8. package/fesm2022/daffodil-external-router-driver-magento-2.4.3.mjs.map +1 -1
  9. package/fesm2022/daffodil-external-router-driver-magento-auto.mjs +7 -0
  10. package/fesm2022/daffodil-external-router-driver-magento-auto.mjs.map +1 -0
  11. package/fesm2022/daffodil-external-router-driver-magento.mjs +6 -18
  12. package/fesm2022/daffodil-external-router-driver-magento.mjs.map +1 -1
  13. package/fesm2022/daffodil-external-router-driver-shopify.mjs +49 -39
  14. package/fesm2022/daffodil-external-router-driver-shopify.mjs.map +1 -1
  15. package/fesm2022/daffodil-external-router-driver-testing.mjs +118 -115
  16. package/fesm2022/daffodil-external-router-driver-testing.mjs.map +1 -1
  17. package/fesm2022/daffodil-external-router-driver.mjs +8 -32
  18. package/fesm2022/daffodil-external-router-driver.mjs.map +1 -1
  19. package/fesm2022/daffodil-external-router-routing.mjs +31 -66
  20. package/fesm2022/daffodil-external-router-routing.mjs.map +1 -1
  21. package/fesm2022/daffodil-external-router.mjs +37 -81
  22. package/fesm2022/daffodil-external-router.mjs.map +1 -1
  23. package/package.json +1 -1
  24. package/types/daffodil-external-router-driver-in-memory.d.ts +15 -21
  25. package/types/daffodil-external-router-driver-magento-2.4.1.d.ts +29 -25
  26. package/types/daffodil-external-router-driver-magento-2.4.2.d.ts +29 -25
  27. package/types/daffodil-external-router-driver-magento-2.4.3.d.ts +25 -28
  28. package/types/daffodil-external-router-driver-magento-auto.d.ts +1 -0
  29. package/types/daffodil-external-router-driver-magento.d.ts +251 -263
  30. package/types/daffodil-external-router-driver-shopify.d.ts +10 -14
  31. package/types/daffodil-external-router-driver-testing.d.ts +22 -27
  32. package/types/daffodil-external-router-driver.d.ts +12 -19
  33. package/types/daffodil-external-router-routing.d.ts +4 -7
  34. package/types/daffodil-external-router.d.ts +72 -86
@@ -1,281 +1,269 @@
1
- interface MagentoUrlResolver {
2
- relative_url: string;
3
- type: string;
4
- redirectCode: number;
5
- /**
6
- * In v2.4.2 this became the standard id field
7
- */
8
- entity_uid?: string;
9
- /**
10
- * The original id field from Magento
11
- */
12
- id?: number;
1
+ export interface MagentoUrlResolver {
2
+ relative_url: string;
3
+ type: string;
4
+ redirectCode: number;
5
+ /**
6
+ * In v2.4.2 this became the standard id field
7
+ */
8
+ entity_uid?: string;
9
+ /**
10
+ * The original id field from Magento
11
+ */
12
+ id?: number;
13
13
  }
14
-
15
- declare enum MagentoUrlRewriteEntityTypeEnum {
16
- PRODUCT = "PRODUCT",
17
- CATEGORY = "CATEGORY",
18
- CMS_PAGE = "CMS_PAGE"
14
+ export declare enum MagentoUrlRewriteEntityTypeEnum {
15
+ PRODUCT = "PRODUCT",
16
+ CATEGORY = "CATEGORY",
17
+ CMS_PAGE = "CMS_PAGE"
19
18
  }
20
-
21
- interface MagentoUrlResolverResponse {
22
- urlResolver: MagentoUrlResolver;
19
+ export interface MagentoUrlResolverResponse {
20
+ urlResolver: MagentoUrlResolver;
23
21
  }
24
-
25
22
  interface MagentoCategoryRouteProduct {
26
- /**
27
- * The relative path for the route.
28
- */
29
- relative_url: string;
30
- /**
31
- * The type of route, typically PRODUCT, CATEGORY or CMS_PAGE
32
- */
33
- type: 'PRODUCT';
34
- /**
35
- * The HTTP code for the page.
36
- */
37
- redirect_code: number;
38
- /**
39
- * In v2.4.3 this became the standard field across types
40
- */
41
- uid: string;
42
- /**
43
- * The canonical url of the route.
44
- */
45
- canonical_url: string | null;
46
- /**
47
- * The name of the route
48
- */
49
- name: string | null;
50
- /**
51
- * The title of the route
52
- */
53
- meta_title: string | null;
54
- /**
55
- * The sku of a product.
56
- */
57
- sku: string;
58
- /**
59
- * The number of reviews of a product.
60
- */
61
- review_count: number;
62
- /**
63
- * The rating of a product.
64
- */
65
- rating_summary: number;
66
- /**
67
- * The images of a product.
68
- */
69
- image: {
70
- url: string;
23
+ /**
24
+ * The relative path for the route.
25
+ */
26
+ relative_url: string;
27
+ /**
28
+ * The type of route, typically PRODUCT, CATEGORY or CMS_PAGE
29
+ */
30
+ type: 'PRODUCT';
31
+ /**
32
+ * The HTTP code for the page.
33
+ */
34
+ redirect_code: number;
35
+ /**
36
+ * In v2.4.3 this became the standard field across types
37
+ */
38
+ uid: string;
39
+ /**
40
+ * The canonical url of the route.
41
+ */
42
+ canonical_url: string | null;
43
+ /**
44
+ * The name of the route
45
+ */
46
+ name: string | null;
47
+ /**
48
+ * The title of the route
49
+ */
50
+ meta_title: string | null;
51
+ /**
52
+ * The sku of a product.
53
+ */
54
+ sku: string;
55
+ /**
56
+ * The number of reviews of a product.
57
+ */
58
+ review_count: number;
59
+ /**
60
+ * The rating of a product.
61
+ */
62
+ rating_summary: number;
63
+ /**
64
+ * The images of a product.
65
+ */
66
+ image: {
67
+ url: string;
68
+ };
69
+ /**
70
+ * The price of the item.
71
+ */
72
+ price_range: {
73
+ maximum_price: {
74
+ final_price: {
75
+ currency: string;
76
+ value: number;
77
+ };
78
+ regular_price: {
79
+ currency: string;
80
+ value: number;
81
+ };
71
82
  };
72
- /**
73
- * The price of the item.
74
- */
75
- price_range: {
76
- maximum_price: {
77
- final_price: {
78
- currency: string;
79
- value: number;
80
- };
81
- regular_price: {
82
- currency: string;
83
- value: number;
84
- };
85
- };
86
- minimum_price: {
87
- final_price: {
88
- currency: string;
89
- value: number;
90
- };
91
- regular_price: {
92
- currency: string;
93
- value: number;
94
- };
95
- };
83
+ minimum_price: {
84
+ final_price: {
85
+ currency: string;
86
+ value: number;
87
+ };
88
+ regular_price: {
89
+ currency: string;
90
+ value: number;
91
+ };
96
92
  };
97
- /**
98
- * The type of route.
99
- */
100
- __typename: string;
93
+ };
94
+ /**
95
+ * The type of route.
96
+ */
97
+ __typename: string;
101
98
  }
102
-
103
- interface MagentoCategoryRoute {
104
- /**
105
- * The relative path for the route.
106
- */
107
- relative_url: string;
108
- /**
109
- * The type of route, typically PRODUCT, CATEGORY or CMS_PAGE
110
- */
111
- type: 'CATEGORY';
112
- /**
113
- * The HTTP code for the page.
114
- */
115
- redirect_code: number;
116
- /**
117
- * In v2.4.3 this became the standard field across types
118
- */
119
- uid?: string;
120
- /**
121
- * The canonical url of the route.
122
- */
123
- canonical_url?: string;
124
- /**
125
- * The meta description of the route
126
- */
127
- meta_description?: string;
128
- /**
129
- * The name of the route
130
- */
131
- name?: string;
132
- /**
133
- * The title of the route
134
- */
135
- meta_title?: string;
136
- /**
137
- * The list of items in the category.
138
- */
139
- products: {
140
- items: MagentoCategoryRouteProduct[];
141
- };
99
+ export interface MagentoCategoryRoute {
100
+ /**
101
+ * The relative path for the route.
102
+ */
103
+ relative_url: string;
104
+ /**
105
+ * The type of route, typically PRODUCT, CATEGORY or CMS_PAGE
106
+ */
107
+ type: 'CATEGORY';
108
+ /**
109
+ * The HTTP code for the page.
110
+ */
111
+ redirect_code: number;
112
+ /**
113
+ * In v2.4.3 this became the standard field across types
114
+ */
115
+ uid?: string;
116
+ /**
117
+ * The canonical url of the route.
118
+ */
119
+ canonical_url?: string;
120
+ /**
121
+ * The meta description of the route
122
+ */
123
+ meta_description?: string;
124
+ /**
125
+ * The name of the route
126
+ */
127
+ name?: string;
128
+ /**
129
+ * The title of the route
130
+ */
131
+ meta_title?: string;
132
+ /**
133
+ * The list of items in the category.
134
+ */
135
+ products: {
136
+ items: MagentoCategoryRouteProduct[];
137
+ };
142
138
  }
143
-
144
- interface MagentoCmsPageRoute {
145
- /**
146
- * The relative path for the route.
147
- */
148
- relative_url: string;
149
- /**
150
- * The type of route, typically PRODUCT, CATEGORY or CMS_PAGE
151
- */
152
- type: 'CMS_PAGE';
153
- /**
154
- * The HTTP code for the page.
155
- */
156
- redirect_code: number;
157
- content?: string;
158
- content_heading?: string;
159
- identifier?: string;
160
- meta_description?: string;
161
- meta_keywords?: string;
162
- meta_title?: string;
163
- page_layout?: string;
164
- title?: string;
165
- url_key?: string;
139
+ export interface MagentoCmsPageRoute {
140
+ /**
141
+ * The relative path for the route.
142
+ */
143
+ relative_url: string;
144
+ /**
145
+ * The type of route, typically PRODUCT, CATEGORY or CMS_PAGE
146
+ */
147
+ type: 'CMS_PAGE';
148
+ /**
149
+ * The HTTP code for the page.
150
+ */
151
+ redirect_code: number;
152
+ content?: string;
153
+ content_heading?: string;
154
+ identifier?: string;
155
+ meta_description?: string;
156
+ meta_keywords?: string;
157
+ meta_title?: string;
158
+ page_layout?: string;
159
+ title?: string;
160
+ url_key?: string;
166
161
  }
167
-
168
- interface MagentoProductRoute {
169
- /**
170
- * The relative path for the route.
171
- */
172
- relative_url: string;
173
- /**
174
- * The type of route, typically PRODUCT, CATEGORY or CMS_PAGE
175
- */
176
- type: 'PRODUCT';
177
- /**
178
- * The HTTP code for the page.
179
- */
180
- redirect_code: number;
181
- /**
182
- * In v2.4.3 this became the standard field across types
183
- */
184
- uid: string;
185
- /**
186
- * The canonical url of the route.
187
- */
188
- canonical_url: string | null;
189
- /**
190
- * The meta description of the route
191
- */
192
- meta_description: string | null;
193
- /**
194
- * The name of the route
195
- */
196
- name: string;
197
- /**
198
- * The title of the route
199
- */
200
- meta_title: string | null;
201
- /**
202
- * The sku of a product.
203
- */
204
- sku: string;
205
- /**
206
- * The number of reviews of a product.
207
- */
208
- review_count: number | null;
209
- /**
210
- * The rating of a product.
211
- */
212
- rating_summary: number | null;
213
- /**
214
- * The images of a product.
215
- */
216
- image?: {
217
- url: string;
162
+ export interface MagentoProductRoute {
163
+ /**
164
+ * The relative path for the route.
165
+ */
166
+ relative_url: string;
167
+ /**
168
+ * The type of route, typically PRODUCT, CATEGORY or CMS_PAGE
169
+ */
170
+ type: 'PRODUCT';
171
+ /**
172
+ * The HTTP code for the page.
173
+ */
174
+ redirect_code: number;
175
+ /**
176
+ * In v2.4.3 this became the standard field across types
177
+ */
178
+ uid: string;
179
+ /**
180
+ * The canonical url of the route.
181
+ */
182
+ canonical_url: string | null;
183
+ /**
184
+ * The meta description of the route
185
+ */
186
+ meta_description: string | null;
187
+ /**
188
+ * The name of the route
189
+ */
190
+ name: string;
191
+ /**
192
+ * The title of the route
193
+ */
194
+ meta_title: string | null;
195
+ /**
196
+ * The sku of a product.
197
+ */
198
+ sku: string;
199
+ /**
200
+ * The number of reviews of a product.
201
+ */
202
+ review_count: number | null;
203
+ /**
204
+ * The rating of a product.
205
+ */
206
+ rating_summary: number | null;
207
+ /**
208
+ * The images of a product.
209
+ */
210
+ image?: {
211
+ url: string;
212
+ };
213
+ /**
214
+ * The type of route.
215
+ */
216
+ __typename: string;
217
+ /**
218
+ * The price of the item.
219
+ */
220
+ price_range: {
221
+ maximum_price: {
222
+ final_price: {
223
+ currency: string;
224
+ value: number;
225
+ };
226
+ regular_price: {
227
+ currency: string;
228
+ value: number;
229
+ };
218
230
  };
219
- /**
220
- * The type of route.
221
- */
222
- __typename: string;
223
- /**
224
- * The price of the item.
225
- */
226
- price_range: {
227
- maximum_price: {
228
- final_price: {
229
- currency: string;
230
- value: number;
231
- };
232
- regular_price: {
233
- currency: string;
234
- value: number;
235
- };
236
- };
237
- minimum_price: {
238
- final_price: {
239
- currency: string;
240
- value: number;
241
- };
242
- regular_price: {
243
- currency: string;
244
- value: number;
245
- };
246
- };
231
+ minimum_price: {
232
+ final_price: {
233
+ currency: string;
234
+ value: number;
235
+ };
236
+ regular_price: {
237
+ currency: string;
238
+ value: number;
239
+ };
247
240
  };
248
- /**
249
- * The stock status of a product.
250
- */
251
- stock_status: 'IN_STOCK' | 'OUT_OF_STOCK';
241
+ };
242
+ /**
243
+ * The stock status of a product.
244
+ */
245
+ stock_status: 'IN_STOCK' | 'OUT_OF_STOCK';
252
246
  }
253
-
254
247
  interface MagentoRoutable {
255
- /**
256
- * The relative path for the route.
257
- */
258
- relative_url: string;
259
- /**
260
- * The type of route, typically PRODUCT, CATEGORY or CMS_PAGE
261
- */
262
- type: 'UNKNOWN' | null;
263
- /**
264
- * The HTTP code for the page.
265
- */
266
- redirect_code: number;
248
+ /**
249
+ * The relative path for the route.
250
+ */
251
+ relative_url: string;
252
+ /**
253
+ * The type of route, typically PRODUCT, CATEGORY or CMS_PAGE
254
+ */
255
+ type: 'UNKNOWN' | null;
256
+ /**
257
+ * The HTTP code for the page.
258
+ */
259
+ redirect_code: number;
267
260
  }
268
-
269
- type MagentoRoute = MagentoRoutable | MagentoProductRoute | MagentoCategoryRoute | MagentoCmsPageRoute;
270
-
271
- interface MagentoRouteResponse {
272
- route: MagentoRoute;
261
+ export type MagentoRoute = MagentoRoutable | MagentoProductRoute | MagentoCategoryRoute | MagentoCmsPageRoute;
262
+ export interface MagentoRouteResponse {
263
+ route: MagentoRoute;
273
264
  }
274
-
275
265
  /**
276
266
  * Transforms a Magento redirect code to the appropriate HTTP status code.
277
267
  */
278
- declare const magentoTransformRedirectToHttpCode: (code: number) => number;
279
-
280
- export { MagentoUrlRewriteEntityTypeEnum, magentoTransformRedirectToHttpCode };
281
- export type { MagentoCategoryRoute, MagentoCmsPageRoute, MagentoProductRoute, MagentoRoute, MagentoRouteResponse, MagentoUrlResolver, MagentoUrlResolverResponse };
268
+ export declare const magentoTransformRedirectToHttpCode: (code: number) => number;
269
+ export {};
@@ -1,15 +1,11 @@
1
- import { Observable } from 'rxjs';
2
- import { DaffExternallyResolvableUrl } from '@daffodil/external-router';
3
- import { DaffExternalRouterDriverInterface } from '@daffodil/external-router/driver';
4
- import * as i0 from '@angular/core';
5
- import { Provider, EnvironmentProviders } from '@angular/core';
6
-
7
- declare class DaffShopifyExternalRouterDriver implements DaffExternalRouterDriverInterface {
8
- resolve(url: string): Observable<DaffExternallyResolvableUrl>;
9
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffShopifyExternalRouterDriver, never>;
10
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffShopifyExternalRouterDriver>;
1
+ import { Observable } from "rxjs";
2
+ import { DaffExternallyResolvableUrl } from "@daffodil/external-router";
3
+ import { DaffExternalRouterDriverInterface } from "@daffodil/external-router/driver";
4
+ import * as i0 from "@angular/core";
5
+ import { EnvironmentProviders, Provider } from "@angular/core";
6
+ export declare class DaffShopifyExternalRouterDriver implements DaffExternalRouterDriverInterface {
7
+ resolve(url: string): Observable<DaffExternallyResolvableUrl>;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffShopifyExternalRouterDriver, never>;
9
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
11
10
  }
12
-
13
- declare const provideDaffExternalRouterShopifyDriver: () => (Provider | EnvironmentProviders)[];
14
-
15
- export { DaffShopifyExternalRouterDriver, provideDaffExternalRouterShopifyDriver };
11
+ export declare const provideDaffExternalRouterShopifyDriver: () => (Provider | EnvironmentProviders)[];
@@ -1,19 +1,17 @@
1
- import { Observable } from 'rxjs';
2
- import { DaffExternalRouteType, DaffExternallyResolvableUrl } from '@daffodil/external-router';
3
- import { DaffExternalRouterDriverInterface } from '@daffodil/external-router/driver';
4
- import * as i0 from '@angular/core';
5
- import { ModuleWithProviders, InjectionToken, EnvironmentProviders } from '@angular/core';
6
- import * as i1 from '@angular/common';
7
-
1
+ import { Observable } from "rxjs";
2
+ import { DaffExternalRouteType, DaffExternallyResolvableUrl } from "@daffodil/external-router";
3
+ import { DaffExternalRouterDriverInterface } from "@daffodil/external-router/driver";
4
+ import * as i0 from "@angular/core";
5
+ import { EnvironmentProviders, InjectionToken, ModuleWithProviders } from "@angular/core";
6
+ import * as i1 from "@angular/common";
8
7
  /**
9
8
  * The configuration for the testing driver. It is a dictionary of "url": "type",
10
9
  * pairs, where the URL is a URL-safe routeable path, e.g. "sweatshirts" or "t-shirts"
11
10
  * and the type is a known type to your application, e.g. "CATEGORY".
12
11
  */
13
- interface DaffExternalRouterDriverTestingConfig {
14
- [url: string]: DaffExternalRouteType | DaffExternallyResolvableUrl;
12
+ export interface DaffExternalRouterDriverTestingConfig {
13
+ [url: string]: DaffExternalRouteType | DaffExternallyResolvableUrl;
15
14
  }
16
-
17
15
  /**
18
16
  * The DaffExternalRouterTestingDriver is responsible for translating an
19
17
  * arbitrary URI into a DaffExternallyResolvableUrl in testing environments.
@@ -22,29 +20,26 @@ interface DaffExternalRouterDriverTestingConfig {
22
20
  *
23
21
  * @see {@link DaffExternalRouterTestingDriver}
24
22
  */
25
- declare class DaffExternalRouterTestingDriver implements DaffExternalRouterDriverInterface {
26
- private testingConfiguration;
27
- constructor(testingConfiguration?: DaffExternalRouterDriverTestingConfig);
28
- resolve(url: string): Observable<DaffExternallyResolvableUrl>;
29
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouterTestingDriver, never>;
30
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffExternalRouterTestingDriver>;
23
+ export declare class DaffExternalRouterTestingDriver implements DaffExternalRouterDriverInterface {
24
+ private testingConfiguration;
25
+ constructor(testingConfiguration?: DaffExternalRouterDriverTestingConfig);
26
+ resolve(url: string): Observable<DaffExternallyResolvableUrl>;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouterTestingDriver, never>;
28
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
31
29
  }
32
-
33
30
  /**
34
31
  * The `DaffExternalRouterDriverTestingModule` is an importable NgModule that can
35
32
  * be used to configure the {@link DaffExternalRouterTestingDriver}.
33
+ *
34
+ * @deprecated in favor of {@link provideDaffExternalRouterTestingDriver} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
36
35
  */
37
- declare class DaffExternalRouterDriverTestingModule {
38
- static forRoot(config: DaffExternalRouterDriverTestingConfig): ModuleWithProviders<DaffExternalRouterDriverTestingModule>;
39
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouterDriverTestingModule, never>;
40
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffExternalRouterDriverTestingModule, never, [typeof i1.CommonModule], never>;
41
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffExternalRouterDriverTestingModule>;
36
+ export declare class DaffExternalRouterDriverTestingModule {
37
+ static forRoot(config: DaffExternalRouterDriverTestingConfig): ModuleWithProviders<DaffExternalRouterDriverTestingModule>;
38
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouterDriverTestingModule, never>;
39
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffExternalRouterDriverTestingModule, never, [typeof i1.CommonModule], never>;
40
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffExternalRouterDriverTestingModule>;
42
41
  }
43
-
44
42
  /**
45
43
  * Provides a testing implementation of {@link DaffExternalRouterDriver}
46
44
  */
47
- declare const provideDaffExternalRouterTestingDriver: (config: DaffExternalRouterDriverTestingConfig | InjectionToken<DaffExternalRouterDriverTestingConfig>) => EnvironmentProviders;
48
-
49
- export { DaffExternalRouterDriverTestingModule, DaffExternalRouterTestingDriver, provideDaffExternalRouterTestingDriver };
50
- export type { DaffExternalRouterDriverTestingConfig };
45
+ export declare const provideDaffExternalRouterTestingDriver: (config: DaffExternalRouterDriverTestingConfig | InjectionToken<DaffExternalRouterDriverTestingConfig>) => EnvironmentProviders;