@fragno-dev/api-fragment 0.0.0-stage → 0.0.1

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 (79) hide show
  1. package/LICENSE.md +16 -0
  2. package/README.md +249 -2
  3. package/dist/browser/client/client-3ZV9sw3i.js +2580 -0
  4. package/dist/browser/client/client-3ZV9sw3i.js.map +1 -0
  5. package/dist/browser/client/client-DPjmoaJQ.d.ts +711 -0
  6. package/dist/browser/client/client-DPjmoaJQ.d.ts.map +1 -0
  7. package/dist/browser/client/client.d.ts +1645 -0
  8. package/dist/browser/client/client.d.ts.map +1 -0
  9. package/dist/browser/client/client.js +2 -0
  10. package/dist/browser/client/react.d.ts +1665 -0
  11. package/dist/browser/client/react.d.ts.map +1 -0
  12. package/dist/browser/client/react.js +194 -0
  13. package/dist/browser/client/react.js.map +1 -0
  14. package/dist/browser/client/solid.d.ts +1668 -0
  15. package/dist/browser/client/solid.d.ts.map +1 -0
  16. package/dist/browser/client/solid.js +129 -0
  17. package/dist/browser/client/solid.js.map +1 -0
  18. package/dist/browser/client/svelte.d.ts +1668 -0
  19. package/dist/browser/client/svelte.d.ts.map +1 -0
  20. package/dist/browser/client/svelte.js +131 -0
  21. package/dist/browser/client/svelte.js.map +1 -0
  22. package/dist/browser/client/vanilla.d.ts +1695 -0
  23. package/dist/browser/client/vanilla.d.ts.map +1 -0
  24. package/dist/browser/client/vanilla.js +159 -0
  25. package/dist/browser/client/vanilla.js.map +1 -0
  26. package/dist/browser/client/vue.d.ts +1668 -0
  27. package/dist/browser/client/vue.d.ts.map +1 -0
  28. package/dist/browser/client/vue.js +127 -0
  29. package/dist/browser/client/vue.js.map +1 -0
  30. package/dist/browser/client-D4NnY-zV.d.ts +713 -0
  31. package/dist/browser/client-D4NnY-zV.d.ts.map +1 -0
  32. package/dist/browser/client-DQE0c7GI.d.ts +711 -0
  33. package/dist/browser/client-DQE0c7GI.d.ts.map +1 -0
  34. package/dist/browser/index.d.ts +3130 -0
  35. package/dist/browser/index.d.ts.map +1 -0
  36. package/dist/browser/index.js +2 -0
  37. package/dist/browser/src-BrYPVbAN.js +2404 -0
  38. package/dist/browser/src-BrYPVbAN.js.map +1 -0
  39. package/dist/browser/src-t-4wp9-f.js +2400 -0
  40. package/dist/browser/src-t-4wp9-f.js.map +1 -0
  41. package/dist/node/api-types.d.ts +731 -0
  42. package/dist/node/api-types.d.ts.map +1 -0
  43. package/dist/node/api-types.js +281 -0
  44. package/dist/node/api-types.js.map +1 -0
  45. package/dist/node/crypto.d.ts +6 -0
  46. package/dist/node/crypto.d.ts.map +1 -0
  47. package/dist/node/crypto.js +103 -0
  48. package/dist/node/crypto.js.map +1 -0
  49. package/dist/node/definition.d.ts +638 -0
  50. package/dist/node/definition.d.ts.map +1 -0
  51. package/dist/node/definition.js +315 -0
  52. package/dist/node/definition.js.map +1 -0
  53. package/dist/node/oauth.js +124 -0
  54. package/dist/node/oauth.js.map +1 -0
  55. package/dist/node/routes.d.ts +1585 -0
  56. package/dist/node/routes.d.ts.map +1 -0
  57. package/dist/node/routes.js +1100 -0
  58. package/dist/node/routes.js.map +1 -0
  59. package/dist/node/schema.d.ts +99 -0
  60. package/dist/node/schema.d.ts.map +1 -0
  61. package/dist/node/schema.js +16 -0
  62. package/dist/node/schema.js.map +1 -0
  63. package/dist/node/server.d.ts +1585 -0
  64. package/dist/node/server.d.ts.map +1 -0
  65. package/dist/node/server.js +12 -0
  66. package/dist/node/server.js.map +1 -0
  67. package/dist/node/services.d.ts +10 -0
  68. package/dist/node/services.d.ts.map +1 -0
  69. package/dist/node/services.js +304 -0
  70. package/dist/node/services.js.map +1 -0
  71. package/dist/node/webhooks/auth.d.ts +133 -0
  72. package/dist/node/webhooks/auth.d.ts.map +1 -0
  73. package/dist/node/webhooks/auth.js +268 -0
  74. package/dist/node/webhooks/auth.js.map +1 -0
  75. package/dist/node/webhooks/verification.d.ts +102 -0
  76. package/dist/node/webhooks/verification.d.ts.map +1 -0
  77. package/dist/node/webhooks/verification.js +119 -0
  78. package/dist/node/webhooks/verification.js.map +1 -0
  79. package/package.json +136 -3
@@ -0,0 +1,1585 @@
1
+ import { ApiFragmentConfig, ApiRequestInput } from "./api-types.js";
2
+ import { AuthPersistenceChanges } from "./services.js";
3
+ import { ApiFragmentHooksConfig, ApiHooksMap } from "./definition.js";
4
+ import { z } from "zod";
5
+ //#region src/routes.d.ts
6
+ declare const apiRoutesFactory: import("@fragno-dev/core").RouteFactory<ApiFragmentConfig & ApiFragmentHooksConfig, import("@fragno-dev/db").ImplicitDatabaseDependencies<import("@fragno-dev/db/schema").Schema<{
7
+ api_connection: import("@fragno-dev/db/schema").Table<Record<"id", import("@fragno-dev/db/schema").IdColumn<"varchar(128)", string | import("@fragno-dev/db/schema").FragnoId | null, import("@fragno-dev/db/schema").FragnoId>> & Record<"name", import("@fragno-dev/db/schema").Column<"string", string | null, string | null>> & Record<"baseUrl", import("@fragno-dev/db/schema").Column<"string", string, string>> & Record<"authMode", import("@fragno-dev/db/schema").Column<"string", string, string>> & Record<"status", import("@fragno-dev/db/schema").Column<"string", string, string>> & Record<"createdAt", import("@fragno-dev/db/schema").Column<"timestamp", (Date | import("@fragno-dev/db").DbNow) | null, Date>> & Record<"updatedAt", import("@fragno-dev/db/schema").Column<"timestamp", (Date | import("@fragno-dev/db").DbNow) | null, Date>>, {}>;
8
+ secret: import("@fragno-dev/db/schema").Table<Record<"id", import("@fragno-dev/db/schema").IdColumn<"varchar(128)", string | import("@fragno-dev/db/schema").FragnoId | null, import("@fragno-dev/db/schema").FragnoId>> & Record<"connectionId", import("@fragno-dev/db/schema").Column<"bigint", string | bigint | import("@fragno-dev/db/schema").FragnoId | import("@fragno-dev/db/schema").FragnoReference, import("@fragno-dev/db/schema").FragnoReference>> & Record<"kind", import("@fragno-dev/db/schema").Column<"string", string, string>> & Record<"payload", import("@fragno-dev/db/schema").Column<"text", string, string>> & Record<"expiresAt", import("@fragno-dev/db/schema").Column<"timestamp", (Date | import("@fragno-dev/db").DbNow) | null, Date | null>> & Record<"updatedAt", import("@fragno-dev/db/schema").Column<"timestamp", (Date | import("@fragno-dev/db").DbNow) | null, Date>>, Record<"idx_secret_connection_kind", import("@fragno-dev/db/schema").Index<readonly [import("@fragno-dev/db/schema").Column<"bigint", string | bigint | import("@fragno-dev/db/schema").FragnoId | import("@fragno-dev/db/schema").FragnoReference, import("@fragno-dev/db/schema").FragnoReference>, import("@fragno-dev/db/schema").Column<"string", string, string>] & import("@fragno-dev/db/schema").AnyColumn[], readonly ["connectionId", "kind"]>>>;
9
+ oauthState: import("@fragno-dev/db/schema").Table<Record<"id", import("@fragno-dev/db/schema").IdColumn<"varchar(128)", string | import("@fragno-dev/db/schema").FragnoId | null, import("@fragno-dev/db/schema").FragnoId>> & Record<"connectionId", import("@fragno-dev/db/schema").Column<"bigint", string | bigint | import("@fragno-dev/db/schema").FragnoId | import("@fragno-dev/db/schema").FragnoReference, import("@fragno-dev/db/schema").FragnoReference>> & Record<"codeVerifier", import("@fragno-dev/db/schema").Column<"text", string, string>> & Record<"redirectUri", import("@fragno-dev/db/schema").Column<"string", string, string>> & Record<"scope", import("@fragno-dev/db/schema").Column<"string", string | null, string | null>> & Record<"expiresAt", import("@fragno-dev/db/schema").Column<"timestamp", Date | import("@fragno-dev/db").DbNow, Date>> & Record<"consumedAt", import("@fragno-dev/db/schema").Column<"timestamp", (Date | import("@fragno-dev/db").DbNow) | null, Date | null>> & Record<"authorizationUrl", import("@fragno-dev/db/schema").Column<"text", string | null, string | null>>, Record<"idx_oauth_state_connection", import("@fragno-dev/db/schema").Index<readonly [import("@fragno-dev/db/schema").Column<"bigint", string | bigint | import("@fragno-dev/db/schema").FragnoId | import("@fragno-dev/db/schema").FragnoReference, import("@fragno-dev/db/schema").FragnoReference>] & import("@fragno-dev/db/schema").AnyColumn[], readonly ["connectionId"]>> & Record<"idx_oauth_state_pending", import("@fragno-dev/db/schema").Index<readonly [import("@fragno-dev/db/schema").Column<"bigint", string | bigint | import("@fragno-dev/db/schema").FragnoId | import("@fragno-dev/db/schema").FragnoReference, import("@fragno-dev/db/schema").FragnoReference>, import("@fragno-dev/db/schema").Column<"timestamp", (Date | import("@fragno-dev/db").DbNow) | null, Date | null>, import("@fragno-dev/db/schema").Column<"timestamp", Date | import("@fragno-dev/db").DbNow, Date>] & import("@fragno-dev/db/schema").AnyColumn[], readonly ["connectionId", "consumedAt", "expiresAt"]>>>;
10
+ webhookEndpoint: import("@fragno-dev/db/schema").Table<Record<"id", import("@fragno-dev/db/schema").IdColumn<"varchar(128)", string | import("@fragno-dev/db/schema").FragnoId | null, import("@fragno-dev/db/schema").FragnoId>> & Record<"name", import("@fragno-dev/db/schema").Column<"string", string, string>> & Record<"status", import("@fragno-dev/db/schema").Column<"string", string, string>> & Record<"authConfig", import("@fragno-dev/db/schema").Column<"json", {
11
+ type: "none";
12
+ } | {
13
+ type: "bearer";
14
+ tokenRef: string;
15
+ } | {
16
+ type: "apiKey";
17
+ location: "header" | "query";
18
+ name: string;
19
+ secretRef: string;
20
+ } | {
21
+ type: "basic";
22
+ usernameRef: string;
23
+ passwordRef: string;
24
+ } | {
25
+ type: "hmac";
26
+ secretRef: string;
27
+ algorithm: "sha1" | "sha256" | "sha512";
28
+ signature: {
29
+ location: "header" | "query";
30
+ name: string;
31
+ encoding: "hex" | "base64" | "base64url";
32
+ prefix?: string | undefined;
33
+ };
34
+ signedPayload: {
35
+ type: "rawBody";
36
+ } | {
37
+ type: "timestampedBody";
38
+ prefix: string;
39
+ timestampHeader: string;
40
+ delimiter: string;
41
+ toleranceSeconds: number;
42
+ };
43
+ }, {
44
+ type: "none";
45
+ } | {
46
+ type: "bearer";
47
+ tokenRef: string;
48
+ } | {
49
+ type: "apiKey";
50
+ location: "header" | "query";
51
+ name: string;
52
+ secretRef: string;
53
+ } | {
54
+ type: "basic";
55
+ usernameRef: string;
56
+ passwordRef: string;
57
+ } | {
58
+ type: "hmac";
59
+ secretRef: string;
60
+ algorithm: "sha1" | "sha256" | "sha512";
61
+ signature: {
62
+ location: "header" | "query";
63
+ name: string;
64
+ encoding: "hex" | "base64" | "base64url";
65
+ prefix?: string | undefined;
66
+ };
67
+ signedPayload: {
68
+ type: "rawBody";
69
+ } | {
70
+ type: "timestampedBody";
71
+ prefix: string;
72
+ timestampHeader: string;
73
+ delimiter: string;
74
+ toleranceSeconds: number;
75
+ };
76
+ }>> & Record<"verification", import("@fragno-dev/db/schema").Column<"json", {
77
+ type: "none";
78
+ } | {
79
+ type: "challenge";
80
+ method: "GET" | "POST";
81
+ when: {
82
+ type: "present";
83
+ source: {
84
+ type: "header";
85
+ name: string;
86
+ } | {
87
+ type: "query";
88
+ name: string;
89
+ } | {
90
+ type: "jsonBodyPath";
91
+ path: string[];
92
+ };
93
+ } | {
94
+ type: "equals";
95
+ source: {
96
+ type: "header";
97
+ name: string;
98
+ } | {
99
+ type: "query";
100
+ name: string;
101
+ } | {
102
+ type: "jsonBodyPath";
103
+ path: string[];
104
+ };
105
+ value: string;
106
+ };
107
+ response: {
108
+ type: "echoText";
109
+ source: {
110
+ type: "header";
111
+ name: string;
112
+ } | {
113
+ type: "query";
114
+ name: string;
115
+ } | {
116
+ type: "jsonBodyPath";
117
+ path: string[];
118
+ };
119
+ };
120
+ }, {
121
+ type: "none";
122
+ } | {
123
+ type: "challenge";
124
+ method: "GET" | "POST";
125
+ when: {
126
+ type: "present";
127
+ source: {
128
+ type: "header";
129
+ name: string;
130
+ } | {
131
+ type: "query";
132
+ name: string;
133
+ } | {
134
+ type: "jsonBodyPath";
135
+ path: string[];
136
+ };
137
+ } | {
138
+ type: "equals";
139
+ source: {
140
+ type: "header";
141
+ name: string;
142
+ } | {
143
+ type: "query";
144
+ name: string;
145
+ } | {
146
+ type: "jsonBodyPath";
147
+ path: string[];
148
+ };
149
+ value: string;
150
+ };
151
+ response: {
152
+ type: "echoText";
153
+ source: {
154
+ type: "header";
155
+ name: string;
156
+ } | {
157
+ type: "query";
158
+ name: string;
159
+ } | {
160
+ type: "jsonBodyPath";
161
+ path: string[];
162
+ };
163
+ };
164
+ }>> & Record<"deliveryIdentity", import("@fragno-dev/db/schema").Column<"json", {
165
+ type: "header";
166
+ name: string;
167
+ } | {
168
+ type: "query";
169
+ name: string;
170
+ } | {
171
+ type: "jsonBodyPath";
172
+ path: string[];
173
+ }, {
174
+ type: "header";
175
+ name: string;
176
+ } | {
177
+ type: "query";
178
+ name: string;
179
+ } | {
180
+ type: "jsonBodyPath";
181
+ path: string[];
182
+ }>> & Record<"createdAt", import("@fragno-dev/db/schema").Column<"timestamp", (Date | import("@fragno-dev/db").DbNow) | null, Date>> & Record<"updatedAt", import("@fragno-dev/db/schema").Column<"timestamp", (Date | import("@fragno-dev/db").DbNow) | null, Date>> & Record<"lastAcceptedAt", import("@fragno-dev/db/schema").Column<"timestamp", (Date | import("@fragno-dev/db").DbNow) | null, Date | null>> & Record<"lastRejectedAt", import("@fragno-dev/db/schema").Column<"timestamp", (Date | import("@fragno-dev/db").DbNow) | null, Date | null>> & Record<"lastRejectionCode", import("@fragno-dev/db/schema").Column<"string", string | null, string | null>>, {}>;
183
+ webhookSecret: import("@fragno-dev/db/schema").Table<Record<"id", import("@fragno-dev/db/schema").IdColumn<"varchar(128)", string | import("@fragno-dev/db/schema").FragnoId | null, import("@fragno-dev/db/schema").FragnoId>> & Record<"endpointId", import("@fragno-dev/db/schema").Column<"bigint", string | bigint | import("@fragno-dev/db/schema").FragnoId | import("@fragno-dev/db/schema").FragnoReference, import("@fragno-dev/db/schema").FragnoReference>> & Record<"ref", import("@fragno-dev/db/schema").Column<"string", string, string>> & Record<"payload", import("@fragno-dev/db/schema").Column<"text", string, string>> & Record<"updatedAt", import("@fragno-dev/db/schema").Column<"timestamp", (Date | import("@fragno-dev/db").DbNow) | null, Date>>, Record<"idx_webhook_secret_endpoint_ref", import("@fragno-dev/db/schema").Index<readonly [import("@fragno-dev/db/schema").Column<"bigint", string | bigint | import("@fragno-dev/db/schema").FragnoId | import("@fragno-dev/db/schema").FragnoReference, import("@fragno-dev/db/schema").FragnoReference>, import("@fragno-dev/db/schema").Column<"string", string, string>] & import("@fragno-dev/db/schema").AnyColumn[], readonly ["endpointId", "ref"]>>>;
184
+ }>>, import("@fragno-dev/core").BoundServices<{
185
+ startOAuth: (input: {
186
+ connectionId: string;
187
+ stateId: string;
188
+ redirectUri: string;
189
+ scopes?: string[];
190
+ extraAuthorizationParams?: Record<string, string>;
191
+ discardTokens: boolean;
192
+ }) => import("@fragno-dev/db").TxResult<{
193
+ found: false;
194
+ reason: "connection_not_found";
195
+ authorizationUrl?: undefined;
196
+ oauthState?: undefined;
197
+ connectionId?: undefined;
198
+ secretId?: undefined;
199
+ clientPayload?: undefined;
200
+ discardChangesReadiness?: undefined;
201
+ } | {
202
+ found: false;
203
+ reason: "auth_not_configured";
204
+ authorizationUrl?: undefined;
205
+ oauthState?: undefined;
206
+ connectionId?: undefined;
207
+ secretId?: undefined;
208
+ clientPayload?: undefined;
209
+ discardChangesReadiness?: undefined;
210
+ } | {
211
+ found: false;
212
+ reason: "auth_not_oauth";
213
+ authorizationUrl?: undefined;
214
+ oauthState?: undefined;
215
+ connectionId?: undefined;
216
+ secretId?: undefined;
217
+ clientPayload?: undefined;
218
+ discardChangesReadiness?: undefined;
219
+ } | {
220
+ found: true;
221
+ authorizationUrl: string;
222
+ oauthState: {
223
+ id: string;
224
+ connectionId: string;
225
+ authorizationUrl: string;
226
+ codeVerifier: string;
227
+ redirectUri: string;
228
+ scope: string | null;
229
+ expiresAt: Date;
230
+ };
231
+ connectionId: string;
232
+ secretId: import("@fragno-dev/db/schema").FragnoId;
233
+ clientPayload: string;
234
+ discardChangesReadiness: boolean;
235
+ reason?: undefined;
236
+ }, {
237
+ found: false;
238
+ reason: "connection_not_found";
239
+ authorizationUrl?: undefined;
240
+ oauthState?: undefined;
241
+ connectionId?: undefined;
242
+ secretId?: undefined;
243
+ clientPayload?: undefined;
244
+ discardChangesReadiness?: undefined;
245
+ } | {
246
+ found: false;
247
+ reason: "auth_not_configured";
248
+ authorizationUrl?: undefined;
249
+ oauthState?: undefined;
250
+ connectionId?: undefined;
251
+ secretId?: undefined;
252
+ clientPayload?: undefined;
253
+ discardChangesReadiness?: undefined;
254
+ } | {
255
+ found: false;
256
+ reason: "auth_not_oauth";
257
+ authorizationUrl?: undefined;
258
+ oauthState?: undefined;
259
+ connectionId?: undefined;
260
+ secretId?: undefined;
261
+ clientPayload?: undefined;
262
+ discardChangesReadiness?: undefined;
263
+ } | {
264
+ found: true;
265
+ authorizationUrl: string;
266
+ oauthState: {
267
+ id: string;
268
+ connectionId: string;
269
+ authorizationUrl: string;
270
+ codeVerifier: string;
271
+ redirectUri: string;
272
+ scope: string | null;
273
+ expiresAt: Date;
274
+ };
275
+ connectionId: string;
276
+ secretId: import("@fragno-dev/db/schema").FragnoId;
277
+ clientPayload: string;
278
+ discardChangesReadiness: boolean;
279
+ reason?: undefined;
280
+ }>;
281
+ completeOAuthCallback: (input: {
282
+ stateId: string;
283
+ code: string;
284
+ }) => import("@fragno-dev/db").TxResult<{
285
+ found: false;
286
+ reason: "invalid_state";
287
+ connection?: undefined;
288
+ changes?: undefined;
289
+ wasReady?: undefined;
290
+ } | {
291
+ found: false;
292
+ reason: "connection_not_found";
293
+ connection?: undefined;
294
+ changes?: undefined;
295
+ wasReady?: undefined;
296
+ } | {
297
+ found: false;
298
+ reason: "auth_not_configured";
299
+ connection?: undefined;
300
+ changes?: undefined;
301
+ wasReady?: undefined;
302
+ } | {
303
+ found: false;
304
+ reason: "auth_not_oauth";
305
+ connection?: undefined;
306
+ changes?: undefined;
307
+ wasReady?: undefined;
308
+ } | {
309
+ found: true;
310
+ connection: {
311
+ id: import("@fragno-dev/db/schema").FragnoId;
312
+ name: string | null;
313
+ baseUrl: string;
314
+ authMode: string;
315
+ status: string;
316
+ createdAt: Date;
317
+ updatedAt: Date;
318
+ };
319
+ changes: {
320
+ authPayload: string;
321
+ authExpiresAt: Date | null;
322
+ };
323
+ wasReady: boolean;
324
+ reason?: undefined;
325
+ }, {
326
+ found: false;
327
+ reason: "invalid_state";
328
+ connection?: undefined;
329
+ changes?: undefined;
330
+ wasReady?: undefined;
331
+ } | {
332
+ found: false;
333
+ reason: "connection_not_found";
334
+ connection?: undefined;
335
+ changes?: undefined;
336
+ wasReady?: undefined;
337
+ } | {
338
+ found: false;
339
+ reason: "auth_not_configured";
340
+ connection?: undefined;
341
+ changes?: undefined;
342
+ wasReady?: undefined;
343
+ } | {
344
+ found: false;
345
+ reason: "auth_not_oauth";
346
+ connection?: undefined;
347
+ changes?: undefined;
348
+ wasReady?: undefined;
349
+ } | {
350
+ found: true;
351
+ connection: {
352
+ id: import("@fragno-dev/db/schema").FragnoId;
353
+ name: string | null;
354
+ baseUrl: string;
355
+ authMode: string;
356
+ status: string;
357
+ createdAt: Date;
358
+ updatedAt: Date;
359
+ };
360
+ changes: {
361
+ authPayload: string;
362
+ authExpiresAt: Date | null;
363
+ };
364
+ wasReady: boolean;
365
+ reason?: undefined;
366
+ }>;
367
+ executeApiRequest: (input: {
368
+ connectionId: string;
369
+ request: ApiRequestInput;
370
+ }) => import("@fragno-dev/db").TxResult<{
371
+ found: false;
372
+ reason?: undefined;
373
+ connection?: undefined;
374
+ secrets?: undefined;
375
+ authChanges?: undefined;
376
+ response?: undefined;
377
+ } | {
378
+ found: false;
379
+ reason: "connection_disabled";
380
+ connection?: undefined;
381
+ secrets?: undefined;
382
+ authChanges?: undefined;
383
+ response?: undefined;
384
+ } | {
385
+ found: true;
386
+ response: {
387
+ ok: true;
388
+ response: {
389
+ status: number;
390
+ statusText: string;
391
+ headers: Record<string, string>;
392
+ body: {
393
+ type: "json";
394
+ value: unknown;
395
+ } | {
396
+ type: "text";
397
+ value: string;
398
+ } | {
399
+ type: "empty";
400
+ value: null;
401
+ };
402
+ };
403
+ error: null;
404
+ } | {
405
+ ok: false;
406
+ response: {
407
+ status: number;
408
+ statusText: string;
409
+ headers: Record<string, string>;
410
+ body: {
411
+ type: "json";
412
+ value: unknown;
413
+ } | {
414
+ type: "text";
415
+ value: string;
416
+ } | {
417
+ type: "empty";
418
+ value: null;
419
+ };
420
+ } | null;
421
+ error: {
422
+ code: "CONNECTION_NOT_FOUND" | "HTTP_ERROR" | "REQUEST_ERROR" | "RESPONSE_DECODING_ERROR" | "CONNECTION_DISABLED";
423
+ message: string;
424
+ };
425
+ };
426
+ }, {
427
+ found: false;
428
+ reason?: undefined;
429
+ connection?: undefined;
430
+ secrets?: undefined;
431
+ authChanges?: undefined;
432
+ response?: undefined;
433
+ } | {
434
+ found: false;
435
+ reason: "connection_disabled";
436
+ connection?: undefined;
437
+ secrets?: undefined;
438
+ authChanges?: undefined;
439
+ response?: undefined;
440
+ } | {
441
+ found: true;
442
+ connection: {
443
+ id: import("@fragno-dev/db/schema").FragnoId;
444
+ name: string | null;
445
+ baseUrl: string;
446
+ authMode: string;
447
+ status: string;
448
+ createdAt: Date;
449
+ updatedAt: Date;
450
+ };
451
+ secrets: {
452
+ id: import("@fragno-dev/db/schema").FragnoId;
453
+ connectionId: import("@fragno-dev/db/schema").FragnoReference;
454
+ kind: string;
455
+ payload: string;
456
+ expiresAt: Date | null;
457
+ updatedAt: Date;
458
+ }[];
459
+ authChanges: AuthPersistenceChanges | undefined;
460
+ response: {
461
+ ok: true;
462
+ response: {
463
+ status: number;
464
+ statusText: string;
465
+ headers: Record<string, string>;
466
+ body: {
467
+ type: "json";
468
+ value: unknown;
469
+ } | {
470
+ type: "text";
471
+ value: string;
472
+ } | {
473
+ type: "empty";
474
+ value: null;
475
+ };
476
+ };
477
+ error: null;
478
+ } | {
479
+ ok: false;
480
+ response: {
481
+ status: number;
482
+ statusText: string;
483
+ headers: Record<string, string>;
484
+ body: {
485
+ type: "json";
486
+ value: unknown;
487
+ } | {
488
+ type: "text";
489
+ value: string;
490
+ } | {
491
+ type: "empty";
492
+ value: null;
493
+ };
494
+ } | null;
495
+ error: {
496
+ code: "CONNECTION_NOT_FOUND" | "HTTP_ERROR" | "REQUEST_ERROR" | "RESPONSE_DECODING_ERROR" | "CONNECTION_DISABLED";
497
+ message: string;
498
+ };
499
+ };
500
+ reason?: undefined;
501
+ }>;
502
+ refreshClientCredentialsToken: (input: {
503
+ connectionId: string;
504
+ }) => import("@fragno-dev/db").TxResult<{
505
+ found: false;
506
+ connection?: undefined;
507
+ secrets?: undefined;
508
+ authChanges?: undefined;
509
+ tokenPresent?: undefined;
510
+ } | {
511
+ found: true;
512
+ tokenPresent: boolean;
513
+ }, {
514
+ found: false;
515
+ connection?: undefined;
516
+ secrets?: undefined;
517
+ authChanges?: undefined;
518
+ tokenPresent?: undefined;
519
+ } | {
520
+ found: true;
521
+ connection: {
522
+ id: import("@fragno-dev/db/schema").FragnoId;
523
+ name: string | null;
524
+ baseUrl: string;
525
+ authMode: string;
526
+ status: string;
527
+ createdAt: Date;
528
+ updatedAt: Date;
529
+ };
530
+ secrets: {
531
+ id: import("@fragno-dev/db/schema").FragnoId;
532
+ connectionId: import("@fragno-dev/db/schema").FragnoReference;
533
+ kind: string;
534
+ payload: string;
535
+ expiresAt: Date | null;
536
+ updatedAt: Date;
537
+ }[];
538
+ authChanges: AuthPersistenceChanges | undefined;
539
+ tokenPresent: boolean;
540
+ }>;
541
+ }>, {}, readonly [import("@fragno-dev/core").FragnoRouteConfig<"PUT", "/webhooks/endpoints/:endpointId", z.ZodObject<{
542
+ name: z.ZodString;
543
+ status: z.ZodDefault<z.ZodEnum<{
544
+ draft: "draft";
545
+ active: "active";
546
+ disabled: "disabled";
547
+ }>>;
548
+ verification: z.ZodDiscriminatedUnion<[z.ZodObject<{
549
+ type: z.ZodLiteral<"none">;
550
+ }, z.core.$strip>, z.ZodObject<{
551
+ type: z.ZodLiteral<"challenge">;
552
+ method: z.ZodEnum<{
553
+ GET: "GET";
554
+ POST: "POST";
555
+ }>;
556
+ when: z.ZodDiscriminatedUnion<[z.ZodObject<{
557
+ type: z.ZodLiteral<"present">;
558
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
559
+ type: z.ZodLiteral<"header">;
560
+ name: z.ZodString;
561
+ }, z.core.$strip>, z.ZodObject<{
562
+ type: z.ZodLiteral<"query">;
563
+ name: z.ZodString;
564
+ }, z.core.$strip>, z.ZodObject<{
565
+ type: z.ZodLiteral<"jsonBodyPath">;
566
+ path: z.ZodArray<z.ZodString>;
567
+ }, z.core.$strip>], "type">;
568
+ }, z.core.$strip>, z.ZodObject<{
569
+ type: z.ZodLiteral<"equals">;
570
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
571
+ type: z.ZodLiteral<"header">;
572
+ name: z.ZodString;
573
+ }, z.core.$strip>, z.ZodObject<{
574
+ type: z.ZodLiteral<"query">;
575
+ name: z.ZodString;
576
+ }, z.core.$strip>, z.ZodObject<{
577
+ type: z.ZodLiteral<"jsonBodyPath">;
578
+ path: z.ZodArray<z.ZodString>;
579
+ }, z.core.$strip>], "type">;
580
+ value: z.ZodString;
581
+ }, z.core.$strip>], "type">;
582
+ response: z.ZodObject<{
583
+ type: z.ZodLiteral<"echoText">;
584
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
585
+ type: z.ZodLiteral<"header">;
586
+ name: z.ZodString;
587
+ }, z.core.$strip>, z.ZodObject<{
588
+ type: z.ZodLiteral<"query">;
589
+ name: z.ZodString;
590
+ }, z.core.$strip>, z.ZodObject<{
591
+ type: z.ZodLiteral<"jsonBodyPath">;
592
+ path: z.ZodArray<z.ZodString>;
593
+ }, z.core.$strip>], "type">;
594
+ }, z.core.$strip>;
595
+ }, z.core.$strip>], "type">;
596
+ deliveryIdentity: z.ZodDiscriminatedUnion<[z.ZodObject<{
597
+ type: z.ZodLiteral<"header">;
598
+ name: z.ZodString;
599
+ }, z.core.$strip>, z.ZodObject<{
600
+ type: z.ZodLiteral<"query">;
601
+ name: z.ZodString;
602
+ }, z.core.$strip>, z.ZodObject<{
603
+ type: z.ZodLiteral<"jsonBodyPath">;
604
+ path: z.ZodArray<z.ZodString>;
605
+ }, z.core.$strip>], "type">;
606
+ auth: z.ZodDiscriminatedUnion<[z.ZodObject<{
607
+ type: z.ZodLiteral<"none">;
608
+ }, z.core.$strip>, z.ZodObject<{
609
+ type: z.ZodLiteral<"bearer">;
610
+ token: z.ZodString;
611
+ }, z.core.$strip>, z.ZodObject<{
612
+ type: z.ZodLiteral<"apiKey">;
613
+ location: z.ZodEnum<{
614
+ header: "header";
615
+ query: "query";
616
+ }>;
617
+ name: z.ZodString;
618
+ secret: z.ZodString;
619
+ }, z.core.$strip>, z.ZodObject<{
620
+ type: z.ZodLiteral<"basic">;
621
+ username: z.ZodString;
622
+ password: z.ZodString;
623
+ }, z.core.$strip>, z.ZodObject<{
624
+ type: z.ZodLiteral<"hmac">;
625
+ secret: z.ZodString;
626
+ algorithm: z.ZodEnum<{
627
+ sha1: "sha1";
628
+ sha256: "sha256";
629
+ sha512: "sha512";
630
+ }>;
631
+ signature: z.ZodObject<{
632
+ location: z.ZodEnum<{
633
+ header: "header";
634
+ query: "query";
635
+ }>;
636
+ name: z.ZodString;
637
+ encoding: z.ZodEnum<{
638
+ hex: "hex";
639
+ base64: "base64";
640
+ base64url: "base64url";
641
+ }>;
642
+ prefix: z.ZodOptional<z.ZodString>;
643
+ }, z.core.$strip>;
644
+ signedPayload: z.ZodDiscriminatedUnion<[z.ZodObject<{
645
+ type: z.ZodLiteral<"rawBody">;
646
+ }, z.core.$strip>, z.ZodObject<{
647
+ type: z.ZodLiteral<"timestampedBody">;
648
+ prefix: z.ZodString;
649
+ timestampHeader: z.ZodString;
650
+ delimiter: z.ZodString;
651
+ toleranceSeconds: z.ZodNumber;
652
+ }, z.core.$strip>], "type">;
653
+ }, z.core.$strip>], "type">;
654
+ }, z.core.$strip>, z.ZodObject<{
655
+ id: z.ZodString;
656
+ name: z.ZodString;
657
+ status: z.ZodEnum<{
658
+ draft: "draft";
659
+ active: "active";
660
+ disabled: "disabled";
661
+ }>;
662
+ authConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
663
+ type: z.ZodLiteral<"none">;
664
+ }, z.core.$strip>, z.ZodObject<{
665
+ type: z.ZodLiteral<"bearer">;
666
+ tokenRef: z.ZodString;
667
+ }, z.core.$strip>, z.ZodObject<{
668
+ type: z.ZodLiteral<"apiKey">;
669
+ location: z.ZodEnum<{
670
+ header: "header";
671
+ query: "query";
672
+ }>;
673
+ name: z.ZodString;
674
+ secretRef: z.ZodString;
675
+ }, z.core.$strip>, z.ZodObject<{
676
+ type: z.ZodLiteral<"basic">;
677
+ usernameRef: z.ZodString;
678
+ passwordRef: z.ZodString;
679
+ }, z.core.$strip>, z.ZodObject<{
680
+ type: z.ZodLiteral<"hmac">;
681
+ secretRef: z.ZodString;
682
+ algorithm: z.ZodEnum<{
683
+ sha1: "sha1";
684
+ sha256: "sha256";
685
+ sha512: "sha512";
686
+ }>;
687
+ signature: z.ZodObject<{
688
+ location: z.ZodEnum<{
689
+ header: "header";
690
+ query: "query";
691
+ }>;
692
+ name: z.ZodString;
693
+ encoding: z.ZodEnum<{
694
+ hex: "hex";
695
+ base64: "base64";
696
+ base64url: "base64url";
697
+ }>;
698
+ prefix: z.ZodOptional<z.ZodString>;
699
+ }, z.core.$strip>;
700
+ signedPayload: z.ZodDiscriminatedUnion<[z.ZodObject<{
701
+ type: z.ZodLiteral<"rawBody">;
702
+ }, z.core.$strip>, z.ZodObject<{
703
+ type: z.ZodLiteral<"timestampedBody">;
704
+ prefix: z.ZodString;
705
+ timestampHeader: z.ZodString;
706
+ delimiter: z.ZodString;
707
+ toleranceSeconds: z.ZodNumber;
708
+ }, z.core.$strip>], "type">;
709
+ }, z.core.$strip>], "type">;
710
+ verification: z.ZodDiscriminatedUnion<[z.ZodObject<{
711
+ type: z.ZodLiteral<"none">;
712
+ }, z.core.$strip>, z.ZodObject<{
713
+ type: z.ZodLiteral<"challenge">;
714
+ method: z.ZodEnum<{
715
+ GET: "GET";
716
+ POST: "POST";
717
+ }>;
718
+ when: z.ZodDiscriminatedUnion<[z.ZodObject<{
719
+ type: z.ZodLiteral<"present">;
720
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
721
+ type: z.ZodLiteral<"header">;
722
+ name: z.ZodString;
723
+ }, z.core.$strip>, z.ZodObject<{
724
+ type: z.ZodLiteral<"query">;
725
+ name: z.ZodString;
726
+ }, z.core.$strip>, z.ZodObject<{
727
+ type: z.ZodLiteral<"jsonBodyPath">;
728
+ path: z.ZodArray<z.ZodString>;
729
+ }, z.core.$strip>], "type">;
730
+ }, z.core.$strip>, z.ZodObject<{
731
+ type: z.ZodLiteral<"equals">;
732
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
733
+ type: z.ZodLiteral<"header">;
734
+ name: z.ZodString;
735
+ }, z.core.$strip>, z.ZodObject<{
736
+ type: z.ZodLiteral<"query">;
737
+ name: z.ZodString;
738
+ }, z.core.$strip>, z.ZodObject<{
739
+ type: z.ZodLiteral<"jsonBodyPath">;
740
+ path: z.ZodArray<z.ZodString>;
741
+ }, z.core.$strip>], "type">;
742
+ value: z.ZodString;
743
+ }, z.core.$strip>], "type">;
744
+ response: z.ZodObject<{
745
+ type: z.ZodLiteral<"echoText">;
746
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
747
+ type: z.ZodLiteral<"header">;
748
+ name: z.ZodString;
749
+ }, z.core.$strip>, z.ZodObject<{
750
+ type: z.ZodLiteral<"query">;
751
+ name: z.ZodString;
752
+ }, z.core.$strip>, z.ZodObject<{
753
+ type: z.ZodLiteral<"jsonBodyPath">;
754
+ path: z.ZodArray<z.ZodString>;
755
+ }, z.core.$strip>], "type">;
756
+ }, z.core.$strip>;
757
+ }, z.core.$strip>], "type">;
758
+ deliveryIdentity: z.ZodDiscriminatedUnion<[z.ZodObject<{
759
+ type: z.ZodLiteral<"header">;
760
+ name: z.ZodString;
761
+ }, z.core.$strip>, z.ZodObject<{
762
+ type: z.ZodLiteral<"query">;
763
+ name: z.ZodString;
764
+ }, z.core.$strip>, z.ZodObject<{
765
+ type: z.ZodLiteral<"jsonBodyPath">;
766
+ path: z.ZodArray<z.ZodString>;
767
+ }, z.core.$strip>], "type">;
768
+ secretRefs: z.ZodArray<z.ZodString>;
769
+ deliveries: z.ZodObject<{
770
+ lastAcceptedAt: z.ZodNullable<z.ZodString>;
771
+ lastRejection: z.ZodNullable<z.ZodObject<{
772
+ receivedAt: z.ZodString;
773
+ code: z.ZodEnum<{
774
+ WEBHOOK_ENDPOINT_DISABLED: "WEBHOOK_ENDPOINT_DISABLED";
775
+ WEBHOOK_ENDPOINT_DRAFT: "WEBHOOK_ENDPOINT_DRAFT";
776
+ WEBHOOK_AUTH_FAILED: "WEBHOOK_AUTH_FAILED";
777
+ WEBHOOK_VERIFICATION_NOT_MATCHED: "WEBHOOK_VERIFICATION_NOT_MATCHED";
778
+ WEBHOOK_VERIFICATION_RESPONSE_INVALID: "WEBHOOK_VERIFICATION_RESPONSE_INVALID";
779
+ WEBHOOK_BODY_INVALID: "WEBHOOK_BODY_INVALID";
780
+ WEBHOOK_DELIVERY_ID_MISSING: "WEBHOOK_DELIVERY_ID_MISSING";
781
+ WEBHOOK_DELIVERY_ID_INVALID: "WEBHOOK_DELIVERY_ID_INVALID";
782
+ }>;
783
+ }, z.core.$strip>>;
784
+ }, z.core.$strip>;
785
+ createdAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>;
786
+ updatedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>;
787
+ }, z.core.$strip>, string, string, import("@fragno-dev/db").DatabaseRequestContext<ApiHooksMap>>, import("@fragno-dev/core").FragnoRouteConfig<"GET", "/webhooks/endpoints", import("@standard-schema/spec").StandardSchemaV1<unknown, unknown> | undefined, z.ZodObject<{
788
+ endpoints: z.ZodArray<z.ZodObject<{
789
+ id: z.ZodString;
790
+ name: z.ZodString;
791
+ status: z.ZodEnum<{
792
+ draft: "draft";
793
+ active: "active";
794
+ disabled: "disabled";
795
+ }>;
796
+ authConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
797
+ type: z.ZodLiteral<"none">;
798
+ }, z.core.$strip>, z.ZodObject<{
799
+ type: z.ZodLiteral<"bearer">;
800
+ tokenRef: z.ZodString;
801
+ }, z.core.$strip>, z.ZodObject<{
802
+ type: z.ZodLiteral<"apiKey">;
803
+ location: z.ZodEnum<{
804
+ header: "header";
805
+ query: "query";
806
+ }>;
807
+ name: z.ZodString;
808
+ secretRef: z.ZodString;
809
+ }, z.core.$strip>, z.ZodObject<{
810
+ type: z.ZodLiteral<"basic">;
811
+ usernameRef: z.ZodString;
812
+ passwordRef: z.ZodString;
813
+ }, z.core.$strip>, z.ZodObject<{
814
+ type: z.ZodLiteral<"hmac">;
815
+ secretRef: z.ZodString;
816
+ algorithm: z.ZodEnum<{
817
+ sha1: "sha1";
818
+ sha256: "sha256";
819
+ sha512: "sha512";
820
+ }>;
821
+ signature: z.ZodObject<{
822
+ location: z.ZodEnum<{
823
+ header: "header";
824
+ query: "query";
825
+ }>;
826
+ name: z.ZodString;
827
+ encoding: z.ZodEnum<{
828
+ hex: "hex";
829
+ base64: "base64";
830
+ base64url: "base64url";
831
+ }>;
832
+ prefix: z.ZodOptional<z.ZodString>;
833
+ }, z.core.$strip>;
834
+ signedPayload: z.ZodDiscriminatedUnion<[z.ZodObject<{
835
+ type: z.ZodLiteral<"rawBody">;
836
+ }, z.core.$strip>, z.ZodObject<{
837
+ type: z.ZodLiteral<"timestampedBody">;
838
+ prefix: z.ZodString;
839
+ timestampHeader: z.ZodString;
840
+ delimiter: z.ZodString;
841
+ toleranceSeconds: z.ZodNumber;
842
+ }, z.core.$strip>], "type">;
843
+ }, z.core.$strip>], "type">;
844
+ verification: z.ZodDiscriminatedUnion<[z.ZodObject<{
845
+ type: z.ZodLiteral<"none">;
846
+ }, z.core.$strip>, z.ZodObject<{
847
+ type: z.ZodLiteral<"challenge">;
848
+ method: z.ZodEnum<{
849
+ GET: "GET";
850
+ POST: "POST";
851
+ }>;
852
+ when: z.ZodDiscriminatedUnion<[z.ZodObject<{
853
+ type: z.ZodLiteral<"present">;
854
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
855
+ type: z.ZodLiteral<"header">;
856
+ name: z.ZodString;
857
+ }, z.core.$strip>, z.ZodObject<{
858
+ type: z.ZodLiteral<"query">;
859
+ name: z.ZodString;
860
+ }, z.core.$strip>, z.ZodObject<{
861
+ type: z.ZodLiteral<"jsonBodyPath">;
862
+ path: z.ZodArray<z.ZodString>;
863
+ }, z.core.$strip>], "type">;
864
+ }, z.core.$strip>, z.ZodObject<{
865
+ type: z.ZodLiteral<"equals">;
866
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
867
+ type: z.ZodLiteral<"header">;
868
+ name: z.ZodString;
869
+ }, z.core.$strip>, z.ZodObject<{
870
+ type: z.ZodLiteral<"query">;
871
+ name: z.ZodString;
872
+ }, z.core.$strip>, z.ZodObject<{
873
+ type: z.ZodLiteral<"jsonBodyPath">;
874
+ path: z.ZodArray<z.ZodString>;
875
+ }, z.core.$strip>], "type">;
876
+ value: z.ZodString;
877
+ }, z.core.$strip>], "type">;
878
+ response: z.ZodObject<{
879
+ type: z.ZodLiteral<"echoText">;
880
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
881
+ type: z.ZodLiteral<"header">;
882
+ name: z.ZodString;
883
+ }, z.core.$strip>, z.ZodObject<{
884
+ type: z.ZodLiteral<"query">;
885
+ name: z.ZodString;
886
+ }, z.core.$strip>, z.ZodObject<{
887
+ type: z.ZodLiteral<"jsonBodyPath">;
888
+ path: z.ZodArray<z.ZodString>;
889
+ }, z.core.$strip>], "type">;
890
+ }, z.core.$strip>;
891
+ }, z.core.$strip>], "type">;
892
+ deliveryIdentity: z.ZodDiscriminatedUnion<[z.ZodObject<{
893
+ type: z.ZodLiteral<"header">;
894
+ name: z.ZodString;
895
+ }, z.core.$strip>, z.ZodObject<{
896
+ type: z.ZodLiteral<"query">;
897
+ name: z.ZodString;
898
+ }, z.core.$strip>, z.ZodObject<{
899
+ type: z.ZodLiteral<"jsonBodyPath">;
900
+ path: z.ZodArray<z.ZodString>;
901
+ }, z.core.$strip>], "type">;
902
+ secretRefs: z.ZodArray<z.ZodString>;
903
+ deliveries: z.ZodObject<{
904
+ lastAcceptedAt: z.ZodNullable<z.ZodString>;
905
+ lastRejection: z.ZodNullable<z.ZodObject<{
906
+ receivedAt: z.ZodString;
907
+ code: z.ZodEnum<{
908
+ WEBHOOK_ENDPOINT_DISABLED: "WEBHOOK_ENDPOINT_DISABLED";
909
+ WEBHOOK_ENDPOINT_DRAFT: "WEBHOOK_ENDPOINT_DRAFT";
910
+ WEBHOOK_AUTH_FAILED: "WEBHOOK_AUTH_FAILED";
911
+ WEBHOOK_VERIFICATION_NOT_MATCHED: "WEBHOOK_VERIFICATION_NOT_MATCHED";
912
+ WEBHOOK_VERIFICATION_RESPONSE_INVALID: "WEBHOOK_VERIFICATION_RESPONSE_INVALID";
913
+ WEBHOOK_BODY_INVALID: "WEBHOOK_BODY_INVALID";
914
+ WEBHOOK_DELIVERY_ID_MISSING: "WEBHOOK_DELIVERY_ID_MISSING";
915
+ WEBHOOK_DELIVERY_ID_INVALID: "WEBHOOK_DELIVERY_ID_INVALID";
916
+ }>;
917
+ }, z.core.$strip>>;
918
+ }, z.core.$strip>;
919
+ createdAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>;
920
+ updatedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>;
921
+ }, z.core.$strip>>;
922
+ }, z.core.$strip>, string, string, import("@fragno-dev/db").DatabaseRequestContext<ApiHooksMap>>, import("@fragno-dev/core").FragnoRouteConfig<"GET", "/webhooks/endpoints/:endpointId", import("@standard-schema/spec").StandardSchemaV1<unknown, unknown> | undefined, z.ZodObject<{
923
+ id: z.ZodString;
924
+ name: z.ZodString;
925
+ status: z.ZodEnum<{
926
+ draft: "draft";
927
+ active: "active";
928
+ disabled: "disabled";
929
+ }>;
930
+ authConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
931
+ type: z.ZodLiteral<"none">;
932
+ }, z.core.$strip>, z.ZodObject<{
933
+ type: z.ZodLiteral<"bearer">;
934
+ tokenRef: z.ZodString;
935
+ }, z.core.$strip>, z.ZodObject<{
936
+ type: z.ZodLiteral<"apiKey">;
937
+ location: z.ZodEnum<{
938
+ header: "header";
939
+ query: "query";
940
+ }>;
941
+ name: z.ZodString;
942
+ secretRef: z.ZodString;
943
+ }, z.core.$strip>, z.ZodObject<{
944
+ type: z.ZodLiteral<"basic">;
945
+ usernameRef: z.ZodString;
946
+ passwordRef: z.ZodString;
947
+ }, z.core.$strip>, z.ZodObject<{
948
+ type: z.ZodLiteral<"hmac">;
949
+ secretRef: z.ZodString;
950
+ algorithm: z.ZodEnum<{
951
+ sha1: "sha1";
952
+ sha256: "sha256";
953
+ sha512: "sha512";
954
+ }>;
955
+ signature: z.ZodObject<{
956
+ location: z.ZodEnum<{
957
+ header: "header";
958
+ query: "query";
959
+ }>;
960
+ name: z.ZodString;
961
+ encoding: z.ZodEnum<{
962
+ hex: "hex";
963
+ base64: "base64";
964
+ base64url: "base64url";
965
+ }>;
966
+ prefix: z.ZodOptional<z.ZodString>;
967
+ }, z.core.$strip>;
968
+ signedPayload: z.ZodDiscriminatedUnion<[z.ZodObject<{
969
+ type: z.ZodLiteral<"rawBody">;
970
+ }, z.core.$strip>, z.ZodObject<{
971
+ type: z.ZodLiteral<"timestampedBody">;
972
+ prefix: z.ZodString;
973
+ timestampHeader: z.ZodString;
974
+ delimiter: z.ZodString;
975
+ toleranceSeconds: z.ZodNumber;
976
+ }, z.core.$strip>], "type">;
977
+ }, z.core.$strip>], "type">;
978
+ verification: z.ZodDiscriminatedUnion<[z.ZodObject<{
979
+ type: z.ZodLiteral<"none">;
980
+ }, z.core.$strip>, z.ZodObject<{
981
+ type: z.ZodLiteral<"challenge">;
982
+ method: z.ZodEnum<{
983
+ GET: "GET";
984
+ POST: "POST";
985
+ }>;
986
+ when: z.ZodDiscriminatedUnion<[z.ZodObject<{
987
+ type: z.ZodLiteral<"present">;
988
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
989
+ type: z.ZodLiteral<"header">;
990
+ name: z.ZodString;
991
+ }, z.core.$strip>, z.ZodObject<{
992
+ type: z.ZodLiteral<"query">;
993
+ name: z.ZodString;
994
+ }, z.core.$strip>, z.ZodObject<{
995
+ type: z.ZodLiteral<"jsonBodyPath">;
996
+ path: z.ZodArray<z.ZodString>;
997
+ }, z.core.$strip>], "type">;
998
+ }, z.core.$strip>, z.ZodObject<{
999
+ type: z.ZodLiteral<"equals">;
1000
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1001
+ type: z.ZodLiteral<"header">;
1002
+ name: z.ZodString;
1003
+ }, z.core.$strip>, z.ZodObject<{
1004
+ type: z.ZodLiteral<"query">;
1005
+ name: z.ZodString;
1006
+ }, z.core.$strip>, z.ZodObject<{
1007
+ type: z.ZodLiteral<"jsonBodyPath">;
1008
+ path: z.ZodArray<z.ZodString>;
1009
+ }, z.core.$strip>], "type">;
1010
+ value: z.ZodString;
1011
+ }, z.core.$strip>], "type">;
1012
+ response: z.ZodObject<{
1013
+ type: z.ZodLiteral<"echoText">;
1014
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1015
+ type: z.ZodLiteral<"header">;
1016
+ name: z.ZodString;
1017
+ }, z.core.$strip>, z.ZodObject<{
1018
+ type: z.ZodLiteral<"query">;
1019
+ name: z.ZodString;
1020
+ }, z.core.$strip>, z.ZodObject<{
1021
+ type: z.ZodLiteral<"jsonBodyPath">;
1022
+ path: z.ZodArray<z.ZodString>;
1023
+ }, z.core.$strip>], "type">;
1024
+ }, z.core.$strip>;
1025
+ }, z.core.$strip>], "type">;
1026
+ deliveryIdentity: z.ZodDiscriminatedUnion<[z.ZodObject<{
1027
+ type: z.ZodLiteral<"header">;
1028
+ name: z.ZodString;
1029
+ }, z.core.$strip>, z.ZodObject<{
1030
+ type: z.ZodLiteral<"query">;
1031
+ name: z.ZodString;
1032
+ }, z.core.$strip>, z.ZodObject<{
1033
+ type: z.ZodLiteral<"jsonBodyPath">;
1034
+ path: z.ZodArray<z.ZodString>;
1035
+ }, z.core.$strip>], "type">;
1036
+ secretRefs: z.ZodArray<z.ZodString>;
1037
+ deliveries: z.ZodObject<{
1038
+ lastAcceptedAt: z.ZodNullable<z.ZodString>;
1039
+ lastRejection: z.ZodNullable<z.ZodObject<{
1040
+ receivedAt: z.ZodString;
1041
+ code: z.ZodEnum<{
1042
+ WEBHOOK_ENDPOINT_DISABLED: "WEBHOOK_ENDPOINT_DISABLED";
1043
+ WEBHOOK_ENDPOINT_DRAFT: "WEBHOOK_ENDPOINT_DRAFT";
1044
+ WEBHOOK_AUTH_FAILED: "WEBHOOK_AUTH_FAILED";
1045
+ WEBHOOK_VERIFICATION_NOT_MATCHED: "WEBHOOK_VERIFICATION_NOT_MATCHED";
1046
+ WEBHOOK_VERIFICATION_RESPONSE_INVALID: "WEBHOOK_VERIFICATION_RESPONSE_INVALID";
1047
+ WEBHOOK_BODY_INVALID: "WEBHOOK_BODY_INVALID";
1048
+ WEBHOOK_DELIVERY_ID_MISSING: "WEBHOOK_DELIVERY_ID_MISSING";
1049
+ WEBHOOK_DELIVERY_ID_INVALID: "WEBHOOK_DELIVERY_ID_INVALID";
1050
+ }>;
1051
+ }, z.core.$strip>>;
1052
+ }, z.core.$strip>;
1053
+ createdAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>;
1054
+ updatedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>;
1055
+ }, z.core.$strip>, "WEBHOOK_ENDPOINT_NOT_FOUND", string, import("@fragno-dev/db").DatabaseRequestContext<ApiHooksMap>>, import("@fragno-dev/core").FragnoRouteConfig<"GET", "/webhooks/endpoints/:endpointId/events", import("@standard-schema/spec").StandardSchemaV1<unknown, unknown> | undefined, import("@standard-schema/spec").StandardSchemaV1<unknown, unknown> | undefined, "WEBHOOK_ENDPOINT_DISABLED" | "WEBHOOK_ENDPOINT_DRAFT" | "WEBHOOK_AUTH_FAILED" | "WEBHOOK_VERIFICATION_NOT_MATCHED" | "WEBHOOK_VERIFICATION_RESPONSE_INVALID" | "WEBHOOK_ENDPOINT_NOT_FOUND", string, import("@fragno-dev/db").DatabaseRequestContext<ApiHooksMap>>, import("@fragno-dev/core").FragnoRouteConfig<"POST", "/webhooks/endpoints/:endpointId/events", import("@standard-schema/spec").StandardSchemaV1<unknown, unknown> | undefined, import("@standard-schema/spec").StandardSchemaV1<unknown, unknown> | undefined, "WEBHOOK_ENDPOINT_DISABLED" | "WEBHOOK_ENDPOINT_DRAFT" | "WEBHOOK_AUTH_FAILED" | "WEBHOOK_VERIFICATION_RESPONSE_INVALID" | "WEBHOOK_BODY_INVALID" | "WEBHOOK_DELIVERY_ID_MISSING" | "WEBHOOK_DELIVERY_ID_INVALID" | "WEBHOOK_ENDPOINT_NOT_FOUND", string, import("@fragno-dev/db").DatabaseRequestContext<ApiHooksMap>>, import("@fragno-dev/core").FragnoRouteConfig<"PATCH", "/webhooks/endpoints/:endpointId", z.ZodObject<{
1056
+ name: z.ZodOptional<z.ZodString>;
1057
+ status: z.ZodOptional<z.ZodEnum<{
1058
+ draft: "draft";
1059
+ active: "active";
1060
+ disabled: "disabled";
1061
+ }>>;
1062
+ verification: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1063
+ type: z.ZodLiteral<"none">;
1064
+ }, z.core.$strip>, z.ZodObject<{
1065
+ type: z.ZodLiteral<"challenge">;
1066
+ method: z.ZodEnum<{
1067
+ GET: "GET";
1068
+ POST: "POST";
1069
+ }>;
1070
+ when: z.ZodDiscriminatedUnion<[z.ZodObject<{
1071
+ type: z.ZodLiteral<"present">;
1072
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1073
+ type: z.ZodLiteral<"header">;
1074
+ name: z.ZodString;
1075
+ }, z.core.$strip>, z.ZodObject<{
1076
+ type: z.ZodLiteral<"query">;
1077
+ name: z.ZodString;
1078
+ }, z.core.$strip>, z.ZodObject<{
1079
+ type: z.ZodLiteral<"jsonBodyPath">;
1080
+ path: z.ZodArray<z.ZodString>;
1081
+ }, z.core.$strip>], "type">;
1082
+ }, z.core.$strip>, z.ZodObject<{
1083
+ type: z.ZodLiteral<"equals">;
1084
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1085
+ type: z.ZodLiteral<"header">;
1086
+ name: z.ZodString;
1087
+ }, z.core.$strip>, z.ZodObject<{
1088
+ type: z.ZodLiteral<"query">;
1089
+ name: z.ZodString;
1090
+ }, z.core.$strip>, z.ZodObject<{
1091
+ type: z.ZodLiteral<"jsonBodyPath">;
1092
+ path: z.ZodArray<z.ZodString>;
1093
+ }, z.core.$strip>], "type">;
1094
+ value: z.ZodString;
1095
+ }, z.core.$strip>], "type">;
1096
+ response: z.ZodObject<{
1097
+ type: z.ZodLiteral<"echoText">;
1098
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1099
+ type: z.ZodLiteral<"header">;
1100
+ name: z.ZodString;
1101
+ }, z.core.$strip>, z.ZodObject<{
1102
+ type: z.ZodLiteral<"query">;
1103
+ name: z.ZodString;
1104
+ }, z.core.$strip>, z.ZodObject<{
1105
+ type: z.ZodLiteral<"jsonBodyPath">;
1106
+ path: z.ZodArray<z.ZodString>;
1107
+ }, z.core.$strip>], "type">;
1108
+ }, z.core.$strip>;
1109
+ }, z.core.$strip>], "type">>;
1110
+ deliveryIdentity: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1111
+ type: z.ZodLiteral<"header">;
1112
+ name: z.ZodString;
1113
+ }, z.core.$strip>, z.ZodObject<{
1114
+ type: z.ZodLiteral<"query">;
1115
+ name: z.ZodString;
1116
+ }, z.core.$strip>, z.ZodObject<{
1117
+ type: z.ZodLiteral<"jsonBodyPath">;
1118
+ path: z.ZodArray<z.ZodString>;
1119
+ }, z.core.$strip>], "type">>;
1120
+ auth: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1121
+ type: z.ZodLiteral<"none">;
1122
+ }, z.core.$strip>, z.ZodObject<{
1123
+ type: z.ZodLiteral<"bearer">;
1124
+ token: z.ZodString;
1125
+ }, z.core.$strip>, z.ZodObject<{
1126
+ type: z.ZodLiteral<"apiKey">;
1127
+ location: z.ZodEnum<{
1128
+ header: "header";
1129
+ query: "query";
1130
+ }>;
1131
+ name: z.ZodString;
1132
+ secret: z.ZodString;
1133
+ }, z.core.$strip>, z.ZodObject<{
1134
+ type: z.ZodLiteral<"basic">;
1135
+ username: z.ZodString;
1136
+ password: z.ZodString;
1137
+ }, z.core.$strip>, z.ZodObject<{
1138
+ type: z.ZodLiteral<"hmac">;
1139
+ secret: z.ZodString;
1140
+ algorithm: z.ZodEnum<{
1141
+ sha1: "sha1";
1142
+ sha256: "sha256";
1143
+ sha512: "sha512";
1144
+ }>;
1145
+ signature: z.ZodObject<{
1146
+ location: z.ZodEnum<{
1147
+ header: "header";
1148
+ query: "query";
1149
+ }>;
1150
+ name: z.ZodString;
1151
+ encoding: z.ZodEnum<{
1152
+ hex: "hex";
1153
+ base64: "base64";
1154
+ base64url: "base64url";
1155
+ }>;
1156
+ prefix: z.ZodOptional<z.ZodString>;
1157
+ }, z.core.$strip>;
1158
+ signedPayload: z.ZodDiscriminatedUnion<[z.ZodObject<{
1159
+ type: z.ZodLiteral<"rawBody">;
1160
+ }, z.core.$strip>, z.ZodObject<{
1161
+ type: z.ZodLiteral<"timestampedBody">;
1162
+ prefix: z.ZodString;
1163
+ timestampHeader: z.ZodString;
1164
+ delimiter: z.ZodString;
1165
+ toleranceSeconds: z.ZodNumber;
1166
+ }, z.core.$strip>], "type">;
1167
+ }, z.core.$strip>], "type">>;
1168
+ }, z.core.$strip>, z.ZodObject<{
1169
+ id: z.ZodString;
1170
+ name: z.ZodString;
1171
+ status: z.ZodEnum<{
1172
+ draft: "draft";
1173
+ active: "active";
1174
+ disabled: "disabled";
1175
+ }>;
1176
+ authConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
1177
+ type: z.ZodLiteral<"none">;
1178
+ }, z.core.$strip>, z.ZodObject<{
1179
+ type: z.ZodLiteral<"bearer">;
1180
+ tokenRef: z.ZodString;
1181
+ }, z.core.$strip>, z.ZodObject<{
1182
+ type: z.ZodLiteral<"apiKey">;
1183
+ location: z.ZodEnum<{
1184
+ header: "header";
1185
+ query: "query";
1186
+ }>;
1187
+ name: z.ZodString;
1188
+ secretRef: z.ZodString;
1189
+ }, z.core.$strip>, z.ZodObject<{
1190
+ type: z.ZodLiteral<"basic">;
1191
+ usernameRef: z.ZodString;
1192
+ passwordRef: z.ZodString;
1193
+ }, z.core.$strip>, z.ZodObject<{
1194
+ type: z.ZodLiteral<"hmac">;
1195
+ secretRef: z.ZodString;
1196
+ algorithm: z.ZodEnum<{
1197
+ sha1: "sha1";
1198
+ sha256: "sha256";
1199
+ sha512: "sha512";
1200
+ }>;
1201
+ signature: z.ZodObject<{
1202
+ location: z.ZodEnum<{
1203
+ header: "header";
1204
+ query: "query";
1205
+ }>;
1206
+ name: z.ZodString;
1207
+ encoding: z.ZodEnum<{
1208
+ hex: "hex";
1209
+ base64: "base64";
1210
+ base64url: "base64url";
1211
+ }>;
1212
+ prefix: z.ZodOptional<z.ZodString>;
1213
+ }, z.core.$strip>;
1214
+ signedPayload: z.ZodDiscriminatedUnion<[z.ZodObject<{
1215
+ type: z.ZodLiteral<"rawBody">;
1216
+ }, z.core.$strip>, z.ZodObject<{
1217
+ type: z.ZodLiteral<"timestampedBody">;
1218
+ prefix: z.ZodString;
1219
+ timestampHeader: z.ZodString;
1220
+ delimiter: z.ZodString;
1221
+ toleranceSeconds: z.ZodNumber;
1222
+ }, z.core.$strip>], "type">;
1223
+ }, z.core.$strip>], "type">;
1224
+ verification: z.ZodDiscriminatedUnion<[z.ZodObject<{
1225
+ type: z.ZodLiteral<"none">;
1226
+ }, z.core.$strip>, z.ZodObject<{
1227
+ type: z.ZodLiteral<"challenge">;
1228
+ method: z.ZodEnum<{
1229
+ GET: "GET";
1230
+ POST: "POST";
1231
+ }>;
1232
+ when: z.ZodDiscriminatedUnion<[z.ZodObject<{
1233
+ type: z.ZodLiteral<"present">;
1234
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1235
+ type: z.ZodLiteral<"header">;
1236
+ name: z.ZodString;
1237
+ }, z.core.$strip>, z.ZodObject<{
1238
+ type: z.ZodLiteral<"query">;
1239
+ name: z.ZodString;
1240
+ }, z.core.$strip>, z.ZodObject<{
1241
+ type: z.ZodLiteral<"jsonBodyPath">;
1242
+ path: z.ZodArray<z.ZodString>;
1243
+ }, z.core.$strip>], "type">;
1244
+ }, z.core.$strip>, z.ZodObject<{
1245
+ type: z.ZodLiteral<"equals">;
1246
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1247
+ type: z.ZodLiteral<"header">;
1248
+ name: z.ZodString;
1249
+ }, z.core.$strip>, z.ZodObject<{
1250
+ type: z.ZodLiteral<"query">;
1251
+ name: z.ZodString;
1252
+ }, z.core.$strip>, z.ZodObject<{
1253
+ type: z.ZodLiteral<"jsonBodyPath">;
1254
+ path: z.ZodArray<z.ZodString>;
1255
+ }, z.core.$strip>], "type">;
1256
+ value: z.ZodString;
1257
+ }, z.core.$strip>], "type">;
1258
+ response: z.ZodObject<{
1259
+ type: z.ZodLiteral<"echoText">;
1260
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1261
+ type: z.ZodLiteral<"header">;
1262
+ name: z.ZodString;
1263
+ }, z.core.$strip>, z.ZodObject<{
1264
+ type: z.ZodLiteral<"query">;
1265
+ name: z.ZodString;
1266
+ }, z.core.$strip>, z.ZodObject<{
1267
+ type: z.ZodLiteral<"jsonBodyPath">;
1268
+ path: z.ZodArray<z.ZodString>;
1269
+ }, z.core.$strip>], "type">;
1270
+ }, z.core.$strip>;
1271
+ }, z.core.$strip>], "type">;
1272
+ deliveryIdentity: z.ZodDiscriminatedUnion<[z.ZodObject<{
1273
+ type: z.ZodLiteral<"header">;
1274
+ name: z.ZodString;
1275
+ }, z.core.$strip>, z.ZodObject<{
1276
+ type: z.ZodLiteral<"query">;
1277
+ name: z.ZodString;
1278
+ }, z.core.$strip>, z.ZodObject<{
1279
+ type: z.ZodLiteral<"jsonBodyPath">;
1280
+ path: z.ZodArray<z.ZodString>;
1281
+ }, z.core.$strip>], "type">;
1282
+ secretRefs: z.ZodArray<z.ZodString>;
1283
+ deliveries: z.ZodObject<{
1284
+ lastAcceptedAt: z.ZodNullable<z.ZodString>;
1285
+ lastRejection: z.ZodNullable<z.ZodObject<{
1286
+ receivedAt: z.ZodString;
1287
+ code: z.ZodEnum<{
1288
+ WEBHOOK_ENDPOINT_DISABLED: "WEBHOOK_ENDPOINT_DISABLED";
1289
+ WEBHOOK_ENDPOINT_DRAFT: "WEBHOOK_ENDPOINT_DRAFT";
1290
+ WEBHOOK_AUTH_FAILED: "WEBHOOK_AUTH_FAILED";
1291
+ WEBHOOK_VERIFICATION_NOT_MATCHED: "WEBHOOK_VERIFICATION_NOT_MATCHED";
1292
+ WEBHOOK_VERIFICATION_RESPONSE_INVALID: "WEBHOOK_VERIFICATION_RESPONSE_INVALID";
1293
+ WEBHOOK_BODY_INVALID: "WEBHOOK_BODY_INVALID";
1294
+ WEBHOOK_DELIVERY_ID_MISSING: "WEBHOOK_DELIVERY_ID_MISSING";
1295
+ WEBHOOK_DELIVERY_ID_INVALID: "WEBHOOK_DELIVERY_ID_INVALID";
1296
+ }>;
1297
+ }, z.core.$strip>>;
1298
+ }, z.core.$strip>;
1299
+ createdAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>;
1300
+ updatedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>;
1301
+ }, z.core.$strip>, "WEBHOOK_ENDPOINT_NOT_FOUND", string, import("@fragno-dev/db").DatabaseRequestContext<ApiHooksMap>>, import("@fragno-dev/core").FragnoRouteConfig<"DELETE", "/webhooks/endpoints/:endpointId", import("@standard-schema/spec").StandardSchemaV1<unknown, unknown> | undefined, import("@standard-schema/spec").StandardSchemaV1<unknown, unknown> | undefined, string, string, import("@fragno-dev/db").DatabaseRequestContext<ApiHooksMap>>, import("@fragno-dev/core").FragnoRouteConfig<"PUT", "/connections/:slug", z.ZodObject<{
1302
+ name: z.ZodOptional<z.ZodString>;
1303
+ baseUrl: z.ZodURL;
1304
+ auth: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
1305
+ type: z.ZodLiteral<"none">;
1306
+ }, z.core.$strip>, z.ZodObject<{
1307
+ type: z.ZodLiteral<"bearer">;
1308
+ token: z.ZodString;
1309
+ }, z.core.$strip>, z.ZodObject<{
1310
+ type: z.ZodLiteral<"basic">;
1311
+ username: z.ZodString;
1312
+ password: z.ZodString;
1313
+ }, z.core.$strip>, z.ZodObject<{
1314
+ type: z.ZodLiteral<"client_credentials">;
1315
+ tokenEndpoint: z.ZodURL;
1316
+ clientId: z.ZodString;
1317
+ clientSecret: z.ZodString;
1318
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1319
+ audience: z.ZodOptional<z.ZodString>;
1320
+ tokenEndpointAuthMethod: z.ZodDefault<z.ZodEnum<{
1321
+ client_secret_basic: "client_secret_basic";
1322
+ client_secret_post: "client_secret_post";
1323
+ }>>;
1324
+ }, z.core.$strip>, z.ZodObject<{
1325
+ type: z.ZodLiteral<"oauth">;
1326
+ authorizationEndpoint: z.ZodURL;
1327
+ tokenEndpoint: z.ZodURL;
1328
+ clientId: z.ZodString;
1329
+ clientSecret: z.ZodOptional<z.ZodString>;
1330
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1331
+ tokenEndpointAuthMethod: z.ZodDefault<z.ZodEnum<{
1332
+ none: "none";
1333
+ client_secret_basic: "client_secret_basic";
1334
+ client_secret_post: "client_secret_post";
1335
+ }>>;
1336
+ extraAuthorizationParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1337
+ extraTokenParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1338
+ }, z.core.$strip>], "type">>;
1339
+ }, z.core.$strip>, z.ZodObject<{
1340
+ slug: z.ZodString;
1341
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1342
+ baseUrl: z.ZodString;
1343
+ authMode: z.ZodString;
1344
+ status: z.ZodString;
1345
+ createdAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>;
1346
+ updatedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>;
1347
+ }, z.core.$strip>, "CONNECTION_EXISTS" | "BASE_URL_NOT_ALLOWED" | "INVALID_SLUG", string, import("@fragno-dev/db").DatabaseRequestContext<ApiHooksMap>>, import("@fragno-dev/core").FragnoRouteConfig<"GET", "/connections", import("@standard-schema/spec").StandardSchemaV1<unknown, unknown> | undefined, z.ZodObject<{
1348
+ connections: z.ZodArray<z.ZodObject<{
1349
+ slug: z.ZodString;
1350
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1351
+ baseUrl: z.ZodString;
1352
+ authMode: z.ZodString;
1353
+ status: z.ZodString;
1354
+ createdAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>;
1355
+ updatedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>;
1356
+ }, z.core.$strip>>;
1357
+ cursor: z.ZodNullable<z.ZodString>;
1358
+ }, z.core.$strip>, "INVALID_CURSOR", "cursor", import("@fragno-dev/db").DatabaseRequestContext<ApiHooksMap>>, import("@fragno-dev/core").FragnoRouteConfig<"GET", "/connections/:slug", import("@standard-schema/spec").StandardSchemaV1<unknown, unknown> | undefined, z.ZodObject<{
1359
+ slug: z.ZodString;
1360
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1361
+ baseUrl: z.ZodString;
1362
+ authMode: z.ZodString;
1363
+ status: z.ZodString;
1364
+ createdAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>;
1365
+ updatedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>;
1366
+ }, z.core.$strip>, "CONNECTION_NOT_FOUND", string, import("@fragno-dev/db").DatabaseRequestContext<ApiHooksMap>>, import("@fragno-dev/core").FragnoRouteConfig<"PUT", "/connections/:slug/configuration", z.ZodObject<{
1367
+ name: z.ZodOptional<z.ZodString>;
1368
+ baseUrl: z.ZodURL;
1369
+ auth: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
1370
+ type: z.ZodLiteral<"none">;
1371
+ }, z.core.$strip>, z.ZodObject<{
1372
+ type: z.ZodLiteral<"bearer">;
1373
+ token: z.ZodString;
1374
+ }, z.core.$strip>, z.ZodObject<{
1375
+ type: z.ZodLiteral<"basic">;
1376
+ username: z.ZodString;
1377
+ password: z.ZodString;
1378
+ }, z.core.$strip>, z.ZodObject<{
1379
+ type: z.ZodLiteral<"client_credentials">;
1380
+ tokenEndpoint: z.ZodURL;
1381
+ clientId: z.ZodString;
1382
+ clientSecret: z.ZodString;
1383
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1384
+ audience: z.ZodOptional<z.ZodString>;
1385
+ tokenEndpointAuthMethod: z.ZodDefault<z.ZodEnum<{
1386
+ client_secret_basic: "client_secret_basic";
1387
+ client_secret_post: "client_secret_post";
1388
+ }>>;
1389
+ }, z.core.$strip>, z.ZodObject<{
1390
+ type: z.ZodLiteral<"oauth">;
1391
+ authorizationEndpoint: z.ZodURL;
1392
+ tokenEndpoint: z.ZodURL;
1393
+ clientId: z.ZodString;
1394
+ clientSecret: z.ZodOptional<z.ZodString>;
1395
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1396
+ tokenEndpointAuthMethod: z.ZodDefault<z.ZodEnum<{
1397
+ none: "none";
1398
+ client_secret_basic: "client_secret_basic";
1399
+ client_secret_post: "client_secret_post";
1400
+ }>>;
1401
+ extraAuthorizationParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1402
+ extraTokenParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1403
+ }, z.core.$strip>], "type">>;
1404
+ }, z.core.$strip>, z.ZodObject<{
1405
+ slug: z.ZodString;
1406
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1407
+ baseUrl: z.ZodString;
1408
+ authMode: z.ZodString;
1409
+ status: z.ZodString;
1410
+ createdAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>;
1411
+ updatedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodDate]>>;
1412
+ }, z.core.$strip>, "BASE_URL_NOT_ALLOWED" | "CONNECTION_NOT_FOUND", string, import("@fragno-dev/db").DatabaseRequestContext<ApiHooksMap>>, import("@fragno-dev/core").FragnoRouteConfig<"DELETE", "/connections/:slug", import("@standard-schema/spec").StandardSchemaV1<unknown, unknown> | undefined, import("@standard-schema/spec").StandardSchemaV1<unknown, unknown> | undefined, "CONNECTION_NOT_FOUND", string, import("@fragno-dev/db").DatabaseRequestContext<ApiHooksMap>>, import("@fragno-dev/core").FragnoRouteConfig<"GET", "/connections/:slug/auth/status", import("@standard-schema/spec").StandardSchemaV1<unknown, unknown> | undefined, z.ZodDiscriminatedUnion<[z.ZodObject<{
1413
+ mode: z.ZodLiteral<"none">;
1414
+ }, z.core.$strip>, z.ZodObject<{
1415
+ mode: z.ZodLiteral<"bearer">;
1416
+ credentials: z.ZodEnum<{
1417
+ present: "present";
1418
+ missing: "missing";
1419
+ }>;
1420
+ }, z.core.$strip>, z.ZodObject<{
1421
+ mode: z.ZodLiteral<"basic">;
1422
+ credentials: z.ZodEnum<{
1423
+ present: "present";
1424
+ missing: "missing";
1425
+ }>;
1426
+ }, z.core.$strip>, z.ZodObject<{
1427
+ mode: z.ZodLiteral<"client_credentials">;
1428
+ credentials: z.ZodEnum<{
1429
+ present: "present";
1430
+ missing: "missing";
1431
+ }>;
1432
+ }, z.core.$strip>, z.ZodObject<{
1433
+ mode: z.ZodLiteral<"oauth">;
1434
+ state: z.ZodEnum<{
1435
+ "client-missing": "client-missing";
1436
+ "consent-required": "consent-required";
1437
+ "consent-pending": "consent-pending";
1438
+ authorized: "authorized";
1439
+ expired: "expired";
1440
+ }>;
1441
+ }, z.core.$strip>], "mode">, "CONNECTION_NOT_FOUND", string, import("@fragno-dev/db").DatabaseRequestContext<ApiHooksMap>>, import("@fragno-dev/core").FragnoRouteConfig<"GET", "/connections/:slug/auth/oauth/pending", import("@standard-schema/spec").StandardSchemaV1<unknown, unknown> | undefined, z.ZodObject<{
1442
+ pending: z.ZodNullable<z.ZodObject<{
1443
+ authorizationUrl: z.ZodURL;
1444
+ expiresAt: z.ZodUnion<readonly [z.ZodString, z.ZodDate]>;
1445
+ }, z.core.$strip>>;
1446
+ }, z.core.$strip>, "CONNECTION_NOT_FOUND", string, import("@fragno-dev/db").DatabaseRequestContext<ApiHooksMap>>, import("@fragno-dev/core").FragnoRouteConfig<"POST", "/connections/:slug/auth/token", z.ZodObject<{
1447
+ token: z.ZodString;
1448
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
1449
+ mode: z.ZodLiteral<"none">;
1450
+ }, z.core.$strip>, z.ZodObject<{
1451
+ mode: z.ZodLiteral<"bearer">;
1452
+ credentials: z.ZodEnum<{
1453
+ present: "present";
1454
+ missing: "missing";
1455
+ }>;
1456
+ }, z.core.$strip>, z.ZodObject<{
1457
+ mode: z.ZodLiteral<"basic">;
1458
+ credentials: z.ZodEnum<{
1459
+ present: "present";
1460
+ missing: "missing";
1461
+ }>;
1462
+ }, z.core.$strip>, z.ZodObject<{
1463
+ mode: z.ZodLiteral<"client_credentials">;
1464
+ credentials: z.ZodEnum<{
1465
+ present: "present";
1466
+ missing: "missing";
1467
+ }>;
1468
+ }, z.core.$strip>, z.ZodObject<{
1469
+ mode: z.ZodLiteral<"oauth">;
1470
+ state: z.ZodEnum<{
1471
+ "client-missing": "client-missing";
1472
+ "consent-required": "consent-required";
1473
+ "consent-pending": "consent-pending";
1474
+ authorized: "authorized";
1475
+ expired: "expired";
1476
+ }>;
1477
+ }, z.core.$strip>], "mode">, "CONNECTION_NOT_FOUND", string, import("@fragno-dev/db").DatabaseRequestContext<ApiHooksMap>>, import("@fragno-dev/core").FragnoRouteConfig<"POST", "/connections/:slug/auth/oauth/start", z.ZodObject<{
1478
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1479
+ extraAuthorizationParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1480
+ discardTokens: z.ZodDefault<z.ZodBoolean>;
1481
+ }, z.core.$strip>, z.ZodObject<{
1482
+ authorizationUrl: z.ZodString;
1483
+ state: z.ZodString;
1484
+ }, z.core.$strip>, "CONNECTION_NOT_FOUND" | "INVALID_OAUTH_REDIRECT_URI" | "OAUTH_REDIRECT_URI_NOT_ALLOWED" | "AUTH_NOT_CONFIGURED" | "AUTH_NOT_OAUTH" | "OAUTH_ERROR", string, import("@fragno-dev/db").DatabaseRequestContext<ApiHooksMap>>, import("@fragno-dev/core").FragnoRouteConfig<"GET", "/oauth/callback", import("@standard-schema/spec").StandardSchemaV1<unknown, unknown> | undefined, z.ZodObject<{
1485
+ authenticated: z.ZodBoolean;
1486
+ mode: z.ZodString;
1487
+ }, z.core.$strip>, "CONNECTION_NOT_FOUND" | "AUTH_NOT_CONFIGURED" | "AUTH_NOT_OAUTH" | "OAUTH_ERROR" | "INVALID_OAUTH_STATE", string, import("@fragno-dev/db").DatabaseRequestContext<ApiHooksMap>>, import("@fragno-dev/core").FragnoRouteConfig<"DELETE", "/connections/:slug/auth", import("@standard-schema/spec").StandardSchemaV1<unknown, unknown> | undefined, z.ZodDiscriminatedUnion<[z.ZodObject<{
1488
+ mode: z.ZodLiteral<"none">;
1489
+ }, z.core.$strip>, z.ZodObject<{
1490
+ mode: z.ZodLiteral<"bearer">;
1491
+ credentials: z.ZodEnum<{
1492
+ present: "present";
1493
+ missing: "missing";
1494
+ }>;
1495
+ }, z.core.$strip>, z.ZodObject<{
1496
+ mode: z.ZodLiteral<"basic">;
1497
+ credentials: z.ZodEnum<{
1498
+ present: "present";
1499
+ missing: "missing";
1500
+ }>;
1501
+ }, z.core.$strip>, z.ZodObject<{
1502
+ mode: z.ZodLiteral<"client_credentials">;
1503
+ credentials: z.ZodEnum<{
1504
+ present: "present";
1505
+ missing: "missing";
1506
+ }>;
1507
+ }, z.core.$strip>, z.ZodObject<{
1508
+ mode: z.ZodLiteral<"oauth">;
1509
+ state: z.ZodEnum<{
1510
+ "client-missing": "client-missing";
1511
+ "consent-required": "consent-required";
1512
+ "consent-pending": "consent-pending";
1513
+ authorized: "authorized";
1514
+ expired: "expired";
1515
+ }>;
1516
+ }, z.core.$strip>], "mode">, "CONNECTION_NOT_FOUND", string, import("@fragno-dev/db").DatabaseRequestContext<ApiHooksMap>>, import("@fragno-dev/core").FragnoRouteConfig<"POST", "/connections/:slug/request", z.ZodObject<{
1517
+ method: z.ZodEnum<{
1518
+ GET: "GET";
1519
+ POST: "POST";
1520
+ PUT: "PUT";
1521
+ PATCH: "PATCH";
1522
+ DELETE: "DELETE";
1523
+ }>;
1524
+ path: z.ZodString;
1525
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1526
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1527
+ body: z.ZodDiscriminatedUnion<[z.ZodObject<{
1528
+ type: z.ZodLiteral<"empty">;
1529
+ }, z.core.$strip>, z.ZodObject<{
1530
+ type: z.ZodLiteral<"json">;
1531
+ value: z.ZodUnknown;
1532
+ }, z.core.$strip>, z.ZodObject<{
1533
+ type: z.ZodLiteral<"text">;
1534
+ value: z.ZodString;
1535
+ }, z.core.$strip>], "type">;
1536
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
1537
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
1538
+ ok: z.ZodLiteral<true>;
1539
+ response: z.ZodObject<{
1540
+ status: z.ZodNumber;
1541
+ statusText: z.ZodString;
1542
+ headers: z.ZodRecord<z.ZodString, z.ZodString>;
1543
+ body: z.ZodDiscriminatedUnion<[z.ZodObject<{
1544
+ type: z.ZodLiteral<"json">;
1545
+ value: z.ZodUnknown;
1546
+ }, z.core.$strip>, z.ZodObject<{
1547
+ type: z.ZodLiteral<"text">;
1548
+ value: z.ZodString;
1549
+ }, z.core.$strip>, z.ZodObject<{
1550
+ type: z.ZodLiteral<"empty">;
1551
+ value: z.ZodNull;
1552
+ }, z.core.$strip>], "type">;
1553
+ }, z.core.$strip>;
1554
+ error: z.ZodNull;
1555
+ }, z.core.$strip>, z.ZodObject<{
1556
+ ok: z.ZodLiteral<false>;
1557
+ response: z.ZodNullable<z.ZodObject<{
1558
+ status: z.ZodNumber;
1559
+ statusText: z.ZodString;
1560
+ headers: z.ZodRecord<z.ZodString, z.ZodString>;
1561
+ body: z.ZodDiscriminatedUnion<[z.ZodObject<{
1562
+ type: z.ZodLiteral<"json">;
1563
+ value: z.ZodUnknown;
1564
+ }, z.core.$strip>, z.ZodObject<{
1565
+ type: z.ZodLiteral<"text">;
1566
+ value: z.ZodString;
1567
+ }, z.core.$strip>, z.ZodObject<{
1568
+ type: z.ZodLiteral<"empty">;
1569
+ value: z.ZodNull;
1570
+ }, z.core.$strip>], "type">;
1571
+ }, z.core.$strip>>;
1572
+ error: z.ZodObject<{
1573
+ code: z.ZodEnum<{
1574
+ CONNECTION_NOT_FOUND: "CONNECTION_NOT_FOUND";
1575
+ HTTP_ERROR: "HTTP_ERROR";
1576
+ REQUEST_ERROR: "REQUEST_ERROR";
1577
+ RESPONSE_DECODING_ERROR: "RESPONSE_DECODING_ERROR";
1578
+ CONNECTION_DISABLED: "CONNECTION_DISABLED";
1579
+ }>;
1580
+ message: z.ZodString;
1581
+ }, z.core.$strip>;
1582
+ }, z.core.$strip>], "ok">, string, string, import("@fragno-dev/db").DatabaseRequestContext<ApiHooksMap>>]>;
1583
+ //#endregion
1584
+ export { apiRoutesFactory };
1585
+ //# sourceMappingURL=routes.d.ts.map