@twin.org/api-service 0.0.3-next.4 → 0.0.3-next.41
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/es/healthRoutes.js +107 -0
- package/dist/es/healthRoutes.js.map +1 -0
- package/dist/es/healthService.js +155 -0
- package/dist/es/healthService.js.map +1 -0
- package/dist/es/hostingService.js +115 -0
- package/dist/es/hostingService.js.map +1 -0
- package/dist/es/index.js +10 -0
- package/dist/es/index.js.map +1 -1
- package/dist/es/informationRoutes.js +92 -62
- package/dist/es/informationRoutes.js.map +1 -1
- package/dist/es/informationService.js +12 -58
- package/dist/es/informationService.js.map +1 -1
- package/dist/es/models/IHealthServiceConfig.js +4 -0
- package/dist/es/models/IHealthServiceConfig.js.map +1 -0
- package/dist/es/models/IHealthServiceConstructorOptions.js +2 -0
- package/dist/es/models/IHealthServiceConstructorOptions.js.map +1 -0
- package/dist/es/models/IHostingServiceConfig.js +4 -0
- package/dist/es/models/IHostingServiceConfig.js.map +1 -0
- package/dist/es/models/IHostingServiceConstructorOptions.js +2 -0
- package/dist/es/models/IHostingServiceConstructorOptions.js.map +1 -0
- package/dist/es/models/IUrlTransformerServiceConfig.js +4 -0
- package/dist/es/models/IUrlTransformerServiceConfig.js.map +1 -0
- package/dist/es/models/IUrlTransformerServiceConstructorOptions.js +2 -0
- package/dist/es/models/IUrlTransformerServiceConstructorOptions.js.map +1 -0
- package/dist/es/restEntryPoints.js +7 -0
- package/dist/es/restEntryPoints.js.map +1 -1
- package/dist/es/urlTransformerService.js +256 -0
- package/dist/es/urlTransformerService.js.map +1 -0
- package/dist/types/healthRoutes.d.ts +20 -0
- package/dist/types/healthService.d.ts +42 -0
- package/dist/types/hostingService.d.ts +45 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/informationRoutes.d.ts +11 -3
- package/dist/types/informationService.d.ts +11 -16
- package/dist/types/models/IHealthServiceConfig.d.ts +16 -0
- package/dist/types/models/IHealthServiceConstructorOptions.d.ts +10 -0
- package/dist/types/models/IHostingServiceConfig.d.ts +13 -0
- package/dist/types/models/IHostingServiceConstructorOptions.d.ts +15 -0
- package/dist/types/models/IUrlTransformerServiceConfig.d.ts +19 -0
- package/dist/types/models/IUrlTransformerServiceConstructorOptions.d.ts +15 -0
- package/dist/types/urlTransformerService.d.ts +94 -0
- package/docs/changelog.md +588 -55
- package/docs/examples.md +74 -1
- package/docs/reference/classes/HealthService.md +123 -0
- package/docs/reference/classes/HostingService.md +157 -0
- package/docs/reference/classes/InformationService.md +19 -65
- package/docs/reference/classes/UrlTransformerService.md +379 -0
- package/docs/reference/functions/generateRestRoutesHealth.md +25 -0
- package/docs/reference/functions/serverLivez.md +31 -0
- package/docs/reference/functions/serverReadyz.md +31 -0
- package/docs/reference/index.md +14 -1
- package/docs/reference/interfaces/IHealthServiceConfig.md +32 -0
- package/docs/reference/interfaces/IHealthServiceConstructorOptions.md +11 -0
- package/docs/reference/interfaces/IHostingServiceConfig.md +19 -0
- package/docs/reference/interfaces/IHostingServiceConstructorOptions.md +25 -0
- package/docs/reference/interfaces/IInformationServiceConfig.md +5 -5
- package/docs/reference/interfaces/IInformationServiceConstructorOptions.md +1 -1
- package/docs/reference/interfaces/IUrlTransformerServiceConfig.md +32 -0
- package/docs/reference/interfaces/IUrlTransformerServiceConstructorOptions.md +25 -0
- package/docs/reference/variables/tagsHealth.md +5 -0
- package/locales/en.json +13 -1
- package/package.json +9 -5
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { IHttpRequestQuery, IUrlTransformerComponent } from "@twin.org/api-models";
|
|
2
|
+
import type { IUrlTransformerServiceConstructorOptions } from "./models/IUrlTransformerServiceConstructorOptions.js";
|
|
3
|
+
/**
|
|
4
|
+
* The URL transformer service for encrypting and decrypting URL parameters.
|
|
5
|
+
*/
|
|
6
|
+
export declare class UrlTransformerService implements IUrlTransformerComponent {
|
|
7
|
+
/**
|
|
8
|
+
* Runtime name for the class.
|
|
9
|
+
*/
|
|
10
|
+
static readonly CLASS_NAME: string;
|
|
11
|
+
/**
|
|
12
|
+
* Create a new instance of UrlTransformerService.
|
|
13
|
+
* @param options The options to create the service.
|
|
14
|
+
*/
|
|
15
|
+
constructor(options?: IUrlTransformerServiceConstructorOptions);
|
|
16
|
+
/**
|
|
17
|
+
* Returns the class name of the component.
|
|
18
|
+
* @returns The class name of the component.
|
|
19
|
+
*/
|
|
20
|
+
className(): string;
|
|
21
|
+
/**
|
|
22
|
+
* The component needs to be started when the node is initialized.
|
|
23
|
+
* @returns Nothing.
|
|
24
|
+
*/
|
|
25
|
+
start(): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Encrypt a named token value and append it as a query parameter to the given URL.
|
|
28
|
+
* @param url The URL to append the encrypted token to.
|
|
29
|
+
* @param id The logical token identifier (e.g. "tenant").
|
|
30
|
+
* @param value The value to encrypt and add.
|
|
31
|
+
* @returns The URL with the encrypted token added as a query parameter.
|
|
32
|
+
*/
|
|
33
|
+
addEncryptedQueryParamToUrl(url: string, id: string, value: string): Promise<string>;
|
|
34
|
+
/**
|
|
35
|
+
* Get a named token value from the query parameters.
|
|
36
|
+
* @param queryParams The HTTP request query containing the parameters.
|
|
37
|
+
* @param id The logical token identifier (e.g. "tenant").
|
|
38
|
+
* @returns The decrypted token value if it exists.
|
|
39
|
+
*/
|
|
40
|
+
getEncryptedQueryParam(queryParams: IHttpRequestQuery | undefined, id: string): Promise<string | undefined>;
|
|
41
|
+
/**
|
|
42
|
+
* Add encrypted key/value pairs to a URL's query string.
|
|
43
|
+
* @param url The base URL to add parameters to.
|
|
44
|
+
* @param params The key/value pairs to encrypt and append.
|
|
45
|
+
* @returns The URL with the encrypted parameters added.
|
|
46
|
+
*/
|
|
47
|
+
addEncryptedToUrl(url: string, params: IHttpRequestQuery): Promise<string>;
|
|
48
|
+
/**
|
|
49
|
+
* Get an encrypted value from a URL's query string.
|
|
50
|
+
* @param url The URL to extract the encrypted value from.
|
|
51
|
+
* @param id The logical identifier for the value to retrieve (e.g. "tenant").
|
|
52
|
+
* @returns The decrypted value if it exists.
|
|
53
|
+
*/
|
|
54
|
+
getEncryptedFromUrl(url: string, id: string): Promise<string | undefined>;
|
|
55
|
+
/**
|
|
56
|
+
* Decrypt specified keys from a query parameter object and return their plain-text values.
|
|
57
|
+
* @param queryParams The HTTP request query containing the encrypted parameters.
|
|
58
|
+
* @param keys The keys to decrypt.
|
|
59
|
+
* @returns A map of the decrypted key/value pairs that were present.
|
|
60
|
+
*/
|
|
61
|
+
getDecryptedFromQueryParams(queryParams: IHttpRequestQuery | undefined, keys: string[]): Promise<IHttpRequestQuery>;
|
|
62
|
+
/**
|
|
63
|
+
* Encrypt query parameters.
|
|
64
|
+
* @param httpRequestQuery The HTTP request query containing the parameters to encrypt.
|
|
65
|
+
* @param keys The keys of the parameters to encrypt.
|
|
66
|
+
* @returns A promise that resolves when the query parameters have been encrypted.
|
|
67
|
+
*/
|
|
68
|
+
encryptQueryParams(httpRequestQuery: IHttpRequestQuery | undefined, keys: string[]): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* Decrypt query parameters.
|
|
71
|
+
* @param httpRequestQuery The HTTP request query containing the encrypted values.
|
|
72
|
+
* @param keys The keys of the parameters to decrypt.
|
|
73
|
+
* @returns A promise that resolves when the query parameters have been decrypted.
|
|
74
|
+
*/
|
|
75
|
+
decryptQueryParams(httpRequestQuery: IHttpRequestQuery | undefined, keys: string[]): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Encrypt a parameter value.
|
|
78
|
+
* @param paramValue The value of the parameter to encrypt.
|
|
79
|
+
* @returns A promise that resolves to the encrypted value of the parameter.
|
|
80
|
+
*/
|
|
81
|
+
encryptParam(paramValue: string): Promise<string>;
|
|
82
|
+
/**
|
|
83
|
+
* Decrypt a parameter value.
|
|
84
|
+
* @param encryptedValue The encrypted value of the parameter.
|
|
85
|
+
* @returns A promise that resolves to the decrypted value of the parameter.
|
|
86
|
+
*/
|
|
87
|
+
decryptParam(encryptedValue: string): Promise<string>;
|
|
88
|
+
/**
|
|
89
|
+
* Get the parameter name for a given key.
|
|
90
|
+
* @param key The key of the parameter.
|
|
91
|
+
* @returns The parameter name.
|
|
92
|
+
*/
|
|
93
|
+
getParamName(key: string): string | undefined;
|
|
94
|
+
}
|