@willyim/idp 0.1.1 → 0.3.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 (42) hide show
  1. package/README.md +95 -12
  2. package/dist/src/api.d.ts +31 -55
  3. package/dist/src/api.d.ts.map +1 -1
  4. package/dist/src/api.js +16 -11
  5. package/dist/src/claims.d.ts +9 -34
  6. package/dist/src/claims.d.ts.map +1 -1
  7. package/dist/src/claims.js +12 -40
  8. package/dist/src/client.d.ts +30 -34
  9. package/dist/src/client.d.ts.map +1 -1
  10. package/dist/src/client.js +16 -22
  11. package/dist/src/drizzle/index.d.ts +78 -13
  12. package/dist/src/drizzle/index.d.ts.map +1 -1
  13. package/dist/src/errors.d.ts +8 -0
  14. package/dist/src/errors.d.ts.map +1 -0
  15. package/dist/src/errors.js +12 -0
  16. package/dist/src/index.d.ts +3 -1
  17. package/dist/src/index.d.ts.map +1 -1
  18. package/dist/src/index.js +3 -1
  19. package/dist/src/schemas/index.d.ts +323 -0
  20. package/dist/src/schemas/index.d.ts.map +1 -0
  21. package/dist/src/schemas/index.js +207 -0
  22. package/dist/src/schemas/openapi.d.ts +31 -0
  23. package/dist/src/schemas/openapi.d.ts.map +1 -0
  24. package/dist/src/schemas/openapi.js +111 -0
  25. package/dist/src/schemas/operations.d.ts +502 -0
  26. package/dist/src/schemas/operations.d.ts.map +1 -0
  27. package/dist/src/schemas/operations.js +213 -0
  28. package/dist/src/session.d.ts +17 -3
  29. package/dist/src/session.d.ts.map +1 -1
  30. package/dist/src/session.js +12 -1
  31. package/dist/src/user-keys.d.ts +124 -0
  32. package/dist/src/user-keys.d.ts.map +1 -0
  33. package/dist/src/user-keys.js +174 -0
  34. package/dist/src/validate.d.ts +13 -0
  35. package/dist/src/validate.d.ts.map +1 -0
  36. package/dist/src/validate.js +28 -0
  37. package/dist/src/wire.d.ts +164 -0
  38. package/dist/src/wire.d.ts.map +1 -0
  39. package/dist/src/wire.js +100 -0
  40. package/openapi/idp-api.json +1110 -17
  41. package/package.json +16 -7
  42. package/dist/src/generated/idp-api.d.ts +0 -1022
@@ -0,0 +1,502 @@
1
+ /**
2
+ * Every operation the management API exposes, in one table.
3
+ *
4
+ * Three things read it: `buildOpenApiDocument` (in `./openapi.ts`) turns it
5
+ * into the published document, `api.ts` uses it to type its `request()` and to
6
+ * parse what comes back, and `apps/idp` validates request bodies with the same
7
+ * `input` schemas. Adding an endpoint means adding a row here; nothing else
8
+ * needs to learn about it.
9
+ */
10
+ import { z } from "zod";
11
+ export type HttpMethod = "get" | "post" | "patch" | "delete" | "put";
12
+ /** A query parameter, as the document describes it. Path params are inferred. */
13
+ export type QueryParam = {
14
+ name: string;
15
+ description?: string;
16
+ required?: boolean;
17
+ };
18
+ export type OperationDef = {
19
+ summary: string;
20
+ /**
21
+ * The scoped-key permission this operation needs. Absent means superadmin
22
+ * only — the cross-app list endpoints.
23
+ */
24
+ permission?: string;
25
+ description?: string;
26
+ query?: readonly QueryParam[];
27
+ /** Path-parameter descriptions, keyed by name. Purely documentation. */
28
+ params?: Readonly<Record<string, string>>;
29
+ /** Set when the operation addresses a single row that may not exist. */
30
+ notFound?: string;
31
+ input?: z.ZodType;
32
+ successCode: "200" | "201";
33
+ success: z.ZodType;
34
+ };
35
+ export declare const operations: {
36
+ readonly "get /api/v1/applications": {
37
+ readonly summary: "List registered applications";
38
+ readonly successCode: "200";
39
+ readonly success: z.ZodObject<{
40
+ applications: z.ZodArray<z.ZodObject<{
41
+ clientId: z.ZodString;
42
+ name: z.ZodNullable<z.ZodString>;
43
+ app: z.ZodNullable<z.ZodString>;
44
+ allowSignup: z.ZodBoolean;
45
+ permissions: z.ZodArray<z.ZodString>;
46
+ redirectUris: z.ZodArray<z.ZodString>;
47
+ disabled: z.ZodBoolean;
48
+ createdAt: z.ZodString;
49
+ }, z.core.$strip>>;
50
+ }, z.core.$strip>;
51
+ };
52
+ readonly "post /api/v1/applications": {
53
+ readonly summary: "Register an application (client secret returned once)";
54
+ readonly description: "Requires the superadmin token. Creating an application is an IdP-level act — there is no app to scope a permission to yet.";
55
+ readonly input: z.ZodObject<{
56
+ name: z.ZodString;
57
+ app: z.ZodString;
58
+ redirectUris: z.ZodArray<z.ZodString>;
59
+ firstAdminUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
60
+ }, z.core.$strip>;
61
+ readonly successCode: "201";
62
+ readonly success: z.ZodObject<{
63
+ clientId: z.ZodString;
64
+ clientSecret: z.ZodString;
65
+ app: z.ZodString;
66
+ }, z.core.$strip>;
67
+ };
68
+ readonly "get /api/v1/applications/{clientId}": {
69
+ readonly summary: "Get one application";
70
+ readonly permission: "app:read";
71
+ readonly params: {
72
+ readonly clientId: "OAuth client id of the application.";
73
+ };
74
+ readonly notFound: "No application with that client id";
75
+ readonly successCode: "200";
76
+ readonly success: z.ZodObject<{
77
+ clientId: z.ZodString;
78
+ name: z.ZodNullable<z.ZodString>;
79
+ app: z.ZodNullable<z.ZodString>;
80
+ allowSignup: z.ZodBoolean;
81
+ permissions: z.ZodArray<z.ZodString>;
82
+ redirectUris: z.ZodArray<z.ZodString>;
83
+ disabled: z.ZodBoolean;
84
+ createdAt: z.ZodString;
85
+ }, z.core.$strip>;
86
+ };
87
+ readonly "patch /api/v1/applications/{clientId}": {
88
+ readonly summary: "Update an application";
89
+ readonly permission: "app:update";
90
+ readonly params: {
91
+ readonly clientId: "OAuth client id of the application.";
92
+ };
93
+ readonly notFound: "No application with that client id";
94
+ readonly input: z.ZodObject<{
95
+ name: z.ZodOptional<z.ZodString>;
96
+ redirectUris: z.ZodOptional<z.ZodArray<z.ZodString>>;
97
+ allowSignup: z.ZodOptional<z.ZodBoolean>;
98
+ }, z.core.$strip>;
99
+ readonly successCode: "200";
100
+ readonly success: z.ZodObject<{
101
+ clientId: z.ZodString;
102
+ name: z.ZodNullable<z.ZodString>;
103
+ app: z.ZodNullable<z.ZodString>;
104
+ allowSignup: z.ZodBoolean;
105
+ permissions: z.ZodArray<z.ZodString>;
106
+ redirectUris: z.ZodArray<z.ZodString>;
107
+ disabled: z.ZodBoolean;
108
+ createdAt: z.ZodString;
109
+ }, z.core.$strip>;
110
+ };
111
+ readonly "delete /api/v1/applications/{clientId}": {
112
+ readonly summary: "Deregister an application";
113
+ readonly permission: "app:delete";
114
+ readonly params: {
115
+ readonly clientId: "OAuth client id of the application.";
116
+ };
117
+ readonly notFound: "No application with that client id";
118
+ readonly successCode: "200";
119
+ readonly success: z.ZodObject<{
120
+ ok: z.ZodLiteral<true>;
121
+ }, z.core.$strip>;
122
+ };
123
+ readonly "post /api/v1/applications/{clientId}/rotate-secret": {
124
+ readonly summary: "Rotate the client secret (returned once; the old one stops working)";
125
+ readonly permission: "app:update";
126
+ readonly params: {
127
+ readonly clientId: "OAuth client id of the application.";
128
+ };
129
+ readonly notFound: "No application with that client id";
130
+ readonly successCode: "200";
131
+ readonly success: z.ZodObject<{
132
+ clientSecret: z.ZodString;
133
+ }, z.core.$strip>;
134
+ };
135
+ readonly "put /api/v1/apps/{app}/permissions": {
136
+ readonly summary: "Replace the app's product-permission catalog";
137
+ readonly permission: "app:update";
138
+ readonly params: {
139
+ readonly app: "Application key (oauth_client.metadata.app).";
140
+ };
141
+ readonly notFound: "No application with that app key";
142
+ readonly input: z.ZodObject<{
143
+ permissions: z.ZodArray<z.ZodString>;
144
+ }, z.core.$strip>;
145
+ readonly successCode: "200";
146
+ readonly success: z.ZodObject<{
147
+ permissions: z.ZodArray<z.ZodString>;
148
+ }, z.core.$strip>;
149
+ };
150
+ readonly "get /api/v1/apps/{app}/keys": {
151
+ readonly summary: "List scoped management API keys (never the hashes)";
152
+ readonly permission: "apikey:read";
153
+ readonly params: {
154
+ readonly app: "Application key (oauth_client.metadata.app).";
155
+ };
156
+ readonly successCode: "200";
157
+ readonly success: z.ZodObject<{
158
+ keys: z.ZodArray<z.ZodObject<{
159
+ id: z.ZodString;
160
+ name: z.ZodString;
161
+ prefix: z.ZodString;
162
+ permissions: z.ZodArray<z.ZodString>;
163
+ status: z.ZodEnum<{
164
+ active: "active";
165
+ expired: "expired";
166
+ revoked: "revoked";
167
+ }>;
168
+ createdAt: z.ZodString;
169
+ lastUsedAt: z.ZodNullable<z.ZodString>;
170
+ expiresAt: z.ZodNullable<z.ZodString>;
171
+ revokedAt: z.ZodNullable<z.ZodString>;
172
+ }, z.core.$strip>>;
173
+ }, z.core.$strip>;
174
+ };
175
+ readonly "post /api/v1/apps/{app}/keys": {
176
+ readonly summary: "Mint a scoped management API key (plaintext returned once)";
177
+ readonly description: "Requires `apikey:create` on the path app (or the superadmin token). The requested permissions must be a subset of the caller's own, otherwise 403 `permissions_exceed_caller` — without that rule any key holding `apikey:create` could mint itself a more powerful successor.";
178
+ readonly permission: "apikey:create";
179
+ readonly params: {
180
+ readonly app: "Application key (oauth_client.metadata.app).";
181
+ };
182
+ readonly input: z.ZodObject<{
183
+ name: z.ZodString;
184
+ permissions: z.ZodArray<z.ZodString>;
185
+ expiresAt: z.ZodOptional<z.ZodISODateTime>;
186
+ }, z.core.$strip>;
187
+ readonly successCode: "201";
188
+ readonly success: z.ZodObject<{
189
+ id: z.ZodString;
190
+ token: z.ZodString;
191
+ prefix: z.ZodString;
192
+ }, z.core.$strip>;
193
+ };
194
+ readonly "delete /api/v1/apps/{app}/keys/{id}": {
195
+ readonly summary: "Revoke a scoped management API key (idempotent)";
196
+ readonly permission: "apikey:revoke";
197
+ readonly params: {
198
+ readonly app: "Application key (oauth_client.metadata.app).";
199
+ };
200
+ readonly notFound: "No key with that id on this app";
201
+ readonly successCode: "200";
202
+ readonly success: z.ZodObject<{
203
+ ok: z.ZodLiteral<true>;
204
+ }, z.core.$strip>;
205
+ };
206
+ readonly "get /api/v1/admin-keys": {
207
+ readonly summary: "List IdP-level admin keys (never the hashes)";
208
+ readonly description: "Requires the superadmin token or an admin key. Admin keys are `api_key` rows with no application scope, so they hold every permission on every app.";
209
+ readonly successCode: "200";
210
+ readonly success: z.ZodObject<{
211
+ keys: z.ZodArray<z.ZodObject<{
212
+ id: z.ZodString;
213
+ name: z.ZodString;
214
+ prefix: z.ZodString;
215
+ status: z.ZodEnum<{
216
+ active: "active";
217
+ expired: "expired";
218
+ revoked: "revoked";
219
+ }>;
220
+ createdAt: z.ZodString;
221
+ lastUsedAt: z.ZodNullable<z.ZodString>;
222
+ expiresAt: z.ZodNullable<z.ZodString>;
223
+ revokedAt: z.ZodNullable<z.ZodString>;
224
+ }, z.core.$strip>>;
225
+ }, z.core.$strip>;
226
+ };
227
+ readonly "post /api/v1/admin-keys": {
228
+ readonly summary: "Mint an IdP-level admin key (plaintext returned once)";
229
+ readonly description: "Requires the superadmin token or an admin key. Mint one per agent: unlike the static ADMIN_API_TOKEN, an admin key has a name, an optional expiry, a revoke switch, and its own `adminkey:<id>` identity in the audit log.";
230
+ readonly input: z.ZodObject<{
231
+ name: z.ZodString;
232
+ expiresAt: z.ZodOptional<z.ZodISODateTime>;
233
+ }, z.core.$strip>;
234
+ readonly successCode: "201";
235
+ readonly success: z.ZodObject<{
236
+ id: z.ZodString;
237
+ token: z.ZodString;
238
+ prefix: z.ZodString;
239
+ }, z.core.$strip>;
240
+ };
241
+ readonly "delete /api/v1/admin-keys/{id}": {
242
+ readonly summary: "Revoke an IdP-level admin key (idempotent)";
243
+ readonly description: "A key may revoke itself — an agent cleaning up after itself is legitimate — after which its next request is simply unauthorized.";
244
+ readonly params: {
245
+ readonly id: "Admin key id.";
246
+ };
247
+ readonly notFound: "No admin key with that id";
248
+ readonly successCode: "200";
249
+ readonly success: z.ZodObject<{
250
+ ok: z.ZodLiteral<true>;
251
+ }, z.core.$strip>;
252
+ };
253
+ readonly "get /api/v1/users": {
254
+ readonly summary: "List users";
255
+ readonly successCode: "200";
256
+ readonly success: z.ZodObject<{
257
+ users: z.ZodArray<z.ZodObject<{
258
+ id: z.ZodString;
259
+ email: z.ZodString;
260
+ name: z.ZodNullable<z.ZodString>;
261
+ emailVerified: z.ZodBoolean;
262
+ createdAt: z.ZodString;
263
+ }, z.core.$strip>>;
264
+ }, z.core.$strip>;
265
+ };
266
+ readonly "get /api/v1/workspaces": {
267
+ readonly summary: "List workspaces";
268
+ readonly successCode: "200";
269
+ readonly success: z.ZodObject<{
270
+ workspaces: z.ZodArray<z.ZodObject<{
271
+ id: z.ZodString;
272
+ name: z.ZodString;
273
+ slug: z.ZodString;
274
+ applicationId: z.ZodNullable<z.ZodString>;
275
+ createdAt: z.ZodString;
276
+ }, z.core.$strip>>;
277
+ }, z.core.$strip>;
278
+ };
279
+ readonly "get /api/v1/apps/{app}/members": {
280
+ readonly summary: "List app members";
281
+ readonly permission: "member:read";
282
+ readonly params: {
283
+ readonly app: "Application key (oauth_client.metadata.app).";
284
+ };
285
+ readonly successCode: "200";
286
+ readonly success: z.ZodObject<{
287
+ members: z.ZodArray<z.ZodObject<{
288
+ userId: z.ZodString;
289
+ email: z.ZodString;
290
+ name: z.ZodNullable<z.ZodString>;
291
+ role: z.ZodEnum<{
292
+ admin: "admin";
293
+ member: "member";
294
+ }>;
295
+ permissions: z.ZodArray<z.ZodString>;
296
+ }, z.core.$strip>>;
297
+ }, z.core.$strip>;
298
+ };
299
+ readonly "post /api/v1/apps/{app}/members": {
300
+ readonly summary: "Add or invite a member";
301
+ readonly permission: "member:invite";
302
+ readonly params: {
303
+ readonly app: "Application key (oauth_client.metadata.app).";
304
+ };
305
+ readonly input: z.ZodObject<{
306
+ email: z.ZodString;
307
+ role: z.ZodDefault<z.ZodEnum<{
308
+ admin: "admin";
309
+ member: "member";
310
+ }>>;
311
+ permissions: z.ZodDefault<z.ZodArray<z.ZodString>>;
312
+ }, z.core.$strip>;
313
+ readonly successCode: "201";
314
+ readonly success: z.ZodObject<{
315
+ result: z.ZodEnum<{
316
+ added: "added";
317
+ invited: "invited";
318
+ }>;
319
+ }, z.core.$strip>;
320
+ };
321
+ readonly "patch /api/v1/apps/{app}/members/{userId}": {
322
+ readonly summary: "Update a member's role + permissions";
323
+ readonly permission: "member:manage";
324
+ readonly params: {
325
+ readonly app: "Application key (oauth_client.metadata.app).";
326
+ };
327
+ readonly input: z.ZodObject<{
328
+ role: z.ZodEnum<{
329
+ admin: "admin";
330
+ member: "member";
331
+ }>;
332
+ permissions: z.ZodDefault<z.ZodArray<z.ZodString>>;
333
+ }, z.core.$strip>;
334
+ readonly successCode: "200";
335
+ readonly success: z.ZodObject<{
336
+ ok: z.ZodLiteral<true>;
337
+ }, z.core.$strip>;
338
+ };
339
+ readonly "delete /api/v1/apps/{app}/members/{userId}": {
340
+ readonly summary: "Remove a member";
341
+ readonly permission: "member:manage";
342
+ readonly params: {
343
+ readonly app: "Application key (oauth_client.metadata.app).";
344
+ };
345
+ readonly successCode: "200";
346
+ readonly success: z.ZodObject<{
347
+ ok: z.ZodLiteral<true>;
348
+ }, z.core.$strip>;
349
+ };
350
+ readonly "get /api/v1/apps/{app}/workspaces": {
351
+ readonly summary: "List app workspaces";
352
+ readonly permission: "workspace:read";
353
+ readonly params: {
354
+ readonly app: "Application key (oauth_client.metadata.app).";
355
+ };
356
+ readonly successCode: "200";
357
+ readonly success: z.ZodObject<{
358
+ workspaces: z.ZodArray<z.ZodObject<{
359
+ id: z.ZodString;
360
+ name: z.ZodString;
361
+ slug: z.ZodString;
362
+ applicationId: z.ZodNullable<z.ZodString>;
363
+ createdAt: z.ZodString;
364
+ }, z.core.$strip>>;
365
+ }, z.core.$strip>;
366
+ };
367
+ readonly "post /api/v1/apps/{app}/workspaces": {
368
+ readonly summary: "Create a workspace";
369
+ readonly permission: "workspace:create";
370
+ readonly params: {
371
+ readonly app: "Application key (oauth_client.metadata.app).";
372
+ };
373
+ readonly input: z.ZodObject<{
374
+ name: z.ZodString;
375
+ slug: z.ZodString;
376
+ }, z.core.$strip>;
377
+ readonly successCode: "201";
378
+ readonly success: z.ZodObject<{
379
+ id: z.ZodString;
380
+ name: z.ZodString;
381
+ slug: z.ZodString;
382
+ }, z.core.$strip>;
383
+ };
384
+ readonly "get /api/v1/apps/{app}/user-keys": {
385
+ readonly summary: "List end-user API keys";
386
+ readonly permission: "userkey:read";
387
+ readonly params: {
388
+ readonly app: "Application key (oauth_client.metadata.app).";
389
+ };
390
+ readonly query: readonly [{
391
+ readonly name: "userId";
392
+ readonly description: "Only keys owned by this user.";
393
+ }, {
394
+ readonly name: "workspaceId";
395
+ readonly description: "Only keys bound to this workspace.";
396
+ }];
397
+ readonly successCode: "200";
398
+ readonly success: z.ZodObject<{
399
+ keys: z.ZodArray<z.ZodObject<{
400
+ id: z.ZodString;
401
+ userId: z.ZodString;
402
+ workspaceId: z.ZodNullable<z.ZodString>;
403
+ name: z.ZodString;
404
+ prefix: z.ZodString;
405
+ scopes: z.ZodArray<z.ZodString>;
406
+ status: z.ZodEnum<{
407
+ active: "active";
408
+ expired: "expired";
409
+ revoked: "revoked";
410
+ }>;
411
+ createdAt: z.ZodString;
412
+ lastUsedAt: z.ZodNullable<z.ZodString>;
413
+ expiresAt: z.ZodNullable<z.ZodString>;
414
+ }, z.core.$strip>>;
415
+ }, z.core.$strip>;
416
+ };
417
+ readonly "post /api/v1/apps/{app}/user-keys": {
418
+ readonly summary: "Mint an end-user API key (plaintext returned once)";
419
+ readonly permission: "userkey:create";
420
+ readonly params: {
421
+ readonly app: "Application key (oauth_client.metadata.app).";
422
+ };
423
+ readonly input: z.ZodObject<{
424
+ userId: z.ZodString;
425
+ name: z.ZodString;
426
+ scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
427
+ workspaceId: z.ZodOptional<z.ZodString>;
428
+ expiresAt: z.ZodOptional<z.ZodISODateTime>;
429
+ }, z.core.$strip>;
430
+ readonly successCode: "201";
431
+ readonly success: z.ZodObject<{
432
+ id: z.ZodString;
433
+ token: z.ZodString;
434
+ prefix: z.ZodString;
435
+ }, z.core.$strip>;
436
+ };
437
+ readonly "post /api/v1/apps/{app}/user-keys/validate": {
438
+ readonly summary: "Validate a presented end-user key (200 + valid discriminator)";
439
+ readonly permission: "userkey:validate";
440
+ readonly params: {
441
+ readonly app: "Application key (oauth_client.metadata.app).";
442
+ };
443
+ readonly input: z.ZodObject<{
444
+ token: z.ZodString;
445
+ }, z.core.$strip>;
446
+ readonly successCode: "200";
447
+ readonly success: z.ZodUnion<readonly [z.ZodObject<{
448
+ valid: z.ZodLiteral<true>;
449
+ keyId: z.ZodString;
450
+ userId: z.ZodString;
451
+ workspaceId: z.ZodNullable<z.ZodString>;
452
+ scopes: z.ZodArray<z.ZodString>;
453
+ name: z.ZodString;
454
+ }, z.core.$strip>, z.ZodObject<{
455
+ valid: z.ZodLiteral<false>;
456
+ reason: z.ZodEnum<{
457
+ expired: "expired";
458
+ revoked: "revoked";
459
+ not_found: "not_found";
460
+ }>;
461
+ }, z.core.$strip>]>;
462
+ };
463
+ readonly "delete /api/v1/apps/{app}/user-keys/{id}": {
464
+ readonly summary: "Revoke an end-user API key (idempotent)";
465
+ readonly permission: "userkey:revoke";
466
+ readonly params: {
467
+ readonly app: "Application key (oauth_client.metadata.app).";
468
+ };
469
+ readonly successCode: "200";
470
+ readonly success: z.ZodObject<{
471
+ ok: z.ZodLiteral<true>;
472
+ }, z.core.$strip>;
473
+ };
474
+ readonly "get /api/v1/apps/{app}/audit": {
475
+ readonly summary: "List recent audit entries";
476
+ readonly permission: "audit:read";
477
+ readonly params: {
478
+ readonly app: "Application key (oauth_client.metadata.app).";
479
+ };
480
+ readonly successCode: "200";
481
+ readonly success: z.ZodObject<{
482
+ entries: z.ZodArray<z.ZodObject<{
483
+ id: z.ZodNumber;
484
+ tableName: z.ZodString;
485
+ operation: z.ZodString;
486
+ rowId: z.ZodNullable<z.ZodString>;
487
+ userId: z.ZodNullable<z.ZodString>;
488
+ actor: z.ZodNullable<z.ZodString>;
489
+ createdAt: z.ZodString;
490
+ }, z.core.$strip>>;
491
+ }, z.core.$strip>;
492
+ };
493
+ };
494
+ export type Operations = typeof operations;
495
+ export type OperationKey = keyof Operations;
496
+ /** `"get /api/v1/users"` -> the paths that declare that method. */
497
+ export type PathsFor<M extends HttpMethod> = OperationKey extends infer K ? K extends `${M} ${infer P}` ? P : never : never;
498
+ export type OperationFor<M extends HttpMethod, P extends string> = `${M} ${P}` extends OperationKey ? Operations[`${M} ${P}`] : never;
499
+ /** Path parameters read straight off the path template — `{app}`, `{userId}`. */
500
+ export type PathParamNames<P extends string> = P extends `${string}{${infer Name}}${infer Rest}` ? Name | PathParamNames<Rest> : never;
501
+ export declare function lookup(method: string, path: string): OperationDef | undefined;
502
+ //# sourceMappingURL=operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../src/schemas/operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAkCvB,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;AAEpE,iFAAiF;AACjF,MAAM,MAAM,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAEnF,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,SAAS,UAAU,EAAE,CAAA;IAC7B,wEAAwE;IACxE,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IACzC,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAA;IACjB,WAAW,EAAE,KAAK,GAAG,KAAK,CAAA;IAC1B,OAAO,EAAE,CAAC,CAAC,OAAO,CAAA;CACnB,CAAA;AAKD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6M0B,CAAA;AAEjD,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAA;AAC1C,MAAM,MAAM,YAAY,GAAG,MAAM,UAAU,CAAA;AAE3C,mEAAmE;AACnE,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,UAAU,IAAI,YAAY,SAAS,MAAM,CAAC,GACrE,CAAC,SAAS,GAAG,CAAC,IAAI,MAAM,CAAC,EAAE,GACzB,CAAC,GACD,KAAK,GACP,KAAK,CAAA;AAET,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,EAAE,SAAS,YAAY,GAC/F,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GACvB,KAAK,CAAA;AAET,iFAAiF;AACjF,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,GAAG,MAAM,IAAI,MAAM,IAAI,IAAI,MAAM,IAAI,EAAE,GAC5F,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,GAC3B,KAAK,CAAA;AAET,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAE7E"}