@rudderhq/db 0.3.5-canary.9 → 0.3.5

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.
Files changed (58) hide show
  1. package/dist/migrations/0088_curly_sue_storm.sql +30 -0
  2. package/dist/migrations/0089_goofy_peter_parker.sql +1 -0
  3. package/dist/migrations/0090_chat_agent_runs.sql +110 -0
  4. package/dist/migrations/0091_disabled_intelligence_profiles.sql +8 -0
  5. package/dist/migrations/0092_white_tombstone.sql +139 -0
  6. package/dist/migrations/meta/0088_snapshot.json +15724 -0
  7. package/dist/migrations/meta/0089_snapshot.json +15730 -0
  8. package/dist/migrations/meta/0090_snapshot.json +15838 -0
  9. package/dist/migrations/meta/0091_snapshot.json +15838 -0
  10. package/dist/migrations/meta/0092_snapshot.json +17120 -0
  11. package/dist/migrations/meta/_journal.json +35 -0
  12. package/dist/schema/agent_integration_binding_tokens.d.ts +161 -0
  13. package/dist/schema/agent_integration_binding_tokens.d.ts.map +1 -0
  14. package/dist/schema/agent_integration_binding_tokens.js +21 -0
  15. package/dist/schema/agent_integration_binding_tokens.js.map +1 -0
  16. package/dist/schema/agent_integration_chat_bindings.d.ts +144 -0
  17. package/dist/schema/agent_integration_chat_bindings.d.ts.map +1 -0
  18. package/dist/schema/agent_integration_chat_bindings.js +22 -0
  19. package/dist/schema/agent_integration_chat_bindings.js.map +1 -0
  20. package/dist/schema/agent_integration_inbound_audit.d.ts +231 -0
  21. package/dist/schema/agent_integration_inbound_audit.d.ts.map +1 -0
  22. package/dist/schema/agent_integration_inbound_audit.js +23 -0
  23. package/dist/schema/agent_integration_inbound_audit.js.map +1 -0
  24. package/dist/schema/agent_integration_inbound_dedup.d.ts +110 -0
  25. package/dist/schema/agent_integration_inbound_dedup.d.ts.map +1 -0
  26. package/dist/schema/agent_integration_inbound_dedup.js +19 -0
  27. package/dist/schema/agent_integration_inbound_dedup.js.map +1 -0
  28. package/dist/schema/agent_integration_outbound_messages.d.ts +229 -0
  29. package/dist/schema/agent_integration_outbound_messages.d.ts.map +1 -0
  30. package/dist/schema/agent_integration_outbound_messages.js +30 -0
  31. package/dist/schema/agent_integration_outbound_messages.js.map +1 -0
  32. package/dist/schema/agent_integration_user_bindings.d.ts +178 -0
  33. package/dist/schema/agent_integration_user_bindings.d.ts.map +1 -0
  34. package/dist/schema/agent_integration_user_bindings.js +22 -0
  35. package/dist/schema/agent_integration_user_bindings.js.map +1 -0
  36. package/dist/schema/agent_integrations.d.ts +297 -0
  37. package/dist/schema/agent_integrations.d.ts.map +1 -0
  38. package/dist/schema/agent_integrations.js +31 -0
  39. package/dist/schema/agent_integrations.js.map +1 -0
  40. package/dist/schema/chat_messages.d.ts +17 -0
  41. package/dist/schema/chat_messages.d.ts.map +1 -1
  42. package/dist/schema/chat_messages.js +3 -0
  43. package/dist/schema/chat_messages.js.map +1 -1
  44. package/dist/schema/heartbeat_runs.d.ts +17 -0
  45. package/dist/schema/heartbeat_runs.d.ts.map +1 -1
  46. package/dist/schema/heartbeat_runs.js +10 -1
  47. package/dist/schema/heartbeat_runs.js.map +1 -1
  48. package/dist/schema/index.d.ts +8 -0
  49. package/dist/schema/index.d.ts.map +1 -1
  50. package/dist/schema/index.js +8 -0
  51. package/dist/schema/index.js.map +1 -1
  52. package/dist/schema/messenger_custom_groups.d.ts +304 -0
  53. package/dist/schema/messenger_custom_groups.d.ts.map +1 -0
  54. package/dist/schema/messenger_custom_groups.js +36 -0
  55. package/dist/schema/messenger_custom_groups.js.map +1 -0
  56. package/dist/schema/organization_intelligence_profiles.js +1 -1
  57. package/dist/schema/organization_intelligence_profiles.js.map +1 -1
  58. package/package.json +2 -2
@@ -617,6 +617,41 @@
617
617
  "when": 1781268744845,
618
618
  "tag": "0087_fixed_white_tiger",
619
619
  "breakpoints": true
620
+ },
621
+ {
622
+ "idx": 88,
623
+ "version": "7",
624
+ "when": 1781621826992,
625
+ "tag": "0088_curly_sue_storm",
626
+ "breakpoints": true
627
+ },
628
+ {
629
+ "idx": 89,
630
+ "version": "7",
631
+ "when": 1781623422598,
632
+ "tag": "0089_goofy_peter_parker",
633
+ "breakpoints": true
634
+ },
635
+ {
636
+ "idx": 90,
637
+ "version": "7",
638
+ "when": 1781625000000,
639
+ "tag": "0090_chat_agent_runs",
640
+ "breakpoints": true
641
+ },
642
+ {
643
+ "idx": 91,
644
+ "version": "7",
645
+ "when": 1781740800000,
646
+ "tag": "0091_disabled_intelligence_profiles",
647
+ "breakpoints": true
648
+ },
649
+ {
650
+ "idx": 92,
651
+ "version": "7",
652
+ "when": 1781768744822,
653
+ "tag": "0092_white_tombstone",
654
+ "breakpoints": true
620
655
  }
621
656
  ]
622
657
  }
@@ -0,0 +1,161 @@
1
+ export declare const agentIntegrationBindingTokens: import("drizzle-orm/pg-core").PgTableWithColumns<{
2
+ name: "agent_integration_binding_tokens";
3
+ schema: undefined;
4
+ columns: {
5
+ id: import("drizzle-orm/pg-core").PgColumn<{
6
+ name: "id";
7
+ tableName: "agent_integration_binding_tokens";
8
+ dataType: "string";
9
+ columnType: "PgUUID";
10
+ data: string;
11
+ driverParam: string;
12
+ notNull: true;
13
+ hasDefault: true;
14
+ isPrimaryKey: true;
15
+ isAutoincrement: false;
16
+ hasRuntimeDefault: false;
17
+ enumValues: undefined;
18
+ baseColumn: never;
19
+ identity: undefined;
20
+ generated: undefined;
21
+ }, {}, {}>;
22
+ orgId: import("drizzle-orm/pg-core").PgColumn<{
23
+ name: "org_id";
24
+ tableName: "agent_integration_binding_tokens";
25
+ dataType: "string";
26
+ columnType: "PgUUID";
27
+ data: string;
28
+ driverParam: string;
29
+ notNull: true;
30
+ hasDefault: false;
31
+ isPrimaryKey: false;
32
+ isAutoincrement: false;
33
+ hasRuntimeDefault: false;
34
+ enumValues: undefined;
35
+ baseColumn: never;
36
+ identity: undefined;
37
+ generated: undefined;
38
+ }, {}, {}>;
39
+ integrationId: import("drizzle-orm/pg-core").PgColumn<{
40
+ name: "integration_id";
41
+ tableName: "agent_integration_binding_tokens";
42
+ dataType: "string";
43
+ columnType: "PgUUID";
44
+ data: string;
45
+ driverParam: string;
46
+ notNull: true;
47
+ hasDefault: false;
48
+ isPrimaryKey: false;
49
+ isAutoincrement: false;
50
+ hasRuntimeDefault: false;
51
+ enumValues: undefined;
52
+ baseColumn: never;
53
+ identity: undefined;
54
+ generated: undefined;
55
+ }, {}, {}>;
56
+ tokenHash: import("drizzle-orm/pg-core").PgColumn<{
57
+ name: "token_hash";
58
+ tableName: "agent_integration_binding_tokens";
59
+ dataType: "string";
60
+ columnType: "PgText";
61
+ data: string;
62
+ driverParam: string;
63
+ notNull: true;
64
+ hasDefault: false;
65
+ isPrimaryKey: false;
66
+ isAutoincrement: false;
67
+ hasRuntimeDefault: false;
68
+ enumValues: [string, ...string[]];
69
+ baseColumn: never;
70
+ identity: undefined;
71
+ generated: undefined;
72
+ }, {}, {}>;
73
+ externalOpenId: import("drizzle-orm/pg-core").PgColumn<{
74
+ name: "external_open_id";
75
+ tableName: "agent_integration_binding_tokens";
76
+ dataType: "string";
77
+ columnType: "PgText";
78
+ data: string;
79
+ driverParam: string;
80
+ notNull: true;
81
+ hasDefault: false;
82
+ isPrimaryKey: false;
83
+ isAutoincrement: false;
84
+ hasRuntimeDefault: false;
85
+ enumValues: [string, ...string[]];
86
+ baseColumn: never;
87
+ identity: undefined;
88
+ generated: undefined;
89
+ }, {}, {}>;
90
+ externalUnionId: import("drizzle-orm/pg-core").PgColumn<{
91
+ name: "external_union_id";
92
+ tableName: "agent_integration_binding_tokens";
93
+ dataType: "string";
94
+ columnType: "PgText";
95
+ data: string;
96
+ driverParam: string;
97
+ notNull: false;
98
+ hasDefault: false;
99
+ isPrimaryKey: false;
100
+ isAutoincrement: false;
101
+ hasRuntimeDefault: false;
102
+ enumValues: [string, ...string[]];
103
+ baseColumn: never;
104
+ identity: undefined;
105
+ generated: undefined;
106
+ }, {}, {}>;
107
+ expiresAt: import("drizzle-orm/pg-core").PgColumn<{
108
+ name: "expires_at";
109
+ tableName: "agent_integration_binding_tokens";
110
+ dataType: "date";
111
+ columnType: "PgTimestamp";
112
+ data: Date;
113
+ driverParam: string;
114
+ notNull: true;
115
+ hasDefault: false;
116
+ isPrimaryKey: false;
117
+ isAutoincrement: false;
118
+ hasRuntimeDefault: false;
119
+ enumValues: undefined;
120
+ baseColumn: never;
121
+ identity: undefined;
122
+ generated: undefined;
123
+ }, {}, {}>;
124
+ consumedAt: import("drizzle-orm/pg-core").PgColumn<{
125
+ name: "consumed_at";
126
+ tableName: "agent_integration_binding_tokens";
127
+ dataType: "date";
128
+ columnType: "PgTimestamp";
129
+ data: Date;
130
+ driverParam: string;
131
+ notNull: false;
132
+ hasDefault: false;
133
+ isPrimaryKey: false;
134
+ isAutoincrement: false;
135
+ hasRuntimeDefault: false;
136
+ enumValues: undefined;
137
+ baseColumn: never;
138
+ identity: undefined;
139
+ generated: undefined;
140
+ }, {}, {}>;
141
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
142
+ name: "created_at";
143
+ tableName: "agent_integration_binding_tokens";
144
+ dataType: "date";
145
+ columnType: "PgTimestamp";
146
+ data: Date;
147
+ driverParam: string;
148
+ notNull: true;
149
+ hasDefault: true;
150
+ isPrimaryKey: false;
151
+ isAutoincrement: false;
152
+ hasRuntimeDefault: false;
153
+ enumValues: undefined;
154
+ baseColumn: never;
155
+ identity: undefined;
156
+ generated: undefined;
157
+ }, {}, {}>;
158
+ };
159
+ dialect: "pg";
160
+ }>;
161
+ //# sourceMappingURL=agent_integration_binding_tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent_integration_binding_tokens.d.ts","sourceRoot":"","sources":["../../src/schema/agent_integration_binding_tokens.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBzC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { index, pgTable, text, timestamp, uniqueIndex, uuid } from "drizzle-orm/pg-core";
2
+ import { agentIntegrations } from "./agent_integrations.js";
3
+ import { organizations } from "./organizations.js";
4
+ export const agentIntegrationBindingTokens = pgTable("agent_integration_binding_tokens", {
5
+ id: uuid("id").primaryKey().defaultRandom(),
6
+ orgId: uuid("org_id").notNull().references(() => organizations.id, { onDelete: "cascade" }),
7
+ integrationId: uuid("integration_id")
8
+ .notNull()
9
+ .references(() => agentIntegrations.id, { onDelete: "cascade" }),
10
+ tokenHash: text("token_hash").notNull(),
11
+ externalOpenId: text("external_open_id").notNull(),
12
+ externalUnionId: text("external_union_id"),
13
+ expiresAt: timestamp("expires_at", { withTimezone: true }).notNull(),
14
+ consumedAt: timestamp("consumed_at", { withTimezone: true }),
15
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
16
+ }, (table) => ({
17
+ tokenHashUq: uniqueIndex("agent_integration_binding_tokens_token_hash_uq").on(table.tokenHash),
18
+ integrationOpenIdIdx: index("agent_integration_binding_tokens_integration_open_id_idx").on(table.integrationId, table.externalOpenId),
19
+ expiryIdx: index("agent_integration_binding_tokens_expiry_idx").on(table.expiresAt),
20
+ }));
21
+ //# sourceMappingURL=agent_integration_binding_tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent_integration_binding_tokens.js","sourceRoot":"","sources":["../../src/schema/agent_integration_binding_tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,CAAC,MAAM,6BAA6B,GAAG,OAA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AC"}
@@ -0,0 +1,144 @@
1
+ export declare const agentIntegrationChatBindings: import("drizzle-orm/pg-core").PgTableWithColumns<{
2
+ name: "agent_integration_chat_bindings";
3
+ schema: undefined;
4
+ columns: {
5
+ id: import("drizzle-orm/pg-core").PgColumn<{
6
+ name: "id";
7
+ tableName: "agent_integration_chat_bindings";
8
+ dataType: "string";
9
+ columnType: "PgUUID";
10
+ data: string;
11
+ driverParam: string;
12
+ notNull: true;
13
+ hasDefault: true;
14
+ isPrimaryKey: true;
15
+ isAutoincrement: false;
16
+ hasRuntimeDefault: false;
17
+ enumValues: undefined;
18
+ baseColumn: never;
19
+ identity: undefined;
20
+ generated: undefined;
21
+ }, {}, {}>;
22
+ orgId: import("drizzle-orm/pg-core").PgColumn<{
23
+ name: "org_id";
24
+ tableName: "agent_integration_chat_bindings";
25
+ dataType: "string";
26
+ columnType: "PgUUID";
27
+ data: string;
28
+ driverParam: string;
29
+ notNull: true;
30
+ hasDefault: false;
31
+ isPrimaryKey: false;
32
+ isAutoincrement: false;
33
+ hasRuntimeDefault: false;
34
+ enumValues: undefined;
35
+ baseColumn: never;
36
+ identity: undefined;
37
+ generated: undefined;
38
+ }, {}, {}>;
39
+ integrationId: import("drizzle-orm/pg-core").PgColumn<{
40
+ name: "integration_id";
41
+ tableName: "agent_integration_chat_bindings";
42
+ dataType: "string";
43
+ columnType: "PgUUID";
44
+ data: string;
45
+ driverParam: string;
46
+ notNull: true;
47
+ hasDefault: false;
48
+ isPrimaryKey: false;
49
+ isAutoincrement: false;
50
+ hasRuntimeDefault: false;
51
+ enumValues: undefined;
52
+ baseColumn: never;
53
+ identity: undefined;
54
+ generated: undefined;
55
+ }, {}, {}>;
56
+ conversationId: import("drizzle-orm/pg-core").PgColumn<{
57
+ name: "conversation_id";
58
+ tableName: "agent_integration_chat_bindings";
59
+ dataType: "string";
60
+ columnType: "PgUUID";
61
+ data: string;
62
+ driverParam: string;
63
+ notNull: true;
64
+ hasDefault: false;
65
+ isPrimaryKey: false;
66
+ isAutoincrement: false;
67
+ hasRuntimeDefault: false;
68
+ enumValues: undefined;
69
+ baseColumn: never;
70
+ identity: undefined;
71
+ generated: undefined;
72
+ }, {}, {}>;
73
+ externalChatId: import("drizzle-orm/pg-core").PgColumn<{
74
+ name: "external_chat_id";
75
+ tableName: "agent_integration_chat_bindings";
76
+ dataType: "string";
77
+ columnType: "PgText";
78
+ data: string;
79
+ driverParam: string;
80
+ notNull: true;
81
+ hasDefault: false;
82
+ isPrimaryKey: false;
83
+ isAutoincrement: false;
84
+ hasRuntimeDefault: false;
85
+ enumValues: [string, ...string[]];
86
+ baseColumn: never;
87
+ identity: undefined;
88
+ generated: undefined;
89
+ }, {}, {}>;
90
+ externalChatType: import("drizzle-orm/pg-core").PgColumn<{
91
+ name: "external_chat_type";
92
+ tableName: "agent_integration_chat_bindings";
93
+ dataType: "string";
94
+ columnType: "PgText";
95
+ data: string;
96
+ driverParam: string;
97
+ notNull: true;
98
+ hasDefault: false;
99
+ isPrimaryKey: false;
100
+ isAutoincrement: false;
101
+ hasRuntimeDefault: false;
102
+ enumValues: [string, ...string[]];
103
+ baseColumn: never;
104
+ identity: undefined;
105
+ generated: undefined;
106
+ }, {}, {}>;
107
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
108
+ name: "created_at";
109
+ tableName: "agent_integration_chat_bindings";
110
+ dataType: "date";
111
+ columnType: "PgTimestamp";
112
+ data: Date;
113
+ driverParam: string;
114
+ notNull: true;
115
+ hasDefault: true;
116
+ isPrimaryKey: false;
117
+ isAutoincrement: false;
118
+ hasRuntimeDefault: false;
119
+ enumValues: undefined;
120
+ baseColumn: never;
121
+ identity: undefined;
122
+ generated: undefined;
123
+ }, {}, {}>;
124
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
125
+ name: "updated_at";
126
+ tableName: "agent_integration_chat_bindings";
127
+ dataType: "date";
128
+ columnType: "PgTimestamp";
129
+ data: Date;
130
+ driverParam: string;
131
+ notNull: true;
132
+ hasDefault: true;
133
+ isPrimaryKey: false;
134
+ isAutoincrement: false;
135
+ hasRuntimeDefault: false;
136
+ enumValues: undefined;
137
+ baseColumn: never;
138
+ identity: undefined;
139
+ generated: undefined;
140
+ }, {}, {}>;
141
+ };
142
+ dialect: "pg";
143
+ }>;
144
+ //# sourceMappingURL=agent_integration_chat_bindings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent_integration_chat_bindings.d.ts","sourceRoot":"","sources":["../../src/schema/agent_integration_chat_bindings.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BxC,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { index, pgTable, text, timestamp, uniqueIndex, uuid } from "drizzle-orm/pg-core";
2
+ import { agentIntegrations } from "./agent_integrations.js";
3
+ import { chatConversations } from "./chat_conversations.js";
4
+ import { organizations } from "./organizations.js";
5
+ export const agentIntegrationChatBindings = pgTable("agent_integration_chat_bindings", {
6
+ id: uuid("id").primaryKey().defaultRandom(),
7
+ orgId: uuid("org_id").notNull().references(() => organizations.id, { onDelete: "cascade" }),
8
+ integrationId: uuid("integration_id")
9
+ .notNull()
10
+ .references(() => agentIntegrations.id, { onDelete: "cascade" }),
11
+ conversationId: uuid("conversation_id")
12
+ .notNull()
13
+ .references(() => chatConversations.id, { onDelete: "cascade" }),
14
+ externalChatId: text("external_chat_id").notNull(),
15
+ externalChatType: text("external_chat_type").notNull(),
16
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
17
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
18
+ }, (table) => ({
19
+ orgConversationIdx: index("agent_integration_chat_bindings_org_conversation_idx").on(table.orgId, table.conversationId),
20
+ integrationExternalChatUq: uniqueIndex("agent_integration_chat_bindings_integration_external_chat_uq").on(table.integrationId, table.externalChatId),
21
+ }));
22
+ //# sourceMappingURL=agent_integration_chat_bindings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent_integration_chat_bindings.js","sourceRoot":"","sources":["../../src/schema/agent_integration_chat_bindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,CAAC,MAAM,4BAA4B,GAAG,OAAO,CACjD,iCAAiC,EACjC;IACE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC,aAAa,EAAE;IAC3C,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC3F,aAAa,EAAE,IAAI,CAAC,gBAAgB,CAAC;SAClC,OAAO,EAAE;SACT,UAAU,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAClE,cAAc,EAAE,IAAI,CAAC,iBAAiB,CAAC;SACpC,OAAO,EAAE;SACT,UAAU,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAClE,cAAc,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC,OAAO,EAAE;IAClD,gBAAgB,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC,OAAO,EAAE;IACtD,SAAS,EAAE,SAAS,CAAC,YAAY,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE;IACjF,SAAS,EAAE,SAAS,CAAC,YAAY,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE;CAClF,EACD,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACV,kBAAkB,EAAE,KAAK,CAAC,sDAAsD,CAAC,CAAC,EAAE,CAClF,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,cAAc,CACrB;IACD,yBAAyB,EAAE,WAAW,CAAC,8DAA8D,CAAC,CAAC,EAAE,CACvG,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,cAAc,CACrB;CACF,CAAC,CACH,CAAC"}
@@ -0,0 +1,231 @@
1
+ export declare const agentIntegrationInboundAudit: import("drizzle-orm/pg-core").PgTableWithColumns<{
2
+ name: "agent_integration_inbound_audit";
3
+ schema: undefined;
4
+ columns: {
5
+ id: import("drizzle-orm/pg-core").PgColumn<{
6
+ name: "id";
7
+ tableName: "agent_integration_inbound_audit";
8
+ dataType: "string";
9
+ columnType: "PgUUID";
10
+ data: string;
11
+ driverParam: string;
12
+ notNull: true;
13
+ hasDefault: true;
14
+ isPrimaryKey: true;
15
+ isAutoincrement: false;
16
+ hasRuntimeDefault: false;
17
+ enumValues: undefined;
18
+ baseColumn: never;
19
+ identity: undefined;
20
+ generated: undefined;
21
+ }, {}, {}>;
22
+ orgId: import("drizzle-orm/pg-core").PgColumn<{
23
+ name: "org_id";
24
+ tableName: "agent_integration_inbound_audit";
25
+ dataType: "string";
26
+ columnType: "PgUUID";
27
+ data: string;
28
+ driverParam: string;
29
+ notNull: false;
30
+ hasDefault: false;
31
+ isPrimaryKey: false;
32
+ isAutoincrement: false;
33
+ hasRuntimeDefault: false;
34
+ enumValues: undefined;
35
+ baseColumn: never;
36
+ identity: undefined;
37
+ generated: undefined;
38
+ }, {}, {}>;
39
+ integrationId: import("drizzle-orm/pg-core").PgColumn<{
40
+ name: "integration_id";
41
+ tableName: "agent_integration_inbound_audit";
42
+ dataType: "string";
43
+ columnType: "PgUUID";
44
+ data: string;
45
+ driverParam: string;
46
+ notNull: false;
47
+ hasDefault: false;
48
+ isPrimaryKey: false;
49
+ isAutoincrement: false;
50
+ hasRuntimeDefault: false;
51
+ enumValues: undefined;
52
+ baseColumn: never;
53
+ identity: undefined;
54
+ generated: undefined;
55
+ }, {}, {}>;
56
+ provider: import("drizzle-orm/pg-core").PgColumn<{
57
+ name: "provider";
58
+ tableName: "agent_integration_inbound_audit";
59
+ dataType: "string";
60
+ columnType: "PgText";
61
+ data: string;
62
+ driverParam: string;
63
+ notNull: true;
64
+ hasDefault: false;
65
+ isPrimaryKey: false;
66
+ isAutoincrement: false;
67
+ hasRuntimeDefault: false;
68
+ enumValues: [string, ...string[]];
69
+ baseColumn: never;
70
+ identity: undefined;
71
+ generated: undefined;
72
+ }, {}, {}>;
73
+ externalChatId: import("drizzle-orm/pg-core").PgColumn<{
74
+ name: "external_chat_id";
75
+ tableName: "agent_integration_inbound_audit";
76
+ dataType: "string";
77
+ columnType: "PgText";
78
+ data: string;
79
+ driverParam: string;
80
+ notNull: false;
81
+ hasDefault: false;
82
+ isPrimaryKey: false;
83
+ isAutoincrement: false;
84
+ hasRuntimeDefault: false;
85
+ enumValues: [string, ...string[]];
86
+ baseColumn: never;
87
+ identity: undefined;
88
+ generated: undefined;
89
+ }, {}, {}>;
90
+ externalChatType: import("drizzle-orm/pg-core").PgColumn<{
91
+ name: "external_chat_type";
92
+ tableName: "agent_integration_inbound_audit";
93
+ dataType: "string";
94
+ columnType: "PgText";
95
+ data: string;
96
+ driverParam: string;
97
+ notNull: false;
98
+ hasDefault: false;
99
+ isPrimaryKey: false;
100
+ isAutoincrement: false;
101
+ hasRuntimeDefault: false;
102
+ enumValues: [string, ...string[]];
103
+ baseColumn: never;
104
+ identity: undefined;
105
+ generated: undefined;
106
+ }, {}, {}>;
107
+ externalEventId: import("drizzle-orm/pg-core").PgColumn<{
108
+ name: "external_event_id";
109
+ tableName: "agent_integration_inbound_audit";
110
+ dataType: "string";
111
+ columnType: "PgText";
112
+ data: string;
113
+ driverParam: string;
114
+ notNull: false;
115
+ hasDefault: false;
116
+ isPrimaryKey: false;
117
+ isAutoincrement: false;
118
+ hasRuntimeDefault: false;
119
+ enumValues: [string, ...string[]];
120
+ baseColumn: never;
121
+ identity: undefined;
122
+ generated: undefined;
123
+ }, {}, {}>;
124
+ externalMessageId: import("drizzle-orm/pg-core").PgColumn<{
125
+ name: "external_message_id";
126
+ tableName: "agent_integration_inbound_audit";
127
+ dataType: "string";
128
+ columnType: "PgText";
129
+ data: string;
130
+ driverParam: string;
131
+ notNull: false;
132
+ hasDefault: false;
133
+ isPrimaryKey: false;
134
+ isAutoincrement: false;
135
+ hasRuntimeDefault: false;
136
+ enumValues: [string, ...string[]];
137
+ baseColumn: never;
138
+ identity: undefined;
139
+ generated: undefined;
140
+ }, {}, {}>;
141
+ senderOpenId: import("drizzle-orm/pg-core").PgColumn<{
142
+ name: "sender_open_id";
143
+ tableName: "agent_integration_inbound_audit";
144
+ dataType: "string";
145
+ columnType: "PgText";
146
+ data: string;
147
+ driverParam: string;
148
+ notNull: false;
149
+ hasDefault: false;
150
+ isPrimaryKey: false;
151
+ isAutoincrement: false;
152
+ hasRuntimeDefault: false;
153
+ enumValues: [string, ...string[]];
154
+ baseColumn: never;
155
+ identity: undefined;
156
+ generated: undefined;
157
+ }, {}, {}>;
158
+ dropReason: import("drizzle-orm/pg-core").PgColumn<{
159
+ name: "drop_reason";
160
+ tableName: "agent_integration_inbound_audit";
161
+ dataType: "string";
162
+ columnType: "PgText";
163
+ data: string;
164
+ driverParam: string;
165
+ notNull: true;
166
+ hasDefault: false;
167
+ isPrimaryKey: false;
168
+ isAutoincrement: false;
169
+ hasRuntimeDefault: false;
170
+ enumValues: [string, ...string[]];
171
+ baseColumn: never;
172
+ identity: undefined;
173
+ generated: undefined;
174
+ }, {}, {}>;
175
+ bodyPersisted: import("drizzle-orm/pg-core").PgColumn<{
176
+ name: "body_persisted";
177
+ tableName: "agent_integration_inbound_audit";
178
+ dataType: "boolean";
179
+ columnType: "PgBoolean";
180
+ data: boolean;
181
+ driverParam: boolean;
182
+ notNull: true;
183
+ hasDefault: true;
184
+ isPrimaryKey: false;
185
+ isAutoincrement: false;
186
+ hasRuntimeDefault: false;
187
+ enumValues: undefined;
188
+ baseColumn: never;
189
+ identity: undefined;
190
+ generated: undefined;
191
+ }, {}, {}>;
192
+ metadata: import("drizzle-orm/pg-core").PgColumn<{
193
+ name: "metadata";
194
+ tableName: "agent_integration_inbound_audit";
195
+ dataType: "json";
196
+ columnType: "PgJsonb";
197
+ data: Record<string, unknown> | null;
198
+ driverParam: unknown;
199
+ notNull: false;
200
+ hasDefault: false;
201
+ isPrimaryKey: false;
202
+ isAutoincrement: false;
203
+ hasRuntimeDefault: false;
204
+ enumValues: undefined;
205
+ baseColumn: never;
206
+ identity: undefined;
207
+ generated: undefined;
208
+ }, {}, {
209
+ $type: Record<string, unknown> | null;
210
+ }>;
211
+ receivedAt: import("drizzle-orm/pg-core").PgColumn<{
212
+ name: "received_at";
213
+ tableName: "agent_integration_inbound_audit";
214
+ dataType: "date";
215
+ columnType: "PgTimestamp";
216
+ data: Date;
217
+ driverParam: string;
218
+ notNull: true;
219
+ hasDefault: true;
220
+ isPrimaryKey: false;
221
+ isAutoincrement: false;
222
+ hasRuntimeDefault: false;
223
+ enumValues: undefined;
224
+ baseColumn: never;
225
+ identity: undefined;
226
+ generated: undefined;
227
+ }, {}, {}>;
228
+ };
229
+ dialect: "pg";
230
+ }>;
231
+ //# sourceMappingURL=agent_integration_inbound_audit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent_integration_inbound_audit.d.ts","sourceRoot":"","sources":["../../src/schema/agent_integration_inbound_audit.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BxC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { boolean, index, jsonb, pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core";
2
+ import { agentIntegrations } from "./agent_integrations.js";
3
+ import { organizations } from "./organizations.js";
4
+ export const agentIntegrationInboundAudit = pgTable("agent_integration_inbound_audit", {
5
+ id: uuid("id").primaryKey().defaultRandom(),
6
+ orgId: uuid("org_id").references(() => organizations.id, { onDelete: "cascade" }),
7
+ integrationId: uuid("integration_id").references(() => agentIntegrations.id, { onDelete: "set null" }),
8
+ provider: text("provider").notNull(),
9
+ externalChatId: text("external_chat_id"),
10
+ externalChatType: text("external_chat_type"),
11
+ externalEventId: text("external_event_id"),
12
+ externalMessageId: text("external_message_id"),
13
+ senderOpenId: text("sender_open_id"),
14
+ dropReason: text("drop_reason").notNull(),
15
+ bodyPersisted: boolean("body_persisted").notNull().default(false),
16
+ metadata: jsonb("metadata").$type(),
17
+ receivedAt: timestamp("received_at", { withTimezone: true }).notNull().defaultNow(),
18
+ }, (table) => ({
19
+ orgReasonReceivedIdx: index("agent_integration_inbound_audit_org_reason_received_idx").on(table.orgId, table.dropReason, table.receivedAt),
20
+ integrationReceivedIdx: index("agent_integration_inbound_audit_integration_received_idx").on(table.integrationId, table.receivedAt),
21
+ messageIdx: index("agent_integration_inbound_audit_message_idx").on(table.provider, table.externalMessageId),
22
+ }));
23
+ //# sourceMappingURL=agent_integration_inbound_audit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent_integ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