@sylphx/contract 0.2.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 (50) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/endpoint.d.ts +6 -0
  3. package/dist/endpoint.d.ts.map +1 -1
  4. package/dist/endpoints/admin-projects.d.ts +29 -0
  5. package/dist/endpoints/admin-projects.d.ts.map +1 -1
  6. package/dist/endpoints/admin-projects.js +30 -1
  7. package/dist/endpoints/auth.d.ts +6 -0
  8. package/dist/endpoints/auth.d.ts.map +1 -1
  9. package/dist/endpoints/auth.js +12 -1
  10. package/dist/endpoints/branch-databases.d.ts +27 -28
  11. package/dist/endpoints/branch-databases.d.ts.map +1 -1
  12. package/dist/endpoints/branch-databases.js +7 -7
  13. package/dist/endpoints/databases.d.ts +253 -3
  14. package/dist/endpoints/databases.d.ts.map +1 -1
  15. package/dist/endpoints/databases.js +19 -12
  16. package/dist/endpoints/organizations.d.ts +11 -0
  17. package/dist/endpoints/organizations.d.ts.map +1 -1
  18. package/dist/endpoints/organizations.js +8 -1
  19. package/dist/endpoints/project-manifest.d.ts +26 -18
  20. package/dist/endpoints/project-manifest.d.ts.map +1 -1
  21. package/dist/endpoints/secrets.d.ts +6 -6
  22. package/dist/endpoints/secrets.d.ts.map +1 -1
  23. package/dist/endpoints/secrets.js +6 -5
  24. package/dist/index.d.ts +104 -50
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +1 -1
  27. package/dist/schemas/admin-projects.d.ts +20 -0
  28. package/dist/schemas/admin-projects.d.ts.map +1 -1
  29. package/dist/schemas/admin-projects.js +17 -0
  30. package/dist/schemas/auth.d.ts +11 -0
  31. package/dist/schemas/auth.d.ts.map +1 -1
  32. package/dist/schemas/auth.js +10 -0
  33. package/dist/schemas/branch-database.d.ts +20 -19
  34. package/dist/schemas/branch-database.d.ts.map +1 -1
  35. package/dist/schemas/branch-database.js +9 -7
  36. package/dist/schemas/ids.d.ts +2 -0
  37. package/dist/schemas/ids.d.ts.map +1 -1
  38. package/dist/schemas/ids.js +1 -0
  39. package/dist/schemas/organization.d.ts +24 -2
  40. package/dist/schemas/organization.d.ts.map +1 -1
  41. package/dist/schemas/organization.js +13 -1
  42. package/dist/schemas/project-manifest.d.ts +43 -21
  43. package/dist/schemas/project-manifest.d.ts.map +1 -1
  44. package/dist/schemas/project-manifest.js +11 -3
  45. package/dist/schemas/secret.d.ts +1 -1
  46. package/dist/schemas/secret.js +2 -2
  47. package/dist/schemas/storage.d.ts +0 -5
  48. package/dist/schemas/storage.d.ts.map +1 -1
  49. package/dist/schemas/storage.js +0 -4
  50. package/package.json +5 -1
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Databases endpoints — surfaced through the unified `/resources` router
3
- * (`kind=database`). Mirrors `apps/api/src/server/platform/routes/management/resources/*`.
4
- * Backups/restore/branch are CNPG-only; bindings apply to every resource kind.
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: ['databases'],
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: ['databases'],
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: ['databases'],
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: ['databases'],
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: ['databases'],
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: ['databases'],
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: ['databases'],
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: ['databases'],
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: ['databases'],
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;AAiZ/B,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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',
@@ -86,6 +86,7 @@ export declare const projectManifestEndpoints: {
86
86
  readonly type?: "function" | "cron" | "web" | "worker" | undefined;
87
87
  readonly port?: number | undefined;
88
88
  readonly env?: readonly string[] | undefined;
89
+ readonly resources?: readonly string[] | undefined;
89
90
  readonly replicas?: number | undefined;
90
91
  readonly command?: string | undefined;
91
92
  readonly internal_port?: number | undefined;
@@ -95,7 +96,6 @@ export declare const projectManifestEndpoints: {
95
96
  readonly scale_to_zero?: boolean | undefined;
96
97
  readonly idle_timeout_seconds?: number | undefined;
97
98
  readonly min_replicas?: number | undefined;
98
- readonly resources?: readonly string[] | undefined;
99
99
  }[] | undefined;
100
100
  readonly region?: "fsn1" | "nbg1" | "hel1" | "ash1" | "hil1" | undefined;
101
101
  readonly env?: {
@@ -138,6 +138,7 @@ export declare const projectManifestEndpoints: {
138
138
  readonly type?: "function" | "cron" | "web" | "worker" | undefined;
139
139
  readonly port?: number | undefined;
140
140
  readonly env?: readonly string[] | undefined;
141
+ readonly resources?: readonly string[] | undefined;
141
142
  readonly replicas?: number | undefined;
142
143
  readonly command?: string | undefined;
143
144
  readonly internal_port?: number | undefined;
@@ -147,7 +148,6 @@ export declare const projectManifestEndpoints: {
147
148
  readonly scale_to_zero?: boolean | undefined;
148
149
  readonly idle_timeout_seconds?: number | undefined;
149
150
  readonly min_replicas?: number | undefined;
150
- readonly resources?: readonly string[] | undefined;
151
151
  }[] | undefined;
152
152
  readonly region?: "fsn1" | "nbg1" | "hel1" | "ash1" | "hil1" | undefined;
153
153
  readonly env?: {
@@ -190,6 +190,7 @@ export declare const projectManifestEndpoints: {
190
190
  readonly type?: "function" | "cron" | "web" | "worker" | undefined;
191
191
  readonly port?: number | undefined;
192
192
  readonly env?: readonly string[] | undefined;
193
+ readonly resources?: readonly string[] | undefined;
193
194
  readonly replicas?: number | undefined;
194
195
  readonly command?: string | undefined;
195
196
  readonly internal_port?: number | undefined;
@@ -199,7 +200,6 @@ export declare const projectManifestEndpoints: {
199
200
  readonly scale_to_zero?: boolean | undefined;
200
201
  readonly idle_timeout_seconds?: number | undefined;
201
202
  readonly min_replicas?: number | undefined;
202
- readonly resources?: readonly string[] | undefined;
203
203
  }[] | undefined;
204
204
  readonly region?: "fsn1" | "nbg1" | "hel1" | "ash1" | "hil1" | undefined;
205
205
  readonly env?: {
@@ -242,6 +242,7 @@ export declare const projectManifestEndpoints: {
242
242
  readonly type?: "function" | "cron" | "web" | "worker" | undefined;
243
243
  readonly port?: number | undefined;
244
244
  readonly env?: readonly string[] | undefined;
245
+ readonly resources?: readonly string[] | undefined;
245
246
  readonly replicas?: number | undefined;
246
247
  readonly command?: string | undefined;
247
248
  readonly internal_port?: number | undefined;
@@ -251,7 +252,6 @@ export declare const projectManifestEndpoints: {
251
252
  readonly scale_to_zero?: boolean | undefined;
252
253
  readonly idle_timeout_seconds?: number | undefined;
253
254
  readonly min_replicas?: number | undefined;
254
- readonly resources?: readonly string[] | undefined;
255
255
  }[] | undefined;
256
256
  readonly region?: "fsn1" | "nbg1" | "hel1" | "ash1" | "hil1" | undefined;
257
257
  readonly env?: {
@@ -295,6 +295,7 @@ export declare const projectManifestEndpoints: {
295
295
  readonly type?: "function" | "cron" | "web" | "worker" | undefined;
296
296
  readonly port?: number | undefined;
297
297
  readonly env?: readonly string[] | undefined;
298
+ readonly resources?: readonly string[] | undefined;
298
299
  readonly replicas?: number | undefined;
299
300
  readonly command?: string | undefined;
300
301
  readonly internal_port?: number | undefined;
@@ -304,7 +305,6 @@ export declare const projectManifestEndpoints: {
304
305
  readonly scale_to_zero?: boolean | undefined;
305
306
  readonly idle_timeout_seconds?: number | undefined;
306
307
  readonly min_replicas?: number | undefined;
307
- readonly resources?: readonly string[] | undefined;
308
308
  }[] | undefined;
309
309
  readonly region?: "fsn1" | "nbg1" | "hel1" | "ash1" | "hil1" | undefined;
310
310
  readonly env?: {
@@ -347,6 +347,7 @@ export declare const projectManifestEndpoints: {
347
347
  readonly type?: "function" | "cron" | "web" | "worker" | undefined;
348
348
  readonly port?: number | undefined;
349
349
  readonly env?: readonly string[] | undefined;
350
+ readonly resources?: readonly string[] | undefined;
350
351
  readonly replicas?: number | undefined;
351
352
  readonly command?: string | undefined;
352
353
  readonly internal_port?: number | undefined;
@@ -356,7 +357,6 @@ export declare const projectManifestEndpoints: {
356
357
  readonly scale_to_zero?: boolean | undefined;
357
358
  readonly idle_timeout_seconds?: number | undefined;
358
359
  readonly min_replicas?: number | undefined;
359
- readonly resources?: readonly string[] | undefined;
360
360
  }[] | undefined;
361
361
  readonly region?: "fsn1" | "nbg1" | "hel1" | "ash1" | "hil1" | undefined;
362
362
  readonly env?: {
@@ -399,6 +399,7 @@ export declare const projectManifestEndpoints: {
399
399
  readonly type?: "function" | "cron" | "web" | "worker" | undefined;
400
400
  readonly port?: number | undefined;
401
401
  readonly env?: readonly string[] | undefined;
402
+ readonly resources?: readonly string[] | undefined;
402
403
  readonly replicas?: number | undefined;
403
404
  readonly command?: string | undefined;
404
405
  readonly internal_port?: number | undefined;
@@ -408,7 +409,6 @@ export declare const projectManifestEndpoints: {
408
409
  readonly scale_to_zero?: boolean | undefined;
409
410
  readonly idle_timeout_seconds?: number | undefined;
410
411
  readonly min_replicas?: number | undefined;
411
- readonly resources?: readonly string[] | undefined;
412
412
  }[] | undefined;
413
413
  readonly region?: "fsn1" | "nbg1" | "hel1" | "ash1" | "hil1" | undefined;
414
414
  readonly env?: {
@@ -451,6 +451,7 @@ export declare const projectManifestEndpoints: {
451
451
  readonly type?: "function" | "cron" | "web" | "worker" | undefined;
452
452
  readonly port?: number | undefined;
453
453
  readonly env?: readonly string[] | undefined;
454
+ readonly resources?: readonly string[] | undefined;
454
455
  readonly replicas?: number | undefined;
455
456
  readonly command?: string | undefined;
456
457
  readonly internal_port?: number | undefined;
@@ -460,7 +461,6 @@ export declare const projectManifestEndpoints: {
460
461
  readonly scale_to_zero?: boolean | undefined;
461
462
  readonly idle_timeout_seconds?: number | undefined;
462
463
  readonly min_replicas?: number | undefined;
463
- readonly resources?: readonly string[] | undefined;
464
464
  }[] | undefined;
465
465
  readonly region?: "fsn1" | "nbg1" | "hel1" | "ash1" | "hil1" | undefined;
466
466
  readonly env?: {
@@ -492,7 +492,8 @@ export declare const projectManifestEndpoints: {
492
492
  };
493
493
  }, never>>;
494
494
  resources: Schema.optional<Schema.Struct<{
495
- postgres: Schema.optional<Schema.Struct<{
495
+ database: Schema.optional<Schema.Struct<{
496
+ engine: Schema.optional<Schema.Literal<["postgres"]>>;
496
497
  tier: Schema.Literal<["nano", "micro", "standard", "large", "xl"]>;
497
498
  storage_gb: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
498
499
  version: Schema.optional<Schema.Literal<["15", "16", "17"]>>;
@@ -512,7 +513,10 @@ export declare const projectManifestEndpoints: {
512
513
  mount: typeof Schema.String;
513
514
  }>>>;
514
515
  search: Schema.optional<Schema.Struct<{
516
+ engine: Schema.optional<Schema.Literal<["typesense"]>>;
515
517
  tier: Schema.Literal<["micro", "standard"]>;
518
+ storage_gb: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
519
+ nodes: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
516
520
  }>>;
517
521
  }>>;
518
522
  ci: Schema.optional<Schema.Struct<{
@@ -599,6 +603,7 @@ export declare const projectManifestEndpoints: {
599
603
  readonly type?: "function" | "cron" | "web" | "worker" | undefined;
600
604
  readonly port?: number | undefined;
601
605
  readonly env?: readonly string[] | undefined;
606
+ readonly resources?: readonly string[] | undefined;
602
607
  readonly replicas?: number | undefined;
603
608
  readonly command?: string | undefined;
604
609
  readonly internal_port?: number | undefined;
@@ -608,7 +613,6 @@ export declare const projectManifestEndpoints: {
608
613
  readonly scale_to_zero?: boolean | undefined;
609
614
  readonly idle_timeout_seconds?: number | undefined;
610
615
  readonly min_replicas?: number | undefined;
611
- readonly resources?: readonly string[] | undefined;
612
616
  }[] | undefined;
613
617
  readonly region?: "fsn1" | "nbg1" | "hel1" | "ash1" | "hil1" | undefined;
614
618
  readonly env?: {
@@ -651,6 +655,7 @@ export declare const projectManifestEndpoints: {
651
655
  readonly type?: "function" | "cron" | "web" | "worker" | undefined;
652
656
  readonly port?: number | undefined;
653
657
  readonly env?: readonly string[] | undefined;
658
+ readonly resources?: readonly string[] | undefined;
654
659
  readonly replicas?: number | undefined;
655
660
  readonly command?: string | undefined;
656
661
  readonly internal_port?: number | undefined;
@@ -660,7 +665,6 @@ export declare const projectManifestEndpoints: {
660
665
  readonly scale_to_zero?: boolean | undefined;
661
666
  readonly idle_timeout_seconds?: number | undefined;
662
667
  readonly min_replicas?: number | undefined;
663
- readonly resources?: readonly string[] | undefined;
664
668
  }[] | undefined;
665
669
  readonly region?: "fsn1" | "nbg1" | "hel1" | "ash1" | "hil1" | undefined;
666
670
  readonly env?: {
@@ -703,6 +707,7 @@ export declare const projectManifestEndpoints: {
703
707
  readonly type?: "function" | "cron" | "web" | "worker" | undefined;
704
708
  readonly port?: number | undefined;
705
709
  readonly env?: readonly string[] | undefined;
710
+ readonly resources?: readonly string[] | undefined;
706
711
  readonly replicas?: number | undefined;
707
712
  readonly command?: string | undefined;
708
713
  readonly internal_port?: number | undefined;
@@ -712,7 +717,6 @@ export declare const projectManifestEndpoints: {
712
717
  readonly scale_to_zero?: boolean | undefined;
713
718
  readonly idle_timeout_seconds?: number | undefined;
714
719
  readonly min_replicas?: number | undefined;
715
- readonly resources?: readonly string[] | undefined;
716
720
  }[] | undefined;
717
721
  readonly region?: "fsn1" | "nbg1" | "hel1" | "ash1" | "hil1" | undefined;
718
722
  readonly env?: {
@@ -755,6 +759,7 @@ export declare const projectManifestEndpoints: {
755
759
  readonly type?: "function" | "cron" | "web" | "worker" | undefined;
756
760
  readonly port?: number | undefined;
757
761
  readonly env?: readonly string[] | undefined;
762
+ readonly resources?: readonly string[] | undefined;
758
763
  readonly replicas?: number | undefined;
759
764
  readonly command?: string | undefined;
760
765
  readonly internal_port?: number | undefined;
@@ -764,7 +769,6 @@ export declare const projectManifestEndpoints: {
764
769
  readonly scale_to_zero?: boolean | undefined;
765
770
  readonly idle_timeout_seconds?: number | undefined;
766
771
  readonly min_replicas?: number | undefined;
767
- readonly resources?: readonly string[] | undefined;
768
772
  }[] | undefined;
769
773
  readonly region?: "fsn1" | "nbg1" | "hel1" | "ash1" | "hil1" | undefined;
770
774
  readonly env?: {
@@ -808,6 +812,7 @@ export declare const projectManifestEndpoints: {
808
812
  readonly type?: "function" | "cron" | "web" | "worker" | undefined;
809
813
  readonly port?: number | undefined;
810
814
  readonly env?: readonly string[] | undefined;
815
+ readonly resources?: readonly string[] | undefined;
811
816
  readonly replicas?: number | undefined;
812
817
  readonly command?: string | undefined;
813
818
  readonly internal_port?: number | undefined;
@@ -817,7 +822,6 @@ export declare const projectManifestEndpoints: {
817
822
  readonly scale_to_zero?: boolean | undefined;
818
823
  readonly idle_timeout_seconds?: number | undefined;
819
824
  readonly min_replicas?: number | undefined;
820
- readonly resources?: readonly string[] | undefined;
821
825
  }[] | undefined;
822
826
  readonly region?: "fsn1" | "nbg1" | "hel1" | "ash1" | "hil1" | undefined;
823
827
  readonly env?: {
@@ -860,6 +864,7 @@ export declare const projectManifestEndpoints: {
860
864
  readonly type?: "function" | "cron" | "web" | "worker" | undefined;
861
865
  readonly port?: number | undefined;
862
866
  readonly env?: readonly string[] | undefined;
867
+ readonly resources?: readonly string[] | undefined;
863
868
  readonly replicas?: number | undefined;
864
869
  readonly command?: string | undefined;
865
870
  readonly internal_port?: number | undefined;
@@ -869,7 +874,6 @@ export declare const projectManifestEndpoints: {
869
874
  readonly scale_to_zero?: boolean | undefined;
870
875
  readonly idle_timeout_seconds?: number | undefined;
871
876
  readonly min_replicas?: number | undefined;
872
- readonly resources?: readonly string[] | undefined;
873
877
  }[] | undefined;
874
878
  readonly region?: "fsn1" | "nbg1" | "hel1" | "ash1" | "hil1" | undefined;
875
879
  readonly env?: {
@@ -912,6 +916,7 @@ export declare const projectManifestEndpoints: {
912
916
  readonly type?: "function" | "cron" | "web" | "worker" | undefined;
913
917
  readonly port?: number | undefined;
914
918
  readonly env?: readonly string[] | undefined;
919
+ readonly resources?: readonly string[] | undefined;
915
920
  readonly replicas?: number | undefined;
916
921
  readonly command?: string | undefined;
917
922
  readonly internal_port?: number | undefined;
@@ -921,7 +926,6 @@ export declare const projectManifestEndpoints: {
921
926
  readonly scale_to_zero?: boolean | undefined;
922
927
  readonly idle_timeout_seconds?: number | undefined;
923
928
  readonly min_replicas?: number | undefined;
924
- readonly resources?: readonly string[] | undefined;
925
929
  }[] | undefined;
926
930
  readonly region?: "fsn1" | "nbg1" | "hel1" | "ash1" | "hil1" | undefined;
927
931
  readonly env?: {
@@ -964,6 +968,7 @@ export declare const projectManifestEndpoints: {
964
968
  readonly type?: "function" | "cron" | "web" | "worker" | undefined;
965
969
  readonly port?: number | undefined;
966
970
  readonly env?: readonly string[] | undefined;
971
+ readonly resources?: readonly string[] | undefined;
967
972
  readonly replicas?: number | undefined;
968
973
  readonly command?: string | undefined;
969
974
  readonly internal_port?: number | undefined;
@@ -973,7 +978,6 @@ export declare const projectManifestEndpoints: {
973
978
  readonly scale_to_zero?: boolean | undefined;
974
979
  readonly idle_timeout_seconds?: number | undefined;
975
980
  readonly min_replicas?: number | undefined;
976
- readonly resources?: readonly string[] | undefined;
977
981
  }[] | undefined;
978
982
  readonly region?: "fsn1" | "nbg1" | "hel1" | "ash1" | "hil1" | undefined;
979
983
  readonly env?: {
@@ -1005,7 +1009,8 @@ export declare const projectManifestEndpoints: {
1005
1009
  };
1006
1010
  }, never>>;
1007
1011
  resources: Schema.optional<Schema.Struct<{
1008
- postgres: Schema.optional<Schema.Struct<{
1012
+ database: Schema.optional<Schema.Struct<{
1013
+ engine: Schema.optional<Schema.Literal<["postgres"]>>;
1009
1014
  tier: Schema.Literal<["nano", "micro", "standard", "large", "xl"]>;
1010
1015
  storage_gb: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
1011
1016
  version: Schema.optional<Schema.Literal<["15", "16", "17"]>>;
@@ -1025,7 +1030,10 @@ export declare const projectManifestEndpoints: {
1025
1030
  mount: typeof Schema.String;
1026
1031
  }>>>;
1027
1032
  search: Schema.optional<Schema.Struct<{
1033
+ engine: Schema.optional<Schema.Literal<["typesense"]>>;
1028
1034
  tier: Schema.Literal<["micro", "standard"]>;
1035
+ storage_gb: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
1036
+ nodes: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
1029
1037
  }>>;
1030
1038
  }>>;
1031
1039
  ci: Schema.optional<Schema.Struct<{
@@ -1 +1 @@
1
- {"version":3,"file":"project-manifest.d.ts","sourceRoot":"","sources":["../../src/endpoints/project-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AA2B/B,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwB3B,CAAA"}
@@ -5,8 +5,8 @@
5
5
  import { Schema } from 'effect';
6
6
  export declare const secretsEndpoints: {
7
7
  readonly list: import("../endpoint.js").Endpoint<"GET", "/secrets", Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
8
- projectId: typeof Schema.String;
9
- environmentId: Schema.optional<typeof Schema.String>;
8
+ projectId: Schema.brand<Schema.filter<typeof Schema.String>, "ProjectId">;
9
+ environmentId: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "EnvironmentId">>;
10
10
  includeInactive: Schema.optional<typeof Schema.String>;
11
11
  }>, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
12
12
  secrets: Schema.Array$<Schema.Struct<{
@@ -24,7 +24,7 @@ export declare const secretsEndpoints: {
24
24
  }>>;
25
25
  }>>;
26
26
  readonly get: import("../endpoint.js").Endpoint<"GET", "/secrets/detail", Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
27
- id: typeof Schema.String;
27
+ id: Schema.brand<Schema.filter<typeof Schema.String>, "SecretId">;
28
28
  reveal: Schema.optional<typeof Schema.String>;
29
29
  }>, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
30
30
  id: Schema.brand<Schema.filter<typeof Schema.String>, "SecretId">;
@@ -47,7 +47,7 @@ export declare const secretsEndpoints: {
47
47
  updatedAt: typeof Schema.String;
48
48
  }>>;
49
49
  readonly create: import("../endpoint.js").Endpoint<"POST", "/secrets", Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
50
- projectId: typeof Schema.String;
50
+ projectId: Schema.brand<Schema.filter<typeof Schema.String>, "ProjectId">;
51
51
  key: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
52
52
  value: Schema.filter<Schema.filter<typeof Schema.String>>;
53
53
  description: Schema.optional<typeof Schema.String>;
@@ -69,7 +69,7 @@ export declare const secretsEndpoints: {
69
69
  version: typeof Schema.String;
70
70
  }>>;
71
71
  readonly delete: import("../endpoint.js").Endpoint<"DELETE", "/secrets", Schema.Schema.AnyNoContext | undefined, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
72
- id: typeof Schema.String;
72
+ id: Schema.brand<Schema.filter<typeof Schema.String>, "SecretId">;
73
73
  }>, Schema.Struct<{
74
74
  success: typeof Schema.Boolean;
75
75
  }>>;
@@ -84,7 +84,7 @@ export declare const secretsEndpoints: {
84
84
  rolledBackTo: typeof Schema.String;
85
85
  }>>;
86
86
  readonly stats: import("../endpoint.js").Endpoint<"GET", "/secrets/stats", Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
87
- projectId: typeof Schema.String;
87
+ projectId: Schema.brand<Schema.filter<typeof Schema.String>, "ProjectId">;
88
88
  }>, Schema.Schema.AnyNoContext | undefined, Schema.Struct<{
89
89
  stats: Schema.Array$<Schema.Struct<{
90
90
  environmentId: Schema.NullOr<typeof Schema.String>;
@@ -1 +1 @@
1
- {"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../src/endpoints/secrets.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AA4B/B,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEnB,CAAA"}
1
+ {"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../src/endpoints/secrets.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AA6B/B,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEnB,CAAA"}
@@ -4,18 +4,19 @@
4
4
  */
5
5
  import { Schema } from 'effect';
6
6
  import { defineEndpoint } from '../endpoint.js';
7
+ import { EnvironmentId, ProjectId, SecretId } from '../schemas/ids.js';
7
8
  import { CreateSecretInput, CreateSecretResult, RollbackSecretInput, RollbackSecretResult, SecretDetail, SecretListItem, UpdateSecretInput, UpdateSecretResult, } from '../schemas/secret.js';
8
9
  const ListQuery = Schema.Struct({
9
- projectId: Schema.String,
10
- environmentId: Schema.optional(Schema.String),
10
+ projectId: ProjectId,
11
+ environmentId: Schema.optional(EnvironmentId),
11
12
  includeInactive: Schema.optional(Schema.String),
12
13
  });
13
14
  const DetailQuery = Schema.Struct({
14
- id: Schema.String,
15
+ id: SecretId,
15
16
  reveal: Schema.optional(Schema.String),
16
17
  });
17
- const StatsQuery = Schema.Struct({ projectId: Schema.String });
18
- const DeleteBody = Schema.Struct({ id: Schema.String });
18
+ const StatsQuery = Schema.Struct({ projectId: ProjectId });
19
+ const DeleteBody = Schema.Struct({ id: SecretId });
19
20
  export const secretsEndpoints = {
20
21
  list: defineEndpoint({
21
22
  method: 'GET',