kassza 0.1.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 (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +150 -0
  3. package/agents/README.md +59 -0
  4. package/agents/api.md +206 -0
  5. package/agents/pitfalls.md +52 -0
  6. package/agents/recipes.md +217 -0
  7. package/agents/skills/kassza/SKILL.md +29 -0
  8. package/assets/logo-wordmark.svg +25 -0
  9. package/assets/logo.svg +19 -0
  10. package/dist/binary-B89HM03_.cjs +63 -0
  11. package/dist/binary-D0M9U2MD.js +34 -0
  12. package/dist/client-B9kbKKBf.d.cts +748 -0
  13. package/dist/client-zv4enyq7.d.ts +748 -0
  14. package/dist/cookie-stores/index.cjs +153 -0
  15. package/dist/cookie-stores/index.d.cts +63 -0
  16. package/dist/cookie-stores/index.d.ts +63 -0
  17. package/dist/cookie-stores/index.js +144 -0
  18. package/dist/create-BZd6CUO7.cjs +1160 -0
  19. package/dist/create-DDZaNlOz.js +939 -0
  20. package/dist/dates-D2XebOIg.js +34 -0
  21. package/dist/dates-DtHzwNU6.d.cts +7 -0
  22. package/dist/dates-DtHzwNU6.d.ts +7 -0
  23. package/dist/dates-PPxH0n5H.cjs +57 -0
  24. package/dist/errors-B0QJhUW1.cjs +302 -0
  25. package/dist/errors-DapdV5DK.js +273 -0
  26. package/dist/index-CYAGCdKJ.d.cts +56 -0
  27. package/dist/index-CYAGCdKJ.d.ts +56 -0
  28. package/dist/index.cjs +1406 -0
  29. package/dist/index.d.cts +8 -0
  30. package/dist/index.d.ts +8 -0
  31. package/dist/index.js +1394 -0
  32. package/dist/ipn/index.cjs +108 -0
  33. package/dist/ipn/index.d.cts +32 -0
  34. package/dist/ipn/index.d.ts +32 -0
  35. package/dist/ipn/index.js +101 -0
  36. package/dist/money/index.cjs +15 -0
  37. package/dist/money/index.d.cts +2 -0
  38. package/dist/money/index.d.ts +2 -0
  39. package/dist/money/index.js +2 -0
  40. package/dist/money-C9j7nBNP.js +258 -0
  41. package/dist/money-DkiGukAw.cjs +335 -0
  42. package/dist/session-CRGOuz-R.cjs +100 -0
  43. package/dist/session-Dm_45x8K.d.cts +11 -0
  44. package/dist/session-Dm_45x8K.d.ts +11 -0
  45. package/dist/session-OJMLGufT.js +77 -0
  46. package/dist/shared-CrxlxI8n.cjs +207 -0
  47. package/dist/shared-D6DLa4b7.js +100 -0
  48. package/dist/storage/fs.cjs +88 -0
  49. package/dist/storage/fs.d.cts +13 -0
  50. package/dist/storage/fs.d.ts +13 -0
  51. package/dist/storage/fs.js +87 -0
  52. package/dist/storage/index.cjs +643 -0
  53. package/dist/storage/index.d.cts +288 -0
  54. package/dist/storage/index.d.ts +288 -0
  55. package/dist/storage/index.js +619 -0
  56. package/dist/testing/index.cjs +409 -0
  57. package/dist/testing/index.d.cts +35 -0
  58. package/dist/testing/index.d.ts +35 -0
  59. package/dist/testing/index.js +407 -0
  60. package/dist/types-DVRgwcqg.d.cts +26 -0
  61. package/dist/types-DVRgwcqg.d.ts +26 -0
  62. package/dist/validators/index.cjs +296 -0
  63. package/dist/validators/index.d.cts +51 -0
  64. package/dist/validators/index.d.ts +51 -0
  65. package/dist/validators/index.js +278 -0
  66. package/llms.txt +16 -0
  67. package/package.json +151 -0
@@ -0,0 +1,288 @@
1
+ import { t as DateInput } from "../dates-DtHzwNU6.cjs";
2
+ import { a as StoredFile, i as StorageUrlOptions, n as StorageAdapter, r as StoragePutOptions, t as CompleteStorageAdapter } from "../types-DVRgwcqg.cjs";
3
+ //#region src/storage/errors.d.ts
4
+ type StorageOperation = "put" | "get" | "delete" | "getUrl" | "key";
5
+ interface StorageErrorOptions {
6
+ readonly operation: StorageOperation;
7
+ readonly key?: string | undefined;
8
+ readonly status?: number | undefined;
9
+ readonly cause?: unknown;
10
+ }
11
+ export declare class StorageError extends Error {
12
+ override readonly name: string;
13
+ readonly operation: StorageOperation;
14
+ readonly key: string | undefined;
15
+ readonly status: number | undefined;
16
+ constructor(message: string, options: StorageErrorOptions);
17
+ }
18
+ export declare function isStorageError(error: unknown): error is StorageError;
19
+ export declare function guardStorageCall<T>(service: string, operation: StorageOperation, key: string, call: () => PromiseLike<T>): Promise<T>;
20
+ //#endregion
21
+ //#region src/storage/keys.d.ts
22
+ type InvoiceDocumentKind = "invoice" | "proforma" | "advance" | "final" | "corrective" | "storno" | "deliveryNote";
23
+ interface InvoicePdfKeyInput {
24
+ readonly number: string;
25
+ readonly type?: InvoiceDocumentKind | undefined;
26
+ readonly prefix?: string | undefined;
27
+ readonly date?: DateInput | undefined;
28
+ }
29
+ interface ReceiptPdfKeyInput {
30
+ readonly number: string;
31
+ readonly prefix?: string | undefined;
32
+ readonly date?: DateInput | undefined;
33
+ }
34
+ export declare const DEFAULT_INVOICE_KEY_PREFIX = "szamlak";
35
+ export declare const DEFAULT_RECEIPT_KEY_PREFIX = "nyugtak";
36
+ export declare function sanitizeKeySegment(value: string): string;
37
+ export declare function invoicePdfKey(input: InvoicePdfKeyInput): string;
38
+ export declare function receiptPdfKey(input: ReceiptPdfKeyInput): string;
39
+ //#endregion
40
+ //#region src/storage/memory.d.ts
41
+ interface MemoryStoredObject {
42
+ readonly body: Uint8Array;
43
+ readonly contentType: string;
44
+ }
45
+ interface MemoryStorageOptions {
46
+ readonly publicBaseUrl?: string | undefined;
47
+ readonly prefix?: string | undefined;
48
+ }
49
+ interface MemoryStorage extends CompleteStorageAdapter {
50
+ readonly files: ReadonlyMap<string, MemoryStoredObject>;
51
+ clear(): void;
52
+ }
53
+ export declare function memoryStorage(options?: MemoryStorageOptions): MemoryStorage;
54
+ //#endregion
55
+ //#region src/storage/r2-binding.d.ts
56
+ interface R2ObjectLike {
57
+ readonly key: string;
58
+ readonly size: number;
59
+ }
60
+ interface R2ObjectBodyLike extends R2ObjectLike {
61
+ arrayBuffer(): Promise<ArrayBuffer>;
62
+ }
63
+ interface R2PutOptionsLike {
64
+ readonly httpMetadata: {
65
+ readonly contentType: string;
66
+ };
67
+ }
68
+ interface R2BucketLike {
69
+ put(key: string, value: Uint8Array, options: R2PutOptionsLike): Promise<R2ObjectLike | null>;
70
+ get(key: string): Promise<R2ObjectBodyLike | null>;
71
+ delete(key: string): Promise<void>;
72
+ }
73
+ interface R2BindingStorageOptions {
74
+ readonly publicBaseUrl?: string | undefined;
75
+ readonly prefix?: string | undefined;
76
+ }
77
+ export declare function r2BindingStorage(bucket: R2BucketLike, options?: R2BindingStorageOptions): CompleteStorageAdapter;
78
+ //#endregion
79
+ //#region src/storage/s3.d.ts
80
+ type S3CommandLike = object;
81
+ interface S3ClientLike {
82
+ send(command: S3CommandLike): Promise<unknown>;
83
+ }
84
+ interface S3ObjectInput {
85
+ readonly Bucket: string;
86
+ readonly Key: string;
87
+ }
88
+ interface S3PutObjectInput extends S3ObjectInput {
89
+ readonly Body: Uint8Array;
90
+ readonly ContentType: string;
91
+ readonly ContentLength: number;
92
+ }
93
+ interface S3Commands {
94
+ readonly PutObjectCommand: new (input: S3PutObjectInput) => S3CommandLike;
95
+ readonly GetObjectCommand?: (new (input: S3ObjectInput) => S3CommandLike) | undefined;
96
+ readonly DeleteObjectCommand?: (new (input: S3ObjectInput) => S3CommandLike) | undefined;
97
+ }
98
+ interface S3PresignOptions {
99
+ readonly expiresIn: number;
100
+ }
101
+ interface S3PresignerMethod {
102
+ presign(client: S3ClientLike, command: S3CommandLike, options: S3PresignOptions): Promise<string>;
103
+ }
104
+ type S3GetSignedUrl = S3PresignerMethod["presign"];
105
+ interface S3StorageOptions {
106
+ readonly client: S3ClientLike;
107
+ readonly bucket: string;
108
+ readonly commands: S3Commands;
109
+ readonly publicBaseUrl?: string | undefined;
110
+ readonly prefix?: string | undefined;
111
+ readonly getSignedUrl?: S3GetSignedUrl | undefined;
112
+ }
113
+ export declare function s3Storage(options: S3StorageOptions): CompleteStorageAdapter;
114
+ //#endregion
115
+ //#region src/storage/s3-fetch.d.ts
116
+ interface S3FetchStorageOptions {
117
+ readonly bucket: string;
118
+ readonly region: string;
119
+ readonly accessKeyId: string;
120
+ readonly secretAccessKey: string;
121
+ readonly sessionToken?: string | undefined;
122
+ readonly endpoint?: string | undefined;
123
+ readonly forcePathStyle?: boolean | undefined;
124
+ readonly publicBaseUrl?: string | undefined;
125
+ readonly prefix?: string | undefined;
126
+ readonly fetch?: typeof globalThis.fetch | undefined;
127
+ }
128
+ export declare function s3FetchStorage(options: S3FetchStorageOptions): CompleteStorageAdapter;
129
+ //#endregion
130
+ //#region src/storage/shared.d.ts
131
+ export declare const PDF_CONTENT_TYPE = "application/pdf";
132
+ export declare const S3_MAX_PRESIGN_SECONDS = 604800;
133
+ export declare function assertStorageKey(key: string): string;
134
+ //#endregion
135
+ //#region src/storage/sigv4.d.ts
136
+ interface AwsCredentials {
137
+ readonly accessKeyId: string;
138
+ readonly secretAccessKey: string;
139
+ readonly sessionToken?: string | undefined;
140
+ }
141
+ interface AwsSigningScope {
142
+ readonly credentials: AwsCredentials;
143
+ readonly region: string;
144
+ readonly service: string;
145
+ readonly date?: Date | undefined;
146
+ }
147
+ interface SignAwsRequestInput extends AwsSigningScope {
148
+ readonly method: string;
149
+ readonly url: string | URL;
150
+ readonly headers?: Readonly<Record<string, string>> | undefined;
151
+ readonly body?: Uint8Array | string | undefined;
152
+ readonly payloadHash?: string | undefined;
153
+ }
154
+ interface PresignAwsUrlInput extends AwsSigningScope {
155
+ readonly method: string;
156
+ readonly url: string | URL;
157
+ readonly expiresInSeconds: number;
158
+ }
159
+ export declare function signAwsRequest(input: SignAwsRequestInput): Promise<Record<string, string>>;
160
+ export declare function presignAwsUrl(input: PresignAwsUrlInput): Promise<string>;
161
+ //#endregion
162
+ //#region src/storage/store-pdf.d.ts
163
+ export declare function storePdf(storage: StorageAdapter, key: string, pdf: Uint8Array): Promise<StoredFile>;
164
+ //#endregion
165
+ //#region src/storage/supabase.d.ts
166
+ export declare const SUPABASE_MAX_SIGNED_URL_SECONDS = 31536e3;
167
+ interface SupabaseStorageErrorLike {
168
+ readonly message: string;
169
+ readonly status?: number | undefined;
170
+ readonly statusCode?: string | undefined;
171
+ }
172
+ interface SupabaseResultLike<T> {
173
+ readonly data: T | null;
174
+ readonly error: SupabaseStorageErrorLike | null;
175
+ }
176
+ interface SupabaseUploadOptions {
177
+ readonly contentType: string;
178
+ readonly upsert: boolean;
179
+ readonly cacheControl?: string;
180
+ }
181
+ interface SupabaseBucketApiLike {
182
+ upload(path: string, body: Uint8Array, options: SupabaseUploadOptions): PromiseLike<SupabaseResultLike<{
183
+ readonly path: string;
184
+ }>>;
185
+ download(path: string): PromiseLike<SupabaseResultLike<Blob>>;
186
+ remove(paths: string[]): PromiseLike<SupabaseResultLike<unknown>>;
187
+ createSignedUrl(path: string, expiresIn: number): PromiseLike<SupabaseResultLike<{
188
+ readonly signedUrl: string;
189
+ }>>;
190
+ getPublicUrl(path: string): {
191
+ readonly data: {
192
+ readonly publicUrl: string;
193
+ };
194
+ };
195
+ }
196
+ interface SupabaseClientLike {
197
+ readonly storage: {
198
+ from(bucket: string): SupabaseBucketApiLike;
199
+ };
200
+ }
201
+ interface SupabaseStorageOptions {
202
+ readonly client: SupabaseClientLike;
203
+ readonly bucket: string;
204
+ readonly public?: boolean | undefined;
205
+ readonly upsert?: boolean | undefined;
206
+ readonly cacheControl?: string | undefined;
207
+ readonly prefix?: string | undefined;
208
+ }
209
+ export declare function supabaseStorage(options: SupabaseStorageOptions): CompleteStorageAdapter;
210
+ //#endregion
211
+ //#region src/storage/uploadthing.d.ts
212
+ export declare const UPLOADTHING_MAX_CUSTOM_ID_LENGTH = 128;
213
+ export declare const UPLOADTHING_MAX_SIGNED_URL_SECONDS = 604800;
214
+ type UploadThingAcl = "public-read" | "private";
215
+ interface UploadThingFileLike extends Blob {
216
+ readonly name: string;
217
+ readonly customId: string;
218
+ }
219
+ interface UploadThingUploadOptions {
220
+ readonly acl?: UploadThingAcl;
221
+ readonly contentDisposition?: "inline" | "attachment";
222
+ }
223
+ interface UploadThingUploadedFile {
224
+ readonly key: string;
225
+ readonly size: number;
226
+ readonly ufsUrl?: string;
227
+ readonly url?: string;
228
+ }
229
+ interface UploadThingUploadResult {
230
+ readonly data: UploadThingUploadedFile | null;
231
+ readonly error: {
232
+ readonly message: string;
233
+ } | null;
234
+ }
235
+ interface UploadThingApiLike {
236
+ uploadFiles(file: UploadThingFileLike, options?: UploadThingUploadOptions): Promise<UploadThingUploadResult>;
237
+ deleteFiles(keys: string, options: {
238
+ readonly keyType: "customId";
239
+ }): Promise<unknown>;
240
+ generateSignedURL?(key: string, options: {
241
+ readonly expiresIn: number;
242
+ }): Promise<{
243
+ readonly ufsUrl: string;
244
+ }>;
245
+ }
246
+ interface UploadThingStorageOptions {
247
+ readonly utapi: UploadThingApiLike;
248
+ readonly acl?: UploadThingAcl | undefined;
249
+ readonly contentDisposition?: "inline" | "attachment" | undefined;
250
+ readonly prefix?: string | undefined;
251
+ }
252
+ export declare function uploadthingStorage(options: UploadThingStorageOptions): StorageAdapter;
253
+ //#endregion
254
+ //#region src/storage/vercel-blob.d.ts
255
+ type VercelBlobAccess = "public" | "private";
256
+ interface VercelBlobPutOptions {
257
+ readonly access: VercelBlobAccess;
258
+ readonly contentType: string;
259
+ readonly addRandomSuffix: boolean;
260
+ readonly allowOverwrite: boolean;
261
+ readonly token?: string;
262
+ readonly cacheControlMaxAge?: number;
263
+ }
264
+ interface VercelBlobCommandOptions {
265
+ readonly token?: string;
266
+ }
267
+ interface VercelBlobPutResult {
268
+ readonly url: string;
269
+ readonly pathname: string;
270
+ }
271
+ interface VercelBlobHeadResult {
272
+ readonly url: string;
273
+ }
274
+ interface VercelBlobFunctions {
275
+ put(pathname: string, body: Blob, options: VercelBlobPutOptions): Promise<VercelBlobPutResult>;
276
+ del?(urlOrPathname: string, options?: VercelBlobCommandOptions): Promise<void>;
277
+ head?(urlOrPathname: string, options?: VercelBlobCommandOptions): Promise<VercelBlobHeadResult>;
278
+ }
279
+ interface VercelBlobStorageOptions extends VercelBlobFunctions {
280
+ readonly access: VercelBlobAccess;
281
+ readonly token?: string | undefined;
282
+ readonly prefix?: string | undefined;
283
+ readonly allowOverwrite?: boolean | undefined;
284
+ readonly cacheControlMaxAge?: number | undefined;
285
+ }
286
+ export declare function vercelBlobStorage(options: VercelBlobStorageOptions): StorageAdapter;
287
+ //#endregion
288
+ export type { AwsCredentials, CompleteStorageAdapter, InvoiceDocumentKind, InvoicePdfKeyInput, MemoryStorage, MemoryStorageOptions, MemoryStoredObject, PresignAwsUrlInput, R2BindingStorageOptions, R2BucketLike, R2ObjectBodyLike, R2ObjectLike, R2PutOptionsLike, ReceiptPdfKeyInput, S3ClientLike, S3CommandLike, S3Commands, S3FetchStorageOptions, S3GetSignedUrl, S3ObjectInput, S3PresignOptions, S3PutObjectInput, S3StorageOptions, SignAwsRequestInput, StorageAdapter, StorageErrorOptions, StorageOperation, StoragePutOptions, StorageUrlOptions, StoredFile, SupabaseBucketApiLike, SupabaseClientLike, SupabaseResultLike, SupabaseStorageErrorLike, SupabaseStorageOptions, SupabaseUploadOptions, UploadThingAcl, UploadThingApiLike, UploadThingFileLike, UploadThingStorageOptions, UploadThingUploadOptions, UploadThingUploadResult, UploadThingUploadedFile, VercelBlobAccess, VercelBlobCommandOptions, VercelBlobFunctions, VercelBlobHeadResult, VercelBlobPutOptions, VercelBlobPutResult, VercelBlobStorageOptions };
@@ -0,0 +1,288 @@
1
+ import { t as DateInput } from "../dates-DtHzwNU6.js";
2
+ import { a as StoredFile, i as StorageUrlOptions, n as StorageAdapter, r as StoragePutOptions, t as CompleteStorageAdapter } from "../types-DVRgwcqg.js";
3
+ //#region src/storage/errors.d.ts
4
+ type StorageOperation = "put" | "get" | "delete" | "getUrl" | "key";
5
+ interface StorageErrorOptions {
6
+ readonly operation: StorageOperation;
7
+ readonly key?: string | undefined;
8
+ readonly status?: number | undefined;
9
+ readonly cause?: unknown;
10
+ }
11
+ export declare class StorageError extends Error {
12
+ override readonly name: string;
13
+ readonly operation: StorageOperation;
14
+ readonly key: string | undefined;
15
+ readonly status: number | undefined;
16
+ constructor(message: string, options: StorageErrorOptions);
17
+ }
18
+ export declare function isStorageError(error: unknown): error is StorageError;
19
+ export declare function guardStorageCall<T>(service: string, operation: StorageOperation, key: string, call: () => PromiseLike<T>): Promise<T>;
20
+ //#endregion
21
+ //#region src/storage/keys.d.ts
22
+ type InvoiceDocumentKind = "invoice" | "proforma" | "advance" | "final" | "corrective" | "storno" | "deliveryNote";
23
+ interface InvoicePdfKeyInput {
24
+ readonly number: string;
25
+ readonly type?: InvoiceDocumentKind | undefined;
26
+ readonly prefix?: string | undefined;
27
+ readonly date?: DateInput | undefined;
28
+ }
29
+ interface ReceiptPdfKeyInput {
30
+ readonly number: string;
31
+ readonly prefix?: string | undefined;
32
+ readonly date?: DateInput | undefined;
33
+ }
34
+ export declare const DEFAULT_INVOICE_KEY_PREFIX = "szamlak";
35
+ export declare const DEFAULT_RECEIPT_KEY_PREFIX = "nyugtak";
36
+ export declare function sanitizeKeySegment(value: string): string;
37
+ export declare function invoicePdfKey(input: InvoicePdfKeyInput): string;
38
+ export declare function receiptPdfKey(input: ReceiptPdfKeyInput): string;
39
+ //#endregion
40
+ //#region src/storage/memory.d.ts
41
+ interface MemoryStoredObject {
42
+ readonly body: Uint8Array;
43
+ readonly contentType: string;
44
+ }
45
+ interface MemoryStorageOptions {
46
+ readonly publicBaseUrl?: string | undefined;
47
+ readonly prefix?: string | undefined;
48
+ }
49
+ interface MemoryStorage extends CompleteStorageAdapter {
50
+ readonly files: ReadonlyMap<string, MemoryStoredObject>;
51
+ clear(): void;
52
+ }
53
+ export declare function memoryStorage(options?: MemoryStorageOptions): MemoryStorage;
54
+ //#endregion
55
+ //#region src/storage/r2-binding.d.ts
56
+ interface R2ObjectLike {
57
+ readonly key: string;
58
+ readonly size: number;
59
+ }
60
+ interface R2ObjectBodyLike extends R2ObjectLike {
61
+ arrayBuffer(): Promise<ArrayBuffer>;
62
+ }
63
+ interface R2PutOptionsLike {
64
+ readonly httpMetadata: {
65
+ readonly contentType: string;
66
+ };
67
+ }
68
+ interface R2BucketLike {
69
+ put(key: string, value: Uint8Array, options: R2PutOptionsLike): Promise<R2ObjectLike | null>;
70
+ get(key: string): Promise<R2ObjectBodyLike | null>;
71
+ delete(key: string): Promise<void>;
72
+ }
73
+ interface R2BindingStorageOptions {
74
+ readonly publicBaseUrl?: string | undefined;
75
+ readonly prefix?: string | undefined;
76
+ }
77
+ export declare function r2BindingStorage(bucket: R2BucketLike, options?: R2BindingStorageOptions): CompleteStorageAdapter;
78
+ //#endregion
79
+ //#region src/storage/s3.d.ts
80
+ type S3CommandLike = object;
81
+ interface S3ClientLike {
82
+ send(command: S3CommandLike): Promise<unknown>;
83
+ }
84
+ interface S3ObjectInput {
85
+ readonly Bucket: string;
86
+ readonly Key: string;
87
+ }
88
+ interface S3PutObjectInput extends S3ObjectInput {
89
+ readonly Body: Uint8Array;
90
+ readonly ContentType: string;
91
+ readonly ContentLength: number;
92
+ }
93
+ interface S3Commands {
94
+ readonly PutObjectCommand: new (input: S3PutObjectInput) => S3CommandLike;
95
+ readonly GetObjectCommand?: (new (input: S3ObjectInput) => S3CommandLike) | undefined;
96
+ readonly DeleteObjectCommand?: (new (input: S3ObjectInput) => S3CommandLike) | undefined;
97
+ }
98
+ interface S3PresignOptions {
99
+ readonly expiresIn: number;
100
+ }
101
+ interface S3PresignerMethod {
102
+ presign(client: S3ClientLike, command: S3CommandLike, options: S3PresignOptions): Promise<string>;
103
+ }
104
+ type S3GetSignedUrl = S3PresignerMethod["presign"];
105
+ interface S3StorageOptions {
106
+ readonly client: S3ClientLike;
107
+ readonly bucket: string;
108
+ readonly commands: S3Commands;
109
+ readonly publicBaseUrl?: string | undefined;
110
+ readonly prefix?: string | undefined;
111
+ readonly getSignedUrl?: S3GetSignedUrl | undefined;
112
+ }
113
+ export declare function s3Storage(options: S3StorageOptions): CompleteStorageAdapter;
114
+ //#endregion
115
+ //#region src/storage/s3-fetch.d.ts
116
+ interface S3FetchStorageOptions {
117
+ readonly bucket: string;
118
+ readonly region: string;
119
+ readonly accessKeyId: string;
120
+ readonly secretAccessKey: string;
121
+ readonly sessionToken?: string | undefined;
122
+ readonly endpoint?: string | undefined;
123
+ readonly forcePathStyle?: boolean | undefined;
124
+ readonly publicBaseUrl?: string | undefined;
125
+ readonly prefix?: string | undefined;
126
+ readonly fetch?: typeof globalThis.fetch | undefined;
127
+ }
128
+ export declare function s3FetchStorage(options: S3FetchStorageOptions): CompleteStorageAdapter;
129
+ //#endregion
130
+ //#region src/storage/shared.d.ts
131
+ export declare const PDF_CONTENT_TYPE = "application/pdf";
132
+ export declare const S3_MAX_PRESIGN_SECONDS = 604800;
133
+ export declare function assertStorageKey(key: string): string;
134
+ //#endregion
135
+ //#region src/storage/sigv4.d.ts
136
+ interface AwsCredentials {
137
+ readonly accessKeyId: string;
138
+ readonly secretAccessKey: string;
139
+ readonly sessionToken?: string | undefined;
140
+ }
141
+ interface AwsSigningScope {
142
+ readonly credentials: AwsCredentials;
143
+ readonly region: string;
144
+ readonly service: string;
145
+ readonly date?: Date | undefined;
146
+ }
147
+ interface SignAwsRequestInput extends AwsSigningScope {
148
+ readonly method: string;
149
+ readonly url: string | URL;
150
+ readonly headers?: Readonly<Record<string, string>> | undefined;
151
+ readonly body?: Uint8Array | string | undefined;
152
+ readonly payloadHash?: string | undefined;
153
+ }
154
+ interface PresignAwsUrlInput extends AwsSigningScope {
155
+ readonly method: string;
156
+ readonly url: string | URL;
157
+ readonly expiresInSeconds: number;
158
+ }
159
+ export declare function signAwsRequest(input: SignAwsRequestInput): Promise<Record<string, string>>;
160
+ export declare function presignAwsUrl(input: PresignAwsUrlInput): Promise<string>;
161
+ //#endregion
162
+ //#region src/storage/store-pdf.d.ts
163
+ export declare function storePdf(storage: StorageAdapter, key: string, pdf: Uint8Array): Promise<StoredFile>;
164
+ //#endregion
165
+ //#region src/storage/supabase.d.ts
166
+ export declare const SUPABASE_MAX_SIGNED_URL_SECONDS = 31536e3;
167
+ interface SupabaseStorageErrorLike {
168
+ readonly message: string;
169
+ readonly status?: number | undefined;
170
+ readonly statusCode?: string | undefined;
171
+ }
172
+ interface SupabaseResultLike<T> {
173
+ readonly data: T | null;
174
+ readonly error: SupabaseStorageErrorLike | null;
175
+ }
176
+ interface SupabaseUploadOptions {
177
+ readonly contentType: string;
178
+ readonly upsert: boolean;
179
+ readonly cacheControl?: string;
180
+ }
181
+ interface SupabaseBucketApiLike {
182
+ upload(path: string, body: Uint8Array, options: SupabaseUploadOptions): PromiseLike<SupabaseResultLike<{
183
+ readonly path: string;
184
+ }>>;
185
+ download(path: string): PromiseLike<SupabaseResultLike<Blob>>;
186
+ remove(paths: string[]): PromiseLike<SupabaseResultLike<unknown>>;
187
+ createSignedUrl(path: string, expiresIn: number): PromiseLike<SupabaseResultLike<{
188
+ readonly signedUrl: string;
189
+ }>>;
190
+ getPublicUrl(path: string): {
191
+ readonly data: {
192
+ readonly publicUrl: string;
193
+ };
194
+ };
195
+ }
196
+ interface SupabaseClientLike {
197
+ readonly storage: {
198
+ from(bucket: string): SupabaseBucketApiLike;
199
+ };
200
+ }
201
+ interface SupabaseStorageOptions {
202
+ readonly client: SupabaseClientLike;
203
+ readonly bucket: string;
204
+ readonly public?: boolean | undefined;
205
+ readonly upsert?: boolean | undefined;
206
+ readonly cacheControl?: string | undefined;
207
+ readonly prefix?: string | undefined;
208
+ }
209
+ export declare function supabaseStorage(options: SupabaseStorageOptions): CompleteStorageAdapter;
210
+ //#endregion
211
+ //#region src/storage/uploadthing.d.ts
212
+ export declare const UPLOADTHING_MAX_CUSTOM_ID_LENGTH = 128;
213
+ export declare const UPLOADTHING_MAX_SIGNED_URL_SECONDS = 604800;
214
+ type UploadThingAcl = "public-read" | "private";
215
+ interface UploadThingFileLike extends Blob {
216
+ readonly name: string;
217
+ readonly customId: string;
218
+ }
219
+ interface UploadThingUploadOptions {
220
+ readonly acl?: UploadThingAcl;
221
+ readonly contentDisposition?: "inline" | "attachment";
222
+ }
223
+ interface UploadThingUploadedFile {
224
+ readonly key: string;
225
+ readonly size: number;
226
+ readonly ufsUrl?: string;
227
+ readonly url?: string;
228
+ }
229
+ interface UploadThingUploadResult {
230
+ readonly data: UploadThingUploadedFile | null;
231
+ readonly error: {
232
+ readonly message: string;
233
+ } | null;
234
+ }
235
+ interface UploadThingApiLike {
236
+ uploadFiles(file: UploadThingFileLike, options?: UploadThingUploadOptions): Promise<UploadThingUploadResult>;
237
+ deleteFiles(keys: string, options: {
238
+ readonly keyType: "customId";
239
+ }): Promise<unknown>;
240
+ generateSignedURL?(key: string, options: {
241
+ readonly expiresIn: number;
242
+ }): Promise<{
243
+ readonly ufsUrl: string;
244
+ }>;
245
+ }
246
+ interface UploadThingStorageOptions {
247
+ readonly utapi: UploadThingApiLike;
248
+ readonly acl?: UploadThingAcl | undefined;
249
+ readonly contentDisposition?: "inline" | "attachment" | undefined;
250
+ readonly prefix?: string | undefined;
251
+ }
252
+ export declare function uploadthingStorage(options: UploadThingStorageOptions): StorageAdapter;
253
+ //#endregion
254
+ //#region src/storage/vercel-blob.d.ts
255
+ type VercelBlobAccess = "public" | "private";
256
+ interface VercelBlobPutOptions {
257
+ readonly access: VercelBlobAccess;
258
+ readonly contentType: string;
259
+ readonly addRandomSuffix: boolean;
260
+ readonly allowOverwrite: boolean;
261
+ readonly token?: string;
262
+ readonly cacheControlMaxAge?: number;
263
+ }
264
+ interface VercelBlobCommandOptions {
265
+ readonly token?: string;
266
+ }
267
+ interface VercelBlobPutResult {
268
+ readonly url: string;
269
+ readonly pathname: string;
270
+ }
271
+ interface VercelBlobHeadResult {
272
+ readonly url: string;
273
+ }
274
+ interface VercelBlobFunctions {
275
+ put(pathname: string, body: Blob, options: VercelBlobPutOptions): Promise<VercelBlobPutResult>;
276
+ del?(urlOrPathname: string, options?: VercelBlobCommandOptions): Promise<void>;
277
+ head?(urlOrPathname: string, options?: VercelBlobCommandOptions): Promise<VercelBlobHeadResult>;
278
+ }
279
+ interface VercelBlobStorageOptions extends VercelBlobFunctions {
280
+ readonly access: VercelBlobAccess;
281
+ readonly token?: string | undefined;
282
+ readonly prefix?: string | undefined;
283
+ readonly allowOverwrite?: boolean | undefined;
284
+ readonly cacheControlMaxAge?: number | undefined;
285
+ }
286
+ export declare function vercelBlobStorage(options: VercelBlobStorageOptions): StorageAdapter;
287
+ //#endregion
288
+ export type { AwsCredentials, CompleteStorageAdapter, InvoiceDocumentKind, InvoicePdfKeyInput, MemoryStorage, MemoryStorageOptions, MemoryStoredObject, PresignAwsUrlInput, R2BindingStorageOptions, R2BucketLike, R2ObjectBodyLike, R2ObjectLike, R2PutOptionsLike, ReceiptPdfKeyInput, S3ClientLike, S3CommandLike, S3Commands, S3FetchStorageOptions, S3GetSignedUrl, S3ObjectInput, S3PresignOptions, S3PutObjectInput, S3StorageOptions, SignAwsRequestInput, StorageAdapter, StorageErrorOptions, StorageOperation, StoragePutOptions, StorageUrlOptions, StoredFile, SupabaseBucketApiLike, SupabaseClientLike, SupabaseResultLike, SupabaseStorageErrorLike, SupabaseStorageOptions, SupabaseUploadOptions, UploadThingAcl, UploadThingApiLike, UploadThingFileLike, UploadThingStorageOptions, UploadThingUploadOptions, UploadThingUploadResult, UploadThingUploadedFile, VercelBlobAccess, VercelBlobCommandOptions, VercelBlobFunctions, VercelBlobHeadResult, VercelBlobPutOptions, VercelBlobPutResult, VercelBlobStorageOptions };