@sylphx/contract 0.2.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/endpoint.d.ts +6 -0
- package/dist/endpoint.d.ts.map +1 -1
- package/dist/endpoints/admin-projects.d.ts +29 -0
- package/dist/endpoints/admin-projects.d.ts.map +1 -1
- package/dist/endpoints/admin-projects.js +30 -1
- package/dist/endpoints/auth.d.ts +47 -0
- package/dist/endpoints/auth.d.ts.map +1 -1
- package/dist/endpoints/auth.js +19 -1
- package/dist/endpoints/branch-databases.d.ts +27 -28
- package/dist/endpoints/branch-databases.d.ts.map +1 -1
- package/dist/endpoints/branch-databases.js +7 -7
- package/dist/endpoints/databases.d.ts +253 -3
- package/dist/endpoints/databases.d.ts.map +1 -1
- package/dist/endpoints/databases.js +19 -12
- package/dist/endpoints/organizations.d.ts +11 -0
- package/dist/endpoints/organizations.d.ts.map +1 -1
- package/dist/endpoints/organizations.js +8 -1
- package/dist/endpoints/project-manifest.d.ts +26 -18
- package/dist/endpoints/project-manifest.d.ts.map +1 -1
- package/dist/endpoints/secrets.d.ts +6 -6
- package/dist/endpoints/secrets.d.ts.map +1 -1
- package/dist/endpoints/secrets.js +6 -5
- package/dist/endpoints/storage.d.ts +183 -125
- package/dist/endpoints/storage.d.ts.map +1 -1
- package/dist/endpoints/storage.js +96 -59
- package/dist/index.d.ts +323 -164
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/schemas/admin-projects.d.ts +20 -0
- package/dist/schemas/admin-projects.d.ts.map +1 -1
- package/dist/schemas/admin-projects.js +17 -0
- package/dist/schemas/auth.d.ts +65 -0
- package/dist/schemas/auth.d.ts.map +1 -1
- package/dist/schemas/auth.js +32 -0
- package/dist/schemas/branch-database.d.ts +20 -19
- package/dist/schemas/branch-database.d.ts.map +1 -1
- package/dist/schemas/branch-database.js +9 -7
- package/dist/schemas/ids.d.ts +2 -0
- package/dist/schemas/ids.d.ts.map +1 -1
- package/dist/schemas/ids.js +1 -0
- package/dist/schemas/organization.d.ts +24 -2
- package/dist/schemas/organization.d.ts.map +1 -1
- package/dist/schemas/organization.js +13 -1
- package/dist/schemas/project-manifest.d.ts +43 -21
- package/dist/schemas/project-manifest.d.ts.map +1 -1
- package/dist/schemas/project-manifest.js +11 -3
- package/dist/schemas/secret.d.ts +1 -1
- package/dist/schemas/secret.js +2 -2
- package/dist/schemas/storage.d.ts +259 -203
- package/dist/schemas/storage.d.ts.map +1 -1
- package/dist/schemas/storage.js +159 -144
- package/package.json +5 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Managed resource endpoints — surfaced through the unified `/resources`
|
|
3
|
+
* router. Backups/restore/branch are database-only; bindings apply to every
|
|
4
|
+
* resource kind.
|
|
5
5
|
*/
|
|
6
6
|
import { Schema } from 'effect';
|
|
7
7
|
export declare const databasesEndpoints: {
|
|
@@ -248,4 +248,254 @@ export declare const databasesEndpoints: {
|
|
|
248
248
|
success: typeof Schema.Boolean;
|
|
249
249
|
}>>;
|
|
250
250
|
};
|
|
251
|
+
/**
|
|
252
|
+
* Canonical name for the unified `/resources` contract group.
|
|
253
|
+
*
|
|
254
|
+
* `databasesEndpoints` remains for database-specific callers; new generic
|
|
255
|
+
* resource surfaces should import `resourcesEndpoints`.
|
|
256
|
+
*/
|
|
257
|
+
export declare const resourcesEndpoints: {
|
|
258
|
+
readonly list: import("../endpoint.js").Endpoint<"GET", "/resources", Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
259
|
+
kind: Schema.optional<typeof Schema.String>;
|
|
260
|
+
}>, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
261
|
+
data: Schema.Array$<Schema.Struct<{
|
|
262
|
+
id: Schema.brand<Schema.filter<typeof Schema.String>, "DatabaseId">;
|
|
263
|
+
name: typeof Schema.String;
|
|
264
|
+
slug: Schema.optional<typeof Schema.String>;
|
|
265
|
+
status: typeof Schema.String;
|
|
266
|
+
kind: Schema.optional<typeof Schema.String>;
|
|
267
|
+
tier: typeof Schema.String;
|
|
268
|
+
host: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
269
|
+
directHost: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
270
|
+
port: Schema.optional<typeof Schema.Number>;
|
|
271
|
+
publicPort: Schema.optional<Schema.NullOr<typeof Schema.Number>>;
|
|
272
|
+
dbUser: Schema.optional<typeof Schema.String>;
|
|
273
|
+
dbName: Schema.optional<typeof Schema.String>;
|
|
274
|
+
connectionString: Schema.optional<typeof Schema.String>;
|
|
275
|
+
storageGb: Schema.optional<typeof Schema.Number>;
|
|
276
|
+
env: Schema.optional<typeof Schema.String>;
|
|
277
|
+
engine: Schema.optional<typeof Schema.String>;
|
|
278
|
+
instances: Schema.optional<typeof Schema.Number>;
|
|
279
|
+
clusterName: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
280
|
+
branchName: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
281
|
+
provider: Schema.optional<typeof Schema.String>;
|
|
282
|
+
backupRetentionDays: Schema.optional<typeof Schema.Number>;
|
|
283
|
+
reconcileStatus: Schema.optional<typeof Schema.String>;
|
|
284
|
+
config: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>>;
|
|
285
|
+
createdAt: Schema.optional<typeof Schema.String>;
|
|
286
|
+
updatedAt: Schema.optional<typeof Schema.String>;
|
|
287
|
+
}>>;
|
|
288
|
+
}>>;
|
|
289
|
+
readonly create: import("../endpoint.js").Endpoint<"POST", "/resources", Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
290
|
+
name: typeof Schema.String;
|
|
291
|
+
kind: Schema.Literal<["database", "kv", "blob", "search", "volume"]>;
|
|
292
|
+
provider: Schema.optional<typeof Schema.String>;
|
|
293
|
+
tier: Schema.optional<typeof Schema.String>;
|
|
294
|
+
env: Schema.optional<typeof Schema.String>;
|
|
295
|
+
storageGb: Schema.optional<typeof Schema.Number>;
|
|
296
|
+
maxMemoryMb: Schema.optional<typeof Schema.Number>;
|
|
297
|
+
nodes: Schema.optional<typeof Schema.Number>;
|
|
298
|
+
bucket: Schema.optional<typeof Schema.String>;
|
|
299
|
+
endpoint: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
300
|
+
region: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
301
|
+
accessKeyEncrypted: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
302
|
+
secretKeyEncrypted: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
303
|
+
accessMode: Schema.optional<Schema.Literal<["ReadWriteOnce", "ReadWriteMany"]>>;
|
|
304
|
+
sizeGb: Schema.optional<Schema.NullOr<typeof Schema.Number>>;
|
|
305
|
+
mountPath: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
306
|
+
config: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
307
|
+
}>, Schema.Struct<{
|
|
308
|
+
id: Schema.brand<Schema.filter<typeof Schema.String>, "DatabaseId">;
|
|
309
|
+
name: typeof Schema.String;
|
|
310
|
+
slug: Schema.optional<typeof Schema.String>;
|
|
311
|
+
status: typeof Schema.String;
|
|
312
|
+
kind: Schema.optional<typeof Schema.String>;
|
|
313
|
+
tier: typeof Schema.String;
|
|
314
|
+
host: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
315
|
+
directHost: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
316
|
+
port: Schema.optional<typeof Schema.Number>;
|
|
317
|
+
publicPort: Schema.optional<Schema.NullOr<typeof Schema.Number>>;
|
|
318
|
+
dbUser: Schema.optional<typeof Schema.String>;
|
|
319
|
+
dbName: Schema.optional<typeof Schema.String>;
|
|
320
|
+
connectionString: Schema.optional<typeof Schema.String>;
|
|
321
|
+
storageGb: Schema.optional<typeof Schema.Number>;
|
|
322
|
+
env: Schema.optional<typeof Schema.String>;
|
|
323
|
+
engine: Schema.optional<typeof Schema.String>;
|
|
324
|
+
instances: Schema.optional<typeof Schema.Number>;
|
|
325
|
+
clusterName: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
326
|
+
branchName: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
327
|
+
provider: Schema.optional<typeof Schema.String>;
|
|
328
|
+
backupRetentionDays: Schema.optional<typeof Schema.Number>;
|
|
329
|
+
reconcileStatus: Schema.optional<typeof Schema.String>;
|
|
330
|
+
config: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>>;
|
|
331
|
+
createdAt: Schema.optional<typeof Schema.String>;
|
|
332
|
+
updatedAt: Schema.optional<typeof Schema.String>;
|
|
333
|
+
}>>;
|
|
334
|
+
readonly get: import("../endpoint.js").Endpoint<"GET", "/resources/:id", Schema.Struct<{
|
|
335
|
+
id: typeof Schema.String;
|
|
336
|
+
}>, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
337
|
+
id: Schema.brand<Schema.filter<typeof Schema.String>, "DatabaseId">;
|
|
338
|
+
name: typeof Schema.String;
|
|
339
|
+
slug: Schema.optional<typeof Schema.String>;
|
|
340
|
+
status: typeof Schema.String;
|
|
341
|
+
kind: Schema.optional<typeof Schema.String>;
|
|
342
|
+
tier: typeof Schema.String;
|
|
343
|
+
host: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
344
|
+
directHost: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
345
|
+
port: Schema.optional<typeof Schema.Number>;
|
|
346
|
+
publicPort: Schema.optional<Schema.NullOr<typeof Schema.Number>>;
|
|
347
|
+
dbUser: Schema.optional<typeof Schema.String>;
|
|
348
|
+
dbName: Schema.optional<typeof Schema.String>;
|
|
349
|
+
connectionString: Schema.optional<typeof Schema.String>;
|
|
350
|
+
storageGb: Schema.optional<typeof Schema.Number>;
|
|
351
|
+
env: Schema.optional<typeof Schema.String>;
|
|
352
|
+
engine: Schema.optional<typeof Schema.String>;
|
|
353
|
+
instances: Schema.optional<typeof Schema.Number>;
|
|
354
|
+
clusterName: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
355
|
+
branchName: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
356
|
+
provider: Schema.optional<typeof Schema.String>;
|
|
357
|
+
backupRetentionDays: Schema.optional<typeof Schema.Number>;
|
|
358
|
+
reconcileStatus: Schema.optional<typeof Schema.String>;
|
|
359
|
+
config: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>>;
|
|
360
|
+
createdAt: Schema.optional<typeof Schema.String>;
|
|
361
|
+
updatedAt: Schema.optional<typeof Schema.String>;
|
|
362
|
+
}>>;
|
|
363
|
+
readonly update: import("../endpoint.js").Endpoint<"PATCH", "/resources/:id", Schema.Struct<{
|
|
364
|
+
id: typeof Schema.String;
|
|
365
|
+
}>, Schema.Schema.AnyNoContext | undefined, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>, Schema.Struct<{
|
|
366
|
+
id: Schema.brand<Schema.filter<typeof Schema.String>, "DatabaseId">;
|
|
367
|
+
name: typeof Schema.String;
|
|
368
|
+
slug: Schema.optional<typeof Schema.String>;
|
|
369
|
+
status: typeof Schema.String;
|
|
370
|
+
kind: Schema.optional<typeof Schema.String>;
|
|
371
|
+
tier: typeof Schema.String;
|
|
372
|
+
host: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
373
|
+
directHost: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
374
|
+
port: Schema.optional<typeof Schema.Number>;
|
|
375
|
+
publicPort: Schema.optional<Schema.NullOr<typeof Schema.Number>>;
|
|
376
|
+
dbUser: Schema.optional<typeof Schema.String>;
|
|
377
|
+
dbName: Schema.optional<typeof Schema.String>;
|
|
378
|
+
connectionString: Schema.optional<typeof Schema.String>;
|
|
379
|
+
storageGb: Schema.optional<typeof Schema.Number>;
|
|
380
|
+
env: Schema.optional<typeof Schema.String>;
|
|
381
|
+
engine: Schema.optional<typeof Schema.String>;
|
|
382
|
+
instances: Schema.optional<typeof Schema.Number>;
|
|
383
|
+
clusterName: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
384
|
+
branchName: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
385
|
+
provider: Schema.optional<typeof Schema.String>;
|
|
386
|
+
backupRetentionDays: Schema.optional<typeof Schema.Number>;
|
|
387
|
+
reconcileStatus: Schema.optional<typeof Schema.String>;
|
|
388
|
+
config: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>>;
|
|
389
|
+
createdAt: Schema.optional<typeof Schema.String>;
|
|
390
|
+
updatedAt: Schema.optional<typeof Schema.String>;
|
|
391
|
+
}>>;
|
|
392
|
+
readonly delete: import("../endpoint.js").Endpoint<"DELETE", "/resources/:id", Schema.Struct<{
|
|
393
|
+
id: typeof Schema.String;
|
|
394
|
+
}>, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
395
|
+
success: Schema.optional<typeof Schema.Boolean>;
|
|
396
|
+
}>>;
|
|
397
|
+
readonly metrics: import("../endpoint.js").Endpoint<"GET", "/resources/:id/metrics", Schema.Struct<{
|
|
398
|
+
id: typeof Schema.String;
|
|
399
|
+
}>, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
400
|
+
readonly backups: import("../endpoint.js").Endpoint<"GET", "/resources/:id/backups", Schema.Struct<{
|
|
401
|
+
id: typeof Schema.String;
|
|
402
|
+
}>, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
403
|
+
backups: Schema.Array$<Schema.Struct<{
|
|
404
|
+
name: typeof Schema.String;
|
|
405
|
+
startedAt: Schema.NullOr<typeof Schema.String>;
|
|
406
|
+
completedAt: Schema.NullOr<typeof Schema.String>;
|
|
407
|
+
status: typeof Schema.String;
|
|
408
|
+
method: typeof Schema.String;
|
|
409
|
+
}>>;
|
|
410
|
+
available: typeof Schema.Boolean;
|
|
411
|
+
reason: Schema.optional<typeof Schema.String>;
|
|
412
|
+
}>>;
|
|
413
|
+
readonly restore: import("../endpoint.js").Endpoint<"POST", "/resources/:id/restore", Schema.Struct<{
|
|
414
|
+
id: typeof Schema.String;
|
|
415
|
+
}>, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
416
|
+
targetTime: typeof Schema.String;
|
|
417
|
+
}>, Schema.Struct<{
|
|
418
|
+
restored: typeof Schema.Boolean;
|
|
419
|
+
resourceId: Schema.optional<typeof Schema.String>;
|
|
420
|
+
clusterName: Schema.optional<typeof Schema.String>;
|
|
421
|
+
targetTime: Schema.optional<typeof Schema.String>;
|
|
422
|
+
message: Schema.optional<typeof Schema.String>;
|
|
423
|
+
}>>;
|
|
424
|
+
readonly restoreInPlace: import("../endpoint.js").Endpoint<"POST", "/resources/:id/restore-in-place", Schema.Struct<{
|
|
425
|
+
id: typeof Schema.String;
|
|
426
|
+
}>, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
427
|
+
targetTime: typeof Schema.String;
|
|
428
|
+
}>, Schema.Struct<{
|
|
429
|
+
restored: typeof Schema.Boolean;
|
|
430
|
+
resourceId: Schema.optional<typeof Schema.String>;
|
|
431
|
+
clusterName: Schema.optional<typeof Schema.String>;
|
|
432
|
+
targetTime: Schema.optional<typeof Schema.String>;
|
|
433
|
+
message: Schema.optional<typeof Schema.String>;
|
|
434
|
+
}>>;
|
|
435
|
+
readonly branch: import("../endpoint.js").Endpoint<"POST", "/resources/:id/branch", Schema.Struct<{
|
|
436
|
+
id: typeof Schema.String;
|
|
437
|
+
}>, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
438
|
+
name: Schema.optional<typeof Schema.String>;
|
|
439
|
+
env: Schema.optional<typeof Schema.String>;
|
|
440
|
+
fast: Schema.optional<typeof Schema.Boolean>;
|
|
441
|
+
sourceEnvironmentId: Schema.optional<typeof Schema.String>;
|
|
442
|
+
targetEnvironmentId: Schema.optional<typeof Schema.String>;
|
|
443
|
+
}>, Schema.Struct<{
|
|
444
|
+
id: Schema.brand<Schema.filter<typeof Schema.String>, "DatabaseId">;
|
|
445
|
+
name: typeof Schema.String;
|
|
446
|
+
slug: Schema.optional<typeof Schema.String>;
|
|
447
|
+
status: typeof Schema.String;
|
|
448
|
+
kind: Schema.optional<typeof Schema.String>;
|
|
449
|
+
tier: typeof Schema.String;
|
|
450
|
+
host: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
451
|
+
directHost: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
452
|
+
port: Schema.optional<typeof Schema.Number>;
|
|
453
|
+
publicPort: Schema.optional<Schema.NullOr<typeof Schema.Number>>;
|
|
454
|
+
dbUser: Schema.optional<typeof Schema.String>;
|
|
455
|
+
dbName: Schema.optional<typeof Schema.String>;
|
|
456
|
+
connectionString: Schema.optional<typeof Schema.String>;
|
|
457
|
+
storageGb: Schema.optional<typeof Schema.Number>;
|
|
458
|
+
env: Schema.optional<typeof Schema.String>;
|
|
459
|
+
engine: Schema.optional<typeof Schema.String>;
|
|
460
|
+
instances: Schema.optional<typeof Schema.Number>;
|
|
461
|
+
clusterName: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
462
|
+
branchName: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
463
|
+
provider: Schema.optional<typeof Schema.String>;
|
|
464
|
+
backupRetentionDays: Schema.optional<typeof Schema.Number>;
|
|
465
|
+
reconcileStatus: Schema.optional<typeof Schema.String>;
|
|
466
|
+
config: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>>;
|
|
467
|
+
createdAt: Schema.optional<typeof Schema.String>;
|
|
468
|
+
updatedAt: Schema.optional<typeof Schema.String>;
|
|
469
|
+
}>>;
|
|
470
|
+
readonly listBindings: import("../endpoint.js").Endpoint<"GET", "/resources/:id/bindings", Schema.Struct<{
|
|
471
|
+
id: typeof Schema.String;
|
|
472
|
+
}>, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
473
|
+
bindings: Schema.Array$<Schema.Struct<{
|
|
474
|
+
id: typeof Schema.String;
|
|
475
|
+
resourceId: typeof Schema.String;
|
|
476
|
+
projectEnvironmentId: typeof Schema.String;
|
|
477
|
+
role: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
478
|
+
createdAt: Schema.optional<typeof Schema.String>;
|
|
479
|
+
}>>;
|
|
480
|
+
}>>;
|
|
481
|
+
readonly createBinding: import("../endpoint.js").Endpoint<"POST", "/resources/:id/bindings", Schema.Struct<{
|
|
482
|
+
id: typeof Schema.String;
|
|
483
|
+
}>, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
484
|
+
projectEnvironmentId: Schema.optional<typeof Schema.String>;
|
|
485
|
+
environmentId: Schema.optional<typeof Schema.String>;
|
|
486
|
+
role: Schema.optional<typeof Schema.String>;
|
|
487
|
+
}>, Schema.Struct<{
|
|
488
|
+
id: typeof Schema.String;
|
|
489
|
+
resourceId: typeof Schema.String;
|
|
490
|
+
projectEnvironmentId: typeof Schema.String;
|
|
491
|
+
role: Schema.optional<Schema.NullOr<typeof Schema.String>>;
|
|
492
|
+
createdAt: Schema.optional<typeof Schema.String>;
|
|
493
|
+
}>>;
|
|
494
|
+
readonly deleteBinding: import("../endpoint.js").Endpoint<"DELETE", "/resources/:id/bindings/:bindingId", Schema.Struct<{
|
|
495
|
+
id: typeof Schema.String;
|
|
496
|
+
bindingId: typeof Schema.String;
|
|
497
|
+
}>, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
498
|
+
success: typeof Schema.Boolean;
|
|
499
|
+
}>>;
|
|
500
|
+
};
|
|
251
501
|
//# sourceMappingURL=databases.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"databases.d.ts","sourceRoot":"","sources":["../../src/endpoints/databases.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AA8C/B,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8GrB,CAAA"}
|
|
1
|
+
{"version":3,"file":"databases.d.ts","sourceRoot":"","sources":["../../src/endpoints/databases.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AA8C/B,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8GrB,CAAA;AAEV;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAqB,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Managed resource endpoints — surfaced through the unified `/resources`
|
|
3
|
+
* router. Backups/restore/branch are database-only; bindings apply to every
|
|
4
|
+
* resource kind.
|
|
5
5
|
*/
|
|
6
6
|
import { Schema } from 'effect';
|
|
7
7
|
import { defineEndpoint } from '../endpoint.js';
|
|
@@ -44,7 +44,7 @@ export const databasesEndpoints = {
|
|
|
44
44
|
query: KindQuery,
|
|
45
45
|
response: Schema.Struct({ data: Schema.Array(Database) }),
|
|
46
46
|
summary: 'List resources (filter via ?kind=database|kv|blob|search|volume)',
|
|
47
|
-
tags: ['
|
|
47
|
+
tags: ['resources'],
|
|
48
48
|
}),
|
|
49
49
|
create: defineEndpoint({
|
|
50
50
|
method: 'POST',
|
|
@@ -52,7 +52,7 @@ export const databasesEndpoints = {
|
|
|
52
52
|
body: CreateResourceBody,
|
|
53
53
|
response: Database,
|
|
54
54
|
summary: 'Provision a new resource (database|kv|blob|search|volume — async, 202)',
|
|
55
|
-
tags: ['
|
|
55
|
+
tags: ['resources'],
|
|
56
56
|
}),
|
|
57
57
|
get: defineEndpoint({
|
|
58
58
|
method: 'GET',
|
|
@@ -60,7 +60,7 @@ export const databasesEndpoints = {
|
|
|
60
60
|
params: IdPath,
|
|
61
61
|
response: Database,
|
|
62
62
|
summary: 'Get a resource (includes live status)',
|
|
63
|
-
tags: ['
|
|
63
|
+
tags: ['resources'],
|
|
64
64
|
}),
|
|
65
65
|
update: defineEndpoint({
|
|
66
66
|
method: 'PATCH',
|
|
@@ -69,7 +69,7 @@ export const databasesEndpoints = {
|
|
|
69
69
|
body: Schema.Record({ key: Schema.String, value: Schema.Unknown }),
|
|
70
70
|
response: Database,
|
|
71
71
|
summary: 'Update resource name and/or config patch',
|
|
72
|
-
tags: ['
|
|
72
|
+
tags: ['resources'],
|
|
73
73
|
}),
|
|
74
74
|
delete: defineEndpoint({
|
|
75
75
|
method: 'DELETE',
|
|
@@ -77,7 +77,7 @@ export const databasesEndpoints = {
|
|
|
77
77
|
params: IdPath,
|
|
78
78
|
response: Schema.Struct({ success: Schema.optional(Schema.Boolean) }),
|
|
79
79
|
summary: 'Deprovision a resource (204 on success, 409 when bindings exist)',
|
|
80
|
-
tags: ['
|
|
80
|
+
tags: ['resources'],
|
|
81
81
|
}),
|
|
82
82
|
metrics: defineEndpoint({
|
|
83
83
|
method: 'GET',
|
|
@@ -85,7 +85,7 @@ export const databasesEndpoints = {
|
|
|
85
85
|
params: IdPath,
|
|
86
86
|
response: MetricsResponse,
|
|
87
87
|
summary: 'Prometheus metrics snapshot (adapts by resource kind)',
|
|
88
|
-
tags: ['
|
|
88
|
+
tags: ['resources'],
|
|
89
89
|
}),
|
|
90
90
|
backups: defineEndpoint({
|
|
91
91
|
method: 'GET',
|
|
@@ -128,7 +128,7 @@ export const databasesEndpoints = {
|
|
|
128
128
|
params: IdPath,
|
|
129
129
|
response: Schema.Struct({ bindings: Schema.Array(DatabaseResourceBinding) }),
|
|
130
130
|
summary: 'List environment bindings for a resource',
|
|
131
|
-
tags: ['
|
|
131
|
+
tags: ['resources'],
|
|
132
132
|
}),
|
|
133
133
|
createBinding: defineEndpoint({
|
|
134
134
|
method: 'POST',
|
|
@@ -137,7 +137,7 @@ export const databasesEndpoints = {
|
|
|
137
137
|
body: CreateBindingInput,
|
|
138
138
|
response: DatabaseResourceBinding,
|
|
139
139
|
summary: 'Bind a resource to an environment',
|
|
140
|
-
tags: ['
|
|
140
|
+
tags: ['resources'],
|
|
141
141
|
}),
|
|
142
142
|
deleteBinding: defineEndpoint({
|
|
143
143
|
method: 'DELETE',
|
|
@@ -145,6 +145,13 @@ export const databasesEndpoints = {
|
|
|
145
145
|
params: BindingPath,
|
|
146
146
|
response: Schema.Struct({ success: Schema.Boolean }),
|
|
147
147
|
summary: 'Unbind a resource from an environment',
|
|
148
|
-
tags: ['
|
|
148
|
+
tags: ['resources'],
|
|
149
149
|
}),
|
|
150
150
|
};
|
|
151
|
+
/**
|
|
152
|
+
* Canonical name for the unified `/resources` contract group.
|
|
153
|
+
*
|
|
154
|
+
* `databasesEndpoints` remains for database-specific callers; new generic
|
|
155
|
+
* resource surfaces should import `resourcesEndpoints`.
|
|
156
|
+
*/
|
|
157
|
+
export const resourcesEndpoints = databasesEndpoints;
|
|
@@ -54,6 +54,17 @@ export declare const organizationsEndpoints: {
|
|
|
54
54
|
limit: typeof Schema.Number;
|
|
55
55
|
offset: typeof Schema.Number;
|
|
56
56
|
}>>;
|
|
57
|
+
readonly memberships: import("../endpoint.js").Endpoint<"GET", "/orgs/memberships", Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
58
|
+
organizations: Schema.Array$<Schema.Struct<{
|
|
59
|
+
id: Schema.brand<Schema.filter<typeof Schema.String>, "OrgId">;
|
|
60
|
+
name: typeof Schema.String;
|
|
61
|
+
slug: typeof Schema.String;
|
|
62
|
+
logoUrl: Schema.NullOr<typeof Schema.String>;
|
|
63
|
+
role: Schema.Literal<["super_admin", "admin", "billing", "analytics", "developer", "viewer", "member"]>;
|
|
64
|
+
joinedAt: typeof Schema.String;
|
|
65
|
+
createdAt: typeof Schema.String;
|
|
66
|
+
}>>;
|
|
67
|
+
}>>;
|
|
57
68
|
readonly get: import("../endpoint.js").Endpoint<"GET", "/orgs/:orgId", Schema.Struct<{
|
|
58
69
|
orgId: typeof Schema.String;
|
|
59
70
|
}>, Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organizations.d.ts","sourceRoot":"","sources":["../../src/endpoints/organizations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"organizations.d.ts","sourceRoot":"","sources":["../../src/endpoints/organizations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAkZ/B,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6IzB,CAAA"}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { Schema } from 'effect';
|
|
14
14
|
import { defineEndpoint } from '../endpoint.js';
|
|
15
|
-
import { CreateOrgInput, InviteMemberInput, InviteMemberResult, MyOrgResponse, Organization, OrgDetail, OrgMember, OrgSettings, ProjectSession, UpdateMemberRoleInput, UpdateMemberRoleResult, UpdateOrgInput, } from '../schemas/organization.js';
|
|
15
|
+
import { CreateOrgInput, InviteMemberInput, InviteMemberResult, MyOrgResponse, Organization, OrgDetail, OrgMember, OrgSettings, ProjectSession, UpdateMemberRoleInput, UpdateMemberRoleResult, UpdateOrgInput, UserOrganizationsResponse, } from '../schemas/organization.js';
|
|
16
16
|
import { CreateCreditCheckoutInput, CreateCreditCheckoutResult, GetAddCreditsDataResult, GetBillingBusinessSettingsResult, GetBillingUsageResult, GetInvoiceDetailResult, GetPlatformPlanResult, InvoiceIdPath, RemoveTaxIdResult, SetTaxIdInput, SetTaxIdResult, UpdateBusinessInfoInput, UpdateBusinessInfoResult, UpgradePlatformPlanInput, UpgradePlatformPlanResult, } from '../schemas/organization-billing.js';
|
|
17
17
|
import { BulkDeleteProjectUsersInput, BulkDeleteProjectUsersResult, BulkUpdateProjectUsersInput, BulkUpdateProjectUsersResult, DeleteProjectUserResult, GetProjectUserResult, ListProjectUsersQuery, ListProjectUsersResult, UpdateProjectUserStatusInput, UpdateProjectUserStatusResult, } from '../schemas/organization-project-users.js';
|
|
18
18
|
import { CheckSlugQuery, CheckSlugResult, CreateOrgProjectInput, CreateOrgProjectResult, DeleteOrgProjectResult, GetOrgProjectLogsResult, GetOrgProjectUsageStatsResult, ListOrgProjectsResult, UpdateOrgProjectInput, UpdateOrgProjectResult, } from '../schemas/organization-projects.js';
|
|
@@ -348,6 +348,13 @@ export const organizationsEndpoints = {
|
|
|
348
348
|
summary: 'List organizations (admin only)',
|
|
349
349
|
tags: ['organizations'],
|
|
350
350
|
}),
|
|
351
|
+
memberships: defineEndpoint({
|
|
352
|
+
method: 'GET',
|
|
353
|
+
path: '/orgs/memberships',
|
|
354
|
+
response: UserOrganizationsResponse,
|
|
355
|
+
summary: 'List organizations the authenticated user belongs to',
|
|
356
|
+
tags: ['organizations'],
|
|
357
|
+
}),
|
|
351
358
|
get: defineEndpoint({
|
|
352
359
|
method: 'GET',
|
|
353
360
|
path: '/orgs/:orgId',
|