@dereekb/nestjs 13.11.13 → 13.11.15
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/discord/index.cjs.js +37 -34
- package/discord/index.esm.js +36 -33
- package/discord/package.json +4 -4
- package/discord/src/lib/discord.api.d.ts +6 -6
- package/discord/src/lib/discord.api.page.d.ts +4 -4
- package/discord/src/lib/discord.config.d.ts +2 -2
- package/discord/src/lib/discord.module.d.ts +2 -2
- package/discord/src/lib/discord.util.d.ts +3 -3
- package/discord/src/lib/webhook/webhook.discord.d.ts +2 -2
- package/discord/src/lib/webhook/webhook.discord.module.d.ts +2 -2
- package/discord/src/lib/webhook/webhook.discord.verify.d.ts +2 -2
- package/eslint/index.cjs.js +142 -145
- package/eslint/index.esm.js +141 -144
- package/eslint/package.json +4 -4
- package/eslint/src/lib/index.d.ts +2 -2
- package/eslint/src/lib/plugin.d.ts +1 -1
- package/eslint/src/lib/require-inject.rule.d.ts +1 -1
- package/index.cjs.js +98 -112
- package/index.esm.js +98 -112
- package/mailgun/index.cjs.js +17 -13
- package/mailgun/index.esm.js +17 -13
- package/mailgun/package.json +6 -6
- package/mailgun/src/lib/mailgun.d.ts +7 -5
- package/mailgun/src/lib/mailgun.service.module.d.ts +4 -3
- package/mailgun/src/lib/mailgun.util.d.ts +6 -5
- package/openai/index.cjs.js +9 -9
- package/openai/index.esm.js +9 -9
- package/openai/package.json +6 -6
- package/openai/src/lib/openai.module.d.ts +2 -2
- package/openai/src/lib/openai.util.d.ts +3 -3
- package/openai/src/lib/webhook/webhook.openai.module.d.ts +2 -2
- package/openai/src/lib/webhook/webhook.openai.verify.d.ts +2 -2
- package/package.json +5 -5
- package/src/lib/asset/asset.loader.node.d.ts +3 -3
- package/src/lib/asset/asset.nest.d.ts +6 -5
- package/src/lib/decorators/local.decorator.d.ts +2 -2
- package/src/lib/decorators/rawbody.d.ts +7 -7
- package/src/lib/module/client/client.config.d.ts +2 -2
- package/src/lib/module/client/client.module.d.ts +3 -2
- package/src/lib/module/env/env.d.ts +1 -1
- package/src/lib/module/env/env.nest.d.ts +2 -2
- package/src/lib/module/module.d.ts +5 -5
- package/src/lib/util/encryption/json.encrypt.d.ts +18 -16
- package/src/lib/util/file/file.json.d.ts +2 -2
- package/src/lib/util/pdf/pdf.encryption.d.ts +3 -3
- package/stripe/index.cjs.js +13 -13
- package/stripe/index.esm.js +13 -13
- package/stripe/package.json +6 -6
- package/stripe/src/lib/stripe.api.d.ts +4 -4
- package/stripe/src/lib/stripe.module.d.ts +3 -3
- package/stripe/src/lib/webhook/webhook.stripe.d.ts +4 -4
- package/typeform/index.cjs.js +12 -12
- package/typeform/index.esm.js +12 -12
- package/typeform/package.json +6 -6
- package/typeform/src/lib/typeform.module.d.ts +2 -2
- package/typeform/src/lib/typeform.util.d.ts +2 -2
- package/typeform/src/lib/webhook/webhook.typeform.form.d.ts +4 -4
- package/typeform/src/lib/webhook/webhook.typeform.module.d.ts +2 -2
- package/typeform/src/lib/webhook/webhook.typeform.verify.d.ts +2 -2
- package/vapiai/index.cjs.js +6 -6
- package/vapiai/index.esm.js +6 -6
- package/vapiai/package.json +6 -6
- package/vapiai/src/lib/vapiai.module.d.ts +2 -2
- package/vapiai/src/lib/webhook/webhook.vapiai.module.d.ts +2 -2
- package/vapiai/src/lib/webhook/webhook.vapiai.verify.d.ts +2 -2
|
@@ -172,6 +172,7 @@ export declare const MAX_BATCH_SEND_RECIPIENTS = 1000;
|
|
|
172
172
|
*
|
|
173
173
|
* @param config - The conversion configuration containing the email request, default sender, and recipient variable settings.
|
|
174
174
|
* @returns The constructed {@link MailgunMessageData} ready to be sent via the Mailgun API.
|
|
175
|
+
* @throws {Error} When `batchSend` is enabled with `cc`/`bcc` set, when the recipient list exceeds {@link MAX_BATCH_SEND_RECIPIENTS}, or when attachments are supplied via both `messageData` and `request.attachments`.
|
|
175
176
|
*/
|
|
176
177
|
export declare function convertMailgunTemplateEmailRequestToMailgunMessageData(config: ConvertMailgunTemplateEmailRequestToMailgunMessageDataConfig): MailgunMessageData;
|
|
177
178
|
/**
|
|
@@ -179,8 +180,8 @@ export declare function convertMailgunTemplateEmailRequestToMailgunMessageData(c
|
|
|
179
180
|
*
|
|
180
181
|
* Each recipient is formatted as "Name <email>" when a name is present, or just the email address.
|
|
181
182
|
*
|
|
182
|
-
* @param recipients -
|
|
183
|
-
* @returns
|
|
183
|
+
* @param recipients - Recipients to convert.
|
|
184
|
+
* @returns Formatted email address strings.
|
|
184
185
|
*/
|
|
185
186
|
export declare function convertMailgunRecipientsToStrings(recipients: MailgunRecipient[]): EmailParticipantString[];
|
|
186
187
|
/**
|
|
@@ -188,14 +189,15 @@ export declare function convertMailgunRecipientsToStrings(recipients: MailgunRec
|
|
|
188
189
|
*
|
|
189
190
|
* Returns "Name <email>" when a name is present, or just the email address otherwise.
|
|
190
191
|
*
|
|
191
|
-
* @param recipient -
|
|
192
|
-
* @returns
|
|
192
|
+
* @param recipient - The recipient to convert.
|
|
193
|
+
* @returns A formatted email participant string.
|
|
193
194
|
*/
|
|
194
195
|
export declare function convertMailgunRecipientToString(recipient: MailgunRecipient): EmailParticipantString;
|
|
195
196
|
/**
|
|
196
197
|
* Encodes a value to a string for use as a Mailgun template variable. Throws an error if the value is not supported.
|
|
197
198
|
*
|
|
198
|
-
* @param value The value to encode.
|
|
199
|
+
* @param value - The value to encode.
|
|
199
200
|
* @returns The encoded value, or undefined if the value is null or undefined.
|
|
201
|
+
* @throws {Error} When `value` has an unsupported runtime type.
|
|
200
202
|
*/
|
|
201
203
|
export declare function encodeMailgunTemplateVariableValue(value: unknown): Maybe<string>;
|
|
@@ -6,9 +6,10 @@ import { MailgunServiceConfig } from './mailgun.config';
|
|
|
6
6
|
*
|
|
7
7
|
* Automatically switches to sandbox credentials when USE_MAILGUN_SANDBOX is true or the environment is a test environment.
|
|
8
8
|
*
|
|
9
|
-
* @param configService - NestJS config service for reading environment variables
|
|
10
|
-
* @param serverEnvironmentService -
|
|
11
|
-
* @returns
|
|
9
|
+
* @param configService - NestJS config service for reading environment variables.
|
|
10
|
+
* @param serverEnvironmentService - Service indicating the current server environment.
|
|
11
|
+
* @returns A validated MailgunServiceConfig.
|
|
12
|
+
* @throws {Error} When sandbox mode is requested without sandbox credentials, or when `MAILGUN_SENDER_EMAIL` / `MAILGUN_API_KEY` / `MAILGUN_DOMAIN` are missing.
|
|
12
13
|
*/
|
|
13
14
|
export declare function mailgunServiceConfigFactory(configService: ConfigService, serverEnvironmentService: ServerEnvironmentService): MailgunServiceConfig;
|
|
14
15
|
/**
|
|
@@ -73,8 +73,8 @@ export type MailgunRecipientBatchSendTargetFromReplyToBatchGroupKey = string;
|
|
|
73
73
|
/**
|
|
74
74
|
* Creates a composite key from the from/replyTo email addresses used to group MailgunRecipientBatchSendTarget values.
|
|
75
75
|
*
|
|
76
|
-
* @param recipient -
|
|
77
|
-
* @returns
|
|
76
|
+
* @param recipient - Batch send target whose from/replyTo addresses are used as the grouping key.
|
|
77
|
+
* @returns Composite key in the form "f:{fromEmail}|r:{replyToEmail}" used to group recipients into batches.
|
|
78
78
|
*/
|
|
79
79
|
export declare function mailgunRecipientBatchSendTargetFromReplyToBatchGroupKey(recipient: MailgunRecipientBatchSendTarget): MailgunRecipientBatchSendTargetFromReplyToBatchGroupKey;
|
|
80
80
|
/**
|
|
@@ -126,8 +126,9 @@ export type ExpandMailgunRecipientBatchSendTargetRequestFactory = (recipients: M
|
|
|
126
126
|
/**
|
|
127
127
|
* Creates a ExpandMailgunRecipientBatchSendTargetRequestFactory from the input config.
|
|
128
128
|
*
|
|
129
|
-
* @param config
|
|
130
|
-
* @returns
|
|
129
|
+
* @param config - Factory configuration providing the base request, recipient lookup, and per-recipient variable handling.
|
|
130
|
+
* @returns A factory that expands `MailgunRecipientBatchSendTarget` lists into individual `MailgunTemplateEmailRequest` objects.
|
|
131
|
+
* @throws {Error} When no subject is configured and `useSubjectFromRecipientUserVariables` is false.
|
|
131
132
|
*/
|
|
132
133
|
export declare function expandMailgunRecipientBatchSendTargetRequestFactory(config: ExpandMailgunRecipientBatchSendTargetRequestFactoryConfig): ExpandMailgunRecipientBatchSendTargetRequestFactory;
|
|
133
134
|
/**
|
|
@@ -165,7 +166,7 @@ export interface MailgunRecipientBatchSendTargetEntityKeyRecipientLookupConfig {
|
|
|
165
166
|
/**
|
|
166
167
|
* Creates a MailgunRecipientBatchSendTargetEntityKeyRecipientLookup given the input configuration.
|
|
167
168
|
*
|
|
168
|
-
* @param config The configuration for the lookup.
|
|
169
|
+
* @param config - The configuration for the lookup.
|
|
169
170
|
* @returns The lookup.
|
|
170
171
|
*/
|
|
171
172
|
export declare function mailgunRecipientBatchSendTargetEntityKeyRecipientLookup(config: MailgunRecipientBatchSendTargetEntityKeyRecipientLookupConfig): MailgunRecipientBatchSendTargetEntityKeyRecipientLookup;
|
package/openai/index.cjs.js
CHANGED
|
@@ -391,8 +391,8 @@ function _ts_generator$2(thisArg, body) {
|
|
|
391
391
|
/**
|
|
392
392
|
* Verifies an OpenAI webhook event header using the OpenAI client's built-in signature verification.
|
|
393
393
|
*
|
|
394
|
-
* @param config -
|
|
395
|
-
* @returns
|
|
394
|
+
* @param config - Verification config containing the OpenAI webhook secret and client.
|
|
395
|
+
* @returns Verifier function that validates the webhook signature on each request.
|
|
396
396
|
*/ function openAIWebhookEventVerifier(config) {
|
|
397
397
|
var secret = config.secret, client = config.client;
|
|
398
398
|
return function(request, _rawBody) {
|
|
@@ -908,8 +908,8 @@ function _class_call_check$1(instance, Constructor) {
|
|
|
908
908
|
*
|
|
909
909
|
* Reads the API key, base URL, organization ID, and project ID from environment variables.
|
|
910
910
|
*
|
|
911
|
-
* @param configService - NestJS config service for reading environment variables
|
|
912
|
-
* @returns
|
|
911
|
+
* @param configService - NestJS config service for reading environment variables.
|
|
912
|
+
* @returns A validated OpenAIServiceConfig.
|
|
913
913
|
*/ function openAIServiceConfigFactory(configService) {
|
|
914
914
|
var _configService_get;
|
|
915
915
|
var config = {
|
|
@@ -963,8 +963,8 @@ function _class_call_check(instance, Constructor) {
|
|
|
963
963
|
*
|
|
964
964
|
* Reads the OpenAI webhook secret token from environment variables.
|
|
965
965
|
*
|
|
966
|
-
* @param configService - NestJS config service for reading environment variables
|
|
967
|
-
* @returns
|
|
966
|
+
* @param configService - NestJS config service for reading environment variables.
|
|
967
|
+
* @returns A validated OpenAIWebhookServiceConfig.
|
|
968
968
|
*/ function openAIWebhookServiceConfigFactory(configService) {
|
|
969
969
|
var config = {
|
|
970
970
|
openaiWebhook: {
|
|
@@ -1017,7 +1017,7 @@ exports.OpenAIWebhookModule = __decorate([
|
|
|
1017
1017
|
/**
|
|
1018
1018
|
* Parses the OpenAI response into a ParsedOpenAIJsonResponse.
|
|
1019
1019
|
*
|
|
1020
|
-
* @param response The OpenAI response to parse.
|
|
1020
|
+
* @param response - The OpenAI response to parse.
|
|
1021
1021
|
* @returns The parsed OpenAI response.
|
|
1022
1022
|
*/ function parseOpenAIJsonResponse(response) {
|
|
1023
1023
|
var output_text = typeof response === 'string' ? response : response.output_text;
|
|
@@ -1039,8 +1039,8 @@ exports.OpenAIWebhookModule = __decorate([
|
|
|
1039
1039
|
/**
|
|
1040
1040
|
* Creates a map of the OpenAI json response fields.
|
|
1041
1041
|
*
|
|
1042
|
-
* @param response
|
|
1043
|
-
* @returns
|
|
1042
|
+
* @param response - OpenAI json response to index.
|
|
1043
|
+
* @returns Map keyed by field name for direct lookup.
|
|
1044
1044
|
*/ function openAIJsonResponseFieldsMap(response) {
|
|
1045
1045
|
return new Map(response.fields.map(function(x) {
|
|
1046
1046
|
return [
|
package/openai/index.esm.js
CHANGED
|
@@ -389,8 +389,8 @@ function _ts_generator$2(thisArg, body) {
|
|
|
389
389
|
/**
|
|
390
390
|
* Verifies an OpenAI webhook event header using the OpenAI client's built-in signature verification.
|
|
391
391
|
*
|
|
392
|
-
* @param config -
|
|
393
|
-
* @returns
|
|
392
|
+
* @param config - Verification config containing the OpenAI webhook secret and client.
|
|
393
|
+
* @returns Verifier function that validates the webhook signature on each request.
|
|
394
394
|
*/ function openAIWebhookEventVerifier(config) {
|
|
395
395
|
var secret = config.secret, client = config.client;
|
|
396
396
|
return function(request, _rawBody) {
|
|
@@ -906,8 +906,8 @@ function _class_call_check$1(instance, Constructor) {
|
|
|
906
906
|
*
|
|
907
907
|
* Reads the API key, base URL, organization ID, and project ID from environment variables.
|
|
908
908
|
*
|
|
909
|
-
* @param configService - NestJS config service for reading environment variables
|
|
910
|
-
* @returns
|
|
909
|
+
* @param configService - NestJS config service for reading environment variables.
|
|
910
|
+
* @returns A validated OpenAIServiceConfig.
|
|
911
911
|
*/ function openAIServiceConfigFactory(configService) {
|
|
912
912
|
var _configService_get;
|
|
913
913
|
var config = {
|
|
@@ -961,8 +961,8 @@ function _class_call_check(instance, Constructor) {
|
|
|
961
961
|
*
|
|
962
962
|
* Reads the OpenAI webhook secret token from environment variables.
|
|
963
963
|
*
|
|
964
|
-
* @param configService - NestJS config service for reading environment variables
|
|
965
|
-
* @returns
|
|
964
|
+
* @param configService - NestJS config service for reading environment variables.
|
|
965
|
+
* @returns A validated OpenAIWebhookServiceConfig.
|
|
966
966
|
*/ function openAIWebhookServiceConfigFactory(configService) {
|
|
967
967
|
var config = {
|
|
968
968
|
openaiWebhook: {
|
|
@@ -1015,7 +1015,7 @@ OpenAIWebhookModule = __decorate([
|
|
|
1015
1015
|
/**
|
|
1016
1016
|
* Parses the OpenAI response into a ParsedOpenAIJsonResponse.
|
|
1017
1017
|
*
|
|
1018
|
-
* @param response The OpenAI response to parse.
|
|
1018
|
+
* @param response - The OpenAI response to parse.
|
|
1019
1019
|
* @returns The parsed OpenAI response.
|
|
1020
1020
|
*/ function parseOpenAIJsonResponse(response) {
|
|
1021
1021
|
var output_text = typeof response === 'string' ? response : response.output_text;
|
|
@@ -1037,8 +1037,8 @@ OpenAIWebhookModule = __decorate([
|
|
|
1037
1037
|
/**
|
|
1038
1038
|
* Creates a map of the OpenAI json response fields.
|
|
1039
1039
|
*
|
|
1040
|
-
* @param response
|
|
1041
|
-
* @returns
|
|
1040
|
+
* @param response - OpenAI json response to index.
|
|
1041
|
+
* @returns Map keyed by field name for direct lookup.
|
|
1042
1042
|
*/ function openAIJsonResponseFieldsMap(response) {
|
|
1043
1043
|
return new Map(response.fields.map(function(x) {
|
|
1044
1044
|
return [
|
package/openai/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/nestjs/openai",
|
|
3
|
-
"version": "13.11.
|
|
3
|
+
"version": "13.11.15",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@dereekb/date": "13.11.
|
|
6
|
-
"@dereekb/model": "13.11.
|
|
7
|
-
"@dereekb/nestjs": "13.11.
|
|
8
|
-
"@dereekb/rxjs": "13.11.
|
|
9
|
-
"@dereekb/util": "13.11.
|
|
5
|
+
"@dereekb/date": "13.11.15",
|
|
6
|
+
"@dereekb/model": "13.11.15",
|
|
7
|
+
"@dereekb/nestjs": "13.11.15",
|
|
8
|
+
"@dereekb/rxjs": "13.11.15",
|
|
9
|
+
"@dereekb/util": "13.11.15",
|
|
10
10
|
"@nestjs/common": "^11.1.19",
|
|
11
11
|
"@nestjs/config": "^4.0.4",
|
|
12
12
|
"express": "^5.2.1",
|
|
@@ -5,8 +5,8 @@ import { OpenAIServiceConfig } from './openai.config';
|
|
|
5
5
|
*
|
|
6
6
|
* Reads the API key, base URL, organization ID, and project ID from environment variables.
|
|
7
7
|
*
|
|
8
|
-
* @param configService - NestJS config service for reading environment variables
|
|
9
|
-
* @returns
|
|
8
|
+
* @param configService - NestJS config service for reading environment variables.
|
|
9
|
+
* @returns A validated OpenAIServiceConfig.
|
|
10
10
|
*/
|
|
11
11
|
export declare function openAIServiceConfigFactory(configService: ConfigService): OpenAIServiceConfig;
|
|
12
12
|
/**
|
|
@@ -52,7 +52,7 @@ export declare function isParsedOpenAIJsonResponseWithJson(response: ParsedOpenA
|
|
|
52
52
|
/**
|
|
53
53
|
* Parses the OpenAI response into a ParsedOpenAIJsonResponse.
|
|
54
54
|
*
|
|
55
|
-
* @param response The OpenAI response to parse.
|
|
55
|
+
* @param response - The OpenAI response to parse.
|
|
56
56
|
* @returns The parsed OpenAI response.
|
|
57
57
|
*/
|
|
58
58
|
export declare function parseOpenAIJsonResponse(response: string | OpenAI.Responses.Response): ParsedOpenAIJsonResponse;
|
|
@@ -63,7 +63,7 @@ export type OpenAIJsonResponseFieldMap = Map<OpenAIJsonResponseFieldName, OpenAI
|
|
|
63
63
|
/**
|
|
64
64
|
* Creates a map of the OpenAI json response fields.
|
|
65
65
|
*
|
|
66
|
-
* @param response
|
|
67
|
-
* @returns
|
|
66
|
+
* @param response - OpenAI json response to index.
|
|
67
|
+
* @returns Map keyed by field name for direct lookup.
|
|
68
68
|
*/
|
|
69
69
|
export declare function openAIJsonResponseFieldsMap(response: OpenAIJsonResponse): OpenAIJsonResponseFieldMap;
|
|
@@ -5,8 +5,8 @@ import { ConfigService } from '@nestjs/config';
|
|
|
5
5
|
*
|
|
6
6
|
* Reads the OpenAI webhook secret token from environment variables.
|
|
7
7
|
*
|
|
8
|
-
* @param configService - NestJS config service for reading environment variables
|
|
9
|
-
* @returns
|
|
8
|
+
* @param configService - NestJS config service for reading environment variables.
|
|
9
|
+
* @returns A validated OpenAIWebhookServiceConfig.
|
|
10
10
|
*/
|
|
11
11
|
export declare function openAIWebhookServiceConfigFactory(configService: ConfigService): OpenAIWebhookServiceConfig;
|
|
12
12
|
/**
|
|
@@ -30,7 +30,7 @@ export type OpenAIWebhookEventVerifier = (req: Request, rawBody: Buffer) => Prom
|
|
|
30
30
|
/**
|
|
31
31
|
* Verifies an OpenAI webhook event header using the OpenAI client's built-in signature verification.
|
|
32
32
|
*
|
|
33
|
-
* @param config -
|
|
34
|
-
* @returns
|
|
33
|
+
* @param config - Verification config containing the OpenAI webhook secret and client.
|
|
34
|
+
* @returns Verifier function that validates the webhook signature on each request.
|
|
35
35
|
*/
|
|
36
36
|
export declare function openAIWebhookEventVerifier(config: OpenAIWebhookEventVerificationConfig): OpenAIWebhookEventVerifier;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/nestjs",
|
|
3
|
-
"version": "13.11.
|
|
3
|
+
"version": "13.11.15",
|
|
4
4
|
"types": "./src/index.d.ts",
|
|
5
5
|
"module": "./index.esm.js",
|
|
6
6
|
"main": "./index.cjs.js",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@dereekb/rxjs": "13.11.
|
|
60
|
-
"@dereekb/util": "13.11.
|
|
59
|
+
"@dereekb/rxjs": "13.11.15",
|
|
60
|
+
"@dereekb/util": "13.11.15",
|
|
61
61
|
"@nestjs/common": "^11.1.19",
|
|
62
62
|
"@nestjs/config": "^4.0.4",
|
|
63
63
|
"@typeform/api-client": "^2.10.2",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@angular/core": "21.2.11",
|
|
77
77
|
"@nestjs/core": "^11.1.19",
|
|
78
|
-
"@typescript-eslint/parser": "8.59.
|
|
79
|
-
"eslint": "
|
|
78
|
+
"@typescript-eslint/parser": "8.59.3",
|
|
79
|
+
"eslint": "10.4.0",
|
|
80
80
|
"rxjs": "^7.8.2"
|
|
81
81
|
}
|
|
82
82
|
}
|
|
@@ -18,6 +18,9 @@ export interface NodeJsLocalAssetLoaderConfig {
|
|
|
18
18
|
* The ref's {@link AssetLocalPathRef.path} is resolved relative
|
|
19
19
|
* to the configured {@link NodeJsLocalAssetLoaderConfig.basePath}.
|
|
20
20
|
*
|
|
21
|
+
* @param config - Filesystem configuration with base path.
|
|
22
|
+
* @returns An {@link AssetLoader} backed by the local filesystem.
|
|
23
|
+
*
|
|
21
24
|
* @example
|
|
22
25
|
* ```ts
|
|
23
26
|
* const loader = nodeJsLocalAssetLoader({ basePath: './assets' });
|
|
@@ -25,8 +28,5 @@ export interface NodeJsLocalAssetLoaderConfig {
|
|
|
25
28
|
* // reads from ./assets/data/districts.json
|
|
26
29
|
* });
|
|
27
30
|
* ```
|
|
28
|
-
*
|
|
29
|
-
* @param config - Filesystem configuration with base path.
|
|
30
|
-
* @returns An {@link AssetLoader} backed by the local filesystem.
|
|
31
31
|
*/
|
|
32
32
|
export declare function nodeJsLocalAssetLoader(config: NodeJsLocalAssetLoaderConfig): AssetLoader;
|
|
@@ -24,15 +24,16 @@ export interface AppAssetLoaderModuleMetadataConfig {
|
|
|
24
24
|
* Local assets are loaded from the filesystem. Remote assets (which always
|
|
25
25
|
* have absolute URLs) are loaded via `fetch`.
|
|
26
26
|
*
|
|
27
|
-
* @
|
|
28
|
-
*
|
|
29
|
-
*
|
|
27
|
+
* @param config - Local filesystem config and optional remote fetch config.
|
|
28
|
+
* @returns NestJS {@link ModuleMetadata} that provides an {@link AssetLoader}.
|
|
29
|
+
*
|
|
30
|
+
* @Module (appAssetLoaderModuleMetadata({
|
|
30
31
|
* local: { basePath: './assets' }
|
|
31
32
|
* }))
|
|
32
33
|
* export class AppAssetLoaderModule {}
|
|
33
34
|
* ```
|
|
34
35
|
*
|
|
35
|
-
* @
|
|
36
|
-
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
37
38
|
*/
|
|
38
39
|
export declare function appAssetLoaderModuleMetadata(config: AppAssetLoaderModuleMetadataConfig): ModuleMetadata;
|
|
@@ -8,7 +8,7 @@ export declare const IsRequestFromLocalHost: (...dataOrPipes: unknown[]) => Para
|
|
|
8
8
|
*
|
|
9
9
|
* Checks for both http://localhost and https://localhost origins.
|
|
10
10
|
*
|
|
11
|
-
* @param context -
|
|
12
|
-
* @returns
|
|
11
|
+
* @param context - The NestJS execution context containing the HTTP request.
|
|
12
|
+
* @returns True if the request origin is localhost.
|
|
13
13
|
*/
|
|
14
14
|
export declare function isLocalhost(context: ExecutionContext): boolean;
|
|
@@ -32,9 +32,9 @@ export declare const ParsedQueryRawBody: (...dataOrPipes: any[]) => ParameterDec
|
|
|
32
32
|
/**
|
|
33
33
|
* Parses a raw body buffer as JSON.
|
|
34
34
|
*
|
|
35
|
-
* @param rawBody - The raw body buffer to parse
|
|
36
|
-
* @returns The parsed JSON object
|
|
37
|
-
* @throws {SyntaxError} When the body is not valid JSON
|
|
35
|
+
* @param rawBody - The raw body buffer to parse.
|
|
36
|
+
* @returns The parsed JSON object.
|
|
37
|
+
* @throws {SyntaxError} When the body is not valid JSON.
|
|
38
38
|
*
|
|
39
39
|
* @example
|
|
40
40
|
* ```typescript
|
|
@@ -45,8 +45,8 @@ export declare function RawBodyToJson<T extends object>(rawBody: RawBodyBuffer):
|
|
|
45
45
|
/**
|
|
46
46
|
* Parses a raw body buffer as a URL-encoded query string.
|
|
47
47
|
*
|
|
48
|
-
* @param rawBody - The raw body buffer to parse
|
|
49
|
-
* @returns The parsed query parameters
|
|
48
|
+
* @param rawBody - The raw body buffer to parse.
|
|
49
|
+
* @returns The parsed query parameters.
|
|
50
50
|
*
|
|
51
51
|
* @example
|
|
52
52
|
* ```typescript
|
|
@@ -57,8 +57,8 @@ export declare function RawBodyToParsedQueryString(rawBody: RawBodyBuffer): Pars
|
|
|
57
57
|
/**
|
|
58
58
|
* Converts a raw body buffer to a trimmed UTF-8 string.
|
|
59
59
|
*
|
|
60
|
-
* @param rawBody - The raw body buffer to convert
|
|
61
|
-
* @returns The decoded and trimmed string content
|
|
60
|
+
* @param rawBody - The raw body buffer to convert.
|
|
61
|
+
* @returns The decoded and trimmed string content.
|
|
62
62
|
*
|
|
63
63
|
* @example
|
|
64
64
|
* ```typescript
|
|
@@ -17,8 +17,8 @@ export declare abstract class ClientAppServiceConfig {
|
|
|
17
17
|
/**
|
|
18
18
|
* Validates that the configuration contains a non-empty client web app URL.
|
|
19
19
|
*
|
|
20
|
-
* @param config - The configuration to validate
|
|
21
|
-
* @throws {Error} When `clientWebAppUrl` is not specified
|
|
20
|
+
* @param config - The configuration to validate.
|
|
21
|
+
* @throws {Error} When `clientWebAppUrl` is not specified.
|
|
22
22
|
*/
|
|
23
23
|
static assertValidConfig(config: ClientAppServiceConfig): void;
|
|
24
24
|
}
|
|
@@ -5,8 +5,9 @@ import { ClientAppServiceConfig } from './client.config';
|
|
|
5
5
|
*
|
|
6
6
|
* Reads the client web app URL from the CLIENT_WEB_APP_URL environment variable.
|
|
7
7
|
*
|
|
8
|
-
* @param configService - NestJS config service for reading environment variables
|
|
9
|
-
* @returns
|
|
8
|
+
* @param configService - NestJS config service for reading environment variables.
|
|
9
|
+
* @returns A validated ClientAppServiceConfig.
|
|
10
|
+
*
|
|
10
11
|
* @__NO_SIDE_EFFECTS__
|
|
11
12
|
*/
|
|
12
13
|
export declare function clientAppConfigFactory(configService: ConfigService): ClientAppServiceConfig;
|
|
@@ -9,7 +9,7 @@ export declare const SERVER_ENV_TOKEN: InjectionToken;
|
|
|
9
9
|
*
|
|
10
10
|
* Use this to register a server environment configuration instance with the NestJS dependency injection container.
|
|
11
11
|
*
|
|
12
|
-
* @param env -
|
|
13
|
-
* @returns
|
|
12
|
+
* @param env - The server environment config to provide.
|
|
13
|
+
* @returns A NestJS Provider that supplies the config under SERVER_ENV_TOKEN.
|
|
14
14
|
*/
|
|
15
15
|
export declare function serverEnvTokenProvider<T extends ServerEnvironmentConfig = ServerEnvironmentConfig>(env: T): Provider;
|
|
@@ -4,9 +4,9 @@ export type AdditionalModuleMetadata = Partial<ModuleMetadata>;
|
|
|
4
4
|
/**
|
|
5
5
|
* Merges two module metadata entries together.
|
|
6
6
|
*
|
|
7
|
-
* @param base -
|
|
8
|
-
* @param additional -
|
|
9
|
-
* @returns
|
|
7
|
+
* @param base - The base module metadata.
|
|
8
|
+
* @param additional - Additional metadata to merge in.
|
|
9
|
+
* @returns The merged module metadata.
|
|
10
10
|
*/
|
|
11
11
|
export declare function mergeModuleMetadata(base: ModuleMetadata, additional?: AdditionalModuleMetadata): ModuleMetadata;
|
|
12
12
|
/**
|
|
@@ -14,7 +14,7 @@ export declare function mergeModuleMetadata(base: ModuleMetadata, additional?: A
|
|
|
14
14
|
*
|
|
15
15
|
* For class providers, returns the class itself; for object providers, returns the provide token.
|
|
16
16
|
*
|
|
17
|
-
* @param providers -
|
|
18
|
-
* @returns
|
|
17
|
+
* @param providers - Providers to extract tokens from.
|
|
18
|
+
* @returns Injection tokens collected from each provider.
|
|
19
19
|
*/
|
|
20
20
|
export declare function injectionTokensFromProviders(providers: ArrayOrValue<Provider<unknown>>): InjectionToken[];
|
|
@@ -6,8 +6,8 @@ export type AES256GCMEncryptionSecret = string;
|
|
|
6
6
|
/**
|
|
7
7
|
* Validates that the given secret is a 64-character hexadecimal string (32 bytes for AES-256).
|
|
8
8
|
*
|
|
9
|
-
* @param secret -
|
|
10
|
-
* @returns
|
|
9
|
+
* @param secret - The hex-encoded secret key string to validate.
|
|
10
|
+
* @returns True if the secret is exactly 64 valid hex characters, false otherwise.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```typescript
|
|
@@ -29,15 +29,15 @@ export type AES256GCMEncryptionSecretSource = GetterOrValue<AES256GCMEncryptionS
|
|
|
29
29
|
* The getter is called immediately and the key is validated on creation. The returned
|
|
30
30
|
* function provides the resolved Buffer without re-resolving or re-validating.
|
|
31
31
|
*
|
|
32
|
+
* @param source - The secret source configuration.
|
|
33
|
+
* @returns A getter that returns the resolved 32-byte Buffer for AES-256 encryption.
|
|
34
|
+
* @throws {Error} When the resolved key is not 64 hex characters.
|
|
35
|
+
*
|
|
32
36
|
* @example
|
|
33
37
|
* ```typescript
|
|
34
38
|
* const getKey = resolveEncryptionKey('a'.repeat(64));
|
|
35
39
|
* const key: Buffer = getKey();
|
|
36
40
|
* ```
|
|
37
|
-
*
|
|
38
|
-
* @param source - The secret source configuration.
|
|
39
|
-
* @returns A getter that returns the resolved 32-byte Buffer for AES-256 encryption.
|
|
40
|
-
* @throws Error if the resolved key is not 64 hex characters.
|
|
41
41
|
*/
|
|
42
42
|
export declare function resolveEncryptionKey(source: AES256GCMEncryptionSecretSource): Getter<Buffer>;
|
|
43
43
|
/**
|
|
@@ -70,6 +70,10 @@ export interface AES256GCMEncryption {
|
|
|
70
70
|
/**
|
|
71
71
|
* Creates an `AES256GCMEncryption` instance that captures the resolved key in a closure.
|
|
72
72
|
*
|
|
73
|
+
* @param source - The hex-encoded secret or getter for the AES-256 key.
|
|
74
|
+
* @returns An `AES256GCMEncryption` instance.
|
|
75
|
+
* @throws {Error} When the resolved key is not 64 hex characters.
|
|
76
|
+
*
|
|
73
77
|
* @example
|
|
74
78
|
* ```typescript
|
|
75
79
|
* const encryption = createAES256GCMEncryption('a'.repeat(64));
|
|
@@ -82,9 +86,6 @@ export interface AES256GCMEncryption {
|
|
|
82
86
|
* // decryptedStr === 'hello'
|
|
83
87
|
* ```
|
|
84
88
|
*
|
|
85
|
-
* @param source - The hex-encoded secret or getter for the AES-256 key.
|
|
86
|
-
* @returns An `AES256GCMEncryption` instance.
|
|
87
|
-
* @throws Error if the resolved key is not 64 hex characters.
|
|
88
89
|
* @__NO_SIDE_EFFECTS__
|
|
89
90
|
*/
|
|
90
91
|
export declare function createAES256GCMEncryption(source: AES256GCMEncryptionSecretSource): AES256GCMEncryption;
|
|
@@ -93,16 +94,16 @@ export declare function createAES256GCMEncryption(source: AES256GCMEncryptionSec
|
|
|
93
94
|
*
|
|
94
95
|
* Format: base64(IV (12 bytes) + ciphertext + authTag (16 bytes))
|
|
95
96
|
*
|
|
97
|
+
* @param value - The value to encrypt (must be JSON-serializable).
|
|
98
|
+
* @param key - The 32-byte encryption key from `resolveEncryptionKey()`.
|
|
99
|
+
* @returns The encrypted value as a base64 string.
|
|
100
|
+
*
|
|
96
101
|
* @example
|
|
97
102
|
* ```typescript
|
|
98
103
|
* const getKey = resolveEncryptionKey(mySecret);
|
|
99
104
|
* const encrypted = encryptValue({ sensitive: 'data' }, getKey());
|
|
100
105
|
* const decrypted = decryptValue<{ sensitive: string }>(encrypted, getKey());
|
|
101
106
|
* ```
|
|
102
|
-
*
|
|
103
|
-
* @param value - The value to encrypt (must be JSON-serializable).
|
|
104
|
-
* @param key - The 32-byte encryption key from `resolveEncryptionKey()`.
|
|
105
|
-
* @returns The encrypted value as a base64 string.
|
|
106
107
|
*/
|
|
107
108
|
export declare function encryptValue<T>(value: T, key: Buffer): string;
|
|
108
109
|
/**
|
|
@@ -119,6 +120,10 @@ export declare function decryptValue<T>(encoded: string, key: Buffer): T;
|
|
|
119
120
|
* The key is resolved and validated eagerly at creation time. The provider encrypts/decrypts
|
|
120
121
|
* raw strings (no JSON serialization) — suitable for use with `selectiveFieldEncryptor`.
|
|
121
122
|
*
|
|
123
|
+
* @param source - The hex-encoded secret or getter for the AES-256 key.
|
|
124
|
+
* @returns A `StringEncryptionProvider` that encrypts/decrypts strings via AES-256-GCM.
|
|
125
|
+
* @throws {Error} When the resolved key is not 64 hex characters.
|
|
126
|
+
*
|
|
122
127
|
* @example
|
|
123
128
|
* ```typescript
|
|
124
129
|
* const provider = createAesStringEncryptionProvider('a'.repeat(64));
|
|
@@ -127,9 +132,6 @@ export declare function decryptValue<T>(encoded: string, key: Buffer): T;
|
|
|
127
132
|
* // decrypted === 'sensitive data'
|
|
128
133
|
* ```
|
|
129
134
|
*
|
|
130
|
-
* @param source - The hex-encoded secret or getter for the AES-256 key.
|
|
131
|
-
* @returns A `StringEncryptionProvider` that encrypts/decrypts strings via AES-256-GCM.
|
|
132
|
-
* @throws Error if the resolved key is not 64 hex characters.
|
|
133
135
|
* @__NO_SIDE_EFFECTS__
|
|
134
136
|
*/
|
|
135
137
|
export declare function createAesStringEncryptionProvider(source: AES256GCMEncryptionSecretSource): StringEncryptionProvider;
|
|
@@ -41,7 +41,7 @@ export interface WriteJsonFileInput {
|
|
|
41
41
|
* @param input.dirPath - Absolute path to the parent directory; created (recursively) when missing.
|
|
42
42
|
* @param input.data - Value to serialize as JSON (pretty-printed with two-space indentation).
|
|
43
43
|
* @param input.mode - Optional numeric file mode (e.g. `0o600`) applied via `chmod` after the write.
|
|
44
|
-
* @returns
|
|
44
|
+
* @returns Resolves once the JSON has been written and the optional `chmod` has completed.
|
|
45
45
|
*/
|
|
46
46
|
export declare function writeJsonFile(input: WriteJsonFileInput): Promise<void>;
|
|
47
47
|
/**
|
|
@@ -52,6 +52,6 @@ export declare function writeJsonFile(input: WriteJsonFileInput): Promise<void>;
|
|
|
52
52
|
* swallowing them masks real failures and makes operations appear to have succeeded.
|
|
53
53
|
*
|
|
54
54
|
* @param filePath - Absolute path to the file to remove.
|
|
55
|
-
* @returns
|
|
55
|
+
* @returns Resolves once the file is removed (or was already absent).
|
|
56
56
|
*/
|
|
57
57
|
export declare function removeFile(filePath: string): Promise<void>;
|
|
@@ -30,6 +30,9 @@ export type PdfEncryptionStatus = 'none' | 'write_protected_only' | 'fully_encry
|
|
|
30
30
|
* Lives in `@dereekb/nestjs` (rather than `@dereekb/util`) because it uses Node's
|
|
31
31
|
* built-in `node:crypto` module, which isn't available in the browser.
|
|
32
32
|
*
|
|
33
|
+
* @param buffer - PDF file contents.
|
|
34
|
+
* @returns The encryption status of the PDF.
|
|
35
|
+
*
|
|
33
36
|
* @example
|
|
34
37
|
* ```ts
|
|
35
38
|
* const status = detectPdfEncryption(buffer);
|
|
@@ -41,8 +44,5 @@ export type PdfEncryptionStatus = 'none' | 'write_protected_only' | 'fully_encry
|
|
|
41
44
|
* // Safe to read, but not to mutate without the owner password.
|
|
42
45
|
* }
|
|
43
46
|
* ```
|
|
44
|
-
*
|
|
45
|
-
* @param buffer - PDF file contents.
|
|
46
|
-
* @returns The encryption status of the PDF.
|
|
47
47
|
*/
|
|
48
48
|
export declare function detectPdfEncryption(buffer: Buffer): PdfEncryptionStatus;
|