@oxy.so/contracts 6.13.0 → 6.14.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/cjs/index.js
CHANGED
|
@@ -935,3 +935,4 @@ Object.defineProperty(exports, "APPLICATION_ACCOUNT_TOTAL_MAX_AGE_SECONDS", { en
|
|
|
935
935
|
Object.defineProperty(exports, "applicationAccountRegistrationRequestSchema", { enumerable: true, get: function () { return applicationAccounts_1.applicationAccountRegistrationRequestSchema; } });
|
|
936
936
|
Object.defineProperty(exports, "applicationAccountRegistrationResponseSchema", { enumerable: true, get: function () { return applicationAccounts_1.applicationAccountRegistrationResponseSchema; } });
|
|
937
937
|
Object.defineProperty(exports, "applicationAccountTotalSchema", { enumerable: true, get: function () { return applicationAccounts_1.applicationAccountTotalSchema; } });
|
|
938
|
+
__exportStar(require("./postalAddresses"), exports);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.postalAddressSchema = exports.postalAddressUpdateSchema = exports.postalAddressInputSchema = exports.postalAddressParamsSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: explicitly refuse controls in postal fields.
|
|
6
|
+
const forbidden = /[\u0000-\u001f\u007f-\u009f\u2028\u2029\u202a-\u202e\u2066-\u2069]/;
|
|
7
|
+
// Postal details are private account data, never part of a public profile.
|
|
8
|
+
const text = (max) => zod_1.z
|
|
9
|
+
.string()
|
|
10
|
+
.trim()
|
|
11
|
+
.min(1)
|
|
12
|
+
.max(max)
|
|
13
|
+
.refine((value) => !forbidden.test(value), 'Control characters are not allowed');
|
|
14
|
+
exports.postalAddressParamsSchema = zod_1.z.object({ id: zod_1.z.uuid() }).strict();
|
|
15
|
+
exports.postalAddressInputSchema = zod_1.z
|
|
16
|
+
.object({
|
|
17
|
+
recipientName: text(200),
|
|
18
|
+
line1: text(300),
|
|
19
|
+
line2: text(300).optional(),
|
|
20
|
+
city: text(150),
|
|
21
|
+
region: text(150).optional(),
|
|
22
|
+
postalCode: zod_1.z
|
|
23
|
+
.string()
|
|
24
|
+
.trim()
|
|
25
|
+
.max(32)
|
|
26
|
+
.refine((value) => !forbidden.test(value)),
|
|
27
|
+
country: zod_1.z.string().regex(/^[A-Z]{2}$/),
|
|
28
|
+
phone: text(50).optional(),
|
|
29
|
+
label: text(100).optional(),
|
|
30
|
+
isDefault: zod_1.z.boolean().optional(),
|
|
31
|
+
})
|
|
32
|
+
.strict();
|
|
33
|
+
exports.postalAddressUpdateSchema = exports.postalAddressInputSchema
|
|
34
|
+
.partial()
|
|
35
|
+
.extend({
|
|
36
|
+
line2: text(300).nullable().optional(),
|
|
37
|
+
region: text(150).nullable().optional(),
|
|
38
|
+
phone: text(50).nullable().optional(),
|
|
39
|
+
label: text(100).nullable().optional(),
|
|
40
|
+
})
|
|
41
|
+
.refine((value) => Object.keys(value).length > 0, 'Provide at least one field');
|
|
42
|
+
exports.postalAddressSchema = exports.postalAddressInputSchema.extend({
|
|
43
|
+
id: zod_1.z.string().min(1),
|
|
44
|
+
isDefault: zod_1.z.boolean(),
|
|
45
|
+
createdAt: zod_1.z.string(),
|
|
46
|
+
updatedAt: zod_1.z.string(),
|
|
47
|
+
});
|
package/dist/esm/index.js
CHANGED
|
@@ -218,3 +218,4 @@ export { utf16MinLength, utf16MaxLength, utf16Length, isoDateTime, urlCheck, } f
|
|
|
218
218
|
export { integerCheck, safeNumberCheck } from './numberChecks.js';
|
|
219
219
|
export { campaignAttributionSchema } from './campaignAttribution.js';
|
|
220
220
|
export { APPLICATION_ACCOUNT_REGISTRATION_BATCH_MAX, APPLICATION_ACCOUNT_TOTAL_MAX_AGE_SECONDS, applicationAccountRegistrationRequestSchema, applicationAccountRegistrationResponseSchema, applicationAccountTotalSchema, } from './applicationAccounts.js';
|
|
221
|
+
export * from './postalAddresses.js';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: explicitly refuse controls in postal fields.
|
|
3
|
+
const forbidden = /[\u0000-\u001f\u007f-\u009f\u2028\u2029\u202a-\u202e\u2066-\u2069]/;
|
|
4
|
+
// Postal details are private account data, never part of a public profile.
|
|
5
|
+
const text = (max) => z
|
|
6
|
+
.string()
|
|
7
|
+
.trim()
|
|
8
|
+
.min(1)
|
|
9
|
+
.max(max)
|
|
10
|
+
.refine((value) => !forbidden.test(value), 'Control characters are not allowed');
|
|
11
|
+
export const postalAddressParamsSchema = z.object({ id: z.uuid() }).strict();
|
|
12
|
+
export const postalAddressInputSchema = z
|
|
13
|
+
.object({
|
|
14
|
+
recipientName: text(200),
|
|
15
|
+
line1: text(300),
|
|
16
|
+
line2: text(300).optional(),
|
|
17
|
+
city: text(150),
|
|
18
|
+
region: text(150).optional(),
|
|
19
|
+
postalCode: z
|
|
20
|
+
.string()
|
|
21
|
+
.trim()
|
|
22
|
+
.max(32)
|
|
23
|
+
.refine((value) => !forbidden.test(value)),
|
|
24
|
+
country: z.string().regex(/^[A-Z]{2}$/),
|
|
25
|
+
phone: text(50).optional(),
|
|
26
|
+
label: text(100).optional(),
|
|
27
|
+
isDefault: z.boolean().optional(),
|
|
28
|
+
})
|
|
29
|
+
.strict();
|
|
30
|
+
export const postalAddressUpdateSchema = postalAddressInputSchema
|
|
31
|
+
.partial()
|
|
32
|
+
.extend({
|
|
33
|
+
line2: text(300).nullable().optional(),
|
|
34
|
+
region: text(150).nullable().optional(),
|
|
35
|
+
phone: text(50).nullable().optional(),
|
|
36
|
+
label: text(100).nullable().optional(),
|
|
37
|
+
})
|
|
38
|
+
.refine((value) => Object.keys(value).length > 0, 'Provide at least one field');
|
|
39
|
+
export const postalAddressSchema = postalAddressInputSchema.extend({
|
|
40
|
+
id: z.string().min(1),
|
|
41
|
+
isDefault: z.boolean(),
|
|
42
|
+
createdAt: z.string(),
|
|
43
|
+
updatedAt: z.string(),
|
|
44
|
+
});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -150,3 +150,4 @@ export { campaignAttributionSchema } from './campaignAttribution';
|
|
|
150
150
|
export type { CampaignAttribution } from './client/campaignAttribution';
|
|
151
151
|
export { APPLICATION_ACCOUNT_REGISTRATION_BATCH_MAX, APPLICATION_ACCOUNT_TOTAL_MAX_AGE_SECONDS, applicationAccountRegistrationRequestSchema, applicationAccountRegistrationResponseSchema, applicationAccountTotalSchema, } from './applicationAccounts';
|
|
152
152
|
export type { ApplicationAccountRegistrationRequest, ApplicationAccountRegistrationResponse, ApplicationAccountTotal, } from './applicationAccounts';
|
|
153
|
+
export * from './postalAddresses';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const postalAddressParamsSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodUUID;
|
|
4
|
+
}, z.core.$strict>;
|
|
5
|
+
export declare const postalAddressInputSchema: z.ZodObject<{
|
|
6
|
+
recipientName: z.ZodString;
|
|
7
|
+
line1: z.ZodString;
|
|
8
|
+
line2: z.ZodOptional<z.ZodString>;
|
|
9
|
+
city: z.ZodString;
|
|
10
|
+
region: z.ZodOptional<z.ZodString>;
|
|
11
|
+
postalCode: z.ZodString;
|
|
12
|
+
country: z.ZodString;
|
|
13
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
14
|
+
label: z.ZodOptional<z.ZodString>;
|
|
15
|
+
isDefault: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
}, z.core.$strict>;
|
|
17
|
+
export declare const postalAddressUpdateSchema: z.ZodObject<{
|
|
18
|
+
recipientName: z.ZodOptional<z.ZodString>;
|
|
19
|
+
line1: z.ZodOptional<z.ZodString>;
|
|
20
|
+
city: z.ZodOptional<z.ZodString>;
|
|
21
|
+
postalCode: z.ZodOptional<z.ZodString>;
|
|
22
|
+
country: z.ZodOptional<z.ZodString>;
|
|
23
|
+
isDefault: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
24
|
+
line2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
25
|
+
region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
26
|
+
phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
27
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
|
+
}, z.core.$strict>;
|
|
29
|
+
export declare const postalAddressSchema: z.ZodObject<{
|
|
30
|
+
recipientName: z.ZodString;
|
|
31
|
+
line1: z.ZodString;
|
|
32
|
+
line2: z.ZodOptional<z.ZodString>;
|
|
33
|
+
city: z.ZodString;
|
|
34
|
+
region: z.ZodOptional<z.ZodString>;
|
|
35
|
+
postalCode: z.ZodString;
|
|
36
|
+
country: z.ZodString;
|
|
37
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
38
|
+
label: z.ZodOptional<z.ZodString>;
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
isDefault: z.ZodBoolean;
|
|
41
|
+
createdAt: z.ZodString;
|
|
42
|
+
updatedAt: z.ZodString;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
export type PostalAddressInput = z.infer<typeof postalAddressInputSchema>;
|
|
45
|
+
export type PostalAddressUpdate = z.infer<typeof postalAddressUpdateSchema>;
|
|
46
|
+
export type PostalAddress = z.infer<typeof postalAddressSchema>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxy.so/contracts",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.14.0",
|
|
4
4
|
"description": "OxyHQ API contracts — single source of truth for request/response Zod schemas and inferred types, shared by the backend and the client SDKs",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|