@sylphx/contract 0.3.0 → 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.
@@ -1,106 +1,143 @@
1
1
  /**
2
- * Storage endpoints — BaaS plane. Paths mirror `@sylphx/sdk/storage.ts`.
2
+ * Storage endpoints — BaaS plane. Per ADR-100.
3
+ *
4
+ * One resource (`uploads`) for upload sessions, one resource (`files`) for
5
+ * everything else. Verb suffix `:action` on `files` follows Google AIP-136.
6
+ *
7
+ * No legacy aliases. No polymorphic POSTs. Mirrors `@sylphx/sdk/storage.ts`.
3
8
  */
4
9
  import { Schema } from 'effect';
5
10
  import { defineEndpoint } from '../endpoint.js';
6
- import { DeleteFileResult, FileInfo, ListFilesQuery, ListFilesResult, ListFileVersionsResult, RestoreFileResult, RestoreVersionResult, SignedUrlInput, SignedUrlResult, UploadTokenInput, UploadTokenResult, UploadUrlInput, UploadUrlResult, } from '../schemas/storage.js';
7
- const IdPath = Schema.Struct({ id: Schema.String });
11
+ import { CopyFileRequest, CopyFileResult, File, ListFilesQuery, ListFilesResult, ListFileVersionsResult, RestoreFileResult, RestoreVersionResult, SignedUrlRequest, SignedUrlResult, SoftDeleteFileResult, UploadCompleteRequest, UploadCompleteResult, UploadCreateRequest, UploadCreateResult, UploadPartPresignResult, } from '../schemas/storage.js';
12
+ const FileIdPath = Schema.Struct({ fileId: Schema.String });
13
+ const UploadIdPath = Schema.Struct({ uploadId: Schema.String });
14
+ const UploadPartPath = Schema.Struct({
15
+ uploadId: Schema.String,
16
+ partNumber: Schema.NumberFromString,
17
+ });
8
18
  const FileVersionPath = Schema.Struct({
9
- id: Schema.String,
19
+ fileId: Schema.String,
10
20
  versionId: Schema.String,
11
21
  });
12
22
  export const storageEndpoints = {
13
- /**
14
- * Mint an upload token for client-direct uploads. Returns either a
15
- * simple `{ uploadUrl, publicUrl }` pair or a Vercel-Blob-style
16
- * `{ uploadEndpoint, clientPayload, instructions }` envelope.
17
- * This is the SDK's primary upload path (`uploadFile` / `uploadAvatar`).
18
- */
19
- upload: defineEndpoint({
23
+ // --------------------------------------------------------------------------
24
+ // Upload sessions
25
+ // --------------------------------------------------------------------------
26
+ createUpload: defineEndpoint({
20
27
  method: 'POST',
21
- path: '/storage/upload',
22
- body: UploadTokenInput,
23
- response: UploadTokenResult,
28
+ path: '/storage/uploads',
29
+ body: UploadCreateRequest,
30
+ response: UploadCreateResult,
24
31
  plane: 'baas',
25
- summary: 'Mint an upload token for client-direct file uploads',
32
+ summary: 'Create an upload session. Returns a single-part PUT or a multipart plan based on size.',
26
33
  tags: ['storage'],
27
34
  }),
28
- presignedUrl: defineEndpoint({
35
+ abortUpload: defineEndpoint({
36
+ method: 'DELETE',
37
+ path: '/storage/uploads/:uploadId',
38
+ params: UploadIdPath,
39
+ response: Schema.Struct({}),
40
+ plane: 'baas',
41
+ summary: 'Abort an in-progress upload session and release its parts.',
42
+ tags: ['storage'],
43
+ }),
44
+ presignUploadPart: defineEndpoint({
29
45
  method: 'POST',
30
- path: '/storage/upload-url',
31
- body: UploadUrlInput,
32
- response: UploadUrlResult,
46
+ path: '/storage/uploads/:uploadId/parts/:partNumber',
47
+ params: UploadPartPath,
48
+ response: UploadPartPresignResult,
33
49
  plane: 'baas',
34
- summary: 'Mint a short-lived presigned upload URL',
50
+ summary: 'Mint a fresh presigned URL for a single multipart part (used to resume long pauses).',
35
51
  tags: ['storage'],
36
52
  }),
37
- /**
38
- * Generate a time-limited signed URL for accessing a private file.
39
- * Signed URLs avoid exposing permanent credentials and can be scoped
40
- * to a specific user via the `userId` field.
41
- */
42
- signedUrl: defineEndpoint({
53
+ completeUpload: defineEndpoint({
43
54
  method: 'POST',
44
- path: '/storage/signed-url',
45
- body: SignedUrlInput,
46
- response: SignedUrlResult,
55
+ path: '/storage/uploads/:uploadId:complete',
56
+ params: UploadIdPath,
57
+ body: UploadCompleteRequest,
58
+ response: UploadCompleteResult,
47
59
  plane: 'baas',
48
- summary: 'Mint a short-lived signed download URL for a private file',
60
+ summary: 'Finalise a multipart upload by submitting per-part etags.',
49
61
  tags: ['storage'],
50
62
  }),
51
- list: defineEndpoint({
63
+ // --------------------------------------------------------------------------
64
+ // Files resource
65
+ // --------------------------------------------------------------------------
66
+ listFiles: defineEndpoint({
52
67
  method: 'GET',
53
68
  path: '/storage/files',
54
69
  query: ListFilesQuery,
55
70
  response: ListFilesResult,
56
71
  plane: 'baas',
57
- summary: 'List files stored by the app (cursor-paginated)',
72
+ summary: 'List files (cursor-paginated).',
58
73
  tags: ['storage'],
59
74
  }),
60
- get: defineEndpoint({
75
+ getFile: defineEndpoint({
61
76
  method: 'GET',
62
- path: '/storage/files/:id',
63
- params: IdPath,
64
- response: FileInfo,
77
+ path: '/storage/files/:fileId',
78
+ params: FileIdPath,
79
+ response: File,
65
80
  plane: 'baas',
66
- summary: 'Get file metadata by ID',
81
+ summary: 'Get file metadata.',
67
82
  tags: ['storage'],
68
83
  }),
69
- delete: defineEndpoint({
84
+ deleteFile: defineEndpoint({
70
85
  method: 'DELETE',
71
- path: '/storage/files/:id',
72
- params: IdPath,
73
- response: DeleteFileResult,
86
+ path: '/storage/files/:fileId',
87
+ params: FileIdPath,
88
+ response: SoftDeleteFileResult,
74
89
  plane: 'baas',
75
- summary: 'Soft-delete a stored file (ADR-089 Phase 5.8)',
90
+ summary: 'Soft-delete a file. Restorable via `:restore`.',
76
91
  tags: ['storage'],
77
92
  }),
78
- // ADR-089 Phase 5.8 — versioning + soft-delete restore
79
- listVersions: defineEndpoint({
80
- method: 'GET',
81
- path: '/storage/files/:id/versions',
82
- params: IdPath,
83
- response: ListFileVersionsResult,
93
+ restoreFile: defineEndpoint({
94
+ method: 'POST',
95
+ path: '/storage/files/:fileId:restore',
96
+ params: FileIdPath,
97
+ response: RestoreFileResult,
84
98
  plane: 'baas',
85
- summary: 'List all versions of a file, newest first',
99
+ summary: 'Restore a soft-deleted file.',
86
100
  tags: ['storage'],
87
101
  }),
88
- restoreVersion: defineEndpoint({
102
+ signFileUrl: defineEndpoint({
89
103
  method: 'POST',
90
- path: '/storage/files/:id/versions/:versionId/restore',
91
- params: FileVersionPath,
92
- response: RestoreVersionResult,
104
+ path: '/storage/files/:fileId:signedUrl',
105
+ params: FileIdPath,
106
+ body: SignedUrlRequest,
107
+ response: SignedUrlResult,
93
108
  plane: 'baas',
94
- summary: 'Restore an older version as the current version',
109
+ summary: 'Mint a short-lived signed download URL for a private file.',
95
110
  tags: ['storage'],
96
111
  }),
97
- restoreFile: defineEndpoint({
112
+ copyFile: defineEndpoint({
98
113
  method: 'POST',
99
- path: '/storage/files/:id/restore',
100
- params: IdPath,
101
- response: RestoreFileResult,
114
+ path: '/storage/files/:fileId:copy',
115
+ params: FileIdPath,
116
+ body: CopyFileRequest,
117
+ response: CopyFileResult,
118
+ plane: 'baas',
119
+ summary: 'Server-side copy (no client bandwidth).',
120
+ tags: ['storage'],
121
+ }),
122
+ // --------------------------------------------------------------------------
123
+ // Versions
124
+ // --------------------------------------------------------------------------
125
+ listFileVersions: defineEndpoint({
126
+ method: 'GET',
127
+ path: '/storage/files/:fileId/versions',
128
+ params: FileIdPath,
129
+ response: ListFileVersionsResult,
130
+ plane: 'baas',
131
+ summary: 'List versions of a file (newest first).',
132
+ tags: ['storage'],
133
+ }),
134
+ restoreFileVersion: defineEndpoint({
135
+ method: 'POST',
136
+ path: '/storage/files/:fileId/versions/:versionId:restore',
137
+ params: FileVersionPath,
138
+ response: RestoreVersionResult,
102
139
  plane: 'baas',
103
- summary: 'Restore a soft-deleted file',
140
+ summary: 'Restore an older version as the current version (append-only history).',
104
141
  tags: ['storage'],
105
142
  }),
106
143
  };
package/dist/index.d.ts CHANGED
@@ -3636,6 +3636,47 @@ export declare const endpoints: {
3636
3636
  emailVerified: typeof import("effect/Schema").Boolean;
3637
3637
  }>>;
3638
3638
  }>>;
3639
+ readonly getPrincipal: import("./endpoint.js").Endpoint<"GET", "/auth/principal", import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Union<[import("effect/Schema").Struct<{
3640
+ principalType: import("effect/Schema").Literal<["user"]>;
3641
+ user: import("effect/Schema").Struct<{
3642
+ id: import("effect/Schema").brand<import("effect/Schema").filter<typeof import("effect/Schema").String>, "UserId">;
3643
+ email: typeof import("effect/Schema").String;
3644
+ name: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
3645
+ }>;
3646
+ orgs: import("effect/Schema").Array$<import("effect/Schema").Struct<{
3647
+ id: import("effect/Schema").brand<import("effect/Schema").filter<typeof import("effect/Schema").String>, "OrgId">;
3648
+ slug: typeof import("effect/Schema").String;
3649
+ name: typeof import("effect/Schema").String;
3650
+ email: import("effect/Schema").optional<import("effect/Schema").NullOr<typeof import("effect/Schema").String>>;
3651
+ billingEmail: import("effect/Schema").optional<import("effect/Schema").NullOr<typeof import("effect/Schema").String>>;
3652
+ logoUrl: import("effect/Schema").optional<import("effect/Schema").NullOr<typeof import("effect/Schema").String>>;
3653
+ metadata: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Unknown>>>;
3654
+ createdAt: import("effect/Schema").optional<typeof import("effect/Schema").String>;
3655
+ }>>;
3656
+ }>, import("effect/Schema").Struct<{
3657
+ principalType: import("effect/Schema").Literal<["service_token"]>;
3658
+ serviceToken: import("effect/Schema").Struct<{
3659
+ id: typeof import("effect/Schema").String;
3660
+ name: typeof import("effect/Schema").String;
3661
+ tokenType: import("effect/Schema").Literal<["service", "oidc"]>;
3662
+ tokenPrefix: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
3663
+ orgId: typeof import("effect/Schema").String;
3664
+ projectId: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
3665
+ environmentId: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
3666
+ scopes: import("effect/Schema").Array$<typeof import("effect/Schema").String>;
3667
+ expiresAt: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
3668
+ }>;
3669
+ org: import("effect/Schema").Struct<{
3670
+ id: import("effect/Schema").brand<import("effect/Schema").filter<typeof import("effect/Schema").String>, "OrgId">;
3671
+ slug: typeof import("effect/Schema").String;
3672
+ name: typeof import("effect/Schema").String;
3673
+ email: import("effect/Schema").optional<import("effect/Schema").NullOr<typeof import("effect/Schema").String>>;
3674
+ billingEmail: import("effect/Schema").optional<import("effect/Schema").NullOr<typeof import("effect/Schema").String>>;
3675
+ logoUrl: import("effect/Schema").optional<import("effect/Schema").NullOr<typeof import("effect/Schema").String>>;
3676
+ metadata: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Unknown>>>;
3677
+ createdAt: import("effect/Schema").optional<typeof import("effect/Schema").String>;
3678
+ }>;
3679
+ }>]>>;
3639
3680
  readonly deviceInit: import("./endpoint.js").Endpoint<"POST", "/auth/device", import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
3640
3681
  client_id: typeof import("effect/Schema").String;
3641
3682
  scope: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
@@ -11877,153 +11918,217 @@ export declare const endpoints: {
11877
11918
  }>>;
11878
11919
  };
11879
11920
  readonly storage: {
11880
- readonly upload: import("./endpoint.js").Endpoint<"POST", "/storage/upload", import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
11881
- filename: typeof import("effect/Schema").String;
11882
- contentType: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11883
- size: import("effect/Schema").optional<typeof import("effect/Schema").Number>;
11884
- path: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11885
- type: import("effect/Schema").optional<import("effect/Schema").Literal<["file", "avatar"]>>;
11886
- userId: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11921
+ readonly createUpload: import("./endpoint.js").Endpoint<"POST", "/storage/uploads", import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
11922
+ filename: import("effect/Schema").filter<typeof import("effect/Schema").String>;
11923
+ contentType: import("effect/Schema").filter<typeof import("effect/Schema").String>;
11924
+ size: import("effect/Schema").filter<typeof import("effect/Schema").Number>;
11925
+ folder: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11926
+ visibility: import("effect/Schema").optional<import("effect/Schema").Literal<["public", "private"]>>;
11887
11927
  metadata: import("effect/Schema").optional<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Unknown>>;
11928
+ checksumSha256: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11929
+ ifNoneMatch: import("effect/Schema").optional<import("effect/Schema").Literal<["*"]>>;
11930
+ }>, import("effect/Schema").Union<[import("effect/Schema").Struct<{
11931
+ method: import("effect/Schema").Literal<["PUT"]>;
11932
+ uploadId: import("effect/Schema").brand<typeof import("effect/Schema").String, "UploadId">;
11933
+ fileId: import("effect/Schema").brand<typeof import("effect/Schema").String, "FileId">;
11934
+ url: typeof import("effect/Schema").String;
11935
+ headers: import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").String>;
11936
+ expiresAt: typeof import("effect/Schema").DateFromString;
11937
+ }>, import("effect/Schema").Struct<{
11938
+ method: import("effect/Schema").Literal<["MULTIPART"]>;
11939
+ uploadId: import("effect/Schema").brand<typeof import("effect/Schema").String, "UploadId">;
11940
+ fileId: import("effect/Schema").brand<typeof import("effect/Schema").String, "FileId">;
11941
+ partSize: typeof import("effect/Schema").Number;
11942
+ partCount: typeof import("effect/Schema").Number;
11943
+ parts: import("effect/Schema").Array$<import("effect/Schema").Struct<{
11944
+ partNumber: import("effect/Schema").filter<typeof import("effect/Schema").Number>;
11945
+ url: typeof import("effect/Schema").String;
11946
+ expiresAt: typeof import("effect/Schema").DateFromString;
11947
+ }>>;
11948
+ expiresAt: typeof import("effect/Schema").DateFromString;
11949
+ }>]>>;
11950
+ readonly abortUpload: import("./endpoint.js").Endpoint<"DELETE", "/storage/uploads/:uploadId", import("effect/Schema").Struct<{
11951
+ uploadId: typeof import("effect/Schema").String;
11952
+ }>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{}>>;
11953
+ readonly presignUploadPart: import("./endpoint.js").Endpoint<"POST", "/storage/uploads/:uploadId/parts/:partNumber", import("effect/Schema").Struct<{
11954
+ uploadId: typeof import("effect/Schema").String;
11955
+ partNumber: typeof import("effect/Schema").NumberFromString;
11956
+ }>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
11957
+ url: typeof import("effect/Schema").String;
11958
+ expiresAt: typeof import("effect/Schema").DateFromString;
11959
+ }>>;
11960
+ readonly completeUpload: import("./endpoint.js").Endpoint<"POST", "/storage/uploads/:uploadId:complete", import("effect/Schema").Struct<{
11961
+ uploadId: typeof import("effect/Schema").String;
11962
+ }>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
11963
+ parts: import("effect/Schema").Array$<import("effect/Schema").Struct<{
11964
+ partNumber: import("effect/Schema").filter<typeof import("effect/Schema").Number>;
11965
+ etag: import("effect/Schema").filter<typeof import("effect/Schema").String>;
11966
+ }>>;
11888
11967
  }>, import("effect/Schema").Struct<{
11889
- uploadUrl: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11890
- publicUrl: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11891
- fileId: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11892
- expiresAt: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11893
- presignedUrl: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11894
- storageKey: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11895
- tokenPayload: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11896
- url: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11897
- uploadEndpoint: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11898
- clientPayload: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11899
- maxSize: import("effect/Schema").optional<typeof import("effect/Schema").Number>;
11900
- maxMultipartSize: import("effect/Schema").optional<typeof import("effect/Schema").Number>;
11901
- multipartThreshold: import("effect/Schema").optional<typeof import("effect/Schema").Number>;
11902
- allowedContentTypes: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
11903
- instructions: import("effect/Schema").optional<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Unknown>>;
11904
- }>>;
11905
- readonly presignedUrl: import("./endpoint.js").Endpoint<"POST", "/storage/upload-url", import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
11968
+ fileId: import("effect/Schema").brand<typeof import("effect/Schema").String, "FileId">;
11969
+ url: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
11970
+ size: typeof import("effect/Schema").Number;
11971
+ etag: typeof import("effect/Schema").String;
11972
+ checksumSha256: typeof import("effect/Schema").String;
11973
+ }>>;
11974
+ readonly listFiles: import("./endpoint.js").Endpoint<"GET", "/storage/files", import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
11975
+ folder: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11976
+ cursor: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11977
+ limit: import("effect/Schema").optional<typeof import("effect/Schema").Number>;
11978
+ includeDeleted: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
11979
+ }>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
11980
+ files: import("effect/Schema").Array$<import("effect/Schema").Struct<{
11981
+ id: import("effect/Schema").brand<typeof import("effect/Schema").String, "FileId">;
11982
+ filename: typeof import("effect/Schema").String;
11983
+ contentType: typeof import("effect/Schema").String;
11984
+ size: typeof import("effect/Schema").Number;
11985
+ checksumSha256: typeof import("effect/Schema").String;
11986
+ etag: typeof import("effect/Schema").String;
11987
+ visibility: import("effect/Schema").Literal<["public", "private"]>;
11988
+ folder: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
11989
+ metadata: import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Unknown>;
11990
+ url: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
11991
+ isDeleted: typeof import("effect/Schema").Boolean;
11992
+ createdAt: typeof import("effect/Schema").DateFromString;
11993
+ updatedAt: typeof import("effect/Schema").DateFromString;
11994
+ }>>;
11995
+ nextCursor: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
11996
+ }>>;
11997
+ readonly getFile: import("./endpoint.js").Endpoint<"GET", "/storage/files/:fileId", import("effect/Schema").Struct<{
11998
+ fileId: typeof import("effect/Schema").String;
11999
+ }>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
12000
+ id: import("effect/Schema").brand<typeof import("effect/Schema").String, "FileId">;
11906
12001
  filename: typeof import("effect/Schema").String;
11907
12002
  contentType: typeof import("effect/Schema").String;
11908
- size: import("effect/Schema").optional<typeof import("effect/Schema").Number>;
11909
- }>, import("effect/Schema").Struct<{
11910
- uploadUrl: typeof import("effect/Schema").String;
12003
+ size: typeof import("effect/Schema").Number;
12004
+ checksumSha256: typeof import("effect/Schema").String;
12005
+ etag: typeof import("effect/Schema").String;
12006
+ visibility: import("effect/Schema").Literal<["public", "private"]>;
12007
+ folder: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
12008
+ metadata: import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Unknown>;
12009
+ url: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
12010
+ isDeleted: typeof import("effect/Schema").Boolean;
12011
+ createdAt: typeof import("effect/Schema").DateFromString;
12012
+ updatedAt: typeof import("effect/Schema").DateFromString;
12013
+ }>>;
12014
+ readonly deleteFile: import("./endpoint.js").Endpoint<"DELETE", "/storage/files/:fileId", import("effect/Schema").Struct<{
11911
12015
  fileId: typeof import("effect/Schema").String;
11912
- expiresAt: typeof import("effect/Schema").String;
12016
+ }>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
12017
+ id: import("effect/Schema").brand<typeof import("effect/Schema").String, "FileId">;
12018
+ isDeleted: import("effect/Schema").Literal<[true]>;
11913
12019
  }>>;
11914
- readonly signedUrl: import("./endpoint.js").Endpoint<"POST", "/storage/signed-url", import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
12020
+ readonly restoreFile: import("./endpoint.js").Endpoint<"POST", "/storage/files/:fileId:restore", import("effect/Schema").Struct<{
11915
12021
  fileId: typeof import("effect/Schema").String;
11916
- expiresIn: import("effect/Schema").optional<typeof import("effect/Schema").Number>;
12022
+ }>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
12023
+ id: import("effect/Schema").brand<typeof import("effect/Schema").String, "FileId">;
12024
+ filename: typeof import("effect/Schema").String;
12025
+ contentType: typeof import("effect/Schema").String;
12026
+ size: typeof import("effect/Schema").Number;
12027
+ checksumSha256: typeof import("effect/Schema").String;
12028
+ etag: typeof import("effect/Schema").String;
12029
+ visibility: import("effect/Schema").Literal<["public", "private"]>;
12030
+ folder: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
12031
+ metadata: import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Unknown>;
12032
+ url: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
12033
+ isDeleted: typeof import("effect/Schema").Boolean;
12034
+ createdAt: typeof import("effect/Schema").DateFromString;
12035
+ updatedAt: typeof import("effect/Schema").DateFromString;
12036
+ }>>;
12037
+ readonly signFileUrl: import("./endpoint.js").Endpoint<"POST", "/storage/files/:fileId:signedUrl", import("effect/Schema").Struct<{
12038
+ fileId: typeof import("effect/Schema").String;
12039
+ }>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
12040
+ expiresIn: import("effect/Schema").optional<import("effect/Schema").filter<typeof import("effect/Schema").Number>>;
11917
12041
  disposition: import("effect/Schema").optional<import("effect/Schema").Literal<["attachment", "inline"]>>;
11918
12042
  userId: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11919
12043
  }>, import("effect/Schema").Struct<{
11920
12044
  url: typeof import("effect/Schema").String;
11921
- expiresAt: typeof import("effect/Schema").String;
12045
+ expiresAt: typeof import("effect/Schema").DateFromString;
11922
12046
  file: import("effect/Schema").Struct<{
11923
- id: typeof import("effect/Schema").String;
12047
+ id: import("effect/Schema").brand<typeof import("effect/Schema").String, "FileId">;
11924
12048
  filename: typeof import("effect/Schema").String;
11925
- mimeType: typeof import("effect/Schema").String;
11926
- sizeBytes: typeof import("effect/Schema").Number;
11927
- isPrivate: typeof import("effect/Schema").Boolean;
12049
+ contentType: typeof import("effect/Schema").String;
12050
+ size: typeof import("effect/Schema").Number;
12051
+ checksumSha256: typeof import("effect/Schema").String;
12052
+ etag: typeof import("effect/Schema").String;
12053
+ visibility: import("effect/Schema").Literal<["public", "private"]>;
12054
+ folder: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
12055
+ metadata: import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Unknown>;
12056
+ url: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
12057
+ isDeleted: typeof import("effect/Schema").Boolean;
12058
+ createdAt: typeof import("effect/Schema").DateFromString;
12059
+ updatedAt: typeof import("effect/Schema").DateFromString;
11928
12060
  }>;
11929
12061
  }>>;
11930
- readonly list: import("./endpoint.js").Endpoint<"GET", "/storage/files", import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
11931
- prefix: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11932
- limit: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11933
- cursor: import("effect/Schema").optional<typeof import("effect/Schema").String>;
12062
+ readonly copyFile: import("./endpoint.js").Endpoint<"POST", "/storage/files/:fileId:copy", import("effect/Schema").Struct<{
12063
+ fileId: typeof import("effect/Schema").String;
11934
12064
  }>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
11935
- files: import("effect/Schema").Array$<import("effect/Schema").Struct<{
11936
- id: typeof import("effect/Schema").String;
11937
- size: typeof import("effect/Schema").Number;
11938
- name: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11939
- filename: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11940
- path: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11941
- key: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11942
- url: import("effect/Schema").optional<import("effect/Schema").NullOr<typeof import("effect/Schema").String>>;
11943
- contentType: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11944
- mimeType: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11945
- isPrivate: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
11946
- metadata: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Unknown>>>;
11947
- createdAt: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11948
- uploadedAt: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11949
- }>>;
11950
- nextCursor: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
11951
- hasMore: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
11952
- }>>;
11953
- readonly get: import("./endpoint.js").Endpoint<"GET", "/storage/files/:id", import("effect/Schema").Struct<{
11954
- id: typeof import("effect/Schema").String;
11955
- }>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
11956
- id: typeof import("effect/Schema").String;
11957
- size: typeof import("effect/Schema").Number;
11958
- name: import("effect/Schema").optional<typeof import("effect/Schema").String>;
12065
+ folder: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11959
12066
  filename: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11960
- path: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11961
- key: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11962
- url: import("effect/Schema").optional<import("effect/Schema").NullOr<typeof import("effect/Schema").String>>;
11963
- contentType: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11964
- mimeType: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11965
- isPrivate: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
11966
- metadata: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Unknown>>>;
11967
- createdAt: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11968
- uploadedAt: import("effect/Schema").optional<typeof import("effect/Schema").String>;
11969
- }>>;
11970
- readonly delete: import("./endpoint.js").Endpoint<"DELETE", "/storage/files/:id", import("effect/Schema").Struct<{
11971
- id: typeof import("effect/Schema").String;
11972
- }>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
11973
- success: typeof import("effect/Schema").Boolean;
12067
+ visibility: import("effect/Schema").optional<import("effect/Schema").Literal<["public", "private"]>>;
12068
+ metadata: import("effect/Schema").optional<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Unknown>>;
12069
+ }>, import("effect/Schema").Struct<{
12070
+ id: import("effect/Schema").brand<typeof import("effect/Schema").String, "FileId">;
12071
+ filename: typeof import("effect/Schema").String;
12072
+ contentType: typeof import("effect/Schema").String;
12073
+ size: typeof import("effect/Schema").Number;
12074
+ checksumSha256: typeof import("effect/Schema").String;
12075
+ etag: typeof import("effect/Schema").String;
12076
+ visibility: import("effect/Schema").Literal<["public", "private"]>;
12077
+ folder: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
12078
+ metadata: import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Unknown>;
12079
+ url: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
12080
+ isDeleted: typeof import("effect/Schema").Boolean;
12081
+ createdAt: typeof import("effect/Schema").DateFromString;
12082
+ updatedAt: typeof import("effect/Schema").DateFromString;
11974
12083
  }>>;
11975
- readonly listVersions: import("./endpoint.js").Endpoint<"GET", "/storage/files/:id/versions", import("effect/Schema").Struct<{
11976
- id: typeof import("effect/Schema").String;
12084
+ readonly listFileVersions: import("./endpoint.js").Endpoint<"GET", "/storage/files/:fileId/versions", import("effect/Schema").Struct<{
12085
+ fileId: typeof import("effect/Schema").String;
11977
12086
  }>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
11978
12087
  versions: import("effect/Schema").Array$<import("effect/Schema").Struct<{
11979
- id: typeof import("effect/Schema").String;
11980
- fileId: typeof import("effect/Schema").String;
12088
+ id: import("effect/Schema").brand<typeof import("effect/Schema").String, "FileVersionId">;
12089
+ fileId: import("effect/Schema").brand<typeof import("effect/Schema").String, "FileId">;
11981
12090
  versionNumber: typeof import("effect/Schema").Number;
11982
- sizeBytes: typeof import("effect/Schema").Number;
11983
- contentType: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
11984
- checksumSha256: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
11985
- createdAt: typeof import("effect/Schema").String;
12091
+ size: typeof import("effect/Schema").Number;
12092
+ contentType: typeof import("effect/Schema").String;
12093
+ checksumSha256: typeof import("effect/Schema").String;
12094
+ etag: typeof import("effect/Schema").String;
12095
+ createdAt: typeof import("effect/Schema").DateFromString;
11986
12096
  createdBy: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
11987
12097
  isCurrent: typeof import("effect/Schema").Boolean;
11988
12098
  }>>;
11989
12099
  }>>;
11990
- readonly restoreVersion: import("./endpoint.js").Endpoint<"POST", "/storage/files/:id/versions/:versionId/restore", import("effect/Schema").Struct<{
11991
- id: typeof import("effect/Schema").String;
12100
+ readonly restoreFileVersion: import("./endpoint.js").Endpoint<"POST", "/storage/files/:fileId/versions/:versionId:restore", import("effect/Schema").Struct<{
12101
+ fileId: typeof import("effect/Schema").String;
11992
12102
  versionId: typeof import("effect/Schema").String;
11993
12103
  }>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
11994
- success: import("effect/Schema").Literal<[true]>;
12104
+ file: import("effect/Schema").Struct<{
12105
+ id: import("effect/Schema").brand<typeof import("effect/Schema").String, "FileId">;
12106
+ filename: typeof import("effect/Schema").String;
12107
+ contentType: typeof import("effect/Schema").String;
12108
+ size: typeof import("effect/Schema").Number;
12109
+ checksumSha256: typeof import("effect/Schema").String;
12110
+ etag: typeof import("effect/Schema").String;
12111
+ visibility: import("effect/Schema").Literal<["public", "private"]>;
12112
+ folder: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
12113
+ metadata: import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Unknown>;
12114
+ url: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
12115
+ isDeleted: typeof import("effect/Schema").Boolean;
12116
+ createdAt: typeof import("effect/Schema").DateFromString;
12117
+ updatedAt: typeof import("effect/Schema").DateFromString;
12118
+ }>;
11995
12119
  version: import("effect/Schema").Struct<{
11996
- id: typeof import("effect/Schema").String;
11997
- fileId: typeof import("effect/Schema").String;
12120
+ id: import("effect/Schema").brand<typeof import("effect/Schema").String, "FileVersionId">;
12121
+ fileId: import("effect/Schema").brand<typeof import("effect/Schema").String, "FileId">;
11998
12122
  versionNumber: typeof import("effect/Schema").Number;
11999
- sizeBytes: typeof import("effect/Schema").Number;
12000
- contentType: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
12001
- checksumSha256: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
12002
- createdAt: typeof import("effect/Schema").String;
12123
+ size: typeof import("effect/Schema").Number;
12124
+ contentType: typeof import("effect/Schema").String;
12125
+ checksumSha256: typeof import("effect/Schema").String;
12126
+ etag: typeof import("effect/Schema").String;
12127
+ createdAt: typeof import("effect/Schema").DateFromString;
12003
12128
  createdBy: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
12004
12129
  isCurrent: typeof import("effect/Schema").Boolean;
12005
12130
  }>;
12006
12131
  }>>;
12007
- readonly restoreFile: import("./endpoint.js").Endpoint<"POST", "/storage/files/:id/restore", import("effect/Schema").Struct<{
12008
- id: typeof import("effect/Schema").String;
12009
- }>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
12010
- success: import("effect/Schema").Literal<[true]>;
12011
- file: import("effect/Schema").Struct<{
12012
- id: typeof import("effect/Schema").String;
12013
- size: typeof import("effect/Schema").Number;
12014
- name: import("effect/Schema").optional<typeof import("effect/Schema").String>;
12015
- filename: import("effect/Schema").optional<typeof import("effect/Schema").String>;
12016
- path: import("effect/Schema").optional<typeof import("effect/Schema").String>;
12017
- key: import("effect/Schema").optional<typeof import("effect/Schema").String>;
12018
- url: import("effect/Schema").optional<import("effect/Schema").NullOr<typeof import("effect/Schema").String>>;
12019
- contentType: import("effect/Schema").optional<typeof import("effect/Schema").String>;
12020
- mimeType: import("effect/Schema").optional<typeof import("effect/Schema").String>;
12021
- isPrivate: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
12022
- metadata: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Unknown>>>;
12023
- createdAt: import("effect/Schema").optional<typeof import("effect/Schema").String>;
12024
- uploadedAt: import("effect/Schema").optional<typeof import("effect/Schema").String>;
12025
- }>;
12026
- }>>;
12027
12132
  };
12028
12133
  readonly storageAdmin: {
12029
12134
  readonly listBuckets: import("./endpoint.js").Endpoint<"GET", "/storage/projects/:id/buckets", import("effect/Schema").Struct<{