@plyaz/types 1.40.1 → 1.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/endpoints/files/index.d.ts +2 -2
- package/dist/api/endpoints/files/schemas.d.ts +30 -19
- package/dist/api/index.cjs +63 -6
- package/dist/api/index.cjs.map +1 -1
- package/dist/api/index.js +62 -7
- package/dist/api/index.js.map +1 -1
- package/dist/core/domain/files/schemas.d.ts +5 -5
- package/package.json +1 -1
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* Single source of truth: types are inferred from Zod schemas
|
|
6
6
|
*/
|
|
7
7
|
export type { FilesEndpointTypes, FilesEndpointKey } from './endpoints';
|
|
8
|
-
export { OutputFormatSchema, AccessLevelSchema, PdfOptionsSchema, FileVariantSchema, UploadFileRequestSchema, UploadFileResponseSchema, UploadFileItemSchema, UploadFilesRequestSchema, UploadFileResultSchema, UploadFilesResponseSchema, GenerateDocumentRequestSchema, GenerateDocumentResponseSchema, GetFileParamsSchema, GetFileRequestSchema, GetFileResponseSchema, DownloadFileParamsSchema, DownloadFileRequestSchema, DownloadFileResponseSchema, DeleteFileParamsSchema, DeleteFileRequestSchema, DeleteFileResponseSchema, GetSignedUrlParamsSchema, GetSignedUrlQuerySchema, GetSignedUrlRequestSchema, GetSignedUrlResponseSchema, } from './schemas';
|
|
9
|
-
export type { OutputFormat, AccessLevel, PdfOptions, FileVariant, UploadFileRequest, UploadFileResponse, UploadFileItem, UploadFilesRequest, UploadFileResult, UploadFilesResponse, GenerateDocumentRequest, GenerateDocumentResponse, GetFileParams, GetFileRequest, GetFileResponse, DownloadFileParams, DownloadFileRequest, DownloadFileResponse, DeleteFileParams, DeleteFileRequest, DeleteFileResponse, GetSignedUrlParams, GetSignedUrlQuery, GetSignedUrlRequest, GetSignedUrlResponse, } from './schemas';
|
|
8
|
+
export { FileCategorySchema, EntityTypeSchema, OutputFormatSchema, AccessLevelSchema, PdfOptionsSchema, FileVariantSchema, UploadFileRequestSchema, UploadFileResponseSchema, UploadFileItemSchema, UploadFilesRequestSchema, UploadFileResultSchema, UploadFilesResponseSchema, GenerateDocumentRequestSchema, GenerateDocumentResponseSchema, GetFileParamsSchema, GetFileRequestSchema, GetFileResponseSchema, DownloadFileParamsSchema, DownloadFileRequestSchema, DownloadFileResponseSchema, DeleteFileParamsSchema, DeleteFileRequestSchema, DeleteFileResponseSchema, GetSignedUrlParamsSchema, GetSignedUrlQuerySchema, GetSignedUrlRequestSchema, GetSignedUrlResponseSchema, } from './schemas';
|
|
9
|
+
export type { FileCategoryType, EntityTypeType, OutputFormat, AccessLevel, PdfOptions, FileVariant, UploadFileRequest, UploadFileResponse, UploadFileItem, UploadFilesRequest, UploadFileResult, UploadFilesResponse, GenerateDocumentRequest, GenerateDocumentResponse, GetFileParams, GetFileRequest, GetFileResponse, DownloadFileParams, DownloadFileRequest, DownloadFileResponse, DeleteFileParams, DeleteFileRequest, DeleteFileResponse, GetSignedUrlParams, GetSignedUrlQuery, GetSignedUrlRequest, GetSignedUrlResponse, } from './schemas';
|
|
@@ -6,14 +6,25 @@
|
|
|
6
6
|
* Single source of truth - types are inferred from schemas.
|
|
7
7
|
*/
|
|
8
8
|
import { z } from 'zod';
|
|
9
|
+
import { FILE_CATEGORY, ENTITY_TYPE } from '../../../storage/enums';
|
|
10
|
+
/**
|
|
11
|
+
* File category schema - uses storage enum values
|
|
12
|
+
*/
|
|
13
|
+
export declare const FileCategorySchema: z.ZodEnum<typeof FILE_CATEGORY>;
|
|
14
|
+
export type FileCategoryType = z.infer<typeof FileCategorySchema>;
|
|
15
|
+
/**
|
|
16
|
+
* Entity type schema - uses storage enum values
|
|
17
|
+
*/
|
|
18
|
+
export declare const EntityTypeSchema: z.ZodEnum<typeof ENTITY_TYPE>;
|
|
19
|
+
export type EntityTypeType = z.infer<typeof EntityTypeSchema>;
|
|
9
20
|
/**
|
|
10
21
|
* Output format for template-based document generation
|
|
11
22
|
*/
|
|
12
23
|
export declare const OutputFormatSchema: z.ZodEnum<{
|
|
13
24
|
pdf: "pdf";
|
|
25
|
+
html: "html";
|
|
14
26
|
docx: "docx";
|
|
15
27
|
xlsx: "xlsx";
|
|
16
|
-
html: "html";
|
|
17
28
|
}>;
|
|
18
29
|
export type OutputFormat = z.infer<typeof OutputFormatSchema>;
|
|
19
30
|
/**
|
|
@@ -63,9 +74,9 @@ export declare const UploadFileRequestSchema: z.ZodObject<{
|
|
|
63
74
|
templateData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
64
75
|
outputFormat: z.ZodOptional<z.ZodEnum<{
|
|
65
76
|
pdf: "pdf";
|
|
77
|
+
html: "html";
|
|
66
78
|
docx: "docx";
|
|
67
79
|
xlsx: "xlsx";
|
|
68
|
-
html: "html";
|
|
69
80
|
}>>;
|
|
70
81
|
locale: z.ZodOptional<z.ZodString>;
|
|
71
82
|
pdfOptions: z.ZodOptional<z.ZodObject<{
|
|
@@ -87,8 +98,8 @@ export declare const UploadFileRequestSchema: z.ZodObject<{
|
|
|
87
98
|
printBackground: z.ZodOptional<z.ZodBoolean>;
|
|
88
99
|
scale: z.ZodOptional<z.ZodNumber>;
|
|
89
100
|
}, z.core.$strip>>;
|
|
90
|
-
category: z.
|
|
91
|
-
entityType: z.
|
|
101
|
+
category: z.ZodEnum<typeof FILE_CATEGORY>;
|
|
102
|
+
entityType: z.ZodEnum<typeof ENTITY_TYPE>;
|
|
92
103
|
entityId: z.ZodString;
|
|
93
104
|
accessLevel: z.ZodOptional<z.ZodEnum<{
|
|
94
105
|
public: "public";
|
|
@@ -129,9 +140,9 @@ export declare const UploadFileResponseSchema: z.ZodObject<{
|
|
|
129
140
|
signedUrl: z.ZodOptional<z.ZodString>;
|
|
130
141
|
bucket: z.ZodString;
|
|
131
142
|
adapter: z.ZodOptional<z.ZodString>;
|
|
132
|
-
entityType: z.ZodOptional<z.
|
|
143
|
+
entityType: z.ZodOptional<z.ZodEnum<typeof ENTITY_TYPE>>;
|
|
133
144
|
entityId: z.ZodOptional<z.ZodString>;
|
|
134
|
-
category: z.ZodOptional<z.
|
|
145
|
+
category: z.ZodOptional<z.ZodEnum<typeof FILE_CATEGORY>>;
|
|
135
146
|
uploadedAt: z.ZodString;
|
|
136
147
|
expiresAt: z.ZodOptional<z.ZodString>;
|
|
137
148
|
variants: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -153,9 +164,9 @@ export declare const UploadFileItemSchema: z.ZodObject<{
|
|
|
153
164
|
templateData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
154
165
|
outputFormat: z.ZodOptional<z.ZodEnum<{
|
|
155
166
|
pdf: "pdf";
|
|
167
|
+
html: "html";
|
|
156
168
|
docx: "docx";
|
|
157
169
|
xlsx: "xlsx";
|
|
158
|
-
html: "html";
|
|
159
170
|
}>>;
|
|
160
171
|
locale: z.ZodOptional<z.ZodString>;
|
|
161
172
|
pdfOptions: z.ZodOptional<z.ZodObject<{
|
|
@@ -177,8 +188,8 @@ export declare const UploadFileItemSchema: z.ZodObject<{
|
|
|
177
188
|
printBackground: z.ZodOptional<z.ZodBoolean>;
|
|
178
189
|
scale: z.ZodOptional<z.ZodNumber>;
|
|
179
190
|
}, z.core.$strip>>;
|
|
180
|
-
category: z.
|
|
181
|
-
entityType: z.
|
|
191
|
+
category: z.ZodEnum<typeof FILE_CATEGORY>;
|
|
192
|
+
entityType: z.ZodEnum<typeof ENTITY_TYPE>;
|
|
182
193
|
entityId: z.ZodString;
|
|
183
194
|
accessLevel: z.ZodOptional<z.ZodEnum<{
|
|
184
195
|
public: "public";
|
|
@@ -208,9 +219,9 @@ export declare const UploadFilesRequestSchema: z.ZodObject<{
|
|
|
208
219
|
templateData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
209
220
|
outputFormat: z.ZodOptional<z.ZodEnum<{
|
|
210
221
|
pdf: "pdf";
|
|
222
|
+
html: "html";
|
|
211
223
|
docx: "docx";
|
|
212
224
|
xlsx: "xlsx";
|
|
213
|
-
html: "html";
|
|
214
225
|
}>>;
|
|
215
226
|
locale: z.ZodOptional<z.ZodString>;
|
|
216
227
|
pdfOptions: z.ZodOptional<z.ZodObject<{
|
|
@@ -232,8 +243,8 @@ export declare const UploadFilesRequestSchema: z.ZodObject<{
|
|
|
232
243
|
printBackground: z.ZodOptional<z.ZodBoolean>;
|
|
233
244
|
scale: z.ZodOptional<z.ZodNumber>;
|
|
234
245
|
}, z.core.$strip>>;
|
|
235
|
-
category: z.
|
|
236
|
-
entityType: z.
|
|
246
|
+
category: z.ZodEnum<typeof FILE_CATEGORY>;
|
|
247
|
+
entityType: z.ZodEnum<typeof ENTITY_TYPE>;
|
|
237
248
|
entityId: z.ZodString;
|
|
238
249
|
accessLevel: z.ZodOptional<z.ZodEnum<{
|
|
239
250
|
public: "public";
|
|
@@ -274,9 +285,9 @@ export declare const UploadFileResultSchema: z.ZodObject<{
|
|
|
274
285
|
signedUrl: z.ZodOptional<z.ZodString>;
|
|
275
286
|
bucket: z.ZodString;
|
|
276
287
|
adapter: z.ZodOptional<z.ZodString>;
|
|
277
|
-
entityType: z.ZodOptional<z.
|
|
288
|
+
entityType: z.ZodOptional<z.ZodEnum<typeof ENTITY_TYPE>>;
|
|
278
289
|
entityId: z.ZodOptional<z.ZodString>;
|
|
279
|
-
category: z.ZodOptional<z.
|
|
290
|
+
category: z.ZodOptional<z.ZodEnum<typeof FILE_CATEGORY>>;
|
|
280
291
|
uploadedAt: z.ZodString;
|
|
281
292
|
expiresAt: z.ZodOptional<z.ZodString>;
|
|
282
293
|
variants: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -308,9 +319,9 @@ export declare const UploadFilesResponseSchema: z.ZodObject<{
|
|
|
308
319
|
signedUrl: z.ZodOptional<z.ZodString>;
|
|
309
320
|
bucket: z.ZodString;
|
|
310
321
|
adapter: z.ZodOptional<z.ZodString>;
|
|
311
|
-
entityType: z.ZodOptional<z.
|
|
322
|
+
entityType: z.ZodOptional<z.ZodEnum<typeof ENTITY_TYPE>>;
|
|
312
323
|
entityId: z.ZodOptional<z.ZodString>;
|
|
313
|
-
category: z.ZodOptional<z.
|
|
324
|
+
category: z.ZodOptional<z.ZodEnum<typeof FILE_CATEGORY>>;
|
|
314
325
|
uploadedAt: z.ZodString;
|
|
315
326
|
expiresAt: z.ZodOptional<z.ZodString>;
|
|
316
327
|
variants: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -338,9 +349,9 @@ export declare const GenerateDocumentRequestSchema: z.ZodObject<{
|
|
|
338
349
|
templateData: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
339
350
|
outputFormat: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
340
351
|
pdf: "pdf";
|
|
352
|
+
html: "html";
|
|
341
353
|
docx: "docx";
|
|
342
354
|
xlsx: "xlsx";
|
|
343
|
-
html: "html";
|
|
344
355
|
}>>>;
|
|
345
356
|
locale: z.ZodOptional<z.ZodString>;
|
|
346
357
|
pdfOptions: z.ZodOptional<z.ZodObject<{
|
|
@@ -401,9 +412,9 @@ export declare const GetFileResponseSchema: z.ZodObject<{
|
|
|
401
412
|
publicUrl: z.ZodOptional<z.ZodString>;
|
|
402
413
|
signedUrl: z.ZodOptional<z.ZodString>;
|
|
403
414
|
bucket: z.ZodString;
|
|
404
|
-
entityType: z.ZodOptional<z.
|
|
415
|
+
entityType: z.ZodOptional<z.ZodEnum<typeof ENTITY_TYPE>>;
|
|
405
416
|
entityId: z.ZodOptional<z.ZodString>;
|
|
406
|
-
category: z.ZodOptional<z.
|
|
417
|
+
category: z.ZodOptional<z.ZodEnum<typeof FILE_CATEGORY>>;
|
|
407
418
|
uploadedAt: z.ZodString;
|
|
408
419
|
expiresAt: z.ZodOptional<z.ZodString>;
|
|
409
420
|
}, z.core.$strip>;
|
package/dist/api/index.cjs
CHANGED
|
@@ -504,6 +504,61 @@ var PUB_SUB_EVENT = {
|
|
|
504
504
|
RequestError: "request:error",
|
|
505
505
|
RequestAbort: "request:abort"
|
|
506
506
|
};
|
|
507
|
+
|
|
508
|
+
// src/storage/enums.ts
|
|
509
|
+
var FILE_CATEGORY = /* @__PURE__ */ ((FILE_CATEGORY2) => {
|
|
510
|
+
FILE_CATEGORY2["ProfileImage"] = "profile_image";
|
|
511
|
+
FILE_CATEGORY2["ProfileBanner"] = "profile_banner";
|
|
512
|
+
FILE_CATEGORY2["ProfileData"] = "profile_data";
|
|
513
|
+
FILE_CATEGORY2["IdDocument"] = "id_document";
|
|
514
|
+
FILE_CATEGORY2["PostImage"] = "post_image";
|
|
515
|
+
FILE_CATEGORY2["PostVideo"] = "post_video";
|
|
516
|
+
FILE_CATEGORY2["PostAudio"] = "post_audio";
|
|
517
|
+
FILE_CATEGORY2["PostDocument"] = "post_document";
|
|
518
|
+
FILE_CATEGORY2["PostArchive"] = "post_archive";
|
|
519
|
+
FILE_CATEGORY2["GalleryImage"] = "gallery_image";
|
|
520
|
+
FILE_CATEGORY2["GalleryVideo"] = "gallery_video";
|
|
521
|
+
FILE_CATEGORY2["HighlightVideo"] = "highlight_video";
|
|
522
|
+
FILE_CATEGORY2["TrainingVideo"] = "training_video";
|
|
523
|
+
FILE_CATEGORY2["ProductImage"] = "product_image";
|
|
524
|
+
FILE_CATEGORY2["ProductVideo"] = "product_video";
|
|
525
|
+
FILE_CATEGORY2["MerchandiseImage"] = "merchandise_image";
|
|
526
|
+
FILE_CATEGORY2["DOCUMENT"] = "document";
|
|
527
|
+
FILE_CATEGORY2["ContractDocument"] = "contract_document";
|
|
528
|
+
FILE_CATEGORY2["InvoiceDocument"] = "invoice_document";
|
|
529
|
+
FILE_CATEGORY2["ReceiptDocument"] = "receipt_document";
|
|
530
|
+
FILE_CATEGORY2["TaxDocument"] = "tax_document";
|
|
531
|
+
FILE_CATEGORY2["LegalDocument"] = "legal_document";
|
|
532
|
+
FILE_CATEGORY2["FinancialDocument"] = "financial_document";
|
|
533
|
+
FILE_CATEGORY2["NftImage"] = "nft_image";
|
|
534
|
+
FILE_CATEGORY2["NftMetadata"] = "nft_metadata";
|
|
535
|
+
FILE_CATEGORY2["BrandLogo"] = "brand_logo";
|
|
536
|
+
FILE_CATEGORY2["BrandAsset"] = "brand_asset";
|
|
537
|
+
FILE_CATEGORY2["MarketingAsset"] = "marketing_asset";
|
|
538
|
+
FILE_CATEGORY2["AVATAR"] = "avatar";
|
|
539
|
+
FILE_CATEGORY2["ATTACHMENT"] = "attachment";
|
|
540
|
+
FILE_CATEGORY2["TempFile"] = "temp_file";
|
|
541
|
+
FILE_CATEGORY2["OTHER"] = "other";
|
|
542
|
+
return FILE_CATEGORY2;
|
|
543
|
+
})(FILE_CATEGORY || {});
|
|
544
|
+
var ENTITY_TYPE = /* @__PURE__ */ ((ENTITY_TYPE2) => {
|
|
545
|
+
ENTITY_TYPE2["USER"] = "user";
|
|
546
|
+
ENTITY_TYPE2["FAN"] = "fan";
|
|
547
|
+
ENTITY_TYPE2["ATHLETE"] = "athlete";
|
|
548
|
+
ENTITY_TYPE2["CLUB"] = "club";
|
|
549
|
+
ENTITY_TYPE2["BRAND"] = "brand";
|
|
550
|
+
ENTITY_TYPE2["ORGANIZATION"] = "organization";
|
|
551
|
+
ENTITY_TYPE2["EVENT"] = "event";
|
|
552
|
+
ENTITY_TYPE2["POST"] = "post";
|
|
553
|
+
ENTITY_TYPE2["PRODUCT"] = "product";
|
|
554
|
+
ENTITY_TYPE2["NFT"] = "nft";
|
|
555
|
+
ENTITY_TYPE2["SYSTEM"] = "system";
|
|
556
|
+
return ENTITY_TYPE2;
|
|
557
|
+
})(ENTITY_TYPE || {});
|
|
558
|
+
|
|
559
|
+
// src/api/endpoints/files/schemas.ts
|
|
560
|
+
var FileCategorySchema = zod.z.nativeEnum(FILE_CATEGORY);
|
|
561
|
+
var EntityTypeSchema = zod.z.nativeEnum(ENTITY_TYPE);
|
|
507
562
|
var PDF_SCALE_MIN = 0.1;
|
|
508
563
|
var PDF_SCALE_MAX = 2;
|
|
509
564
|
var MAX_BULK_UPLOAD_CONCURRENCY = 10;
|
|
@@ -536,8 +591,8 @@ var UploadFileRequestSchema = zod.z.object({
|
|
|
536
591
|
locale: zod.z.string().optional(),
|
|
537
592
|
pdfOptions: PdfOptionsSchema,
|
|
538
593
|
// Path Generation & Storage (required)
|
|
539
|
-
category:
|
|
540
|
-
entityType:
|
|
594
|
+
category: FileCategorySchema,
|
|
595
|
+
entityType: EntityTypeSchema,
|
|
541
596
|
entityId: zod.z.string(),
|
|
542
597
|
// Optional Metadata
|
|
543
598
|
accessLevel: AccessLevelSchema.optional(),
|
|
@@ -588,9 +643,9 @@ var UploadFileResponseSchema = zod.z.object({
|
|
|
588
643
|
// Storage Info
|
|
589
644
|
bucket: zod.z.string(),
|
|
590
645
|
adapter: zod.z.string().optional(),
|
|
591
|
-
entityType:
|
|
646
|
+
entityType: EntityTypeSchema.optional(),
|
|
592
647
|
entityId: zod.z.string().optional(),
|
|
593
|
-
category:
|
|
648
|
+
category: FileCategorySchema.optional(),
|
|
594
649
|
// Timestamps
|
|
595
650
|
uploadedAt: zod.z.string(),
|
|
596
651
|
expiresAt: zod.z.string().optional(),
|
|
@@ -662,9 +717,9 @@ var GetFileResponseSchema = zod.z.object({
|
|
|
662
717
|
publicUrl: zod.z.string().optional(),
|
|
663
718
|
signedUrl: zod.z.string().optional(),
|
|
664
719
|
bucket: zod.z.string(),
|
|
665
|
-
entityType:
|
|
720
|
+
entityType: EntityTypeSchema.optional(),
|
|
666
721
|
entityId: zod.z.string().optional(),
|
|
667
|
-
category:
|
|
722
|
+
category: FileCategorySchema.optional(),
|
|
668
723
|
uploadedAt: zod.z.string(),
|
|
669
724
|
expiresAt: zod.z.string().optional()
|
|
670
725
|
});
|
|
@@ -6151,7 +6206,9 @@ exports.EVENT_OPERATIONS = EVENT_OPERATIONS;
|
|
|
6151
6206
|
exports.EVENT_PRIORITY_MAP = EVENT_PRIORITY_MAP;
|
|
6152
6207
|
exports.EVENT_SCOPES = EVENT_SCOPES;
|
|
6153
6208
|
exports.EVENT_SCOPES_WITH_TEMPORARY = EVENT_SCOPES_WITH_TEMPORARY;
|
|
6209
|
+
exports.EntityTypeSchema = EntityTypeSchema;
|
|
6154
6210
|
exports.FACTORY_OPERATIONS = FACTORY_OPERATIONS;
|
|
6211
|
+
exports.FileCategorySchema = FileCategorySchema;
|
|
6155
6212
|
exports.FileVariantSchema = FileVariantSchema;
|
|
6156
6213
|
exports.GenerateDocumentRequestSchema = GenerateDocumentRequestSchema;
|
|
6157
6214
|
exports.GenerateDocumentResponseSchema = GenerateDocumentResponseSchema;
|