@btps/sdk 1.1.0 → 1.1.2

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.
@@ -1,21 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2025 Bhupendra Tamang
4
- * Licensed under the Apache License, Version 2.0
5
- * https://www.apache.org/licenses/LICENSE-2.0
6
- */
7
- import { z } from 'zod';
8
- export declare const identitySchema: z.ZodEffects<z.ZodString, string, string>;
9
- export declare const BtpSignatureSchema: z.ZodObject<{
10
- algorithmHash: z.ZodLiteral<"sha256">;
11
- value: z.ZodString;
12
- fingerprint: z.ZodString;
13
- }, "strip", z.ZodTypeAny, {
14
- value: string;
15
- algorithmHash: "sha256";
16
- fingerprint: string;
17
- }, {
18
- value: string;
19
- algorithmHash: "sha256";
20
- fingerprint: string;
21
- }>;
@@ -1,14 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2025 Bhupendra Tamang
4
- * Licensed under the Apache License, Version 2.0
5
- * https://www.apache.org/licenses/LICENSE-2.0
6
- */
7
- import { z, ZodError } from 'zod';
8
- export declare function validate<T>(schema: z.ZodSchema<T>, data: unknown): {
9
- success: true;
10
- data: T;
11
- } | {
12
- success: false;
13
- error: ZodError;
14
- };
@@ -1,59 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2025 Bhupendra Tamang
4
- * Licensed under the Apache License, Version 2.0
5
- * https://www.apache.org/licenses/LICENSE-2.0
6
- */
7
- import { MiddlewareDefinition, MiddlewareContext, Phase, Step } from '../types.js';
8
- import { BTPServerResponse } from '../../core/server/types.js';
9
- export declare class MiddlewareManager {
10
- private middlewarePath?;
11
- private middleware;
12
- private lifecycleHooks;
13
- private readonly configuredPath;
14
- constructor(middlewarePath?: string | undefined);
15
- /**
16
- * Loads and validates middleware from the specified path
17
- */
18
- loadMiddleware(dependencies: MiddlewareContext['dependencies']): Promise<void>;
19
- /**
20
- * Validates middleware definitions and sorts them by priority
21
- */
22
- private validateAndSortMiddleware;
23
- /**
24
- * Validates a single middleware definition
25
- */
26
- private validateMiddlewareDefinition;
27
- /**
28
- * Checks if the result is a MiddlewareModule
29
- */
30
- private isMiddlewareModule;
31
- /**
32
- * Gets middleware for a specific phase and step
33
- */
34
- getMiddleware(phase: Phase, step: Step): MiddlewareDefinition[];
35
- /**
36
- * Gets all middleware
37
- */
38
- getAllMiddleware(): MiddlewareDefinition[];
39
- /**
40
- * Gets lifecycle hooks
41
- */
42
- getLifecycleHooks(): {
43
- onServerStart?: () => Promise<void> | void;
44
- onServerStop?: () => Promise<void> | void;
45
- onResponseSent?: (response: BTPServerResponse) => Promise<void> | void;
46
- };
47
- /**
48
- * Executes server start lifecycle hooks
49
- */
50
- onServerStart(): Promise<void>;
51
- /**
52
- * Executes server stop lifecycle hooks
53
- */
54
- onServerStop(): Promise<void>;
55
- /**
56
- * Executes onResponseSent lifecycle hooks
57
- */
58
- onResponseSent(response: BTPServerResponse): Promise<void>;
59
- }