@voyant-travel/identity 0.136.2 → 0.137.1
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/index.js +1 -1
- package/dist/routes/env.d.ts +8 -0
- package/dist/routes/env.d.ts.map +1 -0
- package/dist/routes/env.js +1 -0
- package/dist/routes/openapi-schemas.d.ts +108 -0
- package/dist/routes/openapi-schemas.d.ts.map +1 -0
- package/dist/routes/openapi-schemas.js +80 -0
- package/dist/routes.d.ts +647 -222
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +426 -129
- package/dist/schema.d.ts +3 -3
- package/dist/service.d.ts +32 -32
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export const identityModule = {
|
|
|
5
5
|
};
|
|
6
6
|
export const identityHonoModule = {
|
|
7
7
|
module: identityModule,
|
|
8
|
-
|
|
8
|
+
adminRoutes: identityRoutes,
|
|
9
9
|
};
|
|
10
10
|
export { addressLabelEnum, contactPointKindEnum, identityAddresses, identityContactPoints, identityNamedContacts, namedContactRoleEnum, } from "./schema.js";
|
|
11
11
|
export { addressLabelSchema, addressListQuerySchema, contactPointKindSchema, contactPointListQuerySchema, insertAddressForEntitySchema, insertAddressSchema, insertContactPointForEntitySchema, insertContactPointSchema, insertNamedContactForEntitySchema, insertNamedContactSchema, namedContactListQuerySchema, namedContactRoleSchema, selectAddressSchema, selectContactPointSchema, selectNamedContactSchema, updateAddressSchema, updateContactPointSchema, updateNamedContactSchema, } from "./validation.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/routes/env.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAEjE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE;QACT,EAAE,EAAE,kBAAkB,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response/envelope schemas for the identity admin OpenAPI routes (voyant#2114 —
|
|
3
|
+
* identity sub-batch). The row schemas are authored from the Drizzle
|
|
4
|
+
* `$inferSelect` shapes in `schema.ts` (§17: `timestamp` columns serialize to
|
|
5
|
+
* strings over the wire; `doublePrecision` lat/long stay numbers; jsonb
|
|
6
|
+
* `metadata` bags are open records). Enum columns reuse the exported
|
|
7
|
+
* `validation.ts` enum schemas so the documented values stay in lock-step with
|
|
8
|
+
* request validation.
|
|
9
|
+
*
|
|
10
|
+
* These are shared between `routes.ts` and the contract test so the documented
|
|
11
|
+
* envelopes, the runtime handlers, and the round-trip assertions all read from
|
|
12
|
+
* one source.
|
|
13
|
+
*/
|
|
14
|
+
import { z } from "zod";
|
|
15
|
+
export declare const errorResponseSchema: z.ZodObject<{
|
|
16
|
+
error: z.ZodString;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export declare const successResponseSchema: z.ZodObject<{
|
|
19
|
+
success: z.ZodLiteral<true>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export declare const idParamSchema: z.ZodObject<{
|
|
22
|
+
id: z.ZodString;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export declare const entityParamSchema: z.ZodObject<{
|
|
25
|
+
entityType: z.ZodString;
|
|
26
|
+
entityId: z.ZodString;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export declare const contactPointSchema: z.ZodObject<{
|
|
29
|
+
id: z.ZodString;
|
|
30
|
+
entityType: z.ZodString;
|
|
31
|
+
entityId: z.ZodString;
|
|
32
|
+
kind: z.ZodEnum<{
|
|
33
|
+
email: "email";
|
|
34
|
+
phone: "phone";
|
|
35
|
+
mobile: "mobile";
|
|
36
|
+
whatsapp: "whatsapp";
|
|
37
|
+
website: "website";
|
|
38
|
+
sms: "sms";
|
|
39
|
+
fax: "fax";
|
|
40
|
+
social: "social";
|
|
41
|
+
other: "other";
|
|
42
|
+
}>;
|
|
43
|
+
label: z.ZodNullable<z.ZodString>;
|
|
44
|
+
value: z.ZodString;
|
|
45
|
+
normalizedValue: z.ZodNullable<z.ZodString>;
|
|
46
|
+
isPrimary: z.ZodBoolean;
|
|
47
|
+
notes: z.ZodNullable<z.ZodString>;
|
|
48
|
+
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
49
|
+
createdAt: z.ZodString;
|
|
50
|
+
updatedAt: z.ZodString;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
export declare const addressSchema: z.ZodObject<{
|
|
53
|
+
id: z.ZodString;
|
|
54
|
+
entityType: z.ZodString;
|
|
55
|
+
entityId: z.ZodString;
|
|
56
|
+
label: z.ZodEnum<{
|
|
57
|
+
other: "other";
|
|
58
|
+
primary: "primary";
|
|
59
|
+
billing: "billing";
|
|
60
|
+
shipping: "shipping";
|
|
61
|
+
mailing: "mailing";
|
|
62
|
+
meeting: "meeting";
|
|
63
|
+
service: "service";
|
|
64
|
+
legal: "legal";
|
|
65
|
+
}>;
|
|
66
|
+
fullText: z.ZodNullable<z.ZodString>;
|
|
67
|
+
line1: z.ZodNullable<z.ZodString>;
|
|
68
|
+
line2: z.ZodNullable<z.ZodString>;
|
|
69
|
+
city: z.ZodNullable<z.ZodString>;
|
|
70
|
+
region: z.ZodNullable<z.ZodString>;
|
|
71
|
+
postalCode: z.ZodNullable<z.ZodString>;
|
|
72
|
+
country: z.ZodNullable<z.ZodString>;
|
|
73
|
+
latitude: z.ZodNullable<z.ZodNumber>;
|
|
74
|
+
longitude: z.ZodNullable<z.ZodNumber>;
|
|
75
|
+
timezone: z.ZodNullable<z.ZodString>;
|
|
76
|
+
isPrimary: z.ZodBoolean;
|
|
77
|
+
notes: z.ZodNullable<z.ZodString>;
|
|
78
|
+
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
79
|
+
createdAt: z.ZodString;
|
|
80
|
+
updatedAt: z.ZodString;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
export declare const namedContactSchema: z.ZodObject<{
|
|
83
|
+
id: z.ZodString;
|
|
84
|
+
entityType: z.ZodString;
|
|
85
|
+
entityId: z.ZodString;
|
|
86
|
+
role: z.ZodEnum<{
|
|
87
|
+
other: "other";
|
|
88
|
+
primary: "primary";
|
|
89
|
+
legal: "legal";
|
|
90
|
+
general: "general";
|
|
91
|
+
reservations: "reservations";
|
|
92
|
+
operations: "operations";
|
|
93
|
+
front_desk: "front_desk";
|
|
94
|
+
sales: "sales";
|
|
95
|
+
emergency: "emergency";
|
|
96
|
+
accounting: "accounting";
|
|
97
|
+
}>;
|
|
98
|
+
name: z.ZodString;
|
|
99
|
+
title: z.ZodNullable<z.ZodString>;
|
|
100
|
+
email: z.ZodNullable<z.ZodString>;
|
|
101
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
102
|
+
isPrimary: z.ZodBoolean;
|
|
103
|
+
notes: z.ZodNullable<z.ZodString>;
|
|
104
|
+
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
105
|
+
createdAt: z.ZodString;
|
|
106
|
+
updatedAt: z.ZodString;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
//# sourceMappingURL=openapi-schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi-schemas.d.ts","sourceRoot":"","sources":["../../src/routes/openapi-schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAUvB,eAAO,MAAM,mBAAmB;;iBAAkC,CAAA;AAClE,eAAO,MAAM,qBAAqB;;iBAAyC,CAAA;AAE3E,eAAO,MAAM,aAAa;;iBAA6B,CAAA;AACvD,eAAO,MAAM,iBAAiB;;;iBAG5B,CAAA;AAQF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;iBAa7B,CAAA;AAIF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoBxB,CAAA;AAIF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;iBAc7B,CAAA"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response/envelope schemas for the identity admin OpenAPI routes (voyant#2114 —
|
|
3
|
+
* identity sub-batch). The row schemas are authored from the Drizzle
|
|
4
|
+
* `$inferSelect` shapes in `schema.ts` (§17: `timestamp` columns serialize to
|
|
5
|
+
* strings over the wire; `doublePrecision` lat/long stay numbers; jsonb
|
|
6
|
+
* `metadata` bags are open records). Enum columns reuse the exported
|
|
7
|
+
* `validation.ts` enum schemas so the documented values stay in lock-step with
|
|
8
|
+
* request validation.
|
|
9
|
+
*
|
|
10
|
+
* These are shared between `routes.ts` and the contract test so the documented
|
|
11
|
+
* envelopes, the runtime handlers, and the round-trip assertions all read from
|
|
12
|
+
* one source.
|
|
13
|
+
*/
|
|
14
|
+
import { z } from "zod";
|
|
15
|
+
import { addressLabelSchema, contactPointKindSchema, namedContactRoleSchema, } from "../validation.js";
|
|
16
|
+
// --- shared envelopes -------------------------------------------------------
|
|
17
|
+
export const errorResponseSchema = z.object({ error: z.string() });
|
|
18
|
+
export const successResponseSchema = z.object({ success: z.literal(true) });
|
|
19
|
+
const idSchema = z.string();
|
|
20
|
+
export const idParamSchema = z.object({ id: idSchema });
|
|
21
|
+
export const entityParamSchema = z.object({
|
|
22
|
+
entityType: z.string(),
|
|
23
|
+
entityId: z.string(),
|
|
24
|
+
});
|
|
25
|
+
// §17: `timestamp` columns are serialized to ISO strings over the wire.
|
|
26
|
+
const isoTimestamp = z.string();
|
|
27
|
+
const jsonRecord = z.record(z.string(), z.unknown());
|
|
28
|
+
// --- contact point ----------------------------------------------------------
|
|
29
|
+
export const contactPointSchema = z.object({
|
|
30
|
+
id: idSchema,
|
|
31
|
+
entityType: z.string(),
|
|
32
|
+
entityId: z.string(),
|
|
33
|
+
kind: contactPointKindSchema,
|
|
34
|
+
label: z.string().nullable(),
|
|
35
|
+
value: z.string(),
|
|
36
|
+
normalizedValue: z.string().nullable(),
|
|
37
|
+
isPrimary: z.boolean(),
|
|
38
|
+
notes: z.string().nullable(),
|
|
39
|
+
metadata: jsonRecord.nullable(),
|
|
40
|
+
createdAt: isoTimestamp,
|
|
41
|
+
updatedAt: isoTimestamp,
|
|
42
|
+
});
|
|
43
|
+
// --- address ----------------------------------------------------------------
|
|
44
|
+
export const addressSchema = z.object({
|
|
45
|
+
id: idSchema,
|
|
46
|
+
entityType: z.string(),
|
|
47
|
+
entityId: z.string(),
|
|
48
|
+
label: addressLabelSchema,
|
|
49
|
+
fullText: z.string().nullable(),
|
|
50
|
+
line1: z.string().nullable(),
|
|
51
|
+
line2: z.string().nullable(),
|
|
52
|
+
city: z.string().nullable(),
|
|
53
|
+
region: z.string().nullable(),
|
|
54
|
+
postalCode: z.string().nullable(),
|
|
55
|
+
country: z.string().nullable(),
|
|
56
|
+
latitude: z.number().nullable(),
|
|
57
|
+
longitude: z.number().nullable(),
|
|
58
|
+
timezone: z.string().nullable(),
|
|
59
|
+
isPrimary: z.boolean(),
|
|
60
|
+
notes: z.string().nullable(),
|
|
61
|
+
metadata: jsonRecord.nullable(),
|
|
62
|
+
createdAt: isoTimestamp,
|
|
63
|
+
updatedAt: isoTimestamp,
|
|
64
|
+
});
|
|
65
|
+
// --- named contact ----------------------------------------------------------
|
|
66
|
+
export const namedContactSchema = z.object({
|
|
67
|
+
id: idSchema,
|
|
68
|
+
entityType: z.string(),
|
|
69
|
+
entityId: z.string(),
|
|
70
|
+
role: namedContactRoleSchema,
|
|
71
|
+
name: z.string(),
|
|
72
|
+
title: z.string().nullable(),
|
|
73
|
+
email: z.string().nullable(),
|
|
74
|
+
phone: z.string().nullable(),
|
|
75
|
+
isPrimary: z.boolean(),
|
|
76
|
+
notes: z.string().nullable(),
|
|
77
|
+
metadata: jsonRecord.nullable(),
|
|
78
|
+
createdAt: isoTimestamp,
|
|
79
|
+
updatedAt: isoTimestamp,
|
|
80
|
+
});
|