@voyant-travel/identity 0.132.0 → 0.134.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/service.d.ts CHANGED
@@ -11,25 +11,20 @@ type NamedContactListQuery = z.infer<typeof namedContactListQuerySchema>;
11
11
  type CreateNamedContactInput = z.infer<typeof insertNamedContactSchema>;
12
12
  type UpdateNamedContactInput = z.infer<typeof updateNamedContactSchema>;
13
13
  export declare const identityService: {
14
- listContactPoints(db: PostgresJsDatabase, query: ContactPointListQuery): Promise<{
15
- data: {
16
- id: string;
17
- entityType: string;
18
- entityId: string;
19
- kind: "email" | "other" | "phone" | "mobile" | "whatsapp" | "website" | "sms" | "fax" | "social";
20
- label: string | null;
21
- value: string;
22
- normalizedValue: string | null;
23
- isPrimary: boolean;
24
- notes: string | null;
25
- metadata: Record<string, unknown> | null;
26
- createdAt: Date;
27
- updatedAt: Date;
28
- }[];
29
- total: number;
30
- limit: number;
31
- offset: number;
32
- }>;
14
+ listContactPoints(db: PostgresJsDatabase, query: ContactPointListQuery): Promise<import("@voyant-travel/types").ListResponse<{
15
+ id: string;
16
+ entityType: string;
17
+ entityId: string;
18
+ kind: "email" | "other" | "phone" | "mobile" | "whatsapp" | "website" | "sms" | "fax" | "social";
19
+ label: string | null;
20
+ value: string;
21
+ normalizedValue: string | null;
22
+ isPrimary: boolean;
23
+ notes: string | null;
24
+ metadata: Record<string, unknown> | null;
25
+ createdAt: Date;
26
+ updatedAt: Date;
27
+ }>>;
33
28
  listContactPointsForEntity(db: PostgresJsDatabase, entityType: string, entityId: string): Promise<{
34
29
  id: string;
35
30
  entityType: string;
@@ -89,32 +84,27 @@ export declare const identityService: {
89
84
  deleteContactPoint(db: PostgresJsDatabase, id: string): Promise<{
90
85
  id: string;
91
86
  } | null>;
92
- listAddresses(db: PostgresJsDatabase, query: AddressListQuery): Promise<{
93
- data: {
94
- id: string;
95
- entityType: string;
96
- entityId: string;
97
- label: "service" | "primary" | "other" | "legal" | "billing" | "shipping" | "mailing" | "meeting";
98
- fullText: string | null;
99
- line1: string | null;
100
- line2: string | null;
101
- city: string | null;
102
- region: string | null;
103
- postalCode: string | null;
104
- country: string | null;
105
- latitude: number | null;
106
- longitude: number | null;
107
- timezone: string | null;
108
- isPrimary: boolean;
109
- notes: string | null;
110
- metadata: Record<string, unknown> | null;
111
- createdAt: Date;
112
- updatedAt: Date;
113
- }[];
114
- total: number;
115
- limit: number;
116
- offset: number;
117
- }>;
87
+ listAddresses(db: PostgresJsDatabase, query: AddressListQuery): Promise<import("@voyant-travel/types").ListResponse<{
88
+ id: string;
89
+ entityType: string;
90
+ entityId: string;
91
+ label: "service" | "primary" | "other" | "legal" | "billing" | "shipping" | "mailing" | "meeting";
92
+ fullText: string | null;
93
+ line1: string | null;
94
+ line2: string | null;
95
+ city: string | null;
96
+ region: string | null;
97
+ postalCode: string | null;
98
+ country: string | null;
99
+ latitude: number | null;
100
+ longitude: number | null;
101
+ timezone: string | null;
102
+ isPrimary: boolean;
103
+ notes: string | null;
104
+ metadata: Record<string, unknown> | null;
105
+ createdAt: Date;
106
+ updatedAt: Date;
107
+ }>>;
118
108
  listAddressesForEntity(db: PostgresJsDatabase, entityType: string, entityId: string): Promise<{
119
109
  id: string;
120
110
  entityType: string;
@@ -202,26 +192,21 @@ export declare const identityService: {
202
192
  deleteAddress(db: PostgresJsDatabase, id: string): Promise<{
203
193
  id: string;
204
194
  } | null>;
205
- listNamedContacts(db: PostgresJsDatabase, query: NamedContactListQuery): Promise<{
206
- data: {
207
- id: string;
208
- entityType: string;
209
- entityId: string;
210
- role: "primary" | "other" | "legal" | "operations" | "general" | "reservations" | "front_desk" | "sales" | "emergency" | "accounting";
211
- name: string;
212
- title: string | null;
213
- email: string | null;
214
- phone: string | null;
215
- isPrimary: boolean;
216
- notes: string | null;
217
- metadata: Record<string, unknown> | null;
218
- createdAt: Date;
219
- updatedAt: Date;
220
- }[];
221
- total: number;
222
- limit: number;
223
- offset: number;
224
- }>;
195
+ listNamedContacts(db: PostgresJsDatabase, query: NamedContactListQuery): Promise<import("@voyant-travel/types").ListResponse<{
196
+ id: string;
197
+ entityType: string;
198
+ entityId: string;
199
+ role: "primary" | "other" | "legal" | "operations" | "general" | "reservations" | "front_desk" | "sales" | "emergency" | "accounting";
200
+ name: string;
201
+ title: string | null;
202
+ email: string | null;
203
+ phone: string | null;
204
+ isPrimary: boolean;
205
+ notes: string | null;
206
+ metadata: Record<string, unknown> | null;
207
+ createdAt: Date;
208
+ updatedAt: Date;
209
+ }>>;
225
210
  listNamedContactsForEntity(db: PostgresJsDatabase, entityType: string, entityId: string): Promise<{
226
211
  id: string;
227
212
  entityType: string;
@@ -1 +1 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAG5B,OAAO,KAAK,EACV,sBAAsB,EACtB,2BAA2B,EAC3B,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,2BAA2B,EAC3B,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,iBAAiB,CAAA;AAExB,KAAK,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AACxE,KAAK,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AACvE,KAAK,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AACvE,KAAK,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAC9D,KAAK,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAC7D,KAAK,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC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S/B,kBAAkB,QAAQ,uBAAuB;;;;;;;;;;;;;;2BAajD,kBAAkB,MAAM,MAAM,QAAQ,uBAAuB;;;;;;;;;;;;;;2BAyB7D,kBAAkB,MAAM,MAAM;;;sBAQnC,kBAAkB,SAAS,gBAAgB;;;;;;;;;;;;;;;;;;;;;+BA8BlC,kBAAkB,cAAc,MAAM,YAAY,MAAM;;;;;;;;;;;;;;;;;;;;;uBAUhE,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;sBAS/B,kBAAkB,QAAQ,kBAAkB;;;;;;;;;;;;;;;;;;;;;sBAY5C,kBAAkB,MAAM,MAAM,QAAQ,kBAAkB;;;;;;;;;;;;;;;;;;;;;sBAuBxD,kBAAkB,MAAM,MAAM;;;0BAQ1B,kBAAkB,SAAS,qBAAqB;;;;;;;;;;;;;;;mCAoCvC,kBAAkB,cAAc,MAAM,YAAY,MAAM;;;;;;;;;;;;;;;4BAa/D,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;2BAS/B,kBAAkB,QAAQ,uBAAuB;;;;;;;;;;;;;;;2BAYjD,kBAAkB,MAAM,MAAM,QAAQ,uBAAuB;;;;;;;;;;;;;;;2BAuB7D,kBAAkB,MAAM,MAAM;;;CAO5D,CAAA"}
package/dist/service.js CHANGED
@@ -1,8 +1,9 @@
1
+ import { listResponse } from "@voyant-travel/types";
1
2
  import { and, desc, eq, ne, sql } from "drizzle-orm";
2
3
  import { identityAddresses, identityContactPoints, identityNamedContacts } from "./schema.js";
3
4
  async function paginate(rowsQuery, countQuery, limit, offset) {
4
5
  const [data, countResult] = await Promise.all([rowsQuery, countQuery]);
5
- return { data, total: countResult[0]?.count ?? 0, limit, offset };
6
+ return listResponse(data, { total: countResult[0]?.count ?? 0, limit, offset });
6
7
  }
7
8
  async function ensurePrimaryContactPoint(db, params) {
8
9
  const conditions = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voyant-travel/identity",
3
- "version": "0.132.0",
3
+ "version": "0.134.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -35,9 +35,10 @@
35
35
  "hono": "^4.12.10",
36
36
  "zod": "^4.3.6",
37
37
  "@voyant-travel/core": "^0.111.0",
38
- "@voyant-travel/db": "^0.108.5",
39
- "@voyant-travel/identity-contracts": "^0.104.3",
40
- "@voyant-travel/hono": "^0.113.0"
38
+ "@voyant-travel/db": "^0.109.0",
39
+ "@voyant-travel/types": "^0.106.0",
40
+ "@voyant-travel/identity-contracts": "^0.104.4",
41
+ "@voyant-travel/hono": "^0.115.0"
41
42
  },
42
43
  "devDependencies": {
43
44
  "drizzle-kit": "^0.31.10",