@axiom-lattice/pg-stores 1.0.36 → 1.0.38
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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +18 -0
- package/dist/index.d.mts +103 -3
- package/dist/index.d.ts +103 -3
- package/dist/index.js +502 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +498 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/ChannelIdentityMappingStore.test.ts +219 -0
- package/src/__tests__/PostgreSQLChannelInstallationStore.test.ts +54 -0
- package/src/index.ts +11 -0
- package/src/migrations/channel_identity_mapping_migration.ts +59 -0
- package/src/migrations/channel_installation_migrations.ts +31 -0
- package/src/stores/ChannelIdentityMappingStore.ts +334 -0
- package/src/stores/PostgreSQLChannelInstallationStore.ts +304 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @axiom-lattice/pg-stores@1.0.
|
|
2
|
+
> @axiom-lattice/pg-stores@1.0.38 build /home/runner/work/agentic/agentic/packages/pg-stores
|
|
3
3
|
> tsup src/index.ts --format cjs,esm --dts --sourcemap
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
[34mCLI[39m Target: es2020
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
10
|
[34mESM[39m Build start
|
|
11
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
12
|
-
[32mCJS[39m [1mdist/index.js.map [22m[
|
|
13
|
-
[32mCJS[39m ⚡️ Build success in
|
|
14
|
-
[32mESM[39m [1mdist/index.mjs [22m[
|
|
15
|
-
[32mESM[39m [1mdist/index.mjs.map [22m[
|
|
16
|
-
[32mESM[39m ⚡️ Build success in
|
|
11
|
+
[32mCJS[39m [1mdist/index.js [22m[32m149.14 KB[39m
|
|
12
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m276.37 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 380ms
|
|
14
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m144.79 KB[39m
|
|
15
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m276.31 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 387ms
|
|
17
17
|
[34mDTS[39m Build start
|
|
18
|
-
[32mDTS[39m ⚡️ Build success in
|
|
19
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
20
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[
|
|
18
|
+
[32mDTS[39m ⚡️ Build success in 10122ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m38.33 KB[39m
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m38.33 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @axiom-lattice/pg-stores
|
|
2
2
|
|
|
3
|
+
## 1.0.38
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5444ad4: update
|
|
8
|
+
- Updated dependencies [5444ad4]
|
|
9
|
+
- @axiom-lattice/core@2.1.48
|
|
10
|
+
- @axiom-lattice/protocols@2.1.26
|
|
11
|
+
|
|
12
|
+
## 1.0.37
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 1515f02: publish claw
|
|
17
|
+
- Updated dependencies [1515f02]
|
|
18
|
+
- @axiom-lattice/core@2.1.47
|
|
19
|
+
- @axiom-lattice/protocols@2.1.25
|
|
20
|
+
|
|
3
21
|
## 1.0.36
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PoolConfig, PoolClient, Pool } from 'pg';
|
|
2
2
|
export { Pool, PoolConfig } from 'pg';
|
|
3
|
-
import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, SkillStore, Skill, CreateSkillRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, Project, CreateProjectRequest, UpdateProjectRequest, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest } from '@axiom-lattice/protocols';
|
|
4
|
-
export { Assistant, AssistantStore, CreateAssistantRequest, CreateDatabaseConfigRequest, CreateMcpServerConfigRequest, CreateMetricsServerConfigRequest, CreateProjectRequest, CreateSkillRequest, CreateTenantRequest, CreateThreadRequest, CreateUserRequest, CreateUserTenantLinkRequest, CreateWorkspaceRequest, DatabaseConfig, DatabaseConfigEntry, DatabaseConfigStore, DatabaseType, McpServerConfigEntry, McpServerConfigStore, MetricsServerConfig, MetricsServerConfigEntry, MetricsServerConfigStore, Project, ProjectStore, ScheduleExecutionType, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, Skill, SkillStore, StorageType, Tenant, TenantStatus, TenantStore, Thread, ThreadStore, UpdateDatabaseConfigRequest, UpdateMcpServerConfigRequest, UpdateMetricsServerConfigRequest, UpdateProjectRequest, UpdateTenantRequest, UpdateUserRequest, UpdateUserTenantLinkRequest, UpdateWorkspaceRequest, User, UserStore, UserTenantLink, UserTenantLinkStore, UserTenantRole, Workspace, WorkspaceStore } from '@axiom-lattice/protocols';
|
|
3
|
+
import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, SkillStore, Skill, CreateSkillRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, Project, CreateProjectRequest, UpdateProjectRequest, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, ChannelInstallationStore, ChannelInstallation, CreateChannelInstallationRequest, UpdateChannelInstallationRequest } from '@axiom-lattice/protocols';
|
|
4
|
+
export { Assistant, AssistantStore, ChannelInstallation, ChannelInstallationStore, CreateAssistantRequest, CreateChannelInstallationRequest, CreateDatabaseConfigRequest, CreateMcpServerConfigRequest, CreateMetricsServerConfigRequest, CreateProjectRequest, CreateSkillRequest, CreateTenantRequest, CreateThreadRequest, CreateUserRequest, CreateUserTenantLinkRequest, CreateWorkspaceRequest, DatabaseConfig, DatabaseConfigEntry, DatabaseConfigStore, DatabaseType, LarkChannelInstallationConfig, McpServerConfigEntry, McpServerConfigStore, MetricsServerConfig, MetricsServerConfigEntry, MetricsServerConfigStore, Project, ProjectStore, ScheduleExecutionType, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, Skill, SkillStore, StorageType, Tenant, TenantStatus, TenantStore, Thread, ThreadStore, UpdateChannelInstallationRequest, UpdateDatabaseConfigRequest, UpdateMcpServerConfigRequest, UpdateMetricsServerConfigRequest, UpdateProjectRequest, UpdateTenantRequest, UpdateUserRequest, UpdateUserTenantLinkRequest, UpdateWorkspaceRequest, User, UserStore, UserTenantLink, UserTenantLinkStore, UserTenantRole, Workspace, WorkspaceStore } from '@axiom-lattice/protocols';
|
|
5
5
|
import { IMessageQueueStore, AddMessageParams, PendingMessage, ThreadInfo } from '@axiom-lattice/core';
|
|
6
6
|
export { AddMessageParams, PendingMessage, ThreadInfo } from '@axiom-lattice/core';
|
|
7
7
|
|
|
@@ -1086,6 +1086,10 @@ declare const createTenantsTable: Migration;
|
|
|
1086
1086
|
*/
|
|
1087
1087
|
declare const createThreadMessageQueueTable: Migration;
|
|
1088
1088
|
|
|
1089
|
+
declare const createChannelIdentityMappingTables: Migration;
|
|
1090
|
+
|
|
1091
|
+
declare const createChannelInstallationsTable: Migration;
|
|
1092
|
+
|
|
1089
1093
|
/**
|
|
1090
1094
|
* Thread Message Queue Store
|
|
1091
1095
|
*
|
|
@@ -1159,4 +1163,100 @@ declare class ThreadMessageQueueStore implements IMessageQueueStore {
|
|
|
1159
1163
|
}
|
|
1160
1164
|
declare const getThreadMessageQueueStore: () => ThreadMessageQueueStore;
|
|
1161
1165
|
|
|
1162
|
-
|
|
1166
|
+
interface ChannelIdentityMappingStoreOptions {
|
|
1167
|
+
poolConfig: string | PoolConfig;
|
|
1168
|
+
autoMigrate?: boolean;
|
|
1169
|
+
}
|
|
1170
|
+
interface CreateChannelIdentityMappingInput {
|
|
1171
|
+
channel: string;
|
|
1172
|
+
channelAppId: string;
|
|
1173
|
+
tenantId: string;
|
|
1174
|
+
assistantId: string;
|
|
1175
|
+
mappingMode: "user" | "group" | "hybrid";
|
|
1176
|
+
externalSubjectType: "user" | "chat";
|
|
1177
|
+
externalSubjectKey: string;
|
|
1178
|
+
larkOpenId?: string;
|
|
1179
|
+
larkChatId: string;
|
|
1180
|
+
larkMessageId?: string;
|
|
1181
|
+
threadId: string;
|
|
1182
|
+
}
|
|
1183
|
+
interface ChannelIdentityMapping {
|
|
1184
|
+
id: string;
|
|
1185
|
+
channel: string;
|
|
1186
|
+
channelAppId: string;
|
|
1187
|
+
tenantId: string;
|
|
1188
|
+
assistantId: string;
|
|
1189
|
+
mappingMode: "user" | "group" | "hybrid";
|
|
1190
|
+
externalSubjectType: "user" | "chat";
|
|
1191
|
+
externalSubjectKey: string;
|
|
1192
|
+
larkOpenId?: string;
|
|
1193
|
+
larkChatId: string;
|
|
1194
|
+
larkMessageId?: string;
|
|
1195
|
+
threadId: string;
|
|
1196
|
+
createdAt: Date;
|
|
1197
|
+
updatedAt: Date;
|
|
1198
|
+
lastActivityAt: Date;
|
|
1199
|
+
}
|
|
1200
|
+
declare class ChannelIdentityMappingStore {
|
|
1201
|
+
private pool;
|
|
1202
|
+
private migrationManager;
|
|
1203
|
+
private initialized;
|
|
1204
|
+
private initPromise;
|
|
1205
|
+
constructor(options: ChannelIdentityMappingStoreOptions);
|
|
1206
|
+
initialize(): Promise<void>;
|
|
1207
|
+
createMapping(input: CreateChannelIdentityMappingInput): Promise<ChannelIdentityMapping>;
|
|
1208
|
+
getMappingBySubject(input: {
|
|
1209
|
+
channel: string;
|
|
1210
|
+
channelAppId: string;
|
|
1211
|
+
tenantId: string;
|
|
1212
|
+
assistantId: string;
|
|
1213
|
+
externalSubjectKey: string;
|
|
1214
|
+
}): Promise<ChannelIdentityMapping | null>;
|
|
1215
|
+
claimInboundReceipt(input: {
|
|
1216
|
+
channel: string;
|
|
1217
|
+
channelAppId: string;
|
|
1218
|
+
externalMessageId: string;
|
|
1219
|
+
tenantId: string;
|
|
1220
|
+
}): Promise<{
|
|
1221
|
+
accepted: boolean;
|
|
1222
|
+
status: "processing" | "completed";
|
|
1223
|
+
}>;
|
|
1224
|
+
markInboundReceiptCompleted(input: {
|
|
1225
|
+
channel: string;
|
|
1226
|
+
channelAppId: string;
|
|
1227
|
+
externalMessageId: string;
|
|
1228
|
+
tenantId: string;
|
|
1229
|
+
threadId: string;
|
|
1230
|
+
}): Promise<void>;
|
|
1231
|
+
markInboundReceiptFailed(input: {
|
|
1232
|
+
channel: string;
|
|
1233
|
+
channelAppId: string;
|
|
1234
|
+
externalMessageId: string;
|
|
1235
|
+
tenantId: string;
|
|
1236
|
+
}): Promise<void>;
|
|
1237
|
+
private ensureInitialized;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
interface PostgreSQLChannelInstallationStoreOptions {
|
|
1241
|
+
poolConfig: string | PoolConfig;
|
|
1242
|
+
autoMigrate?: boolean;
|
|
1243
|
+
}
|
|
1244
|
+
declare class PostgreSQLChannelInstallationStore implements ChannelInstallationStore {
|
|
1245
|
+
private pool;
|
|
1246
|
+
private migrationManager;
|
|
1247
|
+
private initialized;
|
|
1248
|
+
private initPromise;
|
|
1249
|
+
constructor(options: PostgreSQLChannelInstallationStoreOptions);
|
|
1250
|
+
initialize(): Promise<void>;
|
|
1251
|
+
getInstallationById(installationId: string): Promise<ChannelInstallation | null>;
|
|
1252
|
+
getInstallationsByTenant(tenantId: string, channel?: "lark"): Promise<ChannelInstallation[]>;
|
|
1253
|
+
createInstallation(tenantId: string, installationId: string, data: CreateChannelInstallationRequest): Promise<ChannelInstallation>;
|
|
1254
|
+
updateInstallation(tenantId: string, installationId: string, updates: UpdateChannelInstallationRequest): Promise<ChannelInstallation | null>;
|
|
1255
|
+
deleteInstallation(tenantId: string, installationId: string): Promise<boolean>;
|
|
1256
|
+
private ensureInitialized;
|
|
1257
|
+
private mapRowToInstallation;
|
|
1258
|
+
private encryptSecrets;
|
|
1259
|
+
private decryptSecrets;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
export { type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, type CreateChannelIdentityMappingInput, type Migration, MigrationManager, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, ThreadMessageQueueStore, addAssistantTenantId, addScheduleTenantId, addSkillTenantId, addThreadTenantId, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createAssistantsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createDatabaseConfigsTable, createMcpServerConfigsTable, createMetricsConfigsTable, createProjectsTable, createScheduledTasksTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkspacesTable, getThreadMessageQueueStore };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PoolConfig, PoolClient, Pool } from 'pg';
|
|
2
2
|
export { Pool, PoolConfig } from 'pg';
|
|
3
|
-
import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, SkillStore, Skill, CreateSkillRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, Project, CreateProjectRequest, UpdateProjectRequest, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest } from '@axiom-lattice/protocols';
|
|
4
|
-
export { Assistant, AssistantStore, CreateAssistantRequest, CreateDatabaseConfigRequest, CreateMcpServerConfigRequest, CreateMetricsServerConfigRequest, CreateProjectRequest, CreateSkillRequest, CreateTenantRequest, CreateThreadRequest, CreateUserRequest, CreateUserTenantLinkRequest, CreateWorkspaceRequest, DatabaseConfig, DatabaseConfigEntry, DatabaseConfigStore, DatabaseType, McpServerConfigEntry, McpServerConfigStore, MetricsServerConfig, MetricsServerConfigEntry, MetricsServerConfigStore, Project, ProjectStore, ScheduleExecutionType, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, Skill, SkillStore, StorageType, Tenant, TenantStatus, TenantStore, Thread, ThreadStore, UpdateDatabaseConfigRequest, UpdateMcpServerConfigRequest, UpdateMetricsServerConfigRequest, UpdateProjectRequest, UpdateTenantRequest, UpdateUserRequest, UpdateUserTenantLinkRequest, UpdateWorkspaceRequest, User, UserStore, UserTenantLink, UserTenantLinkStore, UserTenantRole, Workspace, WorkspaceStore } from '@axiom-lattice/protocols';
|
|
3
|
+
import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, SkillStore, Skill, CreateSkillRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, Project, CreateProjectRequest, UpdateProjectRequest, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, ChannelInstallationStore, ChannelInstallation, CreateChannelInstallationRequest, UpdateChannelInstallationRequest } from '@axiom-lattice/protocols';
|
|
4
|
+
export { Assistant, AssistantStore, ChannelInstallation, ChannelInstallationStore, CreateAssistantRequest, CreateChannelInstallationRequest, CreateDatabaseConfigRequest, CreateMcpServerConfigRequest, CreateMetricsServerConfigRequest, CreateProjectRequest, CreateSkillRequest, CreateTenantRequest, CreateThreadRequest, CreateUserRequest, CreateUserTenantLinkRequest, CreateWorkspaceRequest, DatabaseConfig, DatabaseConfigEntry, DatabaseConfigStore, DatabaseType, LarkChannelInstallationConfig, McpServerConfigEntry, McpServerConfigStore, MetricsServerConfig, MetricsServerConfigEntry, MetricsServerConfigStore, Project, ProjectStore, ScheduleExecutionType, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, Skill, SkillStore, StorageType, Tenant, TenantStatus, TenantStore, Thread, ThreadStore, UpdateChannelInstallationRequest, UpdateDatabaseConfigRequest, UpdateMcpServerConfigRequest, UpdateMetricsServerConfigRequest, UpdateProjectRequest, UpdateTenantRequest, UpdateUserRequest, UpdateUserTenantLinkRequest, UpdateWorkspaceRequest, User, UserStore, UserTenantLink, UserTenantLinkStore, UserTenantRole, Workspace, WorkspaceStore } from '@axiom-lattice/protocols';
|
|
5
5
|
import { IMessageQueueStore, AddMessageParams, PendingMessage, ThreadInfo } from '@axiom-lattice/core';
|
|
6
6
|
export { AddMessageParams, PendingMessage, ThreadInfo } from '@axiom-lattice/core';
|
|
7
7
|
|
|
@@ -1086,6 +1086,10 @@ declare const createTenantsTable: Migration;
|
|
|
1086
1086
|
*/
|
|
1087
1087
|
declare const createThreadMessageQueueTable: Migration;
|
|
1088
1088
|
|
|
1089
|
+
declare const createChannelIdentityMappingTables: Migration;
|
|
1090
|
+
|
|
1091
|
+
declare const createChannelInstallationsTable: Migration;
|
|
1092
|
+
|
|
1089
1093
|
/**
|
|
1090
1094
|
* Thread Message Queue Store
|
|
1091
1095
|
*
|
|
@@ -1159,4 +1163,100 @@ declare class ThreadMessageQueueStore implements IMessageQueueStore {
|
|
|
1159
1163
|
}
|
|
1160
1164
|
declare const getThreadMessageQueueStore: () => ThreadMessageQueueStore;
|
|
1161
1165
|
|
|
1162
|
-
|
|
1166
|
+
interface ChannelIdentityMappingStoreOptions {
|
|
1167
|
+
poolConfig: string | PoolConfig;
|
|
1168
|
+
autoMigrate?: boolean;
|
|
1169
|
+
}
|
|
1170
|
+
interface CreateChannelIdentityMappingInput {
|
|
1171
|
+
channel: string;
|
|
1172
|
+
channelAppId: string;
|
|
1173
|
+
tenantId: string;
|
|
1174
|
+
assistantId: string;
|
|
1175
|
+
mappingMode: "user" | "group" | "hybrid";
|
|
1176
|
+
externalSubjectType: "user" | "chat";
|
|
1177
|
+
externalSubjectKey: string;
|
|
1178
|
+
larkOpenId?: string;
|
|
1179
|
+
larkChatId: string;
|
|
1180
|
+
larkMessageId?: string;
|
|
1181
|
+
threadId: string;
|
|
1182
|
+
}
|
|
1183
|
+
interface ChannelIdentityMapping {
|
|
1184
|
+
id: string;
|
|
1185
|
+
channel: string;
|
|
1186
|
+
channelAppId: string;
|
|
1187
|
+
tenantId: string;
|
|
1188
|
+
assistantId: string;
|
|
1189
|
+
mappingMode: "user" | "group" | "hybrid";
|
|
1190
|
+
externalSubjectType: "user" | "chat";
|
|
1191
|
+
externalSubjectKey: string;
|
|
1192
|
+
larkOpenId?: string;
|
|
1193
|
+
larkChatId: string;
|
|
1194
|
+
larkMessageId?: string;
|
|
1195
|
+
threadId: string;
|
|
1196
|
+
createdAt: Date;
|
|
1197
|
+
updatedAt: Date;
|
|
1198
|
+
lastActivityAt: Date;
|
|
1199
|
+
}
|
|
1200
|
+
declare class ChannelIdentityMappingStore {
|
|
1201
|
+
private pool;
|
|
1202
|
+
private migrationManager;
|
|
1203
|
+
private initialized;
|
|
1204
|
+
private initPromise;
|
|
1205
|
+
constructor(options: ChannelIdentityMappingStoreOptions);
|
|
1206
|
+
initialize(): Promise<void>;
|
|
1207
|
+
createMapping(input: CreateChannelIdentityMappingInput): Promise<ChannelIdentityMapping>;
|
|
1208
|
+
getMappingBySubject(input: {
|
|
1209
|
+
channel: string;
|
|
1210
|
+
channelAppId: string;
|
|
1211
|
+
tenantId: string;
|
|
1212
|
+
assistantId: string;
|
|
1213
|
+
externalSubjectKey: string;
|
|
1214
|
+
}): Promise<ChannelIdentityMapping | null>;
|
|
1215
|
+
claimInboundReceipt(input: {
|
|
1216
|
+
channel: string;
|
|
1217
|
+
channelAppId: string;
|
|
1218
|
+
externalMessageId: string;
|
|
1219
|
+
tenantId: string;
|
|
1220
|
+
}): Promise<{
|
|
1221
|
+
accepted: boolean;
|
|
1222
|
+
status: "processing" | "completed";
|
|
1223
|
+
}>;
|
|
1224
|
+
markInboundReceiptCompleted(input: {
|
|
1225
|
+
channel: string;
|
|
1226
|
+
channelAppId: string;
|
|
1227
|
+
externalMessageId: string;
|
|
1228
|
+
tenantId: string;
|
|
1229
|
+
threadId: string;
|
|
1230
|
+
}): Promise<void>;
|
|
1231
|
+
markInboundReceiptFailed(input: {
|
|
1232
|
+
channel: string;
|
|
1233
|
+
channelAppId: string;
|
|
1234
|
+
externalMessageId: string;
|
|
1235
|
+
tenantId: string;
|
|
1236
|
+
}): Promise<void>;
|
|
1237
|
+
private ensureInitialized;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
interface PostgreSQLChannelInstallationStoreOptions {
|
|
1241
|
+
poolConfig: string | PoolConfig;
|
|
1242
|
+
autoMigrate?: boolean;
|
|
1243
|
+
}
|
|
1244
|
+
declare class PostgreSQLChannelInstallationStore implements ChannelInstallationStore {
|
|
1245
|
+
private pool;
|
|
1246
|
+
private migrationManager;
|
|
1247
|
+
private initialized;
|
|
1248
|
+
private initPromise;
|
|
1249
|
+
constructor(options: PostgreSQLChannelInstallationStoreOptions);
|
|
1250
|
+
initialize(): Promise<void>;
|
|
1251
|
+
getInstallationById(installationId: string): Promise<ChannelInstallation | null>;
|
|
1252
|
+
getInstallationsByTenant(tenantId: string, channel?: "lark"): Promise<ChannelInstallation[]>;
|
|
1253
|
+
createInstallation(tenantId: string, installationId: string, data: CreateChannelInstallationRequest): Promise<ChannelInstallation>;
|
|
1254
|
+
updateInstallation(tenantId: string, installationId: string, updates: UpdateChannelInstallationRequest): Promise<ChannelInstallation | null>;
|
|
1255
|
+
deleteInstallation(tenantId: string, installationId: string): Promise<boolean>;
|
|
1256
|
+
private ensureInitialized;
|
|
1257
|
+
private mapRowToInstallation;
|
|
1258
|
+
private encryptSecrets;
|
|
1259
|
+
private decryptSecrets;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
export { type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, type CreateChannelIdentityMappingInput, type Migration, MigrationManager, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, ThreadMessageQueueStore, addAssistantTenantId, addScheduleTenantId, addSkillTenantId, addThreadTenantId, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createAssistantsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createDatabaseConfigsTable, createMcpServerConfigsTable, createMetricsConfigsTable, createProjectsTable, createScheduledTasksTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkspacesTable, getThreadMessageQueueStore };
|