itrm-tools 1.4.10 → 1.6.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/dist/api/APIRequestBuilder.d.ts +24 -0
- package/dist/api/APIRequestBuilder.js.map +1 -1
- package/dist/api/APIService.d.ts +5 -0
- package/dist/api/APIService.js +22 -5
- package/dist/api/APIService.js.map +1 -1
- package/dist/api/request/docs/DocumentationModels.d.ts +18 -0
- package/dist/api/request/docs/DocumentationModels.js.map +1 -1
- package/dist/api/request/docs/DocumentationRequest.d.ts +19 -4
- package/dist/api/request/docs/DocumentationRequest.js +222 -85
- package/dist/api/request/docs/DocumentationRequest.js.map +1 -1
- package/dist/api/request/docs/SchemaInference.d.ts +20 -0
- package/dist/api/request/docs/SchemaInference.js +106 -0
- package/dist/api/request/docs/SchemaInference.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,10 +3,34 @@ export declare interface ISamples {
|
|
|
3
3
|
status: number;
|
|
4
4
|
input: any;
|
|
5
5
|
output: any;
|
|
6
|
+
/** Shown as the example's title; defaults to "Example <n>". */
|
|
7
|
+
name?: string;
|
|
8
|
+
}
|
|
9
|
+
/** What the documentation should say about one parameter or field, by name. */
|
|
10
|
+
export declare interface ParameterDoc {
|
|
11
|
+
description?: string;
|
|
12
|
+
/** Allowed values. */
|
|
13
|
+
enum?: (string | number | boolean)[];
|
|
14
|
+
/** Overrides the declared type (query values always arrive as strings, but may mean integers). */
|
|
15
|
+
type?: "string" | "integer" | "number" | "boolean" | "object" | "array";
|
|
16
|
+
example?: unknown;
|
|
6
17
|
}
|
|
7
18
|
export declare interface DocDetails {
|
|
8
19
|
description: string;
|
|
9
20
|
samples: ISamples[];
|
|
21
|
+
/**
|
|
22
|
+
* Extra documentation per name. It applies to query, path and header parameters and to fields of
|
|
23
|
+
* the body and the response at any depth.
|
|
24
|
+
*/
|
|
25
|
+
parameters?: Record<string, ParameterDoc>;
|
|
26
|
+
/** The body also accepts `{ values: [item, ...] }` (APIRequest checks every item). */
|
|
27
|
+
batch?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The body and the successful responses travel encrypted in `payload`. The samples show them in
|
|
30
|
+
* clear: the documentation publishes that shape as a component and describes `payload` as its
|
|
31
|
+
* ciphertext.
|
|
32
|
+
*/
|
|
33
|
+
encrypted?: boolean;
|
|
10
34
|
}
|
|
11
35
|
export declare abstract class APIRequestBuilder {
|
|
12
36
|
constructor();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"APIRequestBuilder.js","sourceRoot":"","sources":["../../src/api/APIRequestBuilder.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"APIRequestBuilder.js","sourceRoot":"","sources":["../../src/api/APIRequestBuilder.ts"],"names":[],"mappings":";;;AAsCA,MAAsB,iBAAiB;IAEnC,gBAAgB,CAAC;IAKV,qBAAqB,CAAC,IAAY;QACrC,OAAO;YACH,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE;YAC1B,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE;SAClC,CAAA;IACL,CAAC;CACJ;AAdD,8CAcC"}
|
package/dist/api/APIService.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Express } from 'express';
|
|
|
2
2
|
import { APIRequest } from './APIRequest';
|
|
3
3
|
import { APIRouter } from './APIRouter';
|
|
4
4
|
import { ExpressConfiguration } from './ExpressConfiguration';
|
|
5
|
+
import { DocumentationOptions } from './request/docs/DocumentationModels';
|
|
5
6
|
export declare namespace ITRMAPIServiceGlobal {
|
|
6
7
|
var memory: any;
|
|
7
8
|
var service: APIService | undefined;
|
|
@@ -15,6 +16,8 @@ export declare interface APIServiceConfig {
|
|
|
15
16
|
port: string | number;
|
|
16
17
|
express: ExpressConfiguration;
|
|
17
18
|
domain?: string;
|
|
19
|
+
/** Description, security schemes and "Try it" for /api/documentation. */
|
|
20
|
+
documentation?: DocumentationOptions;
|
|
18
21
|
}
|
|
19
22
|
export declare interface APIServiceResponse {
|
|
20
23
|
status: string;
|
|
@@ -28,6 +31,8 @@ export declare class APIService {
|
|
|
28
31
|
protected port: number | string;
|
|
29
32
|
protected config: ExpressConfiguration;
|
|
30
33
|
protected domain: string | undefined;
|
|
34
|
+
protected documentation: DocumentationOptions;
|
|
35
|
+
private documentationEnabled;
|
|
31
36
|
constructor(config: APIServiceConfig);
|
|
32
37
|
init(): void;
|
|
33
38
|
addRouter(router: APIRouter): void;
|
package/dist/api/APIService.js
CHANGED
|
@@ -22,11 +22,14 @@ class APIService {
|
|
|
22
22
|
port;
|
|
23
23
|
config;
|
|
24
24
|
domain;
|
|
25
|
+
documentation;
|
|
26
|
+
documentationEnabled = false;
|
|
25
27
|
constructor(config) {
|
|
26
28
|
this.name = config.name;
|
|
27
29
|
this.port = config.port;
|
|
28
30
|
this.config = config.express;
|
|
29
31
|
this.domain = config.domain;
|
|
32
|
+
this.documentation = config.documentation ?? {};
|
|
30
33
|
}
|
|
31
34
|
init() {
|
|
32
35
|
ITRMAPIServiceGlobal.service = this;
|
|
@@ -53,12 +56,26 @@ class APIService {
|
|
|
53
56
|
requests: ITRMAPIServiceGlobal.requests
|
|
54
57
|
};
|
|
55
58
|
}
|
|
59
|
+
// Registers /api/documentation once, however many times it is called (init() calls it and so do
|
|
60
|
+
// many services). The document is built per request, so routers added later are included.
|
|
56
61
|
async enableDocumentation() {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
if (!this.documentationEnabled) {
|
|
63
|
+
this.documentationEnabled = true;
|
|
64
|
+
const { apiReference } = await import('@scalar/express-api-reference');
|
|
65
|
+
const hideTestRequest = this.documentation.hideTestRequestButton ?? true;
|
|
66
|
+
// The same document as plain JSON, for clients and assistants that read OpenAPI directly.
|
|
67
|
+
// Registered before the page: app.use('/api/documentation') would also match this path.
|
|
68
|
+
this.app.get('/api/documentation/openapi.json', (req, res) => {
|
|
69
|
+
res.status(200).json(new DocumentationRequest_1.DocumentationRequest(this.documentation).init());
|
|
70
|
+
});
|
|
71
|
+
this.app.use('/api/documentation', (req, res, next) => {
|
|
72
|
+
apiReference({
|
|
73
|
+
content: new DocumentationRequest_1.DocumentationRequest(this.documentation).init(),
|
|
74
|
+
hideTestRequestButton: hideTestRequest,
|
|
75
|
+
hideClientButton: hideTestRequest,
|
|
76
|
+
})(req, res, next); // Scalar's handler ignores the request (typed Request<never>)
|
|
77
|
+
});
|
|
78
|
+
}
|
|
62
79
|
}
|
|
63
80
|
run(init) {
|
|
64
81
|
return new Promise((resolve, reject) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"APIService.js","sourceRoot":"","sources":["../../src/api/APIService.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"APIService.js","sourceRoot":"","sources":["../../src/api/APIService.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA4E;AAI5E,8EAA2E;AAG3E,IAAiB,oBAAoB,CAOpC;AAPD,WAAiB,oBAAoB;IACtB,2BAAM,GAAQ,EAAE,CAAC;IACjB,4BAAO,GAA2B,SAAS,CAAC;IAC5C,6BAAQ,GAAQ,EAAE,CAAC;IACnB,4BAAO,GAAQ,EAAE,CAAC;IAClB,8BAAS,GAAa,EAAE,CAAC;IACzB,0BAAK,GAAQ,EAAE,CAAC;AAC/B,CAAC,EAPgB,oBAAoB,oCAApB,oBAAoB,QAOpC;AAiBD,MAAa,UAAU;IACT,MAAM,GAAQ,SAAS,CAAC;IACxB,GAAG,GAAY,IAAA,iBAAO,GAAE,CAAC;IACzB,IAAI,CAAS;IACb,IAAI,CAAkB;IACtB,MAAM,CAAuB;IAC7B,MAAM,CAAqB;IAC3B,aAAa,CAAuB;IACtC,oBAAoB,GAAG,KAAK,CAAC;IAErC,YAAY,MAAwB;QAChC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;Q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I,CAAC,IAAI,EAAE,CAAC,CAAC;gBAC9E,IAAI,CAAC;oBACD,MAAM,IAAI,EAAE,CAAC;oBACb,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,6BAA6B,EAAE,CAAC,CAAC;gBACtE,CAAC;gBAAC,OAAO,GAAQ,EAAE,CAAC;oBAChB,MAAM,CAAC;wBACH,MAAM,EAAE,OAAO;wBACf,OAAO,EAAE,qDAAqD;wBAC9D,KAAK,EAAE,GAAG;qBACb,CAAC,CAAC;gBACP,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAEM,KAAK,CAAC,MAAgB;QACzB,OAAO,IAAI,OAAO,CAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACvD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAQ,EAAE,EAAE;gBACjC,IAAI,GAAG;oBACH,MAAM,CAAC;wBACH,MAAM,EAAE,OAAO;wBACf,OAAO,EAAE,0CAA0C;wBACnD,KAAK,EAAE,GAAG;qBACb,CAAC,CAAC;gBACP,IAAI,CAAC;oBACD,MAAM,MAAM,EAAE,CAAC;oBACf,OAAO,CAAC;wBACJ,MAAM,EAAE,IAAI;wBACZ,OAAO,EAAE,wBAAwB;qBACpC,CAAC,CAAC;gBACP,CAAC;gBAAC,OAAO,GAAQ,EAAE,CAAC;oBAChB,MAAM,CAAC;wBACH,MAAM,EAAE,OAAO;wBACf,OAAO,EAAE,8CAA8C;wBACvD,KAAK,EAAE,GAAG;qBACb,CAAC,CAAC;gBACP,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAhHD,gCAgHC"}
|
|
@@ -26,6 +26,24 @@ export declare const defaultBodySchema: {
|
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* What a service can tell the generated documentation about itself. Every field is optional, so a
|
|
31
|
+
* service that passes nothing keeps the previous behaviour except for the "Try it" buttons.
|
|
32
|
+
*/
|
|
33
|
+
export interface DocumentationOptions {
|
|
34
|
+
/** Markdown shown under the title (e.g. how to sign and encrypt requests). */
|
|
35
|
+
description?: string;
|
|
36
|
+
/**
|
|
37
|
+
* OpenAPI `components.securitySchemes`. Every scheme listed here is required by every operation.
|
|
38
|
+
* Defaults to `bearerAuth` (JWT).
|
|
39
|
+
*/
|
|
40
|
+
securitySchemes?: Record<string, object>;
|
|
41
|
+
/**
|
|
42
|
+
* Hides "Test Request" and "Open API Client". Defaults to `true`: the browser cannot sign or
|
|
43
|
+
* encrypt requests, and those buttons would send credentials from a public page.
|
|
44
|
+
*/
|
|
45
|
+
hideTestRequestButton?: boolean;
|
|
46
|
+
}
|
|
29
47
|
export declare const securitySchema: {
|
|
30
48
|
components: {
|
|
31
49
|
securitySchemes: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentationModels.js","sourceRoot":"","sources":["../../../../src/api/request/docs/DocumentationModels.ts"],"names":[],"mappings":";;;AAAa,QAAA,0BAA0B,GAAG;IACtC,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE;QACF,KAAK,EAAE,eAAe;QACtB,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,eAAe;QAC5B,OAAO,EAAE,EAAE;KACd;IACD,OAAO,EAAE;QACL;YACI,GAAG,EAAE,uBAAuB;SAC/B;KACJ;IACD,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,EAAwB;IAC9B,UAAU,EAAE,EAAE;IACd,QAAQ,EAAE,EAAS;CACtB,CAAC;AAEW,QAAA,iBAAiB,GAAG;IAC7B,OAAO,EAAE;QACL,kBAAkB,EAAE;YAChB,MAAM,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,EAAS;aACxB;SACJ;KACJ;CACJ,CAAC;
|
|
1
|
+
{"version":3,"file":"DocumentationModels.js","sourceRoot":"","sources":["../../../../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AAC"}
|
|
@@ -1,12 +1,27 @@
|
|
|
1
|
+
import { DocumentationOptions } from "./DocumentationModels";
|
|
1
2
|
export declare class DocumentationRequest {
|
|
2
|
-
|
|
3
|
+
private readonly options;
|
|
4
|
+
constructor(options?: DocumentationOptions);
|
|
3
5
|
init(): any;
|
|
4
6
|
private createTagsObject;
|
|
5
7
|
private createPathsObject;
|
|
6
|
-
private
|
|
7
|
-
private
|
|
8
|
+
private buildRoute;
|
|
9
|
+
private buildOperation;
|
|
10
|
+
private summarize;
|
|
11
|
+
private componentKey;
|
|
12
|
+
private describeOperation;
|
|
13
|
+
private describePlaintextBodies;
|
|
14
|
+
private describeCombinations;
|
|
15
|
+
private describeGetExamples;
|
|
16
|
+
private mergeGroups;
|
|
8
17
|
private buildParams;
|
|
18
|
+
private buildParameter;
|
|
9
19
|
private fixParamName;
|
|
20
|
+
private buildBody;
|
|
21
|
+
private declaredBody;
|
|
22
|
+
private inferItem;
|
|
23
|
+
private withBatch;
|
|
24
|
+
private encryptedEnvelope;
|
|
10
25
|
private buildResponses;
|
|
11
|
-
private
|
|
26
|
+
private buildExamples;
|
|
12
27
|
}
|
|
@@ -2,18 +2,31 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DocumentationRequest = void 0;
|
|
4
4
|
const DocumentationModels_1 = require("./DocumentationModels");
|
|
5
|
+
const APIRequest_1 = require("../../APIRequest");
|
|
5
6
|
const APIService_1 = require("../../APIService");
|
|
7
|
+
const SchemaInference_1 = require("./SchemaInference");
|
|
8
|
+
const encryptedPayloadDescription = "Base64(IV ‖ AES-256-CBC(JSON)), see the introduction.";
|
|
9
|
+
const encryptedPlaceholder = "<Base64(IV ‖ AES-256-CBC(plaintext JSON))>";
|
|
6
10
|
class DocumentationRequest {
|
|
7
|
-
|
|
11
|
+
options;
|
|
12
|
+
constructor(options = {}) {
|
|
13
|
+
this.options = options;
|
|
14
|
+
}
|
|
15
|
+
// Builds a fresh document on every call: the shared default is cloned, never mutated, so the
|
|
16
|
+
// routers added after APIService.init() always show up.
|
|
8
17
|
init() {
|
|
9
18
|
const { name, port, domain, routers, requests } = APIService_1.ITRMAPIServiceGlobal.service?.getServerInformation();
|
|
10
|
-
DocumentationModels_1.
|
|
11
|
-
DocumentationModels_1.defaultDocumentationSchema
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
const schemes = this.options.securitySchemes ?? DocumentationModels_1.securitySchema.components.securitySchemes;
|
|
20
|
+
const document = structuredClone(DocumentationModels_1.defaultDocumentationSchema);
|
|
21
|
+
const schemas = {};
|
|
22
|
+
document.info.title = name;
|
|
23
|
+
document.info.description = this.options.description ?? document.info.description;
|
|
24
|
+
document.servers = [{ url: domain ?? `http://localhost:${port}` }];
|
|
25
|
+
document.tags = this.createTagsObject(routers, name);
|
|
26
|
+
document.paths = this.createPathsObject(requests, name, schemas);
|
|
27
|
+
document.components = Object.keys(schemas).length > 0 ? { securitySchemes: schemes, schemas } : { securitySchemes: schemes };
|
|
28
|
+
document.security = [Object.fromEntries(Object.keys(schemes).map((scheme) => [scheme, []]))];
|
|
29
|
+
return document;
|
|
17
30
|
}
|
|
18
31
|
createTagsObject(routers, name) {
|
|
19
32
|
let tags = [];
|
|
@@ -22,65 +35,114 @@ class DocumentationRequest {
|
|
|
22
35
|
tags.push({ name: name });
|
|
23
36
|
return tags;
|
|
24
37
|
}
|
|
25
|
-
createPathsObject(requests, name) {
|
|
26
|
-
|
|
27
|
-
for (
|
|
28
|
-
|
|
29
|
-
paths[
|
|
30
|
-
paths[
|
|
31
|
-
tags: [buildRequest.tag],
|
|
32
|
-
operationId: buildRequest.requestMethod + " " + (buildRequest.name).toLowerCase(),
|
|
33
|
-
description: requests[request].details?.description ?? (buildRequest.name).toLowerCase(),
|
|
34
|
-
summary: requests[request].details?.description ?? (buildRequest.name).toLowerCase(),
|
|
35
|
-
parameters: buildRequest.params,
|
|
36
|
-
responses: this.buildResponses(requests[request])
|
|
37
|
-
};
|
|
38
|
-
if ((buildRequest.requestMethod === "post" || buildRequest.requestMethod === "put") && requests[request].bodyParams.length > 0)
|
|
39
|
-
paths[buildRequest.name][buildRequest.requestMethod].requestBody = this.buildBodyParams(requests[request].bodyParams);
|
|
38
|
+
createPathsObject(requests, name, schemas) {
|
|
39
|
+
const paths = {};
|
|
40
|
+
for (const key in requests) {
|
|
41
|
+
const route = this.buildRoute(requests[key], key, name);
|
|
42
|
+
paths[route.name] = paths[route.name] ?? {};
|
|
43
|
+
paths[route.name][route.method] = this.buildOperation(requests[key], route, schemas);
|
|
40
44
|
}
|
|
41
45
|
return paths;
|
|
42
46
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
return parameters;
|
|
47
|
+
buildRoute(request, requestName, serviceName) {
|
|
48
|
+
const name = requestName.replace(`${request.method}_`, "").replace(/:([^/]+)/g, '{$1}');
|
|
49
|
+
const tag = name === request.path ? serviceName : name.split("/")[1];
|
|
50
|
+
return { name, tag, method: request.method.toLowerCase() };
|
|
51
|
+
}
|
|
52
|
+
buildOperation(request, route, schemas) {
|
|
53
|
+
const details = request.details;
|
|
54
|
+
const groups = request.getRequestDetails().params;
|
|
55
|
+
const docs = details?.parameters ?? {};
|
|
56
|
+
const operation = {
|
|
57
|
+
tags: [route.tag],
|
|
58
|
+
operationId: route.method + " " + route.name.toLowerCase(),
|
|
59
|
+
summary: this.summarize(details?.description ?? route.name.toLowerCase()),
|
|
60
|
+
description: this.describeOperation(details, route, groups),
|
|
61
|
+
parameters: this.buildParams(groups, docs, details?.samples ?? []),
|
|
62
|
+
responses: this.buildResponses(details, this.componentKey(route), schemas),
|
|
63
|
+
};
|
|
64
|
+
const bodyGroups = groups.filter((group) => group.context === APIRequest_1.RequestContext.BODY);
|
|
65
|
+
if ((route.method === "post" || route.method === "put") && bodyGroups.length > 0)
|
|
66
|
+
operation.requestBody = this.buildBody(bodyGroups, details, this.componentKey(route), schemas);
|
|
67
|
+
return operation;
|
|
68
|
+
}
|
|
69
|
+
// The sidebar shows the summary, so it is the first sentence; the operation keeps the whole text.
|
|
70
|
+
summarize(description) {
|
|
71
|
+
return description.split(/(?<=[.!?])\s/)[0].replace(/[.:]$/, "").replace(/\*\*/g, "");
|
|
72
|
+
}
|
|
73
|
+
componentKey(route) {
|
|
74
|
+
return `${route.method}${route.name}`.replace(/[{}]/g, "").replace(/[^A-Za-z0-9._-]+/g, "_");
|
|
75
|
+
}
|
|
76
|
+
// ---------------------------------------------------------------- description
|
|
77
|
+
describeOperation(details, route, groups) {
|
|
78
|
+
const lines = [details?.description ?? route.name.toLowerCase()];
|
|
79
|
+
for (const context of [APIRequest_1.RequestContext.QUERY, APIRequest_1.RequestContext.BODY]) {
|
|
80
|
+
const combinations = this.describeCombinations(groups.filter((group) => group.context === context));
|
|
81
|
+
if (combinations !== undefined)
|
|
82
|
+
lines.push(`Accepted ${context} combinations (at least one must be complete): ${combinations}.`);
|
|
82
83
|
}
|
|
83
|
-
|
|
84
|
+
const examples = route.method === "get" ? this.describeGetExamples(details?.samples ?? [], route) : [];
|
|
85
|
+
if (examples.length > 0)
|
|
86
|
+
lines.push("Examples:\n" + examples.join("\n"));
|
|
87
|
+
if (details?.encrypted && (route.method === "post" || route.method === "put"))
|
|
88
|
+
lines.push(...this.describePlaintextBodies(details.samples));
|
|
89
|
+
return lines.join("\n\n");
|
|
90
|
+
}
|
|
91
|
+
describePlaintextBodies(samples) {
|
|
92
|
+
return samples
|
|
93
|
+
.filter((sample) => sample.input !== undefined && sample.input !== null)
|
|
94
|
+
.map((sample, index) => `**${sample.name ?? `Example ${index + 1}`}**: plaintext body, before encrypting it into \`payload\`:\n\n\`\`\`json\n${JSON.stringify(sample.input, null, 2)}\n\`\`\``);
|
|
95
|
+
}
|
|
96
|
+
// An empty group means "nothing is required", so the combinations only matter when there is none.
|
|
97
|
+
describeCombinations(groups) {
|
|
98
|
+
const relevant = groups.length > 1 && groups.every((group) => group.properties.length > 0);
|
|
99
|
+
return relevant
|
|
100
|
+
? groups.map((group) => "`" + group.properties.map((property) => property.name).join(", ") + "`").join(" · ")
|
|
101
|
+
: undefined;
|
|
102
|
+
}
|
|
103
|
+
describeGetExamples(samples, route) {
|
|
104
|
+
return samples
|
|
105
|
+
.filter((sample) => sample.input !== null && typeof sample.input === "object")
|
|
106
|
+
.map((sample) => {
|
|
107
|
+
const query = Object.entries(sample.input)
|
|
108
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
109
|
+
.join("&");
|
|
110
|
+
return `- \`GET ${route.name}${query ? "?" + query : ""}\`${sample.name ? " — " + sample.name : ""}`;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
// ---------------------------------------------------------------- parameters
|
|
114
|
+
// Each group is one accepted combination: a parameter is required only when every group of its
|
|
115
|
+
// context has it (and none is empty). Path parameters are always required.
|
|
116
|
+
mergeGroups(groups) {
|
|
117
|
+
const merged = [];
|
|
118
|
+
for (const group of groups)
|
|
119
|
+
for (const property of group.properties)
|
|
120
|
+
if (!merged.some((existing) => existing.name === property.name))
|
|
121
|
+
merged.push({
|
|
122
|
+
...property,
|
|
123
|
+
required: groups.every((other) => other.properties.some((candidate) => candidate.name === property.name)),
|
|
124
|
+
});
|
|
125
|
+
return merged;
|
|
126
|
+
}
|
|
127
|
+
buildParams(groups, docs, samples) {
|
|
128
|
+
const parameters = [];
|
|
129
|
+
for (const context of [APIRequest_1.RequestContext.PARAMS, APIRequest_1.RequestContext.QUERY, APIRequest_1.RequestContext.HEADERS])
|
|
130
|
+
for (const property of this.mergeGroups(groups.filter((group) => group.context === context)))
|
|
131
|
+
parameters.push(this.buildParameter(property, context, docs[property.name] ?? {}, samples));
|
|
132
|
+
return parameters;
|
|
133
|
+
}
|
|
134
|
+
buildParameter(property, context, doc, samples) {
|
|
135
|
+
const schema = { type: property.type, ...(0, SchemaInference_1.describe)(doc) };
|
|
136
|
+
delete schema.description;
|
|
137
|
+
const parameter = { name: property.name, in: this.fixParamName(context), schema };
|
|
138
|
+
if (context === APIRequest_1.RequestContext.PARAMS || property.required)
|
|
139
|
+
parameter.required = true;
|
|
140
|
+
if (doc.description !== undefined)
|
|
141
|
+
parameter.description = doc.description;
|
|
142
|
+
const example = doc.example ?? samples.find((sample) => sample.input?.[property.name] !== undefined)?.input[property.name];
|
|
143
|
+
if (example !== undefined)
|
|
144
|
+
parameter.example = schema.type === "string" && typeof example !== "object" ? String(example) : example;
|
|
145
|
+
return parameter;
|
|
84
146
|
}
|
|
85
147
|
fixParamName(name) {
|
|
86
148
|
switch (name) {
|
|
@@ -92,32 +154,107 @@ class DocumentationRequest {
|
|
|
92
154
|
return name;
|
|
93
155
|
}
|
|
94
156
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
157
|
+
// ---------------------------------------------------------------- body
|
|
158
|
+
buildBody(groups, details, key, schemas) {
|
|
159
|
+
const docs = details?.parameters ?? {};
|
|
160
|
+
const samples = (details?.samples ?? []).filter((sample) => sample.input !== undefined && sample.input !== null);
|
|
161
|
+
let schema;
|
|
162
|
+
if (details?.encrypted && samples.length > 0) {
|
|
163
|
+
schemas[`${key}_body`] = {
|
|
164
|
+
title: `${key} body (plaintext)`,
|
|
165
|
+
example: samples[0].input,
|
|
166
|
+
...this.withBatch((0, SchemaInference_1.applyParameterDocs)(this.inferItem(samples.map((sample) => sample.input)), docs), details),
|
|
167
|
+
};
|
|
168
|
+
schema = this.encryptedEnvelope(`${key}_body`);
|
|
169
|
+
}
|
|
170
|
+
else
|
|
171
|
+
schema = this.withBatch(this.declaredBody(groups, docs), details);
|
|
172
|
+
const media = { schema };
|
|
173
|
+
// Encrypted: the example is what goes on the wire (clients such as Scalar build curl from it);
|
|
174
|
+
// the plaintext of each sample is in the operation description.
|
|
175
|
+
if (samples.length > 0)
|
|
176
|
+
media.examples = this.buildExamples(samples, (sample) => details?.encrypted ? { payload: encryptedPlaceholder } : sample.input, "");
|
|
177
|
+
return { required: true, content: { "application/json": media } };
|
|
178
|
+
}
|
|
179
|
+
declaredBody(groups, docs) {
|
|
180
|
+
const properties = this.mergeGroups(groups);
|
|
181
|
+
const required = properties.filter((property) => property.required).map((property) => property.name);
|
|
182
|
+
const schema = {
|
|
183
|
+
type: "object",
|
|
184
|
+
properties: Object.fromEntries(properties.map((property) => [property.name, { type: property.type, ...(0, SchemaInference_1.describe)(docs[property.name] ?? {}) }])),
|
|
185
|
+
};
|
|
186
|
+
if (required.length > 0)
|
|
187
|
+
schema.required = required;
|
|
188
|
+
return schema;
|
|
189
|
+
}
|
|
190
|
+
// A batch sample `{ values: [...] }` contributes its items; a single sample contributes itself.
|
|
191
|
+
inferItem(inputs) {
|
|
192
|
+
const items = inputs.flatMap((input) => Array.isArray(input?.values) ? input.values : [input]);
|
|
193
|
+
return items.map(SchemaInference_1.inferSchema).reduce(SchemaInference_1.mergeSchemas, undefined) ?? { type: "object" };
|
|
194
|
+
}
|
|
195
|
+
withBatch(item, details) {
|
|
196
|
+
return details?.batch
|
|
197
|
+
? { oneOf: [item, { type: "object", required: ["values"], properties: { values: { type: "array", items: item } } }] }
|
|
198
|
+
: item;
|
|
199
|
+
}
|
|
200
|
+
encryptedEnvelope(component) {
|
|
201
|
+
return {
|
|
202
|
+
type: "object",
|
|
203
|
+
required: ["payload"],
|
|
204
|
+
properties: {
|
|
205
|
+
payload: {
|
|
206
|
+
type: "string",
|
|
207
|
+
description: `${encryptedPayloadDescription} Plaintext: #/components/schemas/${component}`,
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
// ---------------------------------------------------------------- responses
|
|
213
|
+
buildResponses(details, key, schemas) {
|
|
214
|
+
const response = {};
|
|
215
|
+
const samples = details?.samples ?? [];
|
|
216
|
+
const statuses = [...new Set(samples.map((sample) => sample.status))];
|
|
217
|
+
for (const status of statuses) {
|
|
218
|
+
const own = samples.filter((sample) => sample.status === status);
|
|
219
|
+
const outputs = own.map((sample) => sample.output);
|
|
220
|
+
let schema = (0, SchemaInference_1.applyParameterDocs)(outputs.map(SchemaInference_1.inferSchema).reduce(SchemaInference_1.mergeSchemas, undefined) ?? {}, details?.parameters ?? {});
|
|
221
|
+
const encryptedPayloads = details?.encrypted && status < 300
|
|
222
|
+
? outputs.map((output) => output?.payload).filter((payload) => payload !== undefined && payload !== null)
|
|
223
|
+
: [];
|
|
224
|
+
if (encryptedPayloads.length > 0) {
|
|
225
|
+
const component = `${key}_response_${status}`;
|
|
226
|
+
schemas[component] = {
|
|
227
|
+
title: `${key} response ${status} payload (plaintext)`,
|
|
228
|
+
...(0, SchemaInference_1.applyParameterDocs)(encryptedPayloads.map(SchemaInference_1.inferSchema).reduce(SchemaInference_1.mergeSchemas, undefined), details?.parameters ?? {}),
|
|
229
|
+
};
|
|
230
|
+
schema = {
|
|
231
|
+
...schema,
|
|
232
|
+
properties: {
|
|
233
|
+
...schema.properties,
|
|
234
|
+
payload: { type: "string", description: `${encryptedPayloadDescription} Plaintext: #/components/schemas/${component}` },
|
|
235
|
+
},
|
|
109
236
|
};
|
|
110
237
|
}
|
|
111
|
-
|
|
238
|
+
response[status] = {
|
|
239
|
+
description: DocumentationModels_1.httpStatusCodes[status] ?? "response",
|
|
240
|
+
content: {
|
|
241
|
+
"application/json": {
|
|
242
|
+
schema,
|
|
243
|
+
examples: this.buildExamples(own, (sample) => sample.output, encryptedPayloads.length > 0 ? " (payload in plaintext)" : ""),
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
};
|
|
112
247
|
}
|
|
113
|
-
|
|
114
|
-
return { "200": { description: "Successful response" } };
|
|
248
|
+
return statuses.length > 0 ? response : { "200": { description: "Successful response" } };
|
|
115
249
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
250
|
+
buildExamples(samples, value, suffix) {
|
|
251
|
+
const examples = {};
|
|
252
|
+
samples.forEach((sample, index) => {
|
|
253
|
+
const base = sample.name ?? `Example ${index + 1}`;
|
|
254
|
+
const name = examples[base] === undefined ? base : `${base} (${index + 1})`;
|
|
255
|
+
examples[name] = { summary: name + suffix, value: value(sample) };
|
|
256
|
+
});
|
|
257
|
+
return examples;
|
|
121
258
|
}
|
|
122
259
|
}
|
|
123
260
|
exports.DocumentationRequest = DocumentationRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentationRequest.js","sourceRoot":"","sources":["../../../../src/api/request/docs/DocumentationRequest.ts"],"names":[],"mappings":";;;AAAA,+DAA4I;AAE5I,iDAAwD;AAIxD,MAAa,oBAAoB;IAE7B,gBAAgB,CAAC;IAEV,IAAI;QACP,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,iCAAoB,CAAC,OAAO,EAAE,oBAAoB,EAAG,CAAC;QACxG,gDAA0B,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAC7C,gDAA0B,CAAC,OAAO,GAAG,CAAC,EAAE,GAAG,EAAE,MAAM,IAAI,oBAAoB,IAAI,E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,CAAC;QACH,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ;AArRD,oDAqRC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ParameterDoc } from "../../APIRequestBuilder";
|
|
2
|
+
/** A JSON Schema fragment, as OpenAPI 3.0 understands it. */
|
|
3
|
+
export type JsonSchema = Record<string, any>;
|
|
4
|
+
/**
|
|
5
|
+
* Describes a sample value. Objects list their properties without `required`: one example cannot
|
|
6
|
+
* prove a field is mandatory. Arrays merge the schema of every item.
|
|
7
|
+
*/
|
|
8
|
+
export declare function inferSchema(value: unknown): JsonSchema;
|
|
9
|
+
/**
|
|
10
|
+
* Joins two descriptions of the same field seen in different samples: same type → one schema with
|
|
11
|
+
* the union of properties; `null` → nullable; integer and number → number; anything else → oneOf.
|
|
12
|
+
*/
|
|
13
|
+
export declare function mergeSchemas(a: JsonSchema | undefined, b: JsonSchema | undefined): JsonSchema;
|
|
14
|
+
/**
|
|
15
|
+
* Adds the per-field documentation (description, allowed values, type) to every property with that
|
|
16
|
+
* name, at any depth: the same key (e.g. `statusId`) means the same thing in a body and a response.
|
|
17
|
+
*/
|
|
18
|
+
export declare function applyParameterDocs(schema: JsonSchema, docs: Record<string, ParameterDoc>): JsonSchema;
|
|
19
|
+
/** The schema keywords a ParameterDoc contributes (its example goes on the parameter, not here). */
|
|
20
|
+
export declare function describe(doc: ParameterDoc): JsonSchema;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.inferSchema = inferSchema;
|
|
4
|
+
exports.mergeSchemas = mergeSchemas;
|
|
5
|
+
exports.applyParameterDocs = applyParameterDocs;
|
|
6
|
+
exports.describe = describe;
|
|
7
|
+
/**
|
|
8
|
+
* Describes a sample value. Objects list their properties without `required`: one example cannot
|
|
9
|
+
* prove a field is mandatory. Arrays merge the schema of every item.
|
|
10
|
+
*/
|
|
11
|
+
function inferSchema(value) {
|
|
12
|
+
let schema;
|
|
13
|
+
if (value === null || value === undefined)
|
|
14
|
+
schema = { nullable: true };
|
|
15
|
+
else if (Array.isArray(value))
|
|
16
|
+
schema = { type: "array", items: value.map(inferSchema).reduce(mergeSchemas, undefined) ?? {} };
|
|
17
|
+
else if (typeof value === "object")
|
|
18
|
+
schema = {
|
|
19
|
+
type: "object",
|
|
20
|
+
properties: Object.fromEntries(Object.entries(value).map(([key, item]) => [key, inferSchema(item)])),
|
|
21
|
+
};
|
|
22
|
+
else if (typeof value === "number")
|
|
23
|
+
schema = { type: Number.isInteger(value) ? "integer" : "number" };
|
|
24
|
+
else
|
|
25
|
+
schema = { type: typeof value };
|
|
26
|
+
return schema;
|
|
27
|
+
}
|
|
28
|
+
function isNullOnly(schema) {
|
|
29
|
+
return schema.nullable === true && schema.type === undefined && schema.oneOf === undefined;
|
|
30
|
+
}
|
|
31
|
+
function variants(schema) {
|
|
32
|
+
return schema.oneOf ?? [schema];
|
|
33
|
+
}
|
|
34
|
+
function mergeSameType(a, b) {
|
|
35
|
+
let merged = { ...a, ...b };
|
|
36
|
+
if (a.type === "object") {
|
|
37
|
+
const properties = { ...(a.properties ?? {}) };
|
|
38
|
+
for (const [key, schema] of Object.entries(b.properties ?? {}))
|
|
39
|
+
properties[key] = mergeSchemas(properties[key], schema);
|
|
40
|
+
merged = { ...merged, properties };
|
|
41
|
+
}
|
|
42
|
+
else if (a.type === "array")
|
|
43
|
+
merged = { ...merged, items: mergeSchemas(a.items, b.items) };
|
|
44
|
+
return merged;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Joins two descriptions of the same field seen in different samples: same type → one schema with
|
|
48
|
+
* the union of properties; `null` → nullable; integer and number → number; anything else → oneOf.
|
|
49
|
+
*/
|
|
50
|
+
function mergeSchemas(a, b) {
|
|
51
|
+
let merged;
|
|
52
|
+
if (a === undefined || b === undefined)
|
|
53
|
+
merged = (a ?? b) ?? {};
|
|
54
|
+
else if (isNullOnly(a) || isNullOnly(b)) {
|
|
55
|
+
const typed = isNullOnly(a) ? b : a;
|
|
56
|
+
merged = { ...typed, nullable: true };
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
const numeric = ["integer", "number"];
|
|
60
|
+
const sameType = a.type !== undefined && a.oneOf === undefined && b.oneOf === undefined
|
|
61
|
+
&& (a.type === b.type || (numeric.includes(a.type) && numeric.includes(b.type)));
|
|
62
|
+
if (sameType)
|
|
63
|
+
merged = { ...mergeSameType(a, b), type: a.type === b.type ? a.type : "number" };
|
|
64
|
+
else {
|
|
65
|
+
const options = [...variants(a)];
|
|
66
|
+
for (const option of variants(b)) {
|
|
67
|
+
const index = options.findIndex((existing) => existing.type !== undefined && existing.type === option.type);
|
|
68
|
+
if (index >= 0)
|
|
69
|
+
options[index] = mergeSchemas(options[index], option);
|
|
70
|
+
else
|
|
71
|
+
options.push(option);
|
|
72
|
+
}
|
|
73
|
+
merged = options.length === 1 ? options[0] : { oneOf: options };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return merged;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Adds the per-field documentation (description, allowed values, type) to every property with that
|
|
80
|
+
* name, at any depth: the same key (e.g. `statusId`) means the same thing in a body and a response.
|
|
81
|
+
*/
|
|
82
|
+
function applyParameterDocs(schema, docs) {
|
|
83
|
+
let result = { ...schema };
|
|
84
|
+
if (schema.properties)
|
|
85
|
+
result.properties = Object.fromEntries(Object.entries(schema.properties).map(([key, property]) => {
|
|
86
|
+
const documented = applyParameterDocs(property, docs);
|
|
87
|
+
return [key, docs[key] ? { ...documented, ...describe(docs[key]) } : documented];
|
|
88
|
+
}));
|
|
89
|
+
if (schema.items)
|
|
90
|
+
result.items = applyParameterDocs(schema.items, docs);
|
|
91
|
+
if (schema.oneOf)
|
|
92
|
+
result.oneOf = schema.oneOf.map((option) => applyParameterDocs(option, docs));
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
/** The schema keywords a ParameterDoc contributes (its example goes on the parameter, not here). */
|
|
96
|
+
function describe(doc) {
|
|
97
|
+
const schema = {};
|
|
98
|
+
if (doc.type !== undefined)
|
|
99
|
+
schema.type = doc.type;
|
|
100
|
+
if (doc.enum !== undefined)
|
|
101
|
+
schema.enum = doc.enum;
|
|
102
|
+
if (doc.description !== undefined)
|
|
103
|
+
schema.description = doc.description;
|
|
104
|
+
return schema;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=SchemaInference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaInference.js","sourceRoot":"","sources":["../../../../src/api/request/docs/SchemaInference.ts"],"names":[],"mappings":";;AASA,kCAgBC;AA2BD,oCA2BC;AAMD,gDAYC;AAGD,4BAMC;AArGD;;;GAGG;AACH,SAAgB,WAAW,CAAC,KAAc;IACtC,IAAI,MAAkB,CAAC;IACvB,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;QACrC,MAAM,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SAC3B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACzB,MAAM,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,MAAM,CAAyB,YAAY,EAAE,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC;SACvH,IAAI,OAAO,KAAK,KAAK,QAAQ;QAC9B,MAAM,GAAG;YACL,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,KAAe,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACjH,CAAC;SACD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAC9B,MAAM,GAAG,EAAE,IAAI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,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC1D,IAAI,MAAM,CAAC,KAAK;QACZ,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAkB,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;IAC9F,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,oGAAoG;AACpG,SAAgB,QAAQ,CAAC,GAAiB;IACtC,MAAM,MAAM,GAAe,EAAE,CAAC;IAC9B,IAAI,GAAG,CAAC,IAAI,KAAK,SAAS;QAAE,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;IACnD,IAAI,GAAG,CAAC,IAAI,KAAK,SAAS;QAAE,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;IACnD,IAAI,GAAG,CAAC,WAAW,KAAK,SAAS;QAAE,MAAM,CAAC,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;IACxE,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { buildQuery as buildQuery } from './api/utils/BuildQuery';
|
|
|
5
5
|
export { ApiResponse as ApiResponse, PaginationMeta as PaginationMeta } from './types/api';
|
|
6
6
|
export { APIServiceConfig as APIServiceConfig, APIService as APIService, APIServiceResponse as APIServiceResponse, ITRMAPIServiceGlobal as ITRMAPIServiceGlobal } from './api/APIService';
|
|
7
7
|
export { HttpsAPIService as HttpsAPIService } from './api/HttpsAPIService';
|
|
8
|
+
export { DocumentationOptions as DocumentationOptions } from './api/request/docs/DocumentationModels';
|
|
8
9
|
export { ExpressConfiguration as ExpressConfiguration } from './api/ExpressConfiguration';
|
|
9
10
|
export { StandardGetRequestBuilder as StandardGetRequestBuilder } from './api/builder/StandardGetRequestBuilder';
|
|
10
11
|
export { ExpressLogableConfig as ExpressLogableConfig } from './api/express/ExpressLogableConfig';
|
|
@@ -13,7 +14,7 @@ export { ExpressStandardConfiguration as ExpressStandardConfiguration } from './
|
|
|
13
14
|
export { ExpressFileUploadingConfiguration as ExpressFileUploadingConfiguration } from './api/express/ExpressFileUploadingConfiguration';
|
|
14
15
|
export { ExternalApiConnection as ExternalApiConnection } from './api/external/ExternalApiConnection';
|
|
15
16
|
export { APIRequest as APIRequest, RequestMethod as RequestMethod, RequestContext as RequestContext, GroupedParameters as GroupedParameters, APIRequestConfig as APIRequestConfig, RequestParameterType as RequestParameterType } from './api/APIRequest';
|
|
16
|
-
export { APIRequestBuilder as APIRequestBuilder, DocDetails as DocDetails, ISamples as ISamples } from './api/APIRequestBuilder';
|
|
17
|
+
export { APIRequestBuilder as APIRequestBuilder, DocDetails as DocDetails, ISamples as ISamples, ParameterDoc as ParameterDoc } from './api/APIRequestBuilder';
|
|
17
18
|
export { APIRouter as APIRouter } from './api/APIRouter';
|
|
18
19
|
export { SimpleAPIRouter as SimpleAPIRouter } from './api/route/SimpleAPIRouter';
|
|
19
20
|
export { RequestAxiosCall as RequestAxiosCall } from './api/request/RequestAxiosCall';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,gFAA0G;AAAjG,kIAAA,uBAAuB,OAA2B;AAG3D,iDAAsL;AAA7K,2GAAA,eAAe,OAAmB;AAAE,yGAAA,aAAa,OAAiB;AAAE,oHAAA,wBAAwB,OAA4B;AAAE,oGAAA,QAAQ,OAAY;AACvJ,qDAAkE;AAAzD,wGAAA,UAAU,OAAc;AAGjC,+CAA0L;AAA3I,wGAAA,UAAU,OAAc;AAA4C,kHAAA,oBAAoB,OAAwB;AAC/J,yDAA2E;AAAlE,kHAAA,eAAe,OAAmB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,gFAA0G;AAAjG,kIAAA,uBAAuB,OAA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