@daffodil/external-router 0.88.1 → 0.90.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 (98) hide show
  1. package/driver/in-memory/index.d.ts +42 -1
  2. package/driver/index.d.ts +32 -1
  3. package/driver/magento/2.4.1/index.d.ts +50 -1
  4. package/driver/magento/2.4.2/index.d.ts +50 -1
  5. package/driver/magento/2.4.3/index.d.ts +56 -1
  6. package/driver/magento/index.d.ts +281 -1
  7. package/driver/shopify/index.d.ts +15 -0
  8. package/driver/testing/index.d.ts +50 -1
  9. package/fesm2022/daffodil-external-router-driver-in-memory.mjs +3 -3
  10. package/fesm2022/daffodil-external-router-driver-in-memory.mjs.map +1 -1
  11. package/fesm2022/daffodil-external-router-driver-magento-2.4.1.mjs +7 -7
  12. package/fesm2022/daffodil-external-router-driver-magento-2.4.1.mjs.map +1 -1
  13. package/fesm2022/daffodil-external-router-driver-magento-2.4.2.mjs +7 -7
  14. package/fesm2022/daffodil-external-router-driver-magento-2.4.2.mjs.map +1 -1
  15. package/fesm2022/daffodil-external-router-driver-magento-2.4.3.mjs +9 -9
  16. package/fesm2022/daffodil-external-router-driver-magento-2.4.3.mjs.map +1 -1
  17. package/fesm2022/daffodil-external-router-driver-magento.mjs.map +1 -1
  18. package/fesm2022/daffodil-external-router-driver-shopify.mjs +40 -0
  19. package/fesm2022/daffodil-external-router-driver-shopify.mjs.map +1 -0
  20. package/fesm2022/daffodil-external-router-driver-testing.mjs +7 -7
  21. package/fesm2022/daffodil-external-router-driver-testing.mjs.map +1 -1
  22. package/fesm2022/daffodil-external-router-driver.mjs.map +1 -1
  23. package/fesm2022/daffodil-external-router-routing.mjs.map +1 -1
  24. package/fesm2022/daffodil-external-router.mjs.map +1 -1
  25. package/index.d.ts +96 -1
  26. package/package.json +1 -1
  27. package/routing/index.d.ts +13 -1
  28. package/config.d.ts +0 -11
  29. package/driver/in-memory/config.d.ts +0 -14
  30. package/driver/in-memory/in-memory.service.d.ts +0 -20
  31. package/driver/in-memory/provider.d.ts +0 -6
  32. package/driver/in-memory/public_api.d.ts +0 -3
  33. package/driver/interfaces/external-router-driver.interface.d.ts +0 -18
  34. package/driver/magento/2.4.1/graphql/queries/resolve-url-v2.4.1.d.ts +0 -6
  35. package/driver/magento/2.4.1/magento.module.d.ts +0 -29
  36. package/driver/magento/2.4.1/magento.service.d.ts +0 -18
  37. package/driver/magento/2.4.1/public_api.d.ts +0 -2
  38. package/driver/magento/2.4.1/transforms/resolution-to-resolvable-url.d.ts +0 -3
  39. package/driver/magento/2.4.2/graphql/queries/resolve-url-v2.4.2.d.ts +0 -6
  40. package/driver/magento/2.4.2/magento.module.d.ts +0 -29
  41. package/driver/magento/2.4.2/magento.service.d.ts +0 -18
  42. package/driver/magento/2.4.2/public_api.d.ts +0 -2
  43. package/driver/magento/2.4.2/transforms/resolution-to-resolvable-url.d.ts +0 -3
  44. package/driver/magento/2.4.3/graphql/queries/resolve.d.ts +0 -6
  45. package/driver/magento/2.4.3/magento.module.d.ts +0 -29
  46. package/driver/magento/2.4.3/magento.service.d.ts +0 -19
  47. package/driver/magento/2.4.3/provider.d.ts +0 -5
  48. package/driver/magento/2.4.3/public_api.d.ts +0 -3
  49. package/driver/magento/2.4.3/transforms/resolution-to-resolvable-url.d.ts +0 -3
  50. package/driver/magento/2.4.3/transforms/schema/category/category.d.ts +0 -2
  51. package/driver/magento/2.4.3/transforms/schema/clientify-url-path.d.ts +0 -1
  52. package/driver/magento/2.4.3/transforms/schema/page/page.d.ts +0 -2
  53. package/driver/magento/2.4.3/transforms/schema/product/base.d.ts +0 -2
  54. package/driver/magento/2.4.3/transforms/schema/product/bundle.d.ts +0 -2
  55. package/driver/magento/2.4.3/transforms/schema/product/configurable.d.ts +0 -2
  56. package/driver/magento/2.4.3/transforms/schema/product/product.d.ts +0 -5
  57. package/driver/magento/2.4.3/transforms/schema/product/simple.d.ts +0 -2
  58. package/driver/magento/2.4.3/transforms/schema/rescale-rating.d.ts +0 -5
  59. package/driver/magento/2.4.3/transforms/schema/transform-schema.d.ts +0 -2
  60. package/driver/magento/2.4.3/transforms/transform-client-urls.d.ts +0 -2
  61. package/driver/magento/model/category-route-product.d.ts +0 -77
  62. package/driver/magento/model/category-route.d.ts +0 -41
  63. package/driver/magento/model/page-route.type.d.ts +0 -23
  64. package/driver/magento/model/product-route.d.ts +0 -85
  65. package/driver/magento/model/public_api.d.ts +0 -8
  66. package/driver/magento/model/resolution-types.d.ts +0 -5
  67. package/driver/magento/model/routable.d.ts +0 -14
  68. package/driver/magento/model/route-response.d.ts +0 -4
  69. package/driver/magento/model/route.d.ts +0 -5
  70. package/driver/magento/model/url-resolver-response.d.ts +0 -4
  71. package/driver/magento/model/url-resolver.d.ts +0 -13
  72. package/driver/magento/public_api.d.ts +0 -2
  73. package/driver/magento/transforms/public_api.d.ts +0 -1
  74. package/driver/magento/transforms/redirect-to-http.d.ts +0 -4
  75. package/driver/not-found-resolution.d.ts +0 -8
  76. package/driver/public_api.d.ts +0 -2
  77. package/driver/testing/config.d.ts +0 -10
  78. package/driver/testing/provider.d.ts +0 -6
  79. package/driver/testing/public_api.d.ts +0 -4
  80. package/driver/testing/testing.module.d.ts +0 -14
  81. package/driver/testing/testing.service.d.ts +0 -20
  82. package/model/public_api.d.ts +0 -4
  83. package/model/resolvable-route.d.ts +0 -39
  84. package/model/route-data.d.ts +0 -21
  85. package/model/route-type.d.ts +0 -6
  86. package/model/route-with-seo-data.d.ts +0 -11
  87. package/provide-external-router.d.ts +0 -3
  88. package/public_api.d.ts +0 -3
  89. package/routing/errors/client-error.d.ts +0 -8
  90. package/routing/errors/not-found-error.d.ts +0 -9
  91. package/routing/errors/permanent-redirect.d.ts +0 -10
  92. package/routing/errors/server-error.d.ts +0 -8
  93. package/routing/errors/temporary-redirect.d.ts +0 -10
  94. package/routing/guard/external-matcher-type.guard.d.ts +0 -10
  95. package/routing/helper/convert-to-path.d.ts +0 -7
  96. package/routing/processors/process-errors.d.ts +0 -6
  97. package/routing/processors/process-redirect.d.ts +0 -6
  98. package/routing/public_api.d.ts +0 -1
@@ -1,85 +0,0 @@
1
- export interface MagentoProductRoute {
2
- /**
3
- * The relative path for the route.
4
- */
5
- relative_url: string;
6
- /**
7
- * The type of route, typically PRODUCT, CATEGORY or CMS_PAGE
8
- */
9
- type: 'PRODUCT';
10
- /**
11
- * The HTTP code for the page.
12
- */
13
- redirect_code: number;
14
- /**
15
- * In v2.4.3 this became the standard field across types
16
- */
17
- uid: string;
18
- /**
19
- * The canonical url of the route.
20
- */
21
- canonical_url: string | null;
22
- /**
23
- * The meta description of the route
24
- */
25
- meta_description: string | null;
26
- /**
27
- * The name of the route
28
- */
29
- name: string;
30
- /**
31
- * The title of the route
32
- */
33
- meta_title: string | null;
34
- /**
35
- * The sku of a product.
36
- */
37
- sku: string;
38
- /**
39
- * The number of reviews of a product.
40
- */
41
- review_count: number | null;
42
- /**
43
- * The rating of a product.
44
- */
45
- rating_summary: number | null;
46
- /**
47
- * The images of a product.
48
- */
49
- image?: {
50
- url: string;
51
- };
52
- /**
53
- * The type of route.
54
- */
55
- __typename: string;
56
- /**
57
- * The price of the item.
58
- */
59
- price_range: {
60
- maximum_price: {
61
- final_price: {
62
- currency: string;
63
- value: number;
64
- };
65
- regular_price: {
66
- currency: string;
67
- value: number;
68
- };
69
- };
70
- minimum_price: {
71
- final_price: {
72
- currency: string;
73
- value: number;
74
- };
75
- regular_price: {
76
- currency: string;
77
- value: number;
78
- };
79
- };
80
- };
81
- /**
82
- * The stock status of a product.
83
- */
84
- stock_status: 'IN_STOCK' | 'OUT_OF_STOCK';
85
- }
@@ -1,8 +0,0 @@
1
- export { MagentoUrlResolver } from './url-resolver';
2
- export { MagentoUrlRewriteEntityTypeEnum } from './resolution-types';
3
- export { MagentoUrlResolverResponse } from './url-resolver-response';
4
- export { MagentoRoute } from './route';
5
- export { MagentoRouteResponse } from './route-response';
6
- export { MagentoProductRoute } from './product-route';
7
- export { MagentoCategoryRoute } from './category-route';
8
- export { MagentoCmsPageRoute } from './page-route.type';
@@ -1,5 +0,0 @@
1
- export declare enum MagentoUrlRewriteEntityTypeEnum {
2
- PRODUCT = "PRODUCT",
3
- CATEGORY = "CATEGORY",
4
- CMS_PAGE = "CMS_PAGE"
5
- }
@@ -1,14 +0,0 @@
1
- export interface MagentoRoutable {
2
- /**
3
- * The relative path for the route.
4
- */
5
- relative_url: string;
6
- /**
7
- * The type of route, typically PRODUCT, CATEGORY or CMS_PAGE
8
- */
9
- type: 'UNKNOWN' | null;
10
- /**
11
- * The HTTP code for the page.
12
- */
13
- redirect_code: number;
14
- }
@@ -1,4 +0,0 @@
1
- import { MagentoRoute } from './route';
2
- export interface MagentoRouteResponse {
3
- route: MagentoRoute;
4
- }
@@ -1,5 +0,0 @@
1
- import { MagentoCategoryRoute } from './category-route';
2
- import { MagentoCmsPageRoute } from './page-route.type';
3
- import { MagentoProductRoute } from './product-route';
4
- import { MagentoRoutable } from './routable';
5
- export type MagentoRoute = MagentoRoutable | MagentoProductRoute | MagentoCategoryRoute | MagentoCmsPageRoute;
@@ -1,4 +0,0 @@
1
- import { MagentoUrlResolver } from './url-resolver';
2
- export interface MagentoUrlResolverResponse {
3
- urlResolver: MagentoUrlResolver;
4
- }
@@ -1,13 +0,0 @@
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
- }
@@ -1,2 +0,0 @@
1
- export * from './model/public_api';
2
- export * from './transforms/public_api';
@@ -1 +0,0 @@
1
- export { magentoTransformRedirectToHttpCode } from './redirect-to-http';
@@ -1,4 +0,0 @@
1
- /**
2
- * Transforms a Magento redirect code to the appropriate HTTP status code.
3
- */
4
- export declare const magentoTransformRedirectToHttpCode: (code: number) => number;
@@ -1,8 +0,0 @@
1
- import { DaffExternallyResolvableUrl } from '@daffodil/external-router';
2
- /**
3
- * When a driver fails to find a resolution, it should return a 404.
4
- * This const represents the standard "Not Found" resolution that a driver
5
- * should return. Drivers are not required to return this value, but may do so
6
- * if they would like.
7
- */
8
- export declare const DAFF_EXTERNAL_ROUTER_NOT_FOUND_RESOLUTION: DaffExternallyResolvableUrl;
@@ -1,2 +0,0 @@
1
- export { DaffExternalRouterDriverInterface, DaffExternalRouterDriver, provideDaffExternalRouterDriver, } from './interfaces/external-router-driver.interface';
2
- export { DAFF_EXTERNAL_ROUTER_NOT_FOUND_RESOLUTION } from './not-found-resolution';
@@ -1,10 +0,0 @@
1
- import { DaffExternallyResolvableUrl, DaffExternalRouteType } from '@daffodil/external-router';
2
- /**
3
- * The configuration for the testing driver. It is a dictionary of "url": "type",
4
- * pairs, where the URL is a URL-safe routeable path, e.g. "sweatshirts" or "t-shirts"
5
- * and the type is a known type to your application, e.g. "CATEGORY".
6
- */
7
- export interface DaffExternalRouterDriverTestingConfig {
8
- [url: string]: DaffExternalRouteType | DaffExternallyResolvableUrl;
9
- }
10
- export declare const DAFF_EXTERNAL_ROUTER_DRIVER_TESTING_CONFIG: import("@angular/core").InjectionToken<DaffExternalRouterDriverTestingConfig>, provideDaffExternalRouterDriverTestingConfig: <R extends DaffExternalRouterDriverTestingConfig = DaffExternalRouterDriverTestingConfig>(config: Partial<R> | import("@angular/core").InjectionToken<Partial<R>>) => import("@angular/core").FactoryProvider;
@@ -1,6 +0,0 @@
1
- import { EnvironmentProviders, InjectionToken } from '@angular/core';
2
- import { DaffExternalRouterDriverTestingConfig } from './config';
3
- /**
4
- * Provides a testing implementation of {@link DaffExternalRouterDriver}
5
- */
6
- export declare const provideDaffExternalRouterTestingDriver: (config: DaffExternalRouterDriverTestingConfig | InjectionToken<DaffExternalRouterDriverTestingConfig>) => EnvironmentProviders;
@@ -1,4 +0,0 @@
1
- export { DaffExternalRouterTestingDriver } from './testing.service';
2
- export { DaffExternalRouterDriverTestingModule } from './testing.module';
3
- export { DaffExternalRouterDriverTestingConfig } from './config';
4
- export { provideDaffExternalRouterTestingDriver } from './provider';
@@ -1,14 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import { DaffExternalRouterDriverTestingConfig } from './config';
3
- import * as i0 from "@angular/core";
4
- import * as i1 from "@angular/common";
5
- /**
6
- * The `DaffExternalRouterDriverTestingModule` is an importable NgModule that can
7
- * be used to configure the {@link DaffExternalRouterTestingDriver}.
8
- */
9
- export declare class DaffExternalRouterDriverTestingModule {
10
- static forRoot(config: DaffExternalRouterDriverTestingConfig): ModuleWithProviders<DaffExternalRouterDriverTestingModule>;
11
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouterDriverTestingModule, never>;
12
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffExternalRouterDriverTestingModule, never, [typeof i1.CommonModule], never>;
13
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffExternalRouterDriverTestingModule>;
14
- }
@@ -1,20 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { DaffExternallyResolvableUrl } from '@daffodil/external-router';
3
- import { DaffExternalRouterDriverInterface } from '@daffodil/external-router/driver';
4
- import { DaffExternalRouterDriverTestingConfig } from './config';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * The DaffExternalRouterTestingDriver is responsible for translating an
8
- * arbitrary URI into a DaffExternallyResolvableUrl in testing environments.
9
- *
10
- * @inheritdoc
11
- *
12
- * @see {@link DaffExternalRouterTestingDriver}
13
- */
14
- export declare class DaffExternalRouterTestingDriver implements DaffExternalRouterDriverInterface {
15
- private testingConfiguration;
16
- constructor(testingConfiguration?: DaffExternalRouterDriverTestingConfig);
17
- resolve(url: string): Observable<DaffExternallyResolvableUrl>;
18
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalRouterTestingDriver, never>;
19
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffExternalRouterTestingDriver>;
20
- }
@@ -1,4 +0,0 @@
1
- export { DaffExternallyResolvableUrl } from './resolvable-route';
2
- export { DaffRouteData } from './route-data';
3
- export { DaffExternalRouteType } from './route-type';
4
- export { DaffRouteWithSeoData } from './route-with-seo-data';
@@ -1,39 +0,0 @@
1
- import { DaffIdentifiable } from '@daffodil/core';
2
- import { DaffRouteData } from './route-data';
3
- import { DaffExternalRouteType } from './route-type';
4
- /**
5
- * A `DaffExternallyResolvableUrl` describes the relationship between a "type" of route
6
- * as determined by an external platform and a URI.
7
- *
8
- * @example
9
- * ```ts
10
- * export const resolvableRoute: DaffExternallyResolvableUrl = {
11
- * id: "id-of-resource",
12
- * url: "some/path/to-a-resource",
13
- * type: "RESOURCE_TYPE"
14
- * }
15
- * ```
16
- */
17
- export interface DaffExternallyResolvableUrl extends DaffIdentifiable {
18
- /**
19
- * The URL that will be used for the path of the route inserted
20
- * into the Angular routing config.
21
- * Should not contain URL fragments, query parameters, or leading slashes.
22
- */
23
- url: string;
24
- /**
25
- * The type of the route
26
- *
27
- * @see {@link DaffExternalRouteType}
28
- */
29
- type: DaffExternalRouteType;
30
- /**
31
- * The HTTP status code for the resolvable route.
32
- */
33
- code: number;
34
- /**
35
- * Additional route data. Note that this is not guaranteed to come from
36
- * the driver, its only available when the driver makes it available.
37
- */
38
- data?: DaffRouteData;
39
- }
@@ -1,21 +0,0 @@
1
- /**
2
- * Data associated with a route.
3
- */
4
- export interface DaffRouteData {
5
- /**
6
- * The canonical url of the route.
7
- */
8
- canonical_url?: string;
9
- /**
10
- * The meta description of the route.
11
- */
12
- meta_description?: string;
13
- /**
14
- * The title of the route.
15
- */
16
- title?: string;
17
- /**
18
- * An associated schema for the route. See {@link Schema} for full capabilities.
19
- */
20
- schema?: Record<string, unknown>;
21
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * The routing type of a particular route. E.g. if there's a category
3
- * called "Sweatshirts" with an externally resolved URL of "/sweatshirts"
4
- * Then, this type could be something like "CATEGORY".
5
- */
6
- export type DaffExternalRouteType = string;
@@ -1,11 +0,0 @@
1
- import { Route } from '@angular/router';
2
- import { DaffRouteData } from './route-data';
3
- /**
4
- * A type that describes the special data that Daffodil will store for SEO purposes on
5
- * an external resolved route.
6
- */
7
- export type DaffRouteWithSeoData = Route & {
8
- data: Record<string, any> & {
9
- daffSeoData: DaffRouteData;
10
- };
11
- };
@@ -1,3 +0,0 @@
1
- import { EnvironmentProviders } from '@angular/core';
2
- import { DaffExternalRouterConfiguration } from './config';
3
- export declare const provideExternalRouter: (config?: Partial<DaffExternalRouterConfiguration>) => EnvironmentProviders;
package/public_api.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export { DAFF_EXTERNAL_ROUTER_CONFIG, DaffExternalRouterConfiguration, } from './config';
2
- export * from './model/public_api';
3
- export { provideExternalRouter } from './provide-external-router';
@@ -1,8 +0,0 @@
1
- import { DaffError, DaffInheritableError } from '@daffodil/core';
2
- /**
3
- * An error thrown when the driver encounters a 4xx error.
4
- */
5
- export declare class DaffExternalRouterClientError extends DaffInheritableError implements DaffError {
6
- readonly code: string;
7
- constructor(message?: string);
8
- }
@@ -1,9 +0,0 @@
1
- import { DaffError } from '@daffodil/core';
2
- import { DaffExternalRouterClientError } from './client-error';
3
- /**
4
- * An error thrown when the driver determines that a given url is not resolvable.
5
- */
6
- export declare class DaffExternalRouterNotFoundError extends DaffExternalRouterClientError implements DaffError {
7
- readonly code: string;
8
- constructor(message?: string);
9
- }
@@ -1,10 +0,0 @@
1
- import { DaffError, DaffInheritableError } from '@daffodil/core';
2
- /**
3
- * An error thrown when the driver determines that the url needs to be routed somewhere
4
- * else permanently.
5
- */
6
- export declare class DaffExternalRouterPermanentRedirectError extends DaffInheritableError implements DaffError {
7
- redirectUrl: string;
8
- readonly code: string;
9
- constructor(redirectUrl: string, message?: string);
10
- }
@@ -1,8 +0,0 @@
1
- import { DaffError, DaffInheritableError } from '@daffodil/core';
2
- /**
3
- * An error thrown when the platform performing url resolution fails.
4
- */
5
- export declare class DaffExternalRouterServerError extends DaffInheritableError implements DaffError {
6
- readonly code: string;
7
- constructor(message?: string);
8
- }
@@ -1,10 +0,0 @@
1
- import { DaffError, DaffInheritableError } from '@daffodil/core';
2
- /**
3
- * An error thrown when the driver needs a URI to be temporarily redirected
4
- * to another location.
5
- */
6
- export declare class DaffExternalRouterTemporaryRedirectError extends DaffInheritableError implements DaffError {
7
- redirectUrl: string;
8
- readonly code: string;
9
- constructor(redirectUrl: string, message?: string);
10
- }
@@ -1,10 +0,0 @@
1
- import { UrlSegment, UrlTree } from '@angular/router';
2
- import { Observable } from 'rxjs';
3
- import { DaffRouteWithSeoData } from '@daffodil/external-router';
4
- /**
5
- * A `canMatch` guard function that will resolve a route externally, allowing Angular to match it.
6
- *
7
- * Depending on the resolution result, the route's data will contain `daffSeoData` with supplemental search engine data
8
- * about the route. The data on the route is cumulative. If other data properties are set, they will be merged alongside daffSeoData.
9
- */
10
- export declare const daffExternalMatcherTypeGuard: (type: string) => (route: DaffRouteWithSeoData, segments: Array<UrlSegment>) => Observable<boolean | UrlTree>;
@@ -1,7 +0,0 @@
1
- import { UrlSegment } from '@angular/router';
2
- /**
3
- * Converts a UrlSegment into its complete Url.
4
- *
5
- * @docs-private
6
- */
7
- export declare const daffConvertToPath: (segments: UrlSegment[]) => string;
@@ -1,6 +0,0 @@
1
- import { DaffExternallyResolvableUrl } from '@daffodil/external-router';
2
- /**
3
- * Processes resolved URLs and throws the appropriate error so that External Router
4
- * can handle routing errors.
5
- */
6
- export declare const processErrors: (url: DaffExternallyResolvableUrl) => DaffExternallyResolvableUrl;
@@ -1,6 +0,0 @@
1
- import { DaffExternallyResolvableUrl } from '@daffodil/external-router';
2
- /**
3
- * Processes resolvedUrls and throws the appropriate error so that External Router
4
- * can handle redirects.
5
- */
6
- export declare const processRedirects: (url: DaffExternallyResolvableUrl) => DaffExternallyResolvableUrl;
@@ -1 +0,0 @@
1
- export { daffExternalMatcherTypeGuard } from './guard/external-matcher-type.guard';