@devizovaburza/mdm-sdk 2.5.0 → 2.5.2
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/v1/index.d.mts +70 -0
- package/dist/v1/index.d.ts +70 -0
- package/dist/v1/index.mjs +17 -7
- package/package.json +1 -1
package/dist/v1/index.d.mts
CHANGED
|
@@ -540,6 +540,76 @@ declare const partnerApi: OpenAPIHono<AppEnv, hono_types.MergeSchemaPath<{
|
|
|
540
540
|
};
|
|
541
541
|
};
|
|
542
542
|
}, "/v1/documents/:documentId"> & hono_types.MergeSchemaPath<{
|
|
543
|
+
"/": {
|
|
544
|
+
$post: {
|
|
545
|
+
input: {};
|
|
546
|
+
output: {
|
|
547
|
+
message: string;
|
|
548
|
+
documentId: string;
|
|
549
|
+
uploadUrl: string;
|
|
550
|
+
storageUrl: string;
|
|
551
|
+
expiresIn: number;
|
|
552
|
+
};
|
|
553
|
+
outputFormat: "json";
|
|
554
|
+
status: 200;
|
|
555
|
+
} | {
|
|
556
|
+
input: {};
|
|
557
|
+
output: {
|
|
558
|
+
message: string;
|
|
559
|
+
};
|
|
560
|
+
outputFormat: "json";
|
|
561
|
+
status: 400;
|
|
562
|
+
} | {
|
|
563
|
+
input: {};
|
|
564
|
+
output: {
|
|
565
|
+
message: string;
|
|
566
|
+
};
|
|
567
|
+
outputFormat: "json";
|
|
568
|
+
status: 500;
|
|
569
|
+
};
|
|
570
|
+
};
|
|
571
|
+
}, "/v1/documents/upload-url"> & hono_types.MergeSchemaPath<{
|
|
572
|
+
"/": {
|
|
573
|
+
$post: {
|
|
574
|
+
input: {};
|
|
575
|
+
output: {
|
|
576
|
+
message: string;
|
|
577
|
+
documentId: string;
|
|
578
|
+
storageUrl: string;
|
|
579
|
+
};
|
|
580
|
+
outputFormat: "json";
|
|
581
|
+
status: 200;
|
|
582
|
+
} | {
|
|
583
|
+
input: {};
|
|
584
|
+
output: {
|
|
585
|
+
message: string;
|
|
586
|
+
};
|
|
587
|
+
outputFormat: "json";
|
|
588
|
+
status: 400;
|
|
589
|
+
} | {
|
|
590
|
+
input: {};
|
|
591
|
+
output: {
|
|
592
|
+
message: string;
|
|
593
|
+
};
|
|
594
|
+
outputFormat: "json";
|
|
595
|
+
status: 411;
|
|
596
|
+
} | {
|
|
597
|
+
input: {};
|
|
598
|
+
output: {
|
|
599
|
+
message: string;
|
|
600
|
+
};
|
|
601
|
+
outputFormat: "json";
|
|
602
|
+
status: 413;
|
|
603
|
+
} | {
|
|
604
|
+
input: {};
|
|
605
|
+
output: {
|
|
606
|
+
message: string;
|
|
607
|
+
};
|
|
608
|
+
outputFormat: "json";
|
|
609
|
+
status: 500;
|
|
610
|
+
};
|
|
611
|
+
};
|
|
612
|
+
}, "/v1/documents/stream"> & hono_types.MergeSchemaPath<{
|
|
543
613
|
"/": {
|
|
544
614
|
$post: {
|
|
545
615
|
input: {};
|
package/dist/v1/index.d.ts
CHANGED
|
@@ -540,6 +540,76 @@ declare const partnerApi: OpenAPIHono<AppEnv, hono_types.MergeSchemaPath<{
|
|
|
540
540
|
};
|
|
541
541
|
};
|
|
542
542
|
}, "/v1/documents/:documentId"> & hono_types.MergeSchemaPath<{
|
|
543
|
+
"/": {
|
|
544
|
+
$post: {
|
|
545
|
+
input: {};
|
|
546
|
+
output: {
|
|
547
|
+
message: string;
|
|
548
|
+
documentId: string;
|
|
549
|
+
uploadUrl: string;
|
|
550
|
+
storageUrl: string;
|
|
551
|
+
expiresIn: number;
|
|
552
|
+
};
|
|
553
|
+
outputFormat: "json";
|
|
554
|
+
status: 200;
|
|
555
|
+
} | {
|
|
556
|
+
input: {};
|
|
557
|
+
output: {
|
|
558
|
+
message: string;
|
|
559
|
+
};
|
|
560
|
+
outputFormat: "json";
|
|
561
|
+
status: 400;
|
|
562
|
+
} | {
|
|
563
|
+
input: {};
|
|
564
|
+
output: {
|
|
565
|
+
message: string;
|
|
566
|
+
};
|
|
567
|
+
outputFormat: "json";
|
|
568
|
+
status: 500;
|
|
569
|
+
};
|
|
570
|
+
};
|
|
571
|
+
}, "/v1/documents/upload-url"> & hono_types.MergeSchemaPath<{
|
|
572
|
+
"/": {
|
|
573
|
+
$post: {
|
|
574
|
+
input: {};
|
|
575
|
+
output: {
|
|
576
|
+
message: string;
|
|
577
|
+
documentId: string;
|
|
578
|
+
storageUrl: string;
|
|
579
|
+
};
|
|
580
|
+
outputFormat: "json";
|
|
581
|
+
status: 200;
|
|
582
|
+
} | {
|
|
583
|
+
input: {};
|
|
584
|
+
output: {
|
|
585
|
+
message: string;
|
|
586
|
+
};
|
|
587
|
+
outputFormat: "json";
|
|
588
|
+
status: 400;
|
|
589
|
+
} | {
|
|
590
|
+
input: {};
|
|
591
|
+
output: {
|
|
592
|
+
message: string;
|
|
593
|
+
};
|
|
594
|
+
outputFormat: "json";
|
|
595
|
+
status: 411;
|
|
596
|
+
} | {
|
|
597
|
+
input: {};
|
|
598
|
+
output: {
|
|
599
|
+
message: string;
|
|
600
|
+
};
|
|
601
|
+
outputFormat: "json";
|
|
602
|
+
status: 413;
|
|
603
|
+
} | {
|
|
604
|
+
input: {};
|
|
605
|
+
output: {
|
|
606
|
+
message: string;
|
|
607
|
+
};
|
|
608
|
+
outputFormat: "json";
|
|
609
|
+
status: 500;
|
|
610
|
+
};
|
|
611
|
+
};
|
|
612
|
+
}, "/v1/documents/stream"> & hono_types.MergeSchemaPath<{
|
|
543
613
|
"/": {
|
|
544
614
|
$post: {
|
|
545
615
|
input: {};
|
package/dist/v1/index.mjs
CHANGED
|
@@ -385,6 +385,16 @@ const requireRoutableAccount = (data, ctx, basePath = []) => {
|
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
387
|
};
|
|
388
|
+
const zipCodeRegex = /^\d{3}\s?\d{2}$/;
|
|
389
|
+
const refineCzZipCode = (data, ctx) => {
|
|
390
|
+
if (data.countryCode === "CZ" && data.zipCode && !zipCodeRegex.test(data.zipCode)) {
|
|
391
|
+
ctx.addIssue({
|
|
392
|
+
code: "custom",
|
|
393
|
+
path: ["zipCode"],
|
|
394
|
+
message: "PS\u010C je v nespr\xE1vn\xE9m form\xE1tu"
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
};
|
|
388
398
|
|
|
389
399
|
z.object({
|
|
390
400
|
message: z.string(),
|
|
@@ -519,8 +529,7 @@ const disponentSchema = z.object({
|
|
|
519
529
|
partyType: z.literal("INDIVIDUAL"),
|
|
520
530
|
data: individualInsertSchema
|
|
521
531
|
});
|
|
522
|
-
const
|
|
523
|
-
const createAddressInputSchema = z.object({
|
|
532
|
+
const createAddressInputBaseSchema = z.object({
|
|
524
533
|
addressType: z.enum(ADDRESS_TYPE),
|
|
525
534
|
internalId: z.string().optional(),
|
|
526
535
|
street: z.string().min(1, "Adresa je povinn\xE1"),
|
|
@@ -528,20 +537,21 @@ const createAddressInputSchema = z.object({
|
|
|
528
537
|
descriptiveNumber: z.string().max(20, "\u010C\xEDslo popisn\xE9 je mimo povolen\xFD rozsah").optional(),
|
|
529
538
|
municipality: z.string().min(1, "M\u011Bsto je povinn\xE9").max(255),
|
|
530
539
|
municipalityPart: z.string().optional(),
|
|
531
|
-
|
|
540
|
+
// CZ-only format applied via superRefine below so foreign zips are accepted.
|
|
541
|
+
zipCode: z.string().min(1, "PS\u010C je povinn\xE9").max(20),
|
|
532
542
|
district: z.string().max(255),
|
|
533
543
|
region: z.string().max(255),
|
|
534
544
|
countryCode: z.enum(COUNTRY_CODES, "St\xE1t je povinn\xFD"),
|
|
535
545
|
ruianCode: z.string().optional()
|
|
536
546
|
});
|
|
537
|
-
const
|
|
547
|
+
const createAddressInputSchema = createAddressInputBaseSchema.superRefine(refineCzZipCode);
|
|
548
|
+
const ownerAddressInputBaseSchema = createAddressInputBaseSchema.extend({
|
|
538
549
|
addressType: z.enum(ADDRESS_TYPE).default("PERMANENT_ADDRESS"),
|
|
539
550
|
district: z.string().max(255).nullish(),
|
|
540
551
|
region: z.string().max(255).nullish()
|
|
541
552
|
});
|
|
542
|
-
const
|
|
543
|
-
|
|
544
|
-
});
|
|
553
|
+
const ownerAddressInputSchema = ownerAddressInputBaseSchema.superRefine(refineCzZipCode);
|
|
554
|
+
const legalRepresentativeAddressInputSchema = ownerAddressInputBaseSchema.extend({ street: z.string().optional() }).superRefine(refineCzZipCode);
|
|
545
555
|
const ownerIndividualInputSchema = individualInsertSchema.extend({
|
|
546
556
|
email: z.email("E-mail je povinn\xFD").optional()
|
|
547
557
|
});
|