@deepintel-ltd/farmpro-contracts 1.5.23 → 1.5.24
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/routes/documents.routes.d.ts +12 -12
- package/dist/routes/files.routes.d.ts +794 -0
- package/dist/routes/files.routes.d.ts.map +1 -0
- package/dist/routes/files.routes.js +38 -0
- package/dist/routes/index.d.ts +3 -0
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +2 -0
- package/dist/routes/organizations.routes.js +1 -1
- package/dist/schemas/documents.schemas.d.ts +13 -221
- package/dist/schemas/documents.schemas.d.ts.map +1 -1
- package/dist/schemas/documents.schemas.js +2 -12
- package/dist/schemas/files.schemas.d.ts +229 -0
- package/dist/schemas/files.schemas.d.ts.map +1 -0
- package/dist/schemas/files.schemas.js +23 -0
- package/package.json +1 -1
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Generic file upload schemas - reusable across all file upload endpoints
|
|
4
|
+
*/
|
|
5
|
+
export declare const uploadedFileAttributesSchema: z.ZodObject<{
|
|
6
|
+
fileUrl: z.ZodString;
|
|
7
|
+
fileSize: z.ZodNumber;
|
|
8
|
+
fileName: z.ZodString;
|
|
9
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
10
|
+
uploadedAt: z.ZodString;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
fileUrl: string;
|
|
13
|
+
fileName: string;
|
|
14
|
+
fileSize: number;
|
|
15
|
+
uploadedAt: string;
|
|
16
|
+
contentType?: string | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
fileUrl: string;
|
|
19
|
+
fileName: string;
|
|
20
|
+
fileSize: number;
|
|
21
|
+
uploadedAt: string;
|
|
22
|
+
contentType?: string | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const uploadedFileResourceSchema: z.ZodObject<{
|
|
25
|
+
type: z.ZodLiteral<string>;
|
|
26
|
+
id: z.ZodString;
|
|
27
|
+
attributes: z.ZodObject<{
|
|
28
|
+
fileUrl: z.ZodString;
|
|
29
|
+
fileSize: z.ZodNumber;
|
|
30
|
+
fileName: z.ZodString;
|
|
31
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
32
|
+
uploadedAt: z.ZodString;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
fileUrl: string;
|
|
35
|
+
fileName: string;
|
|
36
|
+
fileSize: number;
|
|
37
|
+
uploadedAt: string;
|
|
38
|
+
contentType?: string | undefined;
|
|
39
|
+
}, {
|
|
40
|
+
fileUrl: string;
|
|
41
|
+
fileName: string;
|
|
42
|
+
fileSize: number;
|
|
43
|
+
uploadedAt: string;
|
|
44
|
+
contentType?: string | undefined;
|
|
45
|
+
}>;
|
|
46
|
+
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
47
|
+
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
48
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
type: string;
|
|
51
|
+
id: string;
|
|
52
|
+
attributes: {
|
|
53
|
+
fileUrl: string;
|
|
54
|
+
fileName: string;
|
|
55
|
+
fileSize: number;
|
|
56
|
+
uploadedAt: string;
|
|
57
|
+
contentType?: string | undefined;
|
|
58
|
+
};
|
|
59
|
+
relationships?: Record<string, unknown> | undefined;
|
|
60
|
+
links?: Record<string, string> | undefined;
|
|
61
|
+
meta?: Record<string, unknown> | undefined;
|
|
62
|
+
}, {
|
|
63
|
+
type: string;
|
|
64
|
+
id: string;
|
|
65
|
+
attributes: {
|
|
66
|
+
fileUrl: string;
|
|
67
|
+
fileName: string;
|
|
68
|
+
fileSize: number;
|
|
69
|
+
uploadedAt: string;
|
|
70
|
+
contentType?: string | undefined;
|
|
71
|
+
};
|
|
72
|
+
relationships?: Record<string, unknown> | undefined;
|
|
73
|
+
links?: Record<string, string> | undefined;
|
|
74
|
+
meta?: Record<string, unknown> | undefined;
|
|
75
|
+
}>;
|
|
76
|
+
export declare const uploadedFileResponseSchema: z.ZodObject<{
|
|
77
|
+
data: z.ZodObject<{
|
|
78
|
+
type: z.ZodLiteral<string>;
|
|
79
|
+
id: z.ZodString;
|
|
80
|
+
attributes: z.ZodObject<{
|
|
81
|
+
fileUrl: z.ZodString;
|
|
82
|
+
fileSize: z.ZodNumber;
|
|
83
|
+
fileName: z.ZodString;
|
|
84
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
85
|
+
uploadedAt: z.ZodString;
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
fileUrl: string;
|
|
88
|
+
fileName: string;
|
|
89
|
+
fileSize: number;
|
|
90
|
+
uploadedAt: string;
|
|
91
|
+
contentType?: string | undefined;
|
|
92
|
+
}, {
|
|
93
|
+
fileUrl: string;
|
|
94
|
+
fileName: string;
|
|
95
|
+
fileSize: number;
|
|
96
|
+
uploadedAt: string;
|
|
97
|
+
contentType?: string | undefined;
|
|
98
|
+
}>;
|
|
99
|
+
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
100
|
+
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
101
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
102
|
+
}, "strip", z.ZodTypeAny, {
|
|
103
|
+
type: string;
|
|
104
|
+
id: string;
|
|
105
|
+
attributes: {
|
|
106
|
+
fileUrl: string;
|
|
107
|
+
fileName: string;
|
|
108
|
+
fileSize: number;
|
|
109
|
+
uploadedAt: string;
|
|
110
|
+
contentType?: string | undefined;
|
|
111
|
+
};
|
|
112
|
+
relationships?: Record<string, unknown> | undefined;
|
|
113
|
+
links?: Record<string, string> | undefined;
|
|
114
|
+
meta?: Record<string, unknown> | undefined;
|
|
115
|
+
}, {
|
|
116
|
+
type: string;
|
|
117
|
+
id: string;
|
|
118
|
+
attributes: {
|
|
119
|
+
fileUrl: string;
|
|
120
|
+
fileName: string;
|
|
121
|
+
fileSize: number;
|
|
122
|
+
uploadedAt: string;
|
|
123
|
+
contentType?: string | undefined;
|
|
124
|
+
};
|
|
125
|
+
relationships?: Record<string, unknown> | undefined;
|
|
126
|
+
links?: Record<string, string> | undefined;
|
|
127
|
+
meta?: Record<string, unknown> | undefined;
|
|
128
|
+
}>;
|
|
129
|
+
included: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
130
|
+
type: z.ZodString;
|
|
131
|
+
id: z.ZodString;
|
|
132
|
+
attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
133
|
+
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
134
|
+
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
135
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
type: string;
|
|
138
|
+
id: string;
|
|
139
|
+
attributes?: Record<string, unknown> | undefined;
|
|
140
|
+
relationships?: Record<string, unknown> | undefined;
|
|
141
|
+
links?: Record<string, string> | undefined;
|
|
142
|
+
meta?: Record<string, unknown> | undefined;
|
|
143
|
+
}, {
|
|
144
|
+
type: string;
|
|
145
|
+
id: string;
|
|
146
|
+
attributes?: Record<string, unknown> | undefined;
|
|
147
|
+
relationships?: Record<string, unknown> | undefined;
|
|
148
|
+
links?: Record<string, string> | undefined;
|
|
149
|
+
meta?: Record<string, unknown> | undefined;
|
|
150
|
+
}>, "many">>;
|
|
151
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
152
|
+
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
153
|
+
}, "strip", z.ZodTypeAny, {
|
|
154
|
+
data: {
|
|
155
|
+
type: string;
|
|
156
|
+
id: string;
|
|
157
|
+
attributes: {
|
|
158
|
+
fileUrl: string;
|
|
159
|
+
fileName: string;
|
|
160
|
+
fileSize: number;
|
|
161
|
+
uploadedAt: string;
|
|
162
|
+
contentType?: string | undefined;
|
|
163
|
+
};
|
|
164
|
+
relationships?: Record<string, unknown> | undefined;
|
|
165
|
+
links?: Record<string, string> | undefined;
|
|
166
|
+
meta?: Record<string, unknown> | undefined;
|
|
167
|
+
};
|
|
168
|
+
links?: Record<string, string> | undefined;
|
|
169
|
+
meta?: Record<string, unknown> | undefined;
|
|
170
|
+
included?: {
|
|
171
|
+
type: string;
|
|
172
|
+
id: string;
|
|
173
|
+
attributes?: Record<string, unknown> | undefined;
|
|
174
|
+
relationships?: Record<string, unknown> | undefined;
|
|
175
|
+
links?: Record<string, string> | undefined;
|
|
176
|
+
meta?: Record<string, unknown> | undefined;
|
|
177
|
+
}[] | undefined;
|
|
178
|
+
}, {
|
|
179
|
+
data: {
|
|
180
|
+
type: string;
|
|
181
|
+
id: string;
|
|
182
|
+
attributes: {
|
|
183
|
+
fileUrl: string;
|
|
184
|
+
fileName: string;
|
|
185
|
+
fileSize: number;
|
|
186
|
+
uploadedAt: string;
|
|
187
|
+
contentType?: string | undefined;
|
|
188
|
+
};
|
|
189
|
+
relationships?: Record<string, unknown> | undefined;
|
|
190
|
+
links?: Record<string, string> | undefined;
|
|
191
|
+
meta?: Record<string, unknown> | undefined;
|
|
192
|
+
};
|
|
193
|
+
links?: Record<string, string> | undefined;
|
|
194
|
+
meta?: Record<string, unknown> | undefined;
|
|
195
|
+
included?: {
|
|
196
|
+
type: string;
|
|
197
|
+
id: string;
|
|
198
|
+
attributes?: Record<string, unknown> | undefined;
|
|
199
|
+
relationships?: Record<string, unknown> | undefined;
|
|
200
|
+
links?: Record<string, string> | undefined;
|
|
201
|
+
meta?: Record<string, unknown> | undefined;
|
|
202
|
+
}[] | undefined;
|
|
203
|
+
}>;
|
|
204
|
+
export declare const uploadFileBodySchema: z.ZodObject<{
|
|
205
|
+
file: z.ZodAny;
|
|
206
|
+
}, "strip", z.ZodTypeAny, {
|
|
207
|
+
file?: any;
|
|
208
|
+
}, {
|
|
209
|
+
file?: any;
|
|
210
|
+
}>;
|
|
211
|
+
export declare const uploadMetadataSchema: z.ZodOptional<z.ZodObject<{
|
|
212
|
+
category: z.ZodOptional<z.ZodString>;
|
|
213
|
+
description: z.ZodOptional<z.ZodString>;
|
|
214
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
215
|
+
}, "strip", z.ZodTypeAny, {
|
|
216
|
+
description?: string | undefined;
|
|
217
|
+
category?: string | undefined;
|
|
218
|
+
tags?: string[] | undefined;
|
|
219
|
+
}, {
|
|
220
|
+
description?: string | undefined;
|
|
221
|
+
category?: string | undefined;
|
|
222
|
+
tags?: string[] | undefined;
|
|
223
|
+
}>>;
|
|
224
|
+
export type UploadedFileAttributes = z.infer<typeof uploadedFileAttributesSchema>;
|
|
225
|
+
export type UploadedFileResource = z.infer<typeof uploadedFileResourceSchema>;
|
|
226
|
+
export type UploadedFileResponse = z.infer<typeof uploadedFileResponseSchema>;
|
|
227
|
+
export type UploadFileBody = z.infer<typeof uploadFileBodySchema>;
|
|
228
|
+
export type UploadMetadata = z.infer<typeof uploadMetadataSchema>;
|
|
229
|
+
//# sourceMappingURL=files.schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/files.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;GAEG;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;EAMvC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA8E,CAAC;AAEtH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA0D,CAAC;AAElG,eAAO,MAAM,oBAAoB;;;;;;EAE/B,CAAC;AAGH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;GAIpB,CAAC;AAGd,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createJsonApiResourceSchema, jsonApiSingleResponseSchema } from './common.schemas';
|
|
3
|
+
/**
|
|
4
|
+
* Generic file upload schemas - reusable across all file upload endpoints
|
|
5
|
+
*/
|
|
6
|
+
export const uploadedFileAttributesSchema = z.object({
|
|
7
|
+
fileUrl: z.string(),
|
|
8
|
+
fileSize: z.number().int().positive(),
|
|
9
|
+
fileName: z.string(),
|
|
10
|
+
contentType: z.string().optional(),
|
|
11
|
+
uploadedAt: z.string().datetime(),
|
|
12
|
+
});
|
|
13
|
+
export const uploadedFileResourceSchema = createJsonApiResourceSchema('uploaded-files', uploadedFileAttributesSchema);
|
|
14
|
+
export const uploadedFileResponseSchema = jsonApiSingleResponseSchema(uploadedFileResourceSchema);
|
|
15
|
+
export const uploadFileBodySchema = z.object({
|
|
16
|
+
file: z.any(), // File type handled at runtime (MulterFile or browser File)
|
|
17
|
+
});
|
|
18
|
+
// Optional metadata that can be included with uploads
|
|
19
|
+
export const uploadMetadataSchema = z.object({
|
|
20
|
+
category: z.string().optional(),
|
|
21
|
+
description: z.string().optional(),
|
|
22
|
+
tags: z.array(z.string()).optional(),
|
|
23
|
+
}).optional();
|