@voyant-travel/identity 0.126.0 → 0.127.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.
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
DO $$ BEGIN
|
|
2
|
+
CREATE TYPE "public"."address_label" AS ENUM('primary', 'billing', 'shipping', 'mailing', 'meeting', 'service', 'legal', 'other');
|
|
3
|
+
EXCEPTION WHEN duplicate_object THEN null;
|
|
4
|
+
END $$;--> statement-breakpoint
|
|
5
|
+
DO $$ BEGIN
|
|
6
|
+
CREATE TYPE "public"."contact_point_kind" AS ENUM('email', 'phone', 'mobile', 'whatsapp', 'website', 'sms', 'fax', 'social', 'other');
|
|
7
|
+
EXCEPTION WHEN duplicate_object THEN null;
|
|
8
|
+
END $$;--> statement-breakpoint
|
|
9
|
+
DO $$ BEGIN
|
|
10
|
+
CREATE TYPE "public"."named_contact_role" AS ENUM('general', 'primary', 'reservations', 'operations', 'front_desk', 'sales', 'emergency', 'accounting', 'legal', 'other');
|
|
11
|
+
EXCEPTION WHEN duplicate_object THEN null;
|
|
12
|
+
END $$;--> statement-breakpoint
|
|
13
|
+
CREATE TABLE "identity_addresses" (
|
|
14
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
15
|
+
"entity_type" text NOT NULL,
|
|
16
|
+
"entity_id" text NOT NULL,
|
|
17
|
+
"label" "address_label" DEFAULT 'other' NOT NULL,
|
|
18
|
+
"full_text" text,
|
|
19
|
+
"line_1" text,
|
|
20
|
+
"line_2" text,
|
|
21
|
+
"city" text,
|
|
22
|
+
"region" text,
|
|
23
|
+
"postal_code" text,
|
|
24
|
+
"country" text,
|
|
25
|
+
"latitude" double precision,
|
|
26
|
+
"longitude" double precision,
|
|
27
|
+
"timezone" text,
|
|
28
|
+
"is_primary" boolean DEFAULT false NOT NULL,
|
|
29
|
+
"notes" text,
|
|
30
|
+
"metadata" jsonb,
|
|
31
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
32
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
33
|
+
);
|
|
34
|
+
--> statement-breakpoint
|
|
35
|
+
CREATE TABLE "identity_contact_points" (
|
|
36
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
37
|
+
"entity_type" text NOT NULL,
|
|
38
|
+
"entity_id" text NOT NULL,
|
|
39
|
+
"kind" "contact_point_kind" NOT NULL,
|
|
40
|
+
"label" text,
|
|
41
|
+
"value" text NOT NULL,
|
|
42
|
+
"normalized_value" text,
|
|
43
|
+
"is_primary" boolean DEFAULT false NOT NULL,
|
|
44
|
+
"notes" text,
|
|
45
|
+
"metadata" jsonb,
|
|
46
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
47
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
48
|
+
);
|
|
49
|
+
--> statement-breakpoint
|
|
50
|
+
CREATE TABLE "identity_named_contacts" (
|
|
51
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
52
|
+
"entity_type" text NOT NULL,
|
|
53
|
+
"entity_id" text NOT NULL,
|
|
54
|
+
"role" "named_contact_role" DEFAULT 'general' NOT NULL,
|
|
55
|
+
"name" text NOT NULL,
|
|
56
|
+
"title" text,
|
|
57
|
+
"email" text,
|
|
58
|
+
"phone" text,
|
|
59
|
+
"is_primary" boolean DEFAULT false NOT NULL,
|
|
60
|
+
"notes" text,
|
|
61
|
+
"metadata" jsonb,
|
|
62
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
63
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
64
|
+
);
|
|
65
|
+
--> statement-breakpoint
|
|
66
|
+
CREATE INDEX "idx_identity_addresses_entity" ON "identity_addresses" USING btree ("entity_type","entity_id");--> statement-breakpoint
|
|
67
|
+
CREATE INDEX "idx_identity_addresses_entity_primary_created" ON "identity_addresses" USING btree ("entity_type","entity_id","is_primary","created_at");--> statement-breakpoint
|
|
68
|
+
CREATE INDEX "idx_identity_addresses_label" ON "identity_addresses" USING btree ("label");--> statement-breakpoint
|
|
69
|
+
CREATE INDEX "idx_identity_contact_points_entity" ON "identity_contact_points" USING btree ("entity_type","entity_id");--> statement-breakpoint
|
|
70
|
+
CREATE INDEX "idx_identity_contact_points_entity_primary_created" ON "identity_contact_points" USING btree ("entity_type","entity_id","is_primary","created_at");--> statement-breakpoint
|
|
71
|
+
CREATE INDEX "idx_identity_contact_points_entity_kind_primary_created" ON "identity_contact_points" USING btree ("entity_type","entity_id","kind","is_primary","created_at");--> statement-breakpoint
|
|
72
|
+
CREATE INDEX "idx_identity_contact_points_kind" ON "identity_contact_points" USING btree ("kind");--> statement-breakpoint
|
|
73
|
+
CREATE INDEX "idx_identity_contact_points_normalized" ON "identity_contact_points" USING btree ("normalized_value");--> statement-breakpoint
|
|
74
|
+
CREATE UNIQUE INDEX "uidx_identity_contact_points_entity_kind_value" ON "identity_contact_points" USING btree ("entity_type","entity_id","kind","value");--> statement-breakpoint
|
|
75
|
+
CREATE INDEX "idx_identity_named_contacts_entity" ON "identity_named_contacts" USING btree ("entity_type","entity_id");--> statement-breakpoint
|
|
76
|
+
CREATE INDEX "idx_identity_named_contacts_entity_primary_created" ON "identity_named_contacts" USING btree ("entity_type","entity_id","is_primary","created_at");--> statement-breakpoint
|
|
77
|
+
CREATE INDEX "idx_identity_named_contacts_entity_role_primary_created" ON "identity_named_contacts" USING btree ("entity_type","entity_id","role","is_primary","created_at");--> statement-breakpoint
|
|
78
|
+
CREATE INDEX "idx_identity_named_contacts_role" ON "identity_named_contacts" USING btree ("role");--> statement-breakpoint
|
|
79
|
+
CREATE INDEX "idx_identity_named_contacts_primary" ON "identity_named_contacts" USING btree ("is_primary");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyant-travel/identity",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.127.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -35,16 +35,19 @@
|
|
|
35
35
|
"hono": "^4.12.10",
|
|
36
36
|
"zod": "^4.3.6",
|
|
37
37
|
"@voyant-travel/core": "^0.110.0",
|
|
38
|
-
"@voyant-travel/db": "^0.108.
|
|
38
|
+
"@voyant-travel/db": "^0.108.4",
|
|
39
39
|
"@voyant-travel/identity-contracts": "^0.104.3",
|
|
40
40
|
"@voyant-travel/hono": "^0.112.2"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
+
"drizzle-kit": "^0.31.10",
|
|
43
44
|
"typescript": "^6.0.2",
|
|
44
45
|
"@voyant-travel/voyant-typescript-config": "^0.1.0"
|
|
45
46
|
},
|
|
46
47
|
"files": [
|
|
47
|
-
"dist"
|
|
48
|
+
"dist",
|
|
49
|
+
"migrations/*.sql",
|
|
50
|
+
"migrations/meta/_journal.json"
|
|
48
51
|
],
|
|
49
52
|
"publishConfig": {
|
|
50
53
|
"access": "public"
|
|
@@ -65,7 +68,8 @@
|
|
|
65
68
|
"lint": "biome check src/",
|
|
66
69
|
"test": "vitest run",
|
|
67
70
|
"build": "tsc -p tsconfig.json",
|
|
68
|
-
"clean": "rm -rf dist tsconfig.tsbuildinfo"
|
|
71
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo",
|
|
72
|
+
"db:generate": "drizzle-kit generate --config=drizzle.migrations.config.ts --name=identity_baseline && node ../../scripts/d2/guard-create-type.mjs ./migrations && node ../../scripts/d2/ensure-extensions.mjs ./migrations"
|
|
69
73
|
},
|
|
70
74
|
"main": "./dist/index.js",
|
|
71
75
|
"types": "./dist/index.d.ts"
|