@deepintel-ltd/farmpro-contracts 1.5.25 → 1.5.26

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.
@@ -416,16 +416,19 @@ export declare const filesRouter: {
416
416
  };
417
417
  viewFile: {
418
418
  pathParams: z.ZodObject<{
419
+ prefix: z.ZodString;
419
420
  fileId: z.ZodString;
420
421
  }, "strip", z.ZodTypeAny, {
422
+ prefix: string;
421
423
  fileId: string;
422
424
  }, {
425
+ prefix: string;
423
426
  fileId: string;
424
427
  }>;
425
428
  summary: "View file";
426
- description: "Stream or download a file by its UUID. Extension is optional - both /files/view/{fileId} and /files/view/{fileId}.{ext} work for the same file. Requires authentication and validates that the requesting user has permission to access the file.";
429
+ description: "Stream or download a file by its prefix and UUID. URL format: /files/view/{prefix}/{uuid}.{ext}. The storage path is constructed as {prefix}/{uuid}.{ext}. Requires authentication and validates that the requesting user has permission to access the file.";
427
430
  method: "GET";
428
- path: "/files/view/:fileId";
431
+ path: "/files/view/:prefix/:fileId";
429
432
  responses: {
430
433
  200: z.ZodAny;
431
434
  400: z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"files.routes.d.ts","sourceRoot":"","sources":["../../src/routes/files.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCtB,CAAC"}
@@ -21,9 +21,10 @@ export const filesRouter = c.router({
21
21
  },
22
22
  viewFile: {
23
23
  method: 'GET',
24
- path: '/files/view/:fileId',
24
+ path: '/files/view/:prefix/:fileId',
25
25
  pathParams: z.object({
26
- fileId: z.string(),
26
+ prefix: z.string().describe('Storage prefix (e.g., waybills, invoices, documents, organizations, uploads)'),
27
+ fileId: z.string().describe('File identifier in format {uuid}.{ext} (e.g., 550e8400-e29b-41d4-a716-446655440000.pdf)'),
27
28
  }),
28
29
  responses: {
29
30
  200: z.any(), // File stream response
@@ -33,6 +34,6 @@ export const filesRouter = c.router({
33
34
  404: jsonApiErrorResponseSchema,
34
35
  },
35
36
  summary: 'View file',
36
- description: 'Stream or download a file by its UUID. Extension is optional - both /files/view/{fileId} and /files/view/{fileId}.{ext} work for the same file. Requires authentication and validates that the requesting user has permission to access the file.',
37
+ description: 'Stream or download a file by its prefix and UUID. URL format: /files/view/{prefix}/{uuid}.{ext}. The storage path is constructed as {prefix}/{uuid}.{ext}. Requires authentication and validates that the requesting user has permission to access the file.',
37
38
  },
38
39
  });
@@ -3217,7 +3217,7 @@ export declare const invoicesRouter: {
3217
3217
  summary: "Generate invoice PDF";
3218
3218
  description: "Generate and save PDF for an invoice with organization logo";
3219
3219
  method: "POST";
3220
- body: z.ZodVoid;
3220
+ body: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
3221
3221
  path: "/organizations/:organizationId/invoices/:id/generate-pdf";
3222
3222
  responses: {
3223
3223
  200: z.ZodObject<{
@@ -85,7 +85,7 @@ export const invoicesRouter = c.router({
85
85
  organizationId: z.string().uuid(),
86
86
  id: z.string().uuid(),
87
87
  }),
88
- body: z.void(),
88
+ body: z.object({}).optional(),
89
89
  responses: {
90
90
  200: invoiceResponseSchema,
91
91
  404: jsonApiErrorResponseSchema,
@@ -3013,7 +3013,7 @@ export declare const waybillsRouter: {
3013
3013
  summary: "Generate waybill PDF";
3014
3014
  description: "Generate and save PDF for a waybill with organization logo";
3015
3015
  method: "POST";
3016
- body: z.ZodVoid;
3016
+ body: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
3017
3017
  path: "/organizations/:organizationId/waybills/:id/generate-pdf";
3018
3018
  responses: {
3019
3019
  200: z.ZodObject<{
@@ -82,7 +82,7 @@ export const waybillsRouter = c.router({
82
82
  organizationId: z.string().uuid(),
83
83
  id: z.string().uuid(),
84
84
  }),
85
- body: z.void(),
85
+ body: z.object({}).optional(),
86
86
  responses: {
87
87
  200: waybillResponseSchema,
88
88
  404: jsonApiErrorResponseSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepintel-ltd/farmpro-contracts",
3
- "version": "1.5.25",
3
+ "version": "1.5.26",
4
4
  "description": "Type-safe API contracts for FarmPro API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",