@tstdl/base 0.92.147 → 0.92.148
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/api/client/client.d.ts +2 -0
- package/api/client/client.js +4 -1
- package/api/utils.d.ts +1 -0
- package/api/utils.js +1 -0
- package/document-management/api/document-management.api.d.ts +13 -0
- package/document-management/api/document-management.api.js +8 -0
- package/http/client/http-client-request.js +1 -1
- package/http/index.d.ts +1 -0
- package/http/index.js +1 -0
- package/http/tokens.d.ts +5 -0
- package/http/tokens.js +5 -0
- package/package.json +1 -1
package/api/client/client.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HttpClient, type HttpClientOptions } from '../../http/client/index.js';
|
|
2
|
+
import { bustCacheToken } from '../../http/index.js';
|
|
2
3
|
import { type Resolvable } from '../../injector/interfaces.js';
|
|
3
4
|
import type { Type } from '../../types/index.js';
|
|
4
5
|
import { type ApiClientImplementation, type ApiDefinition, type ApiEndpointDefinition } from '../types.js';
|
|
@@ -13,6 +14,7 @@ export type ClientOptions = {
|
|
|
13
14
|
};
|
|
14
15
|
export type ApiClientHttpRequestContext = {
|
|
15
16
|
endpoint: ApiEndpointDefinition;
|
|
17
|
+
[bustCacheToken]?: boolean;
|
|
16
18
|
};
|
|
17
19
|
export declare const httpClientSymbol: unique symbol;
|
|
18
20
|
export declare const apiDefinitionSymbol: unique symbol;
|
package/api/client/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpClient, HttpClientRequest } from '../../http/client/index.js';
|
|
2
|
-
import { normalizeSingleHttpValue } from '../../http/
|
|
2
|
+
import { bustCacheToken, normalizeSingleHttpValue } from '../../http/index.js';
|
|
3
3
|
import { inject } from '../../injector/inject.js';
|
|
4
4
|
import { Injector } from '../../injector/injector.js';
|
|
5
5
|
import { resolveArgumentType } from '../../injector/interfaces.js';
|
|
@@ -74,6 +74,9 @@ export function compileClient(definition, options = defaultOptions) {
|
|
|
74
74
|
}
|
|
75
75
|
return getServerSentEvents(this[httpClientSymbol].options.baseUrl, resource, endpoint, parameters);
|
|
76
76
|
}
|
|
77
|
+
if (context.endpoint.data?.[bustCacheToken] == true) {
|
|
78
|
+
context[bustCacheToken] = true;
|
|
79
|
+
}
|
|
77
80
|
const request = new HttpClientRequest({
|
|
78
81
|
method,
|
|
79
82
|
url: resource,
|
package/api/utils.d.ts
CHANGED
|
@@ -5,5 +5,6 @@ type GetApiEndpointUrlData = {
|
|
|
5
5
|
defaultPrefix: string | undefined | null;
|
|
6
6
|
explicitVersion?: number | null;
|
|
7
7
|
};
|
|
8
|
+
export declare const defaultAccessControlAllowHeaders = "Content-Type, Authorization";
|
|
8
9
|
export declare function getFullApiEndpointResource({ api, endpoint, defaultPrefix, explicitVersion }: GetApiEndpointUrlData): string;
|
|
9
10
|
export {};
|
package/api/utils.js
CHANGED
|
@@ -2,6 +2,7 @@ import { toArray } from '../utils/array/array.js';
|
|
|
2
2
|
import { compareByValueDescending } from '../utils/comparison.js';
|
|
3
3
|
import { sort } from '../utils/iterable-helpers/sort.js';
|
|
4
4
|
import { isDefined, isNull } from '../utils/type-guards.js';
|
|
5
|
+
export const defaultAccessControlAllowHeaders = 'Content-Type, Authorization';
|
|
5
6
|
export function getFullApiEndpointResource({ api, endpoint, defaultPrefix, explicitVersion }) {
|
|
6
7
|
const versionArray = toArray(isDefined(explicitVersion) ? explicitVersion : endpoint.version);
|
|
7
8
|
const version = sort(versionArray, compareByValueDescending)[0];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { bustCacheToken } from '../../http/tokens.js';
|
|
1
2
|
import { ServerSentEvents } from '../../sse/server-sent-events.js';
|
|
2
3
|
import { Document, DocumentCategory, DocumentRequest, DocumentRequestsTemplate, DocumentRequestTemplate, DocumentType } from '../models/index.js';
|
|
3
4
|
import { DocumentCategoryView, DocumentManagementData, DocumentRequestsTemplateData } from '../service-models/index.js';
|
|
@@ -22,6 +23,12 @@ export declare const documentManagementApiDefinition: {
|
|
|
22
23
|
}>;
|
|
23
24
|
result: typeof ServerSentEvents;
|
|
24
25
|
credentials: true;
|
|
26
|
+
data: {
|
|
27
|
+
[bustCacheToken]: boolean;
|
|
28
|
+
};
|
|
29
|
+
cors: {
|
|
30
|
+
accessControlAllowHeaders: string;
|
|
31
|
+
};
|
|
25
32
|
};
|
|
26
33
|
loadDocumentRequestsTemplateData: {
|
|
27
34
|
resource: string;
|
|
@@ -413,6 +420,12 @@ declare const _DocumentManagementApi: import("../../api/client/index.js").ApiCli
|
|
|
413
420
|
}>;
|
|
414
421
|
result: typeof ServerSentEvents;
|
|
415
422
|
credentials: true;
|
|
423
|
+
data: {
|
|
424
|
+
[bustCacheToken]: boolean;
|
|
425
|
+
};
|
|
426
|
+
cors: {
|
|
427
|
+
accessControlAllowHeaders: string;
|
|
428
|
+
};
|
|
416
429
|
};
|
|
417
430
|
loadDocumentRequestsTemplateData: {
|
|
418
431
|
resource: string;
|
|
@@ -6,6 +6,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { compileClient } from '../../api/client/index.js';
|
|
8
8
|
import { defineApi } from '../../api/index.js';
|
|
9
|
+
import { defaultAccessControlAllowHeaders } from '../../api/utils.js';
|
|
10
|
+
import { bustCacheToken } from '../../http/tokens.js';
|
|
9
11
|
import { ReplaceClass } from '../../injector/decorators.js';
|
|
10
12
|
import { array, boolean, literal, number, object, optional, string } from '../../schema/index.js';
|
|
11
13
|
import { ServerSentEvents } from '../../sse/server-sent-events.js';
|
|
@@ -28,6 +30,12 @@ export const documentManagementApiDefinition = defineApi({
|
|
|
28
30
|
parameters: loadDataParametersSchema,
|
|
29
31
|
result: ServerSentEvents,
|
|
30
32
|
credentials: true,
|
|
33
|
+
data: {
|
|
34
|
+
[bustCacheToken]: true,
|
|
35
|
+
},
|
|
36
|
+
cors: {
|
|
37
|
+
accessControlAllowHeaders: `${defaultAccessControlAllowHeaders}, Cache-Control`,
|
|
38
|
+
},
|
|
31
39
|
},
|
|
32
40
|
loadDocumentRequestsTemplateData: {
|
|
33
41
|
resource: 'views/document-requests-template-data',
|
package/http/index.d.ts
CHANGED
package/http/index.js
CHANGED
package/http/tokens.d.ts
ADDED
package/http/tokens.js
ADDED