@dereekb/nestjs 13.11.18 → 13.12.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/discord/package.json +4 -4
- package/discord/src/lib/discord.api.spec.client.d.ts +20 -0
- package/eslint/index.cjs.js +148 -115
- package/eslint/index.esm.js +148 -115
- package/eslint/package.json +1 -1
- package/mailgun/package.json +6 -6
- package/openai/package.json +6 -6
- package/package.json +11 -4
- package/stripe/package.json +6 -6
- package/twilio/index.cjs.default.js +1 -0
- package/twilio/index.cjs.js +2184 -0
- package/twilio/index.cjs.mjs +2 -0
- package/twilio/index.d.ts +1 -0
- package/twilio/index.esm.js +2159 -0
- package/twilio/package.json +27 -0
- package/twilio/src/index.d.ts +1 -0
- package/twilio/src/lib/index.d.ts +8 -0
- package/twilio/src/lib/lookup/index.d.ts +4 -0
- package/twilio/src/lib/lookup/lookup.api.d.ts +7 -0
- package/twilio/src/lib/lookup/lookup.module.d.ts +7 -0
- package/twilio/src/lib/lookup/lookup.service.d.ts +39 -0
- package/twilio/src/lib/lookup/lookup.type.d.ts +37 -0
- package/twilio/src/lib/twilio.api.d.ts +13 -0
- package/twilio/src/lib/twilio.config.d.ts +71 -0
- package/twilio/src/lib/twilio.module.d.ts +17 -0
- package/twilio/src/lib/twilio.service.d.ts +91 -0
- package/twilio/src/lib/twilio.type.d.ts +53 -0
- package/twilio/src/lib/verify/index.d.ts +4 -0
- package/twilio/src/lib/verify/verify.api.d.ts +10 -0
- package/twilio/src/lib/verify/verify.config.d.ts +22 -0
- package/twilio/src/lib/verify/verify.module.d.ts +17 -0
- package/twilio/src/lib/verify/verify.service.d.ts +83 -0
- package/twilio/src/lib/webhook/index.d.ts +6 -0
- package/twilio/src/lib/webhook/webhook.twilio.config.d.ts +28 -0
- package/twilio/src/lib/webhook/webhook.twilio.controller.d.ts +9 -0
- package/twilio/src/lib/webhook/webhook.twilio.d.ts +68 -0
- package/twilio/src/lib/webhook/webhook.twilio.module.d.ts +22 -0
- package/twilio/src/lib/webhook/webhook.twilio.service.d.ts +21 -0
- package/twilio/src/lib/webhook/webhook.twilio.verify.d.ts +53 -0
- package/typeform/package.json +6 -6
- package/vapiai/package.json +6 -6
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ConfigService } from '@nestjs/config';
|
|
2
|
+
import { TwilioWebhookServiceConfig } from './webhook.twilio.config';
|
|
3
|
+
/**
|
|
4
|
+
* Factory that creates a {@link TwilioWebhookServiceConfig} from environment variables.
|
|
5
|
+
*
|
|
6
|
+
* @param configService - NestJS config service for reading environment variables.
|
|
7
|
+
* @returns A populated {@link TwilioWebhookServiceConfig}.
|
|
8
|
+
*/
|
|
9
|
+
export declare function twilioWebhookServiceConfigFactory(configService: ConfigService): TwilioWebhookServiceConfig;
|
|
10
|
+
/**
|
|
11
|
+
* NestJS module that handles incoming Twilio webhook requests at:
|
|
12
|
+
* - `POST /webhook/twilio/status` (Message status callbacks)
|
|
13
|
+
* - `POST /webhook/twilio/incoming` (Incoming SMS / MMS messages)
|
|
14
|
+
*
|
|
15
|
+
* Webhook bodies are verified against the X-Twilio-Signature header before dispatch.
|
|
16
|
+
*
|
|
17
|
+
* Requires the consuming application to register the raw-body middleware from
|
|
18
|
+
* `@dereekb/nestjs` for the `/webhook/twilio` path so that signature verification can read
|
|
19
|
+
* the unparsed form body.
|
|
20
|
+
*/
|
|
21
|
+
export declare class TwilioWebhookModule {
|
|
22
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Handler } from '@dereekb/util';
|
|
2
|
+
import { type Request } from 'express';
|
|
3
|
+
import { TwilioApi } from '../twilio.api';
|
|
4
|
+
import { type TwilioWebhookEvent, type TwilioWebhookEventType } from './webhook.twilio';
|
|
5
|
+
import { TwilioWebhookServiceConfig } from './webhook.twilio.config';
|
|
6
|
+
export declare class TwilioWebhookService {
|
|
7
|
+
private readonly logger;
|
|
8
|
+
private readonly _verifier;
|
|
9
|
+
readonly handler: Handler<TwilioWebhookEvent, TwilioWebhookEventType>;
|
|
10
|
+
readonly configure: import("@dereekb/util").HandlerConfigurer<import("./webhook.twilio").TwilioWebhookEventHandlerConfigurer, TwilioWebhookEvent, TwilioWebhookEventType, boolean>;
|
|
11
|
+
constructor(twilioApi: TwilioApi, webhookConfig: TwilioWebhookServiceConfig);
|
|
12
|
+
handleStatusCallback(req: Request, rawBody: Buffer): Promise<void>;
|
|
13
|
+
handleIncomingMessage(req: Request, rawBody: Buffer): Promise<void>;
|
|
14
|
+
private dispatchEvent;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Provides a reference to a TwilioWebhookService instance.
|
|
18
|
+
*/
|
|
19
|
+
export interface TwilioWebhookServiceRef {
|
|
20
|
+
readonly twilioWebhookService: TwilioWebhookService;
|
|
21
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type Maybe } from '@dereekb/util';
|
|
2
|
+
import { type Request } from 'express';
|
|
3
|
+
export interface TwilioWebhookVerificationConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Twilio auth token used for HMAC-SHA1 signature verification.
|
|
6
|
+
*/
|
|
7
|
+
readonly authToken: string;
|
|
8
|
+
/**
|
|
9
|
+
* Override base URL Twilio used when calculating the signature. Required when the
|
|
10
|
+
* service is behind a proxy and the request's `Host` header does not match the public URL.
|
|
11
|
+
*/
|
|
12
|
+
readonly baseUrl?: Maybe<string>;
|
|
13
|
+
/**
|
|
14
|
+
* When true, skip verification and always return valid. Intended for local development.
|
|
15
|
+
*/
|
|
16
|
+
readonly skip?: Maybe<boolean>;
|
|
17
|
+
}
|
|
18
|
+
export interface TwilioWebhookVerificationResult {
|
|
19
|
+
readonly valid: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Parsed form params from the request body. Always present even when verification fails.
|
|
22
|
+
*/
|
|
23
|
+
readonly params: Record<string, string>;
|
|
24
|
+
}
|
|
25
|
+
export type TwilioWebhookVerifier = (req: Request, rawBody: Buffer) => TwilioWebhookVerificationResult;
|
|
26
|
+
/**
|
|
27
|
+
* Parses a `application/x-www-form-urlencoded` raw body into a plain `Record<string, string>`.
|
|
28
|
+
*
|
|
29
|
+
* Twilio's status callback and incoming-message webhooks use this content type by default.
|
|
30
|
+
*
|
|
31
|
+
* @param rawBody - The unparsed request body bytes.
|
|
32
|
+
* @returns Form parameters as a flat string-keyed object.
|
|
33
|
+
*/
|
|
34
|
+
export declare function parseTwilioFormBody(rawBody: Buffer): Record<string, string>;
|
|
35
|
+
/**
|
|
36
|
+
* Builds the full URL Twilio used when computing the request signature. Twilio computes
|
|
37
|
+
* the signature over the URL it called (including query string).
|
|
38
|
+
*
|
|
39
|
+
* @param req - Incoming Express request.
|
|
40
|
+
* @param baseUrl - Optional explicit base URL (used when the server sits behind a proxy
|
|
41
|
+
* and the request's `Host` header does not match the public URL).
|
|
42
|
+
* @returns The full URL string Twilio would have signed.
|
|
43
|
+
*/
|
|
44
|
+
export declare function twilioWebhookRequestUrl(req: Request, baseUrl?: Maybe<string>): string;
|
|
45
|
+
/**
|
|
46
|
+
* Creates a verifier that validates the `X-Twilio-Signature` header against the request body
|
|
47
|
+
* using Twilio's HMAC-SHA1 signature scheme.
|
|
48
|
+
*
|
|
49
|
+
* @param config - Verification config (auth token, optional baseUrl, optional skip flag).
|
|
50
|
+
* @returns A verifier function that, given a request and raw body, returns the validity
|
|
51
|
+
* and parsed form params.
|
|
52
|
+
*/
|
|
53
|
+
export declare function twilioWebhookVerifier(config: TwilioWebhookVerificationConfig): TwilioWebhookVerifier;
|
package/typeform/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/nestjs/typeform",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.12.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@dereekb/date": "13.
|
|
6
|
-
"@dereekb/model": "13.
|
|
7
|
-
"@dereekb/nestjs": "13.
|
|
8
|
-
"@dereekb/rxjs": "13.
|
|
9
|
-
"@dereekb/util": "13.
|
|
5
|
+
"@dereekb/date": "13.12.0",
|
|
6
|
+
"@dereekb/model": "13.12.0",
|
|
7
|
+
"@dereekb/nestjs": "13.12.0",
|
|
8
|
+
"@dereekb/rxjs": "13.12.0",
|
|
9
|
+
"@dereekb/util": "13.12.0",
|
|
10
10
|
"@nestjs/common": "^11.1.19",
|
|
11
11
|
"@nestjs/config": "^4.0.4",
|
|
12
12
|
"@typeform/api-client": "^2.10.2",
|
package/vapiai/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/nestjs/vapiai",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.12.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@dereekb/date": "13.
|
|
6
|
-
"@dereekb/model": "13.
|
|
7
|
-
"@dereekb/nestjs": "13.
|
|
8
|
-
"@dereekb/rxjs": "13.
|
|
9
|
-
"@dereekb/util": "13.
|
|
5
|
+
"@dereekb/date": "13.12.0",
|
|
6
|
+
"@dereekb/model": "13.12.0",
|
|
7
|
+
"@dereekb/nestjs": "13.12.0",
|
|
8
|
+
"@dereekb/rxjs": "13.12.0",
|
|
9
|
+
"@dereekb/util": "13.12.0",
|
|
10
10
|
"@nestjs/common": "^11.1.19",
|
|
11
11
|
"@nestjs/config": "^4.0.4",
|
|
12
12
|
"@vapi-ai/server-sdk": "^0.11.0",
|