@mountainpass/waycharter 2.0.3 → 2.0.5
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 +1 -1
- package/dist/action.d.ts +3 -3
- package/dist/collections/build-first-link.js +1 -2
- package/dist/collections/build-first-link.js.map +1 -1
- package/dist/collections/build-next-link.js +1 -2
- package/dist/collections/build-next-link.js.map +1 -1
- package/dist/collections/build-previous-link.js +1 -2
- package/dist/collections/build-previous-link.js.map +1 -1
- package/dist/collections/built-item-links.js +1 -2
- package/dist/collections/built-item-links.js.map +1 -1
- package/dist/handler.d.ts +7 -8
- package/dist/link.d.ts +2 -2
- package/dist/method.d.ts +5 -5
- package/dist/method.js +2 -3
- package/dist/method.js.map +1 -1
- package/dist/to-links.d.ts +1 -1
- package/dist/to-links.js +1 -2
- package/dist/to-links.js.map +1 -1
- package/dist/util/array-to-lower-case.js +1 -2
- package/dist/util/array-to-lower-case.js.map +1 -1
- package/dist/util/check-page.d.ts +1 -1
- package/dist/util/check-page.js +1 -2
- package/dist/util/check-page.js.map +1 -1
- package/dist/util/convert-resource-links.js +1 -2
- package/dist/util/convert-resource-links.js.map +1 -1
- package/dist/util/extract-path-parameters.js +6 -4
- package/dist/util/extract-path-parameters.js.map +1 -1
- package/dist/util/filter-headers.d.ts +0 -1
- package/dist/util/filter-headers.js +1 -2
- package/dist/util/filter-headers.js.map +1 -1
- package/dist/util/filter-parameters.js +2 -3
- package/dist/util/filter-parameters.js.map +1 -1
- package/dist/util/method-can-have-body.js +1 -2
- package/dist/util/method-can-have-body.js.map +1 -1
- package/dist/util/method-is-cacheable.js +1 -2
- package/dist/util/method-is-cacheable.js.map +1 -1
- package/dist/util/router-to-rfc6570.js +1 -2
- package/dist/util/router-to-rfc6570.js.map +1 -1
- package/dist/util/unique.js +1 -2
- package/dist/util/unique.js.map +1 -1
- package/dist/waycharter.d.ts +9 -9
- package/dist/waycharter.js +51 -54
- package/dist/waycharter.js.map +1 -1
- package/package.json +64 -77
- package/CHANGELOG.md +0 -348
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ This library is compatible with Node.js 10.x, 12.x and 14.x
|
|
|
13
13
|
|
|
14
14
|
<!-- [](https://www.codacy.com/gh/mountain-pass/waycharter/dashboard?utm_source=github.com&utm_medium=referral&utm_content=mountain-pass/waycharter&utm_campaign=Badge_Grade) [](https://www.codacy.com/gh/mountain-pass/waycharter/dashboard?utm_source=github.com&utm_medium=referral&utm_content=mountain-pass/waycharter&utm_campaign=Badge_Coverage) -->
|
|
15
15
|
|
|
16
|
-
[](https://snyk.io/test/github/mountain-pass/waycharter) [](https://snyk.io/test/github/mountain-pass/waycharter) [](https://snyk.io/test/npm/@mountainpass/waycharter/2.0.5)
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
[](https://conventionalcommits.org) [](https://github.com/prettier/prettier)
|
package/dist/action.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ActionMap, ItemActionMap } from './method';
|
|
2
2
|
import { BaseLink } from './link';
|
|
3
3
|
import { ActionHandler } from './handler';
|
|
4
|
-
export
|
|
4
|
+
export type Action<ActionResponseBody> = Omit<BaseLink, 'uri' | 'method'> & {
|
|
5
5
|
handler: ActionHandler<ActionResponseBody>;
|
|
6
6
|
} & Record<string, any>;
|
|
7
|
-
export
|
|
8
|
-
export
|
|
7
|
+
export type Actions<ActionResponseBody> = ActionMap<Array<Action<ActionResponseBody>>>;
|
|
8
|
+
export type ItemActions<CanonicalItemActionResponseBody> = ItemActionMap<Array<Action<CanonicalItemActionResponseBody>>>;
|
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.buildFirstLink =
|
|
14
|
+
exports.buildFirstLink = buildFirstLink;
|
|
15
15
|
/**
|
|
16
16
|
* @param hasMore
|
|
17
17
|
* @param pageInt
|
|
@@ -35,5 +35,4 @@ function buildFirstLink(collectionPath, otherParameters) {
|
|
|
35
35
|
}
|
|
36
36
|
];
|
|
37
37
|
}
|
|
38
|
-
exports.buildFirstLink = buildFirstLink;
|
|
39
38
|
//# sourceMappingURL=build-first-link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-first-link.js","sourceRoot":"","sources":["../../src/collections/build-first-link.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-first-link.js","sourceRoot":"","sources":["../../src/collections/build-first-link.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAUA,wCAmBC;AA3BD;;;;;;;GAOG;AACH,SAAgB,cAAc,CAC5B,cAAsB,EACtB,eAAsB;IAEtB,OAAO,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,GAAG,CAAC;QAC5C,CAAC,CAAC;YACA;gBACE,GAAG,EAAE,OAAO;gBACZ,GAAG,EAAE,UAAG,cAAc,cAAI,IAAI,eAAe,cACxC,eAAyC,EAC5C,CAAC,QAAQ,EAAE,CAAE;aAChB;SACF;QACD,CAAC,CAAC;YACA;gBACE,GAAG,EAAE,OAAO;gBACZ,GAAG,EAAE,cAAc;aACpB;SACF,CAAA;AACL,CAAC"}
|
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.buildNextLink =
|
|
14
|
+
exports.buildNextLink = buildNextLink;
|
|
15
15
|
/**
|
|
16
16
|
* @param nextPage
|
|
17
17
|
* @param collectionPath
|
|
@@ -27,5 +27,4 @@ function buildNextLink(nextPage, collectionPath, otherParameters) {
|
|
|
27
27
|
]
|
|
28
28
|
: [];
|
|
29
29
|
}
|
|
30
|
-
exports.buildNextLink = buildNextLink;
|
|
31
30
|
//# sourceMappingURL=build-next-link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-next-link.js","sourceRoot":"","sources":["../../src/collections/build-next-link.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-next-link.js","sourceRoot":"","sources":["../../src/collections/build-next-link.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAOA,sCAgBC;AArBD;;;;GAIG;AACH,SAAgB,aAAa,CAC3B,QAA4B,EAC5B,cAAsB,EACtB,eAAsB;IAEtB,OAAO,QAAQ,KAAK,SAAS;QAC3B,CAAC,CAAC;YACA;gBACE,GAAG,EAAE,MAAM;gBACX,GAAG,EAAE,UAAG,cAAc,cAAI,IAAI,eAAe,YAC3C,IAAI,EAAE,QAAQ,IACX,eAAe,EAClB,CAAC,QAAQ,EAAE,CAAE;aAChB;SACF;QACD,CAAC,CAAC,EAAE,CAAA;AACR,CAAC"}
|
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.buildPreviousLink =
|
|
14
|
+
exports.buildPreviousLink = buildPreviousLink;
|
|
15
15
|
/**
|
|
16
16
|
* @param previousPage
|
|
17
17
|
* @param collectionPath
|
|
@@ -25,5 +25,4 @@ function buildPreviousLink(previousPage, collectionPath, otherParameters) {
|
|
|
25
25
|
}
|
|
26
26
|
] : [];
|
|
27
27
|
}
|
|
28
|
-
exports.buildPreviousLink = buildPreviousLink;
|
|
29
28
|
//# sourceMappingURL=build-previous-link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-previous-link.js","sourceRoot":"","sources":["../../src/collections/build-previous-link.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-previous-link.js","sourceRoot":"","sources":["../../src/collections/build-previous-link.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAOA,8CAcC;AAnBD;;;;GAIG;AACH,SAAgB,iBAAiB,CAC/B,YAAgC,EAChC,cAAsB,EACtB,eAAsB;IAEtB,OAAO,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC;QAClC;YACE,GAAG,EAAE,MAAM;YACX,GAAG,EAAE,UAAG,cAAc,cAAI,IAAI,eAAe,YAC3C,IAAI,EAAE,YAAY,IACf,eAAe,EAClB,CAAC,QAAQ,EAAE,CAAE;SAChB;KACF,CAAC,CAAC,CAAC,EAAE,CAAC;AACT,CAAC"}
|
|
@@ -47,7 +47,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
47
47
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
48
48
|
};
|
|
49
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
-
exports.builtItemLinks =
|
|
50
|
+
exports.builtItemLinks = builtItemLinks;
|
|
51
51
|
var to_links_1 = require("../to-links");
|
|
52
52
|
/**
|
|
53
53
|
* @param array
|
|
@@ -85,5 +85,4 @@ function builtItemLinks(collectionPointer, itemEndPoint, selfUri, itemActions) {
|
|
|
85
85
|
}
|
|
86
86
|
return { itemLinks: itemLinks, canonicalLinks: canonicalLinks };
|
|
87
87
|
}
|
|
88
|
-
exports.builtItemLinks = builtItemLinks;
|
|
89
88
|
//# sourceMappingURL=built-item-links.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"built-item-links.js","sourceRoot":"","sources":["../../src/collections/built-item-links.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"built-item-links.js","sourceRoot":"","sources":["../../src/collections/built-item-links.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,wCAsCC;AApDD,wCAAqC;AAKrC;;;;;;;;GAQG;AACH,SAAgB,cAAc,CAC5B,iBAAyB,EACzB,YAAyE,EACzE,OAAe,EACf,WAAyD;IAIzD,IAAM,SAAS,GAAG,EAAE,CAAA;IACpB,IAAM,cAAc,GAAG,EAAE,CAAA;IACzB,SAAS,CAAC,IAAI,CAAC;QACb,GAAG,EAAE,MAAM;QACX,GAAG,EAAE,WAAI,iBAAiB,CAAE;KAC7B,CAAC,CAAA;IACF,IAAI,YAAY,EAAE,CAAC;QACjB,cAAc,CAAC,IAAI,CAAC;YAClB,GAAG,EAAE,WAAW;YAChB,GAAG,EAAE,YAAY,CAAC,YAAY;YAC9B,MAAM,EAAE,WAAI,iBAAiB,CAAE;SAChC,CAAC,CAAA;IACJ,CAAC;IACD,IAAI,WAAW,EAAE,CAAC;QAChB,SAAS,CAAC,IAAI,OAAd,SAAS,2BACJ,IAAA,kBAAO,EAAC,WAAW,EAAE,OAAO,EAAE,UAAA,MAAM;YAC7B,IAAA,MAAM,GAAuB,MAAM,OAA7B,EAAE,MAAM,GAAe,MAAM,OAArB,EAAK,KAAK,UAAK,MAAM,EAArC,oBAA4B,CAAF,CAAW;YAC3C,6BACK,KAAK,KACR,MAAM,EAAE,WAAI,iBAAiB,CAAE,EAC/B,MAAM,EAAE,MAAM,IAAI;oBAChB,kBAAkB;oBAClB,mCAAmC;oBACnC,qBAAqB;iBACtB,CAAC,uCAAuC;gBAC1C;QACH,CAAC,CAAC,WACH;IACH,CAAC;IACD,OAAO,EAAE,SAAS,WAAA,EAAE,cAAc,gBAAA,EAAE,CAAA;AACtC,CAAC"}
|
package/dist/handler.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import express from 'express';
|
|
3
2
|
import { Query, ParamsDictionary } from 'express-serve-static-core';
|
|
4
3
|
import { IncomingHttpHeaders } from 'http';
|
|
5
|
-
export
|
|
4
|
+
export type HandlerParameters<ResponseBody> = {
|
|
6
5
|
pathParameters: ParamsDictionary;
|
|
7
6
|
queryParameters: Query;
|
|
8
7
|
requestHeaders: IncomingHttpHeaders;
|
|
@@ -10,12 +9,12 @@ export declare type HandlerParameters<ResponseBody> = {
|
|
|
10
9
|
response: express.Response<ResponseBody>;
|
|
11
10
|
next: express.NextFunction;
|
|
12
11
|
};
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
page
|
|
12
|
+
export type Handler<ResponseBody> = (parameters: HandlerParameters<ResponseBody>) => Promise<void> | void;
|
|
13
|
+
export type CollectionHandlerParameters<ResponseBody> = HandlerParameters<ResponseBody> & {
|
|
14
|
+
page?: string;
|
|
16
15
|
};
|
|
17
|
-
export
|
|
18
|
-
export
|
|
16
|
+
export type CollectionHandler<ResponseBody> = (parameters: CollectionHandlerParameters<ResponseBody>) => Promise<void> | void;
|
|
17
|
+
export type ActionHandlerParameters<ResponseBody> = Omit<HandlerParameters<ResponseBody>, 'requestHeaders'> & {
|
|
19
18
|
bodyParameters: Record<string, unknown>;
|
|
20
19
|
};
|
|
21
|
-
export
|
|
20
|
+
export type ActionHandler<ResponseBody> = (parameters: ActionHandlerParameters<ResponseBody>) => Promise<void> | void;
|
package/dist/link.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Method } from './method';
|
|
2
|
-
export
|
|
2
|
+
export type BaseLink = {
|
|
3
3
|
rel: string;
|
|
4
4
|
uri: string;
|
|
5
5
|
anchor?: string;
|
|
@@ -14,4 +14,4 @@ export declare type BaseLink = {
|
|
|
14
14
|
accept?: Array<string>;
|
|
15
15
|
method?: Method;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type Link = BaseLink & Record<string, any>;
|
package/dist/method.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ItemActionMap<V> = {
|
|
2
2
|
POST?: V;
|
|
3
3
|
PUT?: V;
|
|
4
4
|
PATCH?: V;
|
|
5
5
|
CONNECT?: V;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type ItemActionMethod = keyof ItemActionMap<any>;
|
|
8
8
|
/**
|
|
9
9
|
* @param maybeItemActionMethod
|
|
10
10
|
*/
|
|
@@ -12,12 +12,12 @@ export declare type ItemActionMethod = keyof ItemActionMap<any>;
|
|
|
12
12
|
* @param maybeItemActionMethod
|
|
13
13
|
*/
|
|
14
14
|
export declare function isItemActionMethod(maybeItemActionMethod: unknown): maybeItemActionMethod is ItemActionMethod;
|
|
15
|
-
export
|
|
15
|
+
export type ActionMap<V> = ItemActionMap<V> & {
|
|
16
16
|
DELETE?: V;
|
|
17
17
|
OPTIONS?: V;
|
|
18
18
|
TRACE?: V;
|
|
19
19
|
};
|
|
20
|
-
export
|
|
20
|
+
export type ActionMethod = keyof ActionMap<any>;
|
|
21
21
|
/**
|
|
22
22
|
* @param maybeActionMethod
|
|
23
23
|
*/
|
|
@@ -25,4 +25,4 @@ export declare type ActionMethod = keyof ActionMap<any>;
|
|
|
25
25
|
* @param maybeActionMethod
|
|
26
26
|
*/
|
|
27
27
|
export declare function isActionMethod(maybeActionMethod: unknown): maybeActionMethod is ActionMethod;
|
|
28
|
-
export
|
|
28
|
+
export type Method = ActionMethod | 'GET' | 'HEAD';
|
package/dist/method.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isItemActionMethod = isItemActionMethod;
|
|
4
|
+
exports.isActionMethod = isActionMethod;
|
|
4
5
|
var itemActionMapDictionary = {
|
|
5
6
|
POST: '',
|
|
6
7
|
PUT: '',
|
|
@@ -17,7 +18,6 @@ function isItemActionMethod(maybeItemActionMethod) {
|
|
|
17
18
|
return (typeof maybeItemActionMethod === 'string' &&
|
|
18
19
|
Object.prototype.hasOwnProperty.call(itemActionMapDictionary, maybeItemActionMethod));
|
|
19
20
|
}
|
|
20
|
-
exports.isItemActionMethod = isItemActionMethod;
|
|
21
21
|
var actionMapDictionary = {
|
|
22
22
|
POST: '',
|
|
23
23
|
PUT: '',
|
|
@@ -37,5 +37,4 @@ function isActionMethod(maybeActionMethod) {
|
|
|
37
37
|
return (typeof maybeActionMethod === 'string' &&
|
|
38
38
|
Object.prototype.hasOwnProperty.call(actionMapDictionary, maybeActionMethod));
|
|
39
39
|
}
|
|
40
|
-
exports.isActionMethod = isActionMethod;
|
|
41
40
|
//# sourceMappingURL=method.js.map
|
package/dist/method.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method.js","sourceRoot":"","sources":["../src/method.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"method.js","sourceRoot":"","sources":["../src/method.ts"],"names":[],"mappings":";;AAqBA,gDAUC;AAyBD,wCAOC;AAzDD,IAAM,uBAAuB,GAAiC;IAC5D,IAAI,EAAE,EAAE;IACR,GAAG,EAAE,EAAE;IACP,KAAK,EAAE,EAAE;IACT,OAAO,EAAE,EAAE;CACZ,CAAA;AAGD;;GAEG;AAEH;;GAEG;AACH,SAAgB,kBAAkB,CAChC,qBAA8B;IAE9B,OAAO,CACL,OAAO,qBAAqB,KAAK,QAAQ;QACzC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAClC,uBAAuB,EACvB,qBAAqB,CACtB,CACF,CAAA;AACH,CAAC;AAOD,IAAM,mBAAmB,GAA6B;IACpD,IAAI,EAAE,EAAE;IACR,GAAG,EAAE,EAAE;IACP,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;IACT,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,EAAE;CACV,CAAA;AAGD;;GAEG;AAEH;;GAEG;AACH,SAAgB,cAAc,CAC5B,iBAA0B;IAE1B,OAAO,CACL,OAAO,iBAAiB,KAAK,QAAQ;QACrC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAC7E,CAAA;AACH,CAAC"}
|
package/dist/to-links.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Link } from './link';
|
|
2
2
|
import { Action, Actions } from './action';
|
|
3
|
-
export
|
|
3
|
+
export type ActionTransformer<ActionResponseBody> = (action: Readonly<Action<ActionResponseBody>>) => Action<ActionResponseBody>;
|
|
4
4
|
/**
|
|
5
5
|
* @param actions
|
|
6
6
|
* @param uri
|
package/dist/to-links.js
CHANGED
|
@@ -33,7 +33,7 @@ var __values = (this && this.__values) || function(o) {
|
|
|
33
33
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
34
34
|
};
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.toLinks =
|
|
36
|
+
exports.toLinks = toLinks;
|
|
37
37
|
var method_1 = require("./method");
|
|
38
38
|
/**
|
|
39
39
|
* @param actions
|
|
@@ -63,7 +63,6 @@ function toLinks(actions, uri, transform) {
|
|
|
63
63
|
}
|
|
64
64
|
return links;
|
|
65
65
|
}
|
|
66
|
-
exports.toLinks = toLinks;
|
|
67
66
|
/**
|
|
68
67
|
* @param action
|
|
69
68
|
* @param uri
|
package/dist/to-links.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-links.js","sourceRoot":"","sources":["../src/to-links.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"to-links.js","sourceRoot":"","sources":["../src/to-links.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,0BAeC;AA1BD,mCAAuD;AAMvD;;;;GAIG;AACH,SAAgB,OAAO,CACrB,OAAoC,EACpC,GAAW,EACX,SAAiD;;IAEjD,IAAM,KAAK,GAAG,EAAE,CAAA;IAChB,KAAK,IAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,IAAA,uBAAc,EAAC,MAAM,CAAC,EAAE,CAAC;YAC3B,IAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;;gBACrC,KAAqB,IAAA,iCAAA,SAAA,aAAa,CAAA,CAAA,4CAAA,uEAAE,CAAC;oBAAhC,IAAM,MAAM,0BAAA;oBACf,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAA;gBACpD,CAAC;;;;;;;;;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED;;;;;GAKG;AACH,SAAS,MAAM,CACb,MAAkC,EAClC,GAAW,EACX,MAAoB,EACpB,SAAiD;IAEjD,IAAM,KAAwB,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,EAA5D,OAAO,aAAA,EAAK,KAAK,cAAnB,WAAqB,CAAyC,CAAA;IACpE,6BACK,KAAK,KACR,GAAG,KAAA,EACH,MAAM,QAAA,IACP;AACH,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.arrayToLowerCase =
|
|
3
|
+
exports.arrayToLowerCase = arrayToLowerCase;
|
|
4
4
|
/**
|
|
5
5
|
* @param array
|
|
6
6
|
*/
|
|
7
7
|
function arrayToLowerCase(array) {
|
|
8
8
|
return array ? array.map(function (value) { return value.toLowerCase(); }) : undefined;
|
|
9
9
|
}
|
|
10
|
-
exports.arrayToLowerCase = arrayToLowerCase;
|
|
11
10
|
//# sourceMappingURL=array-to-lower-case.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array-to-lower-case.js","sourceRoot":"","sources":["../../src/util/array-to-lower-case.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"array-to-lower-case.js","sourceRoot":"","sources":["../../src/util/array-to-lower-case.ts"],"names":[],"mappings":";;AAGA,4CAEC;AALD;;GAEG;AACH,SAAgB,gBAAgB,CAAE,KAAwB;IACxD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,UAAA,KAAK,IAAI,OAAA,KAAK,CAAC,WAAW,EAAE,EAAnB,CAAmB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AACpE,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { ParsedQs } from 'qs';
|
|
|
4
4
|
/**
|
|
5
5
|
* @param page
|
|
6
6
|
*/
|
|
7
|
-
export declare function checkPage(page: string | ParsedQs | string[] | ParsedQs[] | undefined): {
|
|
7
|
+
export declare function checkPage(page: string | ParsedQs | string[] | ParsedQs[] | (string | ParsedQs)[] | undefined): {
|
|
8
8
|
page?: string;
|
|
9
9
|
} | {
|
|
10
10
|
pageValidationError: HandlerResponse<ProblemDocument>;
|
package/dist/util/check-page.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkPage =
|
|
3
|
+
exports.checkPage = checkPage;
|
|
4
4
|
var problem_document_1 = require("@mountainpass/problem-document");
|
|
5
5
|
/**
|
|
6
6
|
* @param page
|
|
@@ -21,5 +21,4 @@ function checkPage(page) {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
exports.checkPage = checkPage;
|
|
25
24
|
//# sourceMappingURL=check-page.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-page.js","sourceRoot":"","sources":["../../src/util/check-page.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"check-page.js","sourceRoot":"","sources":["../../src/util/check-page.ts"],"names":[],"mappings":";;AAMA,8BAiBC;AAvBD,mEAAgE;AAGhE;;GAEG;AACH,SAAgB,SAAS,CACvB,IAAmF;IAEnF,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,EAAE,IAAI,MAAA,EAAE,CAAC,CAAC,CAAC;QAC1E,mBAAmB,EAAE;YACnB,MAAM,EAAE,GAAG;YACX,IAAI,EAAE,IAAI,kCAAe,CAAC;gBACxB,IAAI,EAAE,gCAAgC;gBACtC,KAAK,EAAE,UAAU;gBACjB,MAAM,EAAE,yCAAkC,IAAI,yCAAsC;gBACpF,IAAI,MAAA;aACL,CAAC;YACF,OAAO,EAAE;gBACP,cAAc,EAAE,0BAA0B;aAC3C;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.covertResourceLinks =
|
|
39
|
+
exports.covertResourceLinks = covertResourceLinks;
|
|
40
40
|
var http_link_header_1 = __importDefault(require("http-link-header"));
|
|
41
41
|
/**
|
|
42
42
|
* @param resourceLinks
|
|
@@ -69,5 +69,4 @@ function covertResourceLinks(resourceLinks) {
|
|
|
69
69
|
}
|
|
70
70
|
return links;
|
|
71
71
|
}
|
|
72
|
-
exports.covertResourceLinks = covertResourceLinks;
|
|
73
72
|
//# sourceMappingURL=convert-resource-links.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-resource-links.js","sourceRoot":"","sources":["../../src/util/convert-resource-links.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"convert-resource-links.js","sourceRoot":"","sources":["../../src/util/convert-resource-links.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,kDAsBC;AA7BD,sEAAyC;AAGzC;;;GAGG;AACH,SAAgB,mBAAmB,CAAE,aAA0B;;IAC7D,IAAM,KAAK,GAAG,IAAI,0BAAU,EAAE,CAAA;;QAC9B,KAAmB,IAAA,kBAAA,SAAA,aAAa,CAAA,4CAAA,uEAAE,CAAC;YAA9B,IAAM,IAAI,0BAAA;YACL,IAAY,cAAc,GAAqC,IAAI,WAAzC,EAAE,MAAM,GAA6B,IAAI,OAAjC,EAAE,GAAG,GAAwB,IAAI,IAA5B,EAAE,OAAO,GAAe,IAAI,QAAnB,EAAK,KAAK,UAAK,IAAI,EAArE,0CAA8D,CAAF,CAAS;YAC3E,IAAM,aAAa,GACjB,cAAc;gBACd,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC;oBAC3D,CAAC,OAAO,cAAc,KAAK,QAAQ;wBACjC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAA;YAE9C,KAAK,CAAC,GAAG,yCACJ,KAAK,KACR,GAAG,KAAA,KACA,CAAC,aAAa,IAAI;gBACnB,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE;aACrD,CAAC,GACC,CAAC,MAAM,IAAI;gBACZ,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;aAC7B,CAAC,EACF,CAAA;QACJ,CAAC;;;;;;;;;IACD,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extractPathParameters =
|
|
4
|
-
var uri_template_lite_1 = require("uri-template-lite");
|
|
6
|
+
exports.extractPathParameters = extractPathParameters;
|
|
7
|
+
var uri_template_lite_1 = __importDefault(require("uri-template-lite"));
|
|
5
8
|
/**
|
|
6
9
|
* @param uriTemplate
|
|
7
10
|
*/
|
|
8
11
|
function extractPathParameters(uriTemplate) {
|
|
9
|
-
var template = new uri_template_lite_1.
|
|
12
|
+
var template = new uri_template_lite_1.default(uriTemplate);
|
|
10
13
|
return template.match(uriTemplate);
|
|
11
14
|
}
|
|
12
|
-
exports.extractPathParameters = extractPathParameters;
|
|
13
15
|
//# sourceMappingURL=extract-path-parameters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-path-parameters.js","sourceRoot":"","sources":["../../src/util/extract-path-parameters.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extract-path-parameters.js","sourceRoot":"","sources":["../../src/util/extract-path-parameters.ts"],"names":[],"mappings":";;;;;AAKA,sDAOC;AAZD,wEAAwC;AAExC;;GAEG;AACH,SAAgB,qBAAqB,CACnC,WAAmB;IAInB,IAAM,QAAQ,GAAG,IAAI,2BAAQ,CAAC,WAAW,CAAC,CAAA;IAC1C,OAAO,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;AACpC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.filterHeaders =
|
|
3
|
+
exports.filterHeaders = filterHeaders;
|
|
4
4
|
/**
|
|
5
5
|
* @param request
|
|
6
6
|
* @param response
|
|
@@ -18,5 +18,4 @@ function filterHeaders(request, response, headerParameters) {
|
|
|
18
18
|
}
|
|
19
19
|
return {};
|
|
20
20
|
}
|
|
21
|
-
exports.filterHeaders = filterHeaders;
|
|
22
21
|
//# sourceMappingURL=filter-headers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-headers.js","sourceRoot":"","sources":["../../src/util/filter-headers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"filter-headers.js","sourceRoot":"","sources":["../../src/util/filter-headers.ts"],"names":[],"mappings":";;AAQA,sCAeC;AApBD;;;;GAIG;AACH,SAAgB,aAAa,CAC3B,OAAwB,EACxB,QAA0B,EAC1B,gBAA0B;IAE1B,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChC,IAAM,eAAe,GAAG,EAAE,CAAA;QAC1B,KAAK,IAAM,UAAU,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACzC,IAAI,gBAAgB,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC1C,eAAe,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;YAC3D,CAAC;QACH,CAAC;QACD,OAAO,eAAe,CAAA;IACxB,CAAC;IACD,OAAO,EAAE,CAAA;AACX,CAAC"}
|
|
@@ -22,7 +22,8 @@ var __values = (this && this.__values) || function(o) {
|
|
|
22
22
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.
|
|
25
|
+
exports.filterParameters = filterParameters;
|
|
26
|
+
exports.filterBodyParameters = filterBodyParameters;
|
|
26
27
|
var method_can_have_body_1 = require("./method-can-have-body");
|
|
27
28
|
/**
|
|
28
29
|
* @param filters
|
|
@@ -60,7 +61,6 @@ function filterParameters(filters, queryParameters) {
|
|
|
60
61
|
}
|
|
61
62
|
return filteredParameters;
|
|
62
63
|
}
|
|
63
|
-
exports.filterParameters = filterParameters;
|
|
64
64
|
/**
|
|
65
65
|
* @param request
|
|
66
66
|
* @param parameters
|
|
@@ -83,5 +83,4 @@ function filterBodyParameters(request, parameters) {
|
|
|
83
83
|
return {};
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
exports.filterBodyParameters = filterBodyParameters;
|
|
87
86
|
//# sourceMappingURL=filter-parameters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-parameters.js","sourceRoot":"","sources":["../../src/util/filter-parameters.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"filter-parameters.js","sourceRoot":"","sources":["../../src/util/filter-parameters.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAQA,4CAaC;AAMD,oDAkBC;AA3CD,+DAA0D;AAE1D;;;GAGG;AACH,SAAgB,gBAAgB,CAC9B,OAAqD,EACrD,eAAsB;;IAEtB,IAAM,kBAAkB,GAAG,EAAE,CAAA;;QAC7B,KAAqB,IAAA,KAAA,SAAA,OAAO,IAAI,EAAE,CAAA,gBAAA,4BAAE,CAAC;YAAhC,IAAM,MAAM,WAAA;;gBACf,KAAwB,IAAA,oBAAA,SAAA,MAAM,CAAC,UAAU,CAAA,CAAA,gBAAA,4BAAE,CAAC;oBAAvC,IAAM,SAAS,WAAA;oBAClB,IAAI,eAAe,CAAC,SAAS,CAAC,KAAK,SAAS,EAAE,CAAC;wBAC7C,kBAAkB,CAAC,SAAS,CAAC,GAAG,eAAe,CAAC,SAAS,CAAC,CAAA;oBAC5D,CAAC;gBACH,CAAC;;;;;;;;;QACH,CAAC;;;;;;;;;IACD,OAAO,kBAAkB,CAAA;AAC3B,CAAC;AAED;;;GAGG;AACH,SAAgB,oBAAoB,CAClC,OAAgB,EAChB,UAAwD;IAExD,IAAI,UAAU,EAAE,CAAC;QACf,IAAM,WAAW,GAAG,IAAA,wCAAiB,EAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QACrD,IAAI,WAAW,EAAE,CAAC;YAChB,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;iBAC7B,MAAM,CAAC,UAAA,GAAG;gBACT,OAAA,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC;YAAtE,CAAsE,CACvE;iBACA,MAAM,CAAC,UAAC,QAAQ,EAAE,OAAO;;gBACxB,6BAAY,QAAQ,gBAAG,OAAO,IAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,OAAE;YAC1D,CAAC,EAAE,EAAE,CAAC,CAAA;QACV,CAAC;IACH,CAAC;SAAM,CAAC;QACN,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.methodCanHaveBody =
|
|
3
|
+
exports.methodCanHaveBody = methodCanHaveBody;
|
|
4
4
|
/**
|
|
5
5
|
* @param method
|
|
6
6
|
*/
|
|
7
7
|
function methodCanHaveBody(method) {
|
|
8
8
|
return !['GET', 'DELETE', 'TRACE', 'OPTIONS', 'HEAD'].includes(method);
|
|
9
9
|
}
|
|
10
|
-
exports.methodCanHaveBody = methodCanHaveBody;
|
|
11
10
|
//# sourceMappingURL=method-can-have-body.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method-can-have-body.js","sourceRoot":"","sources":["../../src/util/method-can-have-body.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"method-can-have-body.js","sourceRoot":"","sources":["../../src/util/method-can-have-body.js"],"names":[],"mappings":";;AAGA,8CAEC;AALD;;GAEG;AACH,SAAgB,iBAAiB,CAAE,MAAM;IACvC,OAAO,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;AACxE,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.methodIsCacheable =
|
|
3
|
+
exports.methodIsCacheable = methodIsCacheable;
|
|
4
4
|
/**
|
|
5
5
|
* @param method
|
|
6
6
|
*/
|
|
7
7
|
function methodIsCacheable(method) {
|
|
8
8
|
return ['GET', 'HEAD'].includes(method);
|
|
9
9
|
}
|
|
10
|
-
exports.methodIsCacheable = methodIsCacheable;
|
|
11
10
|
//# sourceMappingURL=method-is-cacheable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method-is-cacheable.js","sourceRoot":"","sources":["../../src/util/method-is-cacheable.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"method-is-cacheable.js","sourceRoot":"","sources":["../../src/util/method-is-cacheable.js"],"names":[],"mappings":";;AAGA,8CAEC;AALD;;GAEG;AACH,SAAgB,iBAAiB,CAAE,MAAM;IACvC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;AACzC,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.routerToRfc6570 =
|
|
3
|
+
exports.routerToRfc6570 = routerToRfc6570;
|
|
4
4
|
/**
|
|
5
5
|
* @param url
|
|
6
6
|
*/
|
|
7
7
|
function routerToRfc6570(url) {
|
|
8
8
|
return url.replace(/:(\w*)/g, '{+$1}');
|
|
9
9
|
}
|
|
10
|
-
exports.routerToRfc6570 = routerToRfc6570;
|
|
11
10
|
//# sourceMappingURL=router-to-rfc6570.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-to-rfc6570.js","sourceRoot":"","sources":["../../src/util/router-to-rfc6570.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"router-to-rfc6570.js","sourceRoot":"","sources":["../../src/util/router-to-rfc6570.js"],"names":[],"mappings":";;AAGA,0CAEC;AALD;;GAEG;AACH,SAAgB,eAAe,CAAC,GAAG;IACjC,OAAO,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;AACxC,CAAC"}
|
package/dist/util/unique.js
CHANGED
|
@@ -25,12 +25,11 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
25
25
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.unique =
|
|
28
|
+
exports.unique = unique;
|
|
29
29
|
/**
|
|
30
30
|
* @param array
|
|
31
31
|
*/
|
|
32
32
|
function unique(array) {
|
|
33
33
|
return __spreadArray([], __read(new Set(array)), false);
|
|
34
34
|
}
|
|
35
|
-
exports.unique = unique;
|
|
36
35
|
//# sourceMappingURL=unique.js.map
|
package/dist/util/unique.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unique.js","sourceRoot":"","sources":["../../src/util/unique.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"unique.js","sourceRoot":"","sources":["../../src/util/unique.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,wBAEC;AALD;;GAEG;AACH,SAAgB,MAAM,CAAK,KAAe;IACxC,gCAAW,IAAI,GAAG,CAAC,KAAK,CAAC,UAAC;AAC5B,CAAC"}
|
package/dist/waycharter.d.ts
CHANGED
|
@@ -3,25 +3,25 @@ import { Link } from './link';
|
|
|
3
3
|
import { Handler, CollectionHandler } from './handler';
|
|
4
4
|
import { Actions, ItemActions } from './action';
|
|
5
5
|
import { ProblemDocument } from '@mountainpass/problem-document';
|
|
6
|
-
export
|
|
6
|
+
export type EmptyHandlerResponse = {
|
|
7
7
|
links?: Array<Link>;
|
|
8
8
|
headers?: {
|
|
9
9
|
[key: string]: string;
|
|
10
10
|
};
|
|
11
11
|
status?: number;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type HandlerResponse<ResponseBody> = EmptyHandlerResponse & {
|
|
14
14
|
body: ResponseBody;
|
|
15
15
|
};
|
|
16
|
-
export
|
|
16
|
+
export type CollectionHandlerResponse<ResponseBody> = HandlerResponse<ResponseBody> & {
|
|
17
17
|
collectionPointer: string;
|
|
18
18
|
prevPage?: string;
|
|
19
19
|
nextPage?: string;
|
|
20
20
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
type ChartItem<ResponseBody> = (arguments_: HandlerResponse<ResponseBody>) => void;
|
|
22
|
+
type ChartError = (arguments_: HandlerResponse<ProblemDocument>) => void;
|
|
23
|
+
type ChartCollection<ResponseBody> = (arguments_: CollectionHandlerResponse<ResponseBody>) => void;
|
|
24
|
+
type ChartRedirect = (arguments_: EmptyHandlerResponse) => void;
|
|
25
25
|
declare module 'express' {
|
|
26
26
|
interface Response<ResBody = any> {
|
|
27
27
|
chart: ChartItem<ResBody>;
|
|
@@ -30,7 +30,7 @@ declare module 'express' {
|
|
|
30
30
|
chartRedirect: ChartRedirect;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
export
|
|
33
|
+
export type EndPointParameters<ResponseBody, ActionResponseBody> = {
|
|
34
34
|
router: express.Router;
|
|
35
35
|
path: string;
|
|
36
36
|
headerParameters?: Array<string>;
|
|
@@ -38,7 +38,7 @@ export declare type EndPointParameters<ResponseBody, ActionResponseBody> = {
|
|
|
38
38
|
actions?: Actions<ActionResponseBody>;
|
|
39
39
|
links?: Link[];
|
|
40
40
|
};
|
|
41
|
-
|
|
41
|
+
type CollectionEndPointParameters<ResponseBody, ActionResponseBody, CanonicalItemResponseBody, CanonicalItemActionResponseBody> = Omit<EndPointParameters<ResponseBody, ActionResponseBody>, 'handler'> & {
|
|
42
42
|
handler: CollectionHandler<ResponseBody>;
|
|
43
43
|
filters?: Array<{
|
|
44
44
|
rel: string;
|