@btps/sdk 0.0.0-stage → 1.1.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.
Files changed (167) hide show
  1. package/CHANGELOG.md +149 -0
  2. package/LICENSE +190 -0
  3. package/NOTICE +25 -0
  4. package/README.md +261 -2
  5. package/dist/client/btpsAgent.d.ts +20 -0
  6. package/dist/client/btpsAgent.js +172 -0
  7. package/dist/client/btpsClient.d.ts +202 -0
  8. package/dist/client/btpsClient.js +602 -0
  9. package/dist/client/btpsTransporter.d.ts +52 -0
  10. package/dist/client/btpsTransporter.js +249 -0
  11. package/dist/client/constants.ts/index.d.ts +11 -0
  12. package/dist/client/constants.ts/index.js +20 -0
  13. package/dist/client/index.d.ts +12 -0
  14. package/dist/client/index.js +27 -0
  15. package/dist/client/libs/schema.d.ts +27604 -0
  16. package/dist/client/libs/schema.js +56 -0
  17. package/dist/client/libs/timeouts.d.ts +22 -0
  18. package/dist/client/libs/timeouts.js +19 -0
  19. package/dist/client/types/index.d.ts +155 -0
  20. package/dist/client/types/index.js +7 -0
  21. package/dist/core/authentication/BtpsAuthentication.d.ts +128 -0
  22. package/dist/core/authentication/BtpsAuthentication.js +293 -0
  23. package/dist/core/authentication/index.d.ts +11 -0
  24. package/dist/core/authentication/index.js +12 -0
  25. package/dist/core/authentication/keyProof.d.ts +18 -0
  26. package/dist/core/authentication/keyProof.js +16 -0
  27. package/dist/core/authentication/storage/InMemoryAuthSessionStore.d.ts +55 -0
  28. package/dist/core/authentication/storage/InMemoryAuthSessionStore.js +62 -0
  29. package/dist/core/authentication/storage/InMemoryTokenStore.d.ts +63 -0
  30. package/dist/core/authentication/storage/InMemoryTokenStore.js +63 -0
  31. package/dist/core/authentication/types.d.ts +135 -0
  32. package/dist/core/authentication/types.js +7 -0
  33. package/dist/core/crypto/decryptVerify.d.ts +9 -0
  34. package/dist/core/crypto/decryptVerify.js +45 -0
  35. package/dist/core/crypto/decrypter-interface.d.ts +25 -0
  36. package/dist/core/crypto/decrypter-interface.js +7 -0
  37. package/dist/core/crypto/index.d.ts +77 -0
  38. package/dist/core/crypto/index.js +210 -0
  39. package/dist/core/crypto/jcs.d.ts +28 -0
  40. package/dist/core/crypto/jcs.js +60 -0
  41. package/dist/core/crypto/keygen.d.ts +9 -0
  42. package/dist/core/crypto/keygen.js +35 -0
  43. package/dist/core/crypto/pem-decrypter.d.ts +26 -0
  44. package/dist/core/crypto/pem-decrypter.js +52 -0
  45. package/dist/core/crypto/pem-signer.d.ts +21 -0
  46. package/dist/core/crypto/pem-signer.js +34 -0
  47. package/dist/core/crypto/signEncrypt.d.ts +34 -0
  48. package/dist/core/crypto/signEncrypt.js +75 -0
  49. package/dist/core/crypto/signer-interface.d.ts +22 -0
  50. package/dist/core/crypto/signer-interface.js +7 -0
  51. package/dist/core/crypto/types.d.ts +79 -0
  52. package/dist/core/crypto/types.js +7 -0
  53. package/dist/core/delegation/BtpsDelegator.d.ts +102 -0
  54. package/dist/core/delegation/BtpsDelegator.js +118 -0
  55. package/dist/core/delegation/index.d.ts +7 -0
  56. package/dist/core/delegation/index.js +8 -0
  57. package/dist/core/error/constant.d.ts +66 -0
  58. package/dist/core/error/constant.js +194 -0
  59. package/dist/core/error/index.d.ts +35 -0
  60. package/dist/core/error/index.js +52 -0
  61. package/dist/core/error/types.d.ts +16 -0
  62. package/dist/core/error/types.js +7 -0
  63. package/dist/core/server/constants/btps-protocol.d.ts +17 -0
  64. package/dist/core/server/constants/btps-protocol.js +25 -0
  65. package/dist/core/server/constants/control.d.ts +7 -0
  66. package/dist/core/server/constants/control.js +11 -0
  67. package/dist/core/server/constants/currency.d.ts +7 -0
  68. package/dist/core/server/constants/currency.js +332 -0
  69. package/dist/core/server/constants/index.d.ts +26 -0
  70. package/dist/core/server/constants/index.js +61 -0
  71. package/dist/core/server/constants/limits.d.ts +50 -0
  72. package/dist/core/server/constants/limits.js +50 -0
  73. package/dist/core/server/helpers/BtpsMessageQueue.d.ts +13 -0
  74. package/dist/core/server/helpers/BtpsMessageQueue.js +12 -0
  75. package/dist/core/server/helpers/InMemoryQueue.d.ts +16 -0
  76. package/dist/core/server/helpers/InMemoryQueue.js +35 -0
  77. package/dist/core/server/helpers/index.d.ts +8 -0
  78. package/dist/core/server/helpers/index.js +9 -0
  79. package/dist/core/server/schemas/artifacts/agentSchema.d.ts +4565 -0
  80. package/dist/core/server/schemas/artifacts/agentSchema.js +51 -0
  81. package/dist/core/server/schemas/artifacts/artifacts.d.ts +4920 -0
  82. package/dist/core/server/schemas/artifacts/artifacts.js +21 -0
  83. package/dist/core/server/schemas/artifacts/controlSchema.d.ts +23 -0
  84. package/dist/core/server/schemas/artifacts/controlSchema.js +18 -0
  85. package/dist/core/server/schemas/artifacts/identityLookupSchema.d.ts +32 -0
  86. package/dist/core/server/schemas/artifacts/identityLookupSchema.js +21 -0
  87. package/dist/core/server/schemas/artifacts/transporterSchema.d.ts +553 -0
  88. package/dist/core/server/schemas/artifacts/transporterSchema.js +60 -0
  89. package/dist/core/server/schemas/btpsDocsSchema.d.ts +4519 -0
  90. package/dist/core/server/schemas/btpsDocsSchema.js +272 -0
  91. package/dist/core/server/schemas/helpers.d.ts +1612 -0
  92. package/dist/core/server/schemas/helpers.js +87 -0
  93. package/dist/core/server/schemas/responseSchema.d.ts +6918 -0
  94. package/dist/core/server/schemas/responseSchema.js +86 -0
  95. package/dist/core/server/schemas/schema.d.ts +4916 -0
  96. package/dist/core/server/schemas/schema.js +70 -0
  97. package/dist/core/server/schemas/shared.d.ts +21 -0
  98. package/dist/core/server/schemas/shared.js +18 -0
  99. package/dist/core/server/types.d.ts +172 -0
  100. package/dist/core/server/types.js +7 -0
  101. package/dist/core/storage/AbstractIdentityStore.d.ts +17 -0
  102. package/dist/core/storage/AbstractIdentityStore.js +13 -0
  103. package/dist/core/storage/AbstractStorageStore.d.ts +16 -0
  104. package/dist/core/storage/AbstractStorageStore.js +17 -0
  105. package/dist/core/storage/JsonIdentityStore.d.ts +29 -0
  106. package/dist/core/storage/JsonIdentityStore.js +39 -0
  107. package/dist/core/storage/JsonStorageStore.d.ts +59 -0
  108. package/dist/core/storage/JsonStorageStore.js +110 -0
  109. package/dist/core/storage/index.d.ts +11 -0
  110. package/dist/core/storage/index.js +18 -0
  111. package/dist/core/storage/types.d.ts +28 -0
  112. package/dist/core/storage/types.js +7 -0
  113. package/dist/core/trust/index.d.ts +10 -0
  114. package/dist/core/trust/index.js +15 -0
  115. package/dist/core/trust/storage/AbstractTrustStore.d.ts +23 -0
  116. package/dist/core/trust/storage/AbstractTrustStore.js +13 -0
  117. package/dist/core/trust/storage/JsonTrustStore.d.ts +33 -0
  118. package/dist/core/trust/storage/JsonTrustStore.js +42 -0
  119. package/dist/core/trust/trustUtils.d.ts +78 -0
  120. package/dist/core/trust/trustUtils.js +41 -0
  121. package/dist/core/trust/types.d.ts +53 -0
  122. package/dist/core/trust/types.js +7 -0
  123. package/dist/core/utils/identity.d.ts +20 -0
  124. package/dist/core/utils/identity.js +22 -0
  125. package/dist/core/utils/index.d.ts +70 -0
  126. package/dist/core/utils/index.js +124 -0
  127. package/dist/core/utils/types.d.ts +10 -0
  128. package/dist/core/utils/types.js +7 -0
  129. package/dist/core/utils/validation.d.ts +14 -0
  130. package/dist/core/utils/validation.js +13 -0
  131. package/dist/index.d.ts +7 -0
  132. package/dist/index.js +8 -0
  133. package/dist/server/btpsServer.d.ts +292 -0
  134. package/dist/server/btpsServer.js +827 -0
  135. package/dist/server/index.d.ts +11 -0
  136. package/dist/server/index.js +15 -0
  137. package/dist/server/libs/abstractRateLimiter.d.ts +10 -0
  138. package/dist/server/libs/abstractRateLimiter.js +15 -0
  139. package/dist/server/libs/artifactSizeGuard.d.ts +27 -0
  140. package/dist/server/libs/artifactSizeGuard.js +44 -0
  141. package/dist/server/libs/artifactTimeWindow.d.ts +24 -0
  142. package/dist/server/libs/artifactTimeWindow.js +30 -0
  143. package/dist/server/libs/btpsFactory.d.ts +29 -0
  144. package/dist/server/libs/btpsFactory.js +49 -0
  145. package/dist/server/libs/btpsLightweightFactory.d.ts +35 -0
  146. package/dist/server/libs/btpsLightweightFactory.js +37 -0
  147. package/dist/server/libs/btpsRegistry.d.ts +14 -0
  148. package/dist/server/libs/btpsRegistry.js +16 -0
  149. package/dist/server/libs/btpsSimpleMetricsTracker.d.ts +13 -0
  150. package/dist/server/libs/btpsSimpleMetricsTracker.js +21 -0
  151. package/dist/server/libs/btpsSimpleRateLimiter.d.ts +28 -0
  152. package/dist/server/libs/btpsSimpleRateLimiter.js +46 -0
  153. package/dist/server/libs/connectionTimeout.d.ts +16 -0
  154. package/dist/server/libs/connectionTimeout.js +14 -0
  155. package/dist/server/libs/defaultMiddleware.d.ts +8 -0
  156. package/dist/server/libs/defaultMiddleware.js +128 -0
  157. package/dist/server/libs/inFlightLimit.d.ts +18 -0
  158. package/dist/server/libs/inFlightLimit.js +17 -0
  159. package/dist/server/libs/index.d.ts +18 -0
  160. package/dist/server/libs/index.js +34 -0
  161. package/dist/server/libs/middlewareManager.d.ts +59 -0
  162. package/dist/server/libs/middlewareManager.js +126 -0
  163. package/dist/server/libs/type.d.ts +22 -0
  164. package/dist/server/libs/type.js +7 -0
  165. package/dist/server/types.d.ts +236 -0
  166. package/dist/server/types.js +7 -0
  167. package/package.json +126 -4
@@ -0,0 +1,21 @@
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
+
8
+ import { z } from "zod";
9
+ import { BtpAgentArtifactSchema } from "./agentSchema.js";
10
+ import { BtpTransporterArtifactSchema } from "./transporterSchema.js";
11
+ import { BtpControlArtifactSchema } from "./controlSchema.js";
12
+ import { BtpIdentityLookupRequestSchema } from "./identityLookupSchema.js";
13
+ const BtpArtifactServerSchema = z.union([
14
+ BtpAgentArtifactSchema,
15
+ BtpTransporterArtifactSchema,
16
+ BtpControlArtifactSchema,
17
+ BtpIdentityLookupRequestSchema
18
+ ]);
19
+ export {
20
+ BtpArtifactServerSchema
21
+ };
@@ -0,0 +1,23 @@
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 BtpControlArtifactSchema: z.ZodObject<{
9
+ version: z.ZodString;
10
+ id: z.ZodString;
11
+ issuedAt: z.ZodString;
12
+ action: z.ZodEnum<["QUIT", "PING"]>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ id: string;
15
+ issuedAt: string;
16
+ action: "QUIT" | "PING";
17
+ version: string;
18
+ }, {
19
+ id: string;
20
+ issuedAt: string;
21
+ action: "QUIT" | "PING";
22
+ version: string;
23
+ }>;
@@ -0,0 +1,18 @@
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
+
8
+ import { z } from "zod";
9
+ import { CONTROL_ACTIONS } from "../../constants/control.js";
10
+ const BtpControlArtifactSchema = z.object({
11
+ version: z.string(),
12
+ id: z.string(),
13
+ issuedAt: z.string().datetime(),
14
+ action: z.enum(CONTROL_ACTIONS)
15
+ });
16
+ export {
17
+ BtpControlArtifactSchema
18
+ };
@@ -0,0 +1,32 @@
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 BtpIdentityLookupRequestSchema: z.ZodObject<{
9
+ version: z.ZodString;
10
+ id: z.ZodString;
11
+ issuedAt: z.ZodString;
12
+ identity: z.ZodEffects<z.ZodString, string, string>;
13
+ from: z.ZodEffects<z.ZodString, string, string>;
14
+ hostSelector: z.ZodString;
15
+ identitySelector: z.ZodOptional<z.ZodString>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ id: string;
18
+ issuedAt: string;
19
+ from: string;
20
+ version: string;
21
+ identity: string;
22
+ hostSelector: string;
23
+ identitySelector?: string | undefined;
24
+ }, {
25
+ id: string;
26
+ issuedAt: string;
27
+ from: string;
28
+ version: string;
29
+ identity: string;
30
+ hostSelector: string;
31
+ identitySelector?: string | undefined;
32
+ }>;
@@ -0,0 +1,21 @@
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
+
8
+ import { z } from "zod";
9
+ import { identitySchema } from "../shared.js";
10
+ const BtpIdentityLookupRequestSchema = z.object({
11
+ version: z.string(),
12
+ id: z.string(),
13
+ issuedAt: z.string().datetime(),
14
+ identity: identitySchema,
15
+ from: identitySchema,
16
+ hostSelector: z.string(),
17
+ identitySelector: z.string().optional()
18
+ });
19
+ export {
20
+ BtpIdentityLookupRequestSchema
21
+ };
@@ -0,0 +1,553 @@
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 BtpTransporterArtifactBaseSchema: z.ZodObject<{
9
+ version: z.ZodString;
10
+ issuedAt: z.ZodString;
11
+ id: z.ZodString;
12
+ type: z.ZodEnum<["TRUST_REQ", "TRUST_RES", "BTPS_DOC", "BTPS_EVENT"]>;
13
+ from: z.ZodEffects<z.ZodString, string, string>;
14
+ to: z.ZodEffects<z.ZodString, string, string>;
15
+ signature: z.ZodObject<{
16
+ algorithmHash: z.ZodLiteral<"sha256">;
17
+ value: z.ZodString;
18
+ fingerprint: z.ZodString;
19
+ }, "strip", z.ZodTypeAny, {
20
+ value: string;
21
+ algorithmHash: "sha256";
22
+ fingerprint: string;
23
+ }, {
24
+ value: string;
25
+ algorithmHash: "sha256";
26
+ fingerprint: string;
27
+ }>;
28
+ encryption: z.ZodNullable<z.ZodObject<{
29
+ algorithm: z.ZodLiteral<"aes-256-gcm">;
30
+ encryptedKey: z.ZodString;
31
+ iv: z.ZodString;
32
+ type: z.ZodEnum<["none", "standardEncrypt", "2faEncrypt"]>;
33
+ authTag: z.ZodString;
34
+ }, "strip", z.ZodTypeAny, {
35
+ type: "none" | "standardEncrypt" | "2faEncrypt";
36
+ algorithm: "aes-256-gcm";
37
+ encryptedKey: string;
38
+ iv: string;
39
+ authTag: string;
40
+ }, {
41
+ type: "none" | "standardEncrypt" | "2faEncrypt";
42
+ algorithm: "aes-256-gcm";
43
+ encryptedKey: string;
44
+ iv: string;
45
+ authTag: string;
46
+ }>>;
47
+ document: z.ZodUnknown;
48
+ delegation: z.ZodOptional<z.ZodObject<{
49
+ agentId: z.ZodString;
50
+ agentPubKey: z.ZodString;
51
+ signedBy: z.ZodEffects<z.ZodString, string, string>;
52
+ signature: z.ZodObject<{
53
+ algorithmHash: z.ZodLiteral<"sha256">;
54
+ value: z.ZodString;
55
+ fingerprint: z.ZodString;
56
+ }, "strip", z.ZodTypeAny, {
57
+ value: string;
58
+ algorithmHash: "sha256";
59
+ fingerprint: string;
60
+ }, {
61
+ value: string;
62
+ algorithmHash: "sha256";
63
+ fingerprint: string;
64
+ }>;
65
+ issuedAt: z.ZodString;
66
+ attestation: z.ZodOptional<z.ZodObject<{
67
+ signedBy: z.ZodEffects<z.ZodString, string, string>;
68
+ issuedAt: z.ZodString;
69
+ signature: z.ZodObject<{
70
+ algorithmHash: z.ZodLiteral<"sha256">;
71
+ value: z.ZodString;
72
+ fingerprint: z.ZodString;
73
+ }, "strip", z.ZodTypeAny, {
74
+ value: string;
75
+ algorithmHash: "sha256";
76
+ fingerprint: string;
77
+ }, {
78
+ value: string;
79
+ algorithmHash: "sha256";
80
+ fingerprint: string;
81
+ }>;
82
+ selector: z.ZodString;
83
+ }, "strip", z.ZodTypeAny, {
84
+ issuedAt: string;
85
+ signature: {
86
+ value: string;
87
+ algorithmHash: "sha256";
88
+ fingerprint: string;
89
+ };
90
+ selector: string;
91
+ signedBy: string;
92
+ }, {
93
+ issuedAt: string;
94
+ signature: {
95
+ value: string;
96
+ algorithmHash: "sha256";
97
+ fingerprint: string;
98
+ };
99
+ selector: string;
100
+ signedBy: string;
101
+ }>>;
102
+ selector: z.ZodString;
103
+ }, "strip", z.ZodTypeAny, {
104
+ issuedAt: string;
105
+ agentId: string;
106
+ signature: {
107
+ value: string;
108
+ algorithmHash: "sha256";
109
+ fingerprint: string;
110
+ };
111
+ selector: string;
112
+ agentPubKey: string;
113
+ signedBy: string;
114
+ attestation?: {
115
+ issuedAt: string;
116
+ signature: {
117
+ value: string;
118
+ algorithmHash: "sha256";
119
+ fingerprint: string;
120
+ };
121
+ selector: string;
122
+ signedBy: string;
123
+ } | undefined;
124
+ }, {
125
+ issuedAt: string;
126
+ agentId: string;
127
+ signature: {
128
+ value: string;
129
+ algorithmHash: "sha256";
130
+ fingerprint: string;
131
+ };
132
+ selector: string;
133
+ agentPubKey: string;
134
+ signedBy: string;
135
+ attestation?: {
136
+ issuedAt: string;
137
+ signature: {
138
+ value: string;
139
+ algorithmHash: "sha256";
140
+ fingerprint: string;
141
+ };
142
+ selector: string;
143
+ signedBy: string;
144
+ } | undefined;
145
+ }>>;
146
+ selector: z.ZodString;
147
+ relatesTo: z.ZodOptional<z.ZodString>;
148
+ }, "strip", z.ZodTypeAny, {
149
+ type: "TRUST_REQ" | "TRUST_RES" | "BTPS_DOC" | "BTPS_EVENT";
150
+ id: string;
151
+ issuedAt: string;
152
+ from: string;
153
+ encryption: {
154
+ type: "none" | "standardEncrypt" | "2faEncrypt";
155
+ algorithm: "aes-256-gcm";
156
+ encryptedKey: string;
157
+ iv: string;
158
+ authTag: string;
159
+ } | null;
160
+ version: string;
161
+ to: string;
162
+ signature: {
163
+ value: string;
164
+ algorithmHash: "sha256";
165
+ fingerprint: string;
166
+ };
167
+ selector: string;
168
+ document?: unknown;
169
+ delegation?: {
170
+ issuedAt: string;
171
+ agentId: string;
172
+ signature: {
173
+ value: string;
174
+ algorithmHash: "sha256";
175
+ fingerprint: string;
176
+ };
177
+ selector: string;
178
+ agentPubKey: string;
179
+ signedBy: string;
180
+ attestation?: {
181
+ issuedAt: string;
182
+ signature: {
183
+ value: string;
184
+ algorithmHash: "sha256";
185
+ fingerprint: string;
186
+ };
187
+ selector: string;
188
+ signedBy: string;
189
+ } | undefined;
190
+ } | undefined;
191
+ relatesTo?: string | undefined;
192
+ }, {
193
+ type: "TRUST_REQ" | "TRUST_RES" | "BTPS_DOC" | "BTPS_EVENT";
194
+ id: string;
195
+ issuedAt: string;
196
+ from: string;
197
+ encryption: {
198
+ type: "none" | "standardEncrypt" | "2faEncrypt";
199
+ algorithm: "aes-256-gcm";
200
+ encryptedKey: string;
201
+ iv: string;
202
+ authTag: string;
203
+ } | null;
204
+ version: string;
205
+ to: string;
206
+ signature: {
207
+ value: string;
208
+ algorithmHash: "sha256";
209
+ fingerprint: string;
210
+ };
211
+ selector: string;
212
+ document?: unknown;
213
+ delegation?: {
214
+ issuedAt: string;
215
+ agentId: string;
216
+ signature: {
217
+ value: string;
218
+ algorithmHash: "sha256";
219
+ fingerprint: string;
220
+ };
221
+ selector: string;
222
+ agentPubKey: string;
223
+ signedBy: string;
224
+ attestation?: {
225
+ issuedAt: string;
226
+ signature: {
227
+ value: string;
228
+ algorithmHash: "sha256";
229
+ fingerprint: string;
230
+ };
231
+ selector: string;
232
+ signedBy: string;
233
+ } | undefined;
234
+ } | undefined;
235
+ relatesTo?: string | undefined;
236
+ }>;
237
+ export declare const BtpTransporterArtifactSchema: z.ZodEffects<z.ZodObject<{
238
+ version: z.ZodString;
239
+ issuedAt: z.ZodString;
240
+ id: z.ZodString;
241
+ type: z.ZodEnum<["TRUST_REQ", "TRUST_RES", "BTPS_DOC", "BTPS_EVENT"]>;
242
+ from: z.ZodEffects<z.ZodString, string, string>;
243
+ to: z.ZodEffects<z.ZodString, string, string>;
244
+ signature: z.ZodObject<{
245
+ algorithmHash: z.ZodLiteral<"sha256">;
246
+ value: z.ZodString;
247
+ fingerprint: z.ZodString;
248
+ }, "strip", z.ZodTypeAny, {
249
+ value: string;
250
+ algorithmHash: "sha256";
251
+ fingerprint: string;
252
+ }, {
253
+ value: string;
254
+ algorithmHash: "sha256";
255
+ fingerprint: string;
256
+ }>;
257
+ encryption: z.ZodNullable<z.ZodObject<{
258
+ algorithm: z.ZodLiteral<"aes-256-gcm">;
259
+ encryptedKey: z.ZodString;
260
+ iv: z.ZodString;
261
+ type: z.ZodEnum<["none", "standardEncrypt", "2faEncrypt"]>;
262
+ authTag: z.ZodString;
263
+ }, "strip", z.ZodTypeAny, {
264
+ type: "none" | "standardEncrypt" | "2faEncrypt";
265
+ algorithm: "aes-256-gcm";
266
+ encryptedKey: string;
267
+ iv: string;
268
+ authTag: string;
269
+ }, {
270
+ type: "none" | "standardEncrypt" | "2faEncrypt";
271
+ algorithm: "aes-256-gcm";
272
+ encryptedKey: string;
273
+ iv: string;
274
+ authTag: string;
275
+ }>>;
276
+ document: z.ZodUnknown;
277
+ delegation: z.ZodOptional<z.ZodObject<{
278
+ agentId: z.ZodString;
279
+ agentPubKey: z.ZodString;
280
+ signedBy: z.ZodEffects<z.ZodString, string, string>;
281
+ signature: z.ZodObject<{
282
+ algorithmHash: z.ZodLiteral<"sha256">;
283
+ value: z.ZodString;
284
+ fingerprint: z.ZodString;
285
+ }, "strip", z.ZodTypeAny, {
286
+ value: string;
287
+ algorithmHash: "sha256";
288
+ fingerprint: string;
289
+ }, {
290
+ value: string;
291
+ algorithmHash: "sha256";
292
+ fingerprint: string;
293
+ }>;
294
+ issuedAt: z.ZodString;
295
+ attestation: z.ZodOptional<z.ZodObject<{
296
+ signedBy: z.ZodEffects<z.ZodString, string, string>;
297
+ issuedAt: z.ZodString;
298
+ signature: z.ZodObject<{
299
+ algorithmHash: z.ZodLiteral<"sha256">;
300
+ value: z.ZodString;
301
+ fingerprint: z.ZodString;
302
+ }, "strip", z.ZodTypeAny, {
303
+ value: string;
304
+ algorithmHash: "sha256";
305
+ fingerprint: string;
306
+ }, {
307
+ value: string;
308
+ algorithmHash: "sha256";
309
+ fingerprint: string;
310
+ }>;
311
+ selector: z.ZodString;
312
+ }, "strip", z.ZodTypeAny, {
313
+ issuedAt: string;
314
+ signature: {
315
+ value: string;
316
+ algorithmHash: "sha256";
317
+ fingerprint: string;
318
+ };
319
+ selector: string;
320
+ signedBy: string;
321
+ }, {
322
+ issuedAt: string;
323
+ signature: {
324
+ value: string;
325
+ algorithmHash: "sha256";
326
+ fingerprint: string;
327
+ };
328
+ selector: string;
329
+ signedBy: string;
330
+ }>>;
331
+ selector: z.ZodString;
332
+ }, "strip", z.ZodTypeAny, {
333
+ issuedAt: string;
334
+ agentId: string;
335
+ signature: {
336
+ value: string;
337
+ algorithmHash: "sha256";
338
+ fingerprint: string;
339
+ };
340
+ selector: string;
341
+ agentPubKey: string;
342
+ signedBy: string;
343
+ attestation?: {
344
+ issuedAt: string;
345
+ signature: {
346
+ value: string;
347
+ algorithmHash: "sha256";
348
+ fingerprint: string;
349
+ };
350
+ selector: string;
351
+ signedBy: string;
352
+ } | undefined;
353
+ }, {
354
+ issuedAt: string;
355
+ agentId: string;
356
+ signature: {
357
+ value: string;
358
+ algorithmHash: "sha256";
359
+ fingerprint: string;
360
+ };
361
+ selector: string;
362
+ agentPubKey: string;
363
+ signedBy: string;
364
+ attestation?: {
365
+ issuedAt: string;
366
+ signature: {
367
+ value: string;
368
+ algorithmHash: "sha256";
369
+ fingerprint: string;
370
+ };
371
+ selector: string;
372
+ signedBy: string;
373
+ } | undefined;
374
+ }>>;
375
+ selector: z.ZodString;
376
+ relatesTo: z.ZodOptional<z.ZodString>;
377
+ }, "strip", z.ZodTypeAny, {
378
+ type: "TRUST_REQ" | "TRUST_RES" | "BTPS_DOC" | "BTPS_EVENT";
379
+ id: string;
380
+ issuedAt: string;
381
+ from: string;
382
+ encryption: {
383
+ type: "none" | "standardEncrypt" | "2faEncrypt";
384
+ algorithm: "aes-256-gcm";
385
+ encryptedKey: string;
386
+ iv: string;
387
+ authTag: string;
388
+ } | null;
389
+ version: string;
390
+ to: string;
391
+ signature: {
392
+ value: string;
393
+ algorithmHash: "sha256";
394
+ fingerprint: string;
395
+ };
396
+ selector: string;
397
+ document?: unknown;
398
+ delegation?: {
399
+ issuedAt: string;
400
+ agentId: string;
401
+ signature: {
402
+ value: string;
403
+ algorithmHash: "sha256";
404
+ fingerprint: string;
405
+ };
406
+ selector: string;
407
+ agentPubKey: string;
408
+ signedBy: string;
409
+ attestation?: {
410
+ issuedAt: string;
411
+ signature: {
412
+ value: string;
413
+ algorithmHash: "sha256";
414
+ fingerprint: string;
415
+ };
416
+ selector: string;
417
+ signedBy: string;
418
+ } | undefined;
419
+ } | undefined;
420
+ relatesTo?: string | undefined;
421
+ }, {
422
+ type: "TRUST_REQ" | "TRUST_RES" | "BTPS_DOC" | "BTPS_EVENT";
423
+ id: string;
424
+ issuedAt: string;
425
+ from: string;
426
+ encryption: {
427
+ type: "none" | "standardEncrypt" | "2faEncrypt";
428
+ algorithm: "aes-256-gcm";
429
+ encryptedKey: string;
430
+ iv: string;
431
+ authTag: string;
432
+ } | null;
433
+ version: string;
434
+ to: string;
435
+ signature: {
436
+ value: string;
437
+ algorithmHash: "sha256";
438
+ fingerprint: string;
439
+ };
440
+ selector: string;
441
+ document?: unknown;
442
+ delegation?: {
443
+ issuedAt: string;
444
+ agentId: string;
445
+ signature: {
446
+ value: string;
447
+ algorithmHash: "sha256";
448
+ fingerprint: string;
449
+ };
450
+ selector: string;
451
+ agentPubKey: string;
452
+ signedBy: string;
453
+ attestation?: {
454
+ issuedAt: string;
455
+ signature: {
456
+ value: string;
457
+ algorithmHash: "sha256";
458
+ fingerprint: string;
459
+ };
460
+ selector: string;
461
+ signedBy: string;
462
+ } | undefined;
463
+ } | undefined;
464
+ relatesTo?: string | undefined;
465
+ }>, {
466
+ type: "TRUST_REQ" | "TRUST_RES" | "BTPS_DOC" | "BTPS_EVENT";
467
+ id: string;
468
+ issuedAt: string;
469
+ from: string;
470
+ encryption: {
471
+ type: "none" | "standardEncrypt" | "2faEncrypt";
472
+ algorithm: "aes-256-gcm";
473
+ encryptedKey: string;
474
+ iv: string;
475
+ authTag: string;
476
+ } | null;
477
+ version: string;
478
+ to: string;
479
+ signature: {
480
+ value: string;
481
+ algorithmHash: "sha256";
482
+ fingerprint: string;
483
+ };
484
+ selector: string;
485
+ document?: unknown;
486
+ delegation?: {
487
+ issuedAt: string;
488
+ agentId: string;
489
+ signature: {
490
+ value: string;
491
+ algorithmHash: "sha256";
492
+ fingerprint: string;
493
+ };
494
+ selector: string;
495
+ agentPubKey: string;
496
+ signedBy: string;
497
+ attestation?: {
498
+ issuedAt: string;
499
+ signature: {
500
+ value: string;
501
+ algorithmHash: "sha256";
502
+ fingerprint: string;
503
+ };
504
+ selector: string;
505
+ signedBy: string;
506
+ } | undefined;
507
+ } | undefined;
508
+ relatesTo?: string | undefined;
509
+ }, {
510
+ type: "TRUST_REQ" | "TRUST_RES" | "BTPS_DOC" | "BTPS_EVENT";
511
+ id: string;
512
+ issuedAt: string;
513
+ from: string;
514
+ encryption: {
515
+ type: "none" | "standardEncrypt" | "2faEncrypt";
516
+ algorithm: "aes-256-gcm";
517
+ encryptedKey: string;
518
+ iv: string;
519
+ authTag: string;
520
+ } | null;
521
+ version: string;
522
+ to: string;
523
+ signature: {
524
+ value: string;
525
+ algorithmHash: "sha256";
526
+ fingerprint: string;
527
+ };
528
+ selector: string;
529
+ document?: unknown;
530
+ delegation?: {
531
+ issuedAt: string;
532
+ agentId: string;
533
+ signature: {
534
+ value: string;
535
+ algorithmHash: "sha256";
536
+ fingerprint: string;
537
+ };
538
+ selector: string;
539
+ agentPubKey: string;
540
+ signedBy: string;
541
+ attestation?: {
542
+ issuedAt: string;
543
+ signature: {
544
+ value: string;
545
+ algorithmHash: "sha256";
546
+ fingerprint: string;
547
+ };
548
+ selector: string;
549
+ signedBy: string;
550
+ } | undefined;
551
+ } | undefined;
552
+ relatesTo?: string | undefined;
553
+ }>;