@tstdl/base 0.92.154 → 0.92.155
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
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpClient, type HttpClientOptions } from '../../http/client/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import { bustCache } from '../../http/index.js';
|
|
3
3
|
import { type Resolvable } from '../../injector/interfaces.js';
|
|
4
4
|
import type { Type } from '../../types/index.js';
|
|
5
5
|
import { type ApiClientImplementation, type ApiDefinition, type ApiEndpointDefinition } from '../types.js';
|
|
@@ -14,7 +14,7 @@ export type ClientOptions = {
|
|
|
14
14
|
};
|
|
15
15
|
export type ApiClientHttpRequestContext = {
|
|
16
16
|
endpoint: ApiEndpointDefinition;
|
|
17
|
-
[
|
|
17
|
+
[bustCache]?: boolean;
|
|
18
18
|
};
|
|
19
19
|
export declare const httpClientSymbol: unique symbol;
|
|
20
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 {
|
|
2
|
+
import { bustCache, 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';
|
|
@@ -81,8 +81,8 @@ export function compileClient(definition, options = defaultOptions) {
|
|
|
81
81
|
}
|
|
82
82
|
return getDataStream(this[httpClientSymbol].options.baseUrl, resource, endpoint, parameters);
|
|
83
83
|
}
|
|
84
|
-
if (context.endpoint.data?.[
|
|
85
|
-
context[
|
|
84
|
+
if (context.endpoint.data?.[bustCache] == true) {
|
|
85
|
+
context[bustCache] = true;
|
|
86
86
|
}
|
|
87
87
|
const request = new HttpClientRequest({
|
|
88
88
|
method,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { bustCacheToken } from '../../http/tokens.js';
|
|
2
1
|
import { DataStream } from '../../sse/index.js';
|
|
3
2
|
import { Document, DocumentCategory, DocumentRequest, DocumentRequestsTemplate, DocumentRequestTemplate, DocumentType } from '../models/index.js';
|
|
4
3
|
import { DocumentCategoryView, DocumentManagementData, DocumentRequestsTemplateData } from '../service-models/index.js';
|
|
@@ -27,7 +26,7 @@ export declare const documentManagementApiDefinition: {
|
|
|
27
26
|
};
|
|
28
27
|
credentials: true;
|
|
29
28
|
data: {
|
|
30
|
-
|
|
29
|
+
bustCache: boolean;
|
|
31
30
|
};
|
|
32
31
|
cors: {
|
|
33
32
|
accessControlAllowHeaders: string;
|
|
@@ -427,7 +426,7 @@ declare const _DocumentManagementApi: import("../../api/client/index.js").ApiCli
|
|
|
427
426
|
};
|
|
428
427
|
credentials: true;
|
|
429
428
|
data: {
|
|
430
|
-
|
|
429
|
+
bustCache: boolean;
|
|
431
430
|
};
|
|
432
431
|
cors: {
|
|
433
432
|
accessControlAllowHeaders: string;
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { compileClient } from '../../api/client/index.js';
|
|
8
8
|
import { defineApi } from '../../api/index.js';
|
|
9
9
|
import { defaultAccessControlAllowHeaders } from '../../api/utils.js';
|
|
10
|
-
import {
|
|
10
|
+
import { bustCache } from '../../http/tokens.js';
|
|
11
11
|
import { ReplaceClass } from '../../injector/index.js';
|
|
12
12
|
import { array, boolean, literal, number, object, optional, string } from '../../schema/index.js';
|
|
13
13
|
import { DataStream } from '../../sse/index.js';
|
|
@@ -31,7 +31,7 @@ export const documentManagementApiDefinition = defineApi({
|
|
|
31
31
|
result: (DataStream),
|
|
32
32
|
credentials: true,
|
|
33
33
|
data: {
|
|
34
|
-
[
|
|
34
|
+
[bustCache]: true,
|
|
35
35
|
},
|
|
36
36
|
cors: {
|
|
37
37
|
accessControlAllowHeaders: `${defaultAccessControlAllowHeaders}, Cache-Control`,
|
package/http/tokens.d.ts
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* This can be used in the request context to indicate that the request should not be cached.
|
|
3
3
|
* HttpClientAdapters should check for this token and bypass any caching mechanisms if it is present.
|
|
4
4
|
*/
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const bustCache = "bustCache";
|
package/http/tokens.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* This can be used in the request context to indicate that the request should not be cached.
|
|
3
3
|
* HttpClientAdapters should check for this token and bypass any caching mechanisms if it is present.
|
|
4
4
|
*/
|
|
5
|
-
export const
|
|
5
|
+
export const bustCache = 'bustCache';
|