@inkeep/agents-core 0.0.0-dev-20260204182014 → 0.0.0-dev-20260204185956
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/auth/auth.d.ts +54 -54
- package/dist/auth/permissions.d.ts +13 -13
- package/dist/client-exports.d.ts +4 -3
- package/dist/data-access/index.d.ts +1 -3
- package/dist/data-access/index.js +1 -3
- package/dist/data-access/manage/agents.d.ts +10 -10
- package/dist/data-access/manage/artifactComponents.d.ts +4 -4
- package/dist/data-access/manage/contextConfigs.d.ts +8 -8
- package/dist/data-access/manage/dataComponents.d.ts +2 -2
- package/dist/data-access/manage/functionTools.d.ts +6 -6
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +12 -12
- package/dist/data-access/manage/subAgentRelations.d.ts +6 -6
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +6 -6
- package/dist/data-access/manage/subAgents.d.ts +6 -6
- package/dist/data-access/manage/tools.d.ts +18 -18
- package/dist/data-access/runtime/apiKeys.d.ts +8 -8
- package/dist/data-access/runtime/conversations.d.ts +20 -20
- package/dist/data-access/runtime/messages.d.ts +15 -15
- package/dist/data-access/runtime/tasks.d.ts +4 -4
- package/dist/db/manage/manage-schema.d.ts +380 -600
- package/dist/db/manage/manage-schema.js +2 -27
- package/dist/db/runtime/runtime-schema.d.ts +234 -1147
- package/dist/db/runtime/runtime-schema.js +2 -98
- package/dist/index.d.ts +5 -10
- package/dist/index.js +4 -9
- package/dist/types/entities.d.ts +2 -8
- package/dist/types/index.d.ts +2 -2
- package/dist/utils/index.d.ts +1 -4
- package/dist/utils/index.js +1 -4
- package/dist/utils/trigger-auth.d.ts +1 -1
- package/dist/validation/index.d.ts +2 -2
- package/dist/validation/index.js +2 -2
- package/dist/validation/schemas.d.ts +1352 -3912
- package/dist/validation/schemas.js +3 -65
- package/drizzle/manage/meta/_journal.json +0 -7
- package/drizzle/runtime/meta/_journal.json +0 -14
- package/package.json +1 -1
- package/dist/auth/create-test-users.d.ts +0 -1
- package/dist/auth/create-test-users.js +0 -102
- package/dist/data-access/manage/workAppConfigs.d.ts +0 -228
- package/dist/data-access/manage/workAppConfigs.js +0 -120
- package/dist/data-access/runtime/workAppSlack.d.ts +0 -45
- package/dist/data-access/runtime/workAppSlack.js +0 -154
- package/dist/utils/slack-link-token.d.ts +0 -60
- package/dist/utils/slack-link-token.js +0 -124
- package/dist/utils/slack-user-token.d.ts +0 -87
- package/dist/utils/slack-user-token.js +0 -156
- package/dist/utils/sse-parser.d.ts +0 -35
- package/dist/utils/sse-parser.js +0 -71
- package/drizzle/manage/0007_whole_skreet.sql +0 -17
- package/drizzle/manage/meta/0007_snapshot.json +0 -3265
- package/drizzle/runtime/0011_grey_energizer.sql +0 -131
- package/drizzle/runtime/0012_salty_zuras.sql +0 -6
- package/drizzle/runtime/meta/0011_snapshot.json +0 -3747
- package/drizzle/runtime/meta/0012_snapshot.json +0 -3747
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { schemaValidationDefaults } from "../constants/schema-validation/defaults.js";
|
|
2
2
|
import { CredentialStoreType, MCPServerType, MCPTransportType, TOOL_STATUS_VALUES, VALID_RELATION_TYPES } from "../types/utility.js";
|
|
3
3
|
import { jmespathString, validateJMESPathSecure, validateRegex } from "../utils/jmespath-utils.js";
|
|
4
|
-
import { agents, artifactComponents, contextConfigs, credentialReferences, dataComponents, dataset, datasetItem, datasetRunConfig, datasetRunConfigAgentRelations, evaluationJobConfig, evaluationJobConfigEvaluatorRelations, evaluationRunConfig, evaluationRunConfigEvaluationSuiteConfigRelations, evaluationSuiteConfig, evaluationSuiteConfigEvaluatorRelations, evaluator, externalAgents, functionTools, functions, projects, subAgentArtifactComponents, subAgentDataComponents, subAgentExternalAgentRelations, subAgentFunctionToolRelations, subAgentRelations, subAgentTeamAgentRelations, subAgentToolRelations, subAgents, tools, triggers
|
|
5
|
-
import { apiKeys, contextCache, conversations, datasetRun, datasetRunConversationRelations, evaluationResult, evaluationRun, ledgerArtifacts, messages, projectMetadata, taskRelations, tasks, triggerInvocations, workAppGitHubInstallations, workAppGitHubMcpToolRepositoryAccess, workAppGitHubProjectRepositoryAccess, workAppGitHubRepositories
|
|
4
|
+
import { agents, artifactComponents, contextConfigs, credentialReferences, dataComponents, dataset, datasetItem, datasetRunConfig, datasetRunConfigAgentRelations, evaluationJobConfig, evaluationJobConfigEvaluatorRelations, evaluationRunConfig, evaluationRunConfigEvaluationSuiteConfigRelations, evaluationSuiteConfig, evaluationSuiteConfigEvaluatorRelations, evaluator, externalAgents, functionTools, functions, projects, subAgentArtifactComponents, subAgentDataComponents, subAgentExternalAgentRelations, subAgentFunctionToolRelations, subAgentRelations, subAgentTeamAgentRelations, subAgentToolRelations, subAgents, tools, triggers } from "../db/manage/manage-schema.js";
|
|
5
|
+
import { apiKeys, contextCache, conversations, datasetRun, datasetRunConversationRelations, evaluationResult, evaluationRun, ledgerArtifacts, messages, projectMetadata, taskRelations, tasks, triggerInvocations, workAppGitHubInstallations, workAppGitHubMcpToolRepositoryAccess, workAppGitHubProjectRepositoryAccess, workAppGitHubRepositories } from "../db/runtime/runtime-schema.js";
|
|
6
6
|
import { ResolvedRefSchema } from "./dolt-schemas.js";
|
|
7
7
|
import { createInsertSchema, createSelectSchema, registerFieldSchemas } from "./drizzle-schema-helpers.js";
|
|
8
8
|
import { z } from "@hono/zod-openapi";
|
|
@@ -1441,68 +1441,6 @@ const WorkAppGitHubAccessGetResponseSchema = z.object({
|
|
|
1441
1441
|
mode: WorkAppGitHubAccessModeSchema,
|
|
1442
1442
|
repositories: z.array(WorkAppGitHubRepositorySelectSchema)
|
|
1443
1443
|
});
|
|
1444
|
-
const WorkAppTypeSchema = z.enum(["slack", "teams"]).openapi("WorkAppType");
|
|
1445
|
-
const WorkAppConfigMetadataSchema = z.object({
|
|
1446
|
-
configuredByUserId: z.string().optional(),
|
|
1447
|
-
configuredByUserName: z.string().optional(),
|
|
1448
|
-
notes: z.string().optional()
|
|
1449
|
-
}).openapi("WorkAppConfigMetadata");
|
|
1450
|
-
const WorkAppConfigSelectSchema = createSelectSchema(workAppConfigs);
|
|
1451
|
-
const WorkAppConfigInsertSchema = createInsertSchema(workAppConfigs).extend({
|
|
1452
|
-
id: ResourceIdSchema,
|
|
1453
|
-
appType: WorkAppTypeSchema,
|
|
1454
|
-
metadata: WorkAppConfigMetadataSchema.optional()
|
|
1455
|
-
});
|
|
1456
|
-
const WorkAppConfigUpdateSchema = WorkAppConfigInsertSchema.partial();
|
|
1457
|
-
const WorkAppConfigApiSelectSchema = WorkAppConfigSelectSchema.omit({ tenantId: true }).openapi("WorkAppConfig");
|
|
1458
|
-
const WorkAppConfigApiInsertSchema = WorkAppConfigInsertSchema.omit({
|
|
1459
|
-
tenantId: true,
|
|
1460
|
-
createdAt: true,
|
|
1461
|
-
updatedAt: true
|
|
1462
|
-
}).openapi("WorkAppConfigCreate");
|
|
1463
|
-
const WorkAppConfigApiUpdateSchema = WorkAppConfigApiInsertSchema.partial().openapi("WorkAppConfigUpdate");
|
|
1464
|
-
const WorkAppSlackWorkspaceStatusSchema = z.enum([
|
|
1465
|
-
"active",
|
|
1466
|
-
"suspended",
|
|
1467
|
-
"disconnected"
|
|
1468
|
-
]);
|
|
1469
|
-
const WorkAppSlackWorkspaceSelectSchema = createSelectSchema(workAppSlackWorkspaces);
|
|
1470
|
-
const WorkAppSlackWorkspaceInsertSchema = createInsertSchema(workAppSlackWorkspaces).omit({
|
|
1471
|
-
createdAt: true,
|
|
1472
|
-
updatedAt: true
|
|
1473
|
-
}).extend({ status: WorkAppSlackWorkspaceStatusSchema.optional().default("active") });
|
|
1474
|
-
const WorkAppSlackWorkspaceUpdateSchema = WorkAppSlackWorkspaceInsertSchema.partial();
|
|
1475
|
-
const WorkAppSlackWorkspaceApiSelectSchema = omitTenantScope(WorkAppSlackWorkspaceSelectSchema).openapi("WorkAppSlackWorkspace");
|
|
1476
|
-
const WorkAppSlackWorkspaceApiInsertSchema = omitGeneratedFields(WorkAppSlackWorkspaceInsertSchema).openapi("WorkAppSlackWorkspaceCreate");
|
|
1477
|
-
const WorkAppSlackWorkspaceApiUpdateSchema = WorkAppSlackWorkspaceUpdateSchema.partial().openapi("WorkAppSlackWorkspaceUpdate");
|
|
1478
|
-
const WorkAppSlackUserMappingSelectSchema = createSelectSchema(workAppSlackUserMappings);
|
|
1479
|
-
const WorkAppSlackUserMappingInsertSchema = createInsertSchema(workAppSlackUserMappings).omit({
|
|
1480
|
-
createdAt: true,
|
|
1481
|
-
updatedAt: true,
|
|
1482
|
-
linkedAt: true
|
|
1483
|
-
}).extend({ clientId: z.string().optional().default("work-apps-slack") });
|
|
1484
|
-
const WorkAppSlackUserMappingUpdateSchema = WorkAppSlackUserMappingInsertSchema.partial();
|
|
1485
|
-
const WorkAppSlackUserMappingApiSelectSchema = omitTenantScope(WorkAppSlackUserMappingSelectSchema).openapi("WorkAppSlackUserMapping");
|
|
1486
|
-
const WorkAppSlackUserMappingApiInsertSchema = omitGeneratedFields(WorkAppSlackUserMappingInsertSchema).openapi("WorkAppSlackUserMappingCreate");
|
|
1487
|
-
const WorkAppSlackUserMappingApiUpdateSchema = WorkAppSlackUserMappingUpdateSchema.partial().openapi("WorkAppSlackUserMappingUpdate");
|
|
1488
|
-
const WorkAppSlackChannelAgentConfigSelectSchema = createSelectSchema(workAppSlackChannelAgentConfigs);
|
|
1489
|
-
const WorkAppSlackChannelAgentConfigInsertSchema = createInsertSchema(workAppSlackChannelAgentConfigs).omit({
|
|
1490
|
-
createdAt: true,
|
|
1491
|
-
updatedAt: true
|
|
1492
|
-
});
|
|
1493
|
-
const WorkAppSlackChannelAgentConfigUpdateSchema = WorkAppSlackChannelAgentConfigInsertSchema.partial();
|
|
1494
|
-
const WorkAppSlackChannelAgentConfigApiSelectSchema = omitTenantScope(WorkAppSlackChannelAgentConfigSelectSchema).openapi("WorkAppSlackChannelAgentConfig");
|
|
1495
|
-
const WorkAppSlackChannelAgentConfigApiInsertSchema = omitGeneratedFields(WorkAppSlackChannelAgentConfigInsertSchema).openapi("WorkAppSlackChannelAgentConfigCreate");
|
|
1496
|
-
const WorkAppSlackChannelAgentConfigApiUpdateSchema = WorkAppSlackChannelAgentConfigUpdateSchema.partial().openapi("WorkAppSlackChannelAgentConfigUpdate");
|
|
1497
|
-
const WorkAppSlackUserSettingsSelectSchema = createSelectSchema(workAppSlackUserSettings);
|
|
1498
|
-
const WorkAppSlackUserSettingsInsertSchema = createInsertSchema(workAppSlackUserSettings).omit({
|
|
1499
|
-
createdAt: true,
|
|
1500
|
-
updatedAt: true
|
|
1501
|
-
});
|
|
1502
|
-
const WorkAppSlackUserSettingsUpdateSchema = WorkAppSlackUserSettingsInsertSchema.partial();
|
|
1503
|
-
const WorkAppSlackUserSettingsApiSelectSchema = omitTenantScope(WorkAppSlackUserSettingsSelectSchema).openapi("WorkAppSlackUserSettings");
|
|
1504
|
-
const WorkAppSlackUserSettingsApiInsertSchema = omitGeneratedFields(WorkAppSlackUserSettingsInsertSchema).openapi("WorkAppSlackUserSettingsCreate");
|
|
1505
|
-
const WorkAppSlackUserSettingsApiUpdateSchema = WorkAppSlackUserSettingsUpdateSchema.partial().openapi("WorkAppSlackUserSettingsUpdate");
|
|
1506
1444
|
|
|
1507
1445
|
//#endregion
|
|
1508
|
-
export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentInsertSchema, AgentListResponse, AgentResponse, AgentSelectSchema, AgentStopWhenSchema, AgentUpdateSchema, AgentWithinContextOfProjectResponse, AgentWithinContextOfProjectSchema, AgentWithinContextOfProjectSelectResponse, AgentWithinContextOfProjectSelectSchema, AgentWithinContextOfProjectSelectSchemaWithRelationIds, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeyListResponse, ApiKeyResponse, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentArrayResponse, ArtifactComponentInsertSchema, ArtifactComponentListResponse, ArtifactComponentResponse, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ComponentAssociationListResponse, ComponentAssociationSchema, ComponentJoinSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigListResponse, ContextConfigResponse, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationListResponse, ConversationResponse, ConversationSelectSchema, ConversationUpdateSchema, CreateCredentialInStoreRequestSchema, CreateCredentialInStoreResponseSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceListResponse, CredentialReferenceResponse, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, CredentialStoreListResponseSchema, CredentialStoreSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentArrayResponse, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentListResponse, DataComponentResponse, DataComponentSelectSchema, DataComponentUpdateSchema, DatasetApiInsertSchema, DatasetApiSelectSchema, DatasetApiUpdateSchema, DatasetInsertSchema, DatasetItemApiInsertSchema, DatasetItemApiSelectSchema, DatasetItemApiUpdateSchema, DatasetItemInsertSchema, DatasetItemSelectSchema, DatasetItemUpdateSchema, DatasetRunApiInsertSchema, DatasetRunApiSelectSchema, DatasetRunApiUpdateSchema, DatasetRunConfigAgentRelationApiInsertSchema, DatasetRunConfigAgentRelationApiSelectSchema, DatasetRunConfigAgentRelationApiUpdateSchema, DatasetRunConfigAgentRelationInsertSchema, DatasetRunConfigAgentRelationSelectSchema, DatasetRunConfigAgentRelationUpdateSchema, DatasetRunConfigApiInsertSchema, DatasetRunConfigApiSelectSchema, DatasetRunConfigApiUpdateSchema, DatasetRunConfigInsertSchema, DatasetRunConfigSelectSchema, DatasetRunConfigUpdateSchema, DatasetRunConversationRelationApiInsertSchema, DatasetRunConversationRelationApiSelectSchema, DatasetRunConversationRelationApiUpdateSchema, DatasetRunConversationRelationInsertSchema, DatasetRunConversationRelationSelectSchema, DatasetRunConversationRelationUpdateSchema, DatasetRunInsertSchema, DatasetRunItemSchema, DatasetRunSelectSchema, DatasetRunUpdateSchema, DatasetSelectSchema, DatasetUpdateSchema, ErrorResponseSchema, EvaluationJobConfigApiInsertSchema, EvaluationJobConfigApiSelectSchema, EvaluationJobConfigApiUpdateSchema, EvaluationJobConfigEvaluatorRelationApiInsertSchema, EvaluationJobConfigEvaluatorRelationApiSelectSchema, EvaluationJobConfigEvaluatorRelationApiUpdateSchema, EvaluationJobConfigEvaluatorRelationInsertSchema, EvaluationJobConfigEvaluatorRelationSelectSchema, EvaluationJobConfigEvaluatorRelationUpdateSchema, EvaluationJobConfigInsertSchema, EvaluationJobConfigSelectSchema, EvaluationJobConfigUpdateSchema, EvaluationJobFilterCriteriaSchema, EvaluationResultApiInsertSchema, EvaluationResultApiSelectSchema, EvaluationResultApiUpdateSchema, EvaluationResultInsertSchema, EvaluationResultSelectSchema, EvaluationResultUpdateSchema, EvaluationRunApiInsertSchema, EvaluationRunApiSelectSchema, EvaluationRunApiUpdateSchema, EvaluationRunConfigApiInsertSchema, EvaluationRunConfigApiSelectSchema, EvaluationRunConfigApiUpdateSchema, EvaluationRunConfigEvaluationSuiteConfigRelationApiInsertSchema, EvaluationRunConfigEvaluationSuiteConfigRelationApiSelectSchema, EvaluationRunConfigEvaluationSuiteConfigRelationApiUpdateSchema, EvaluationRunConfigEvaluationSuiteConfigRelationInsertSchema, EvaluationRunConfigEvaluationSuiteConfigRelationSelectSchema, EvaluationRunConfigEvaluationSuiteConfigRelationUpdateSchema, EvaluationRunConfigInsertSchema, EvaluationRunConfigSelectSchema, EvaluationRunConfigUpdateSchema, EvaluationRunConfigWithSuiteConfigsApiSelectSchema, EvaluationRunInsertSchema, EvaluationRunSelectSchema, EvaluationRunUpdateSchema, EvaluationSuiteConfigApiInsertSchema, EvaluationSuiteConfigApiSelectSchema, EvaluationSuiteConfigApiUpdateSchema, EvaluationSuiteConfigEvaluatorRelationApiInsertSchema, EvaluationSuiteConfigEvaluatorRelationApiSelectSchema, EvaluationSuiteConfigEvaluatorRelationApiUpdateSchema, EvaluationSuiteConfigEvaluatorRelationInsertSchema, EvaluationSuiteConfigEvaluatorRelationSelectSchema, EvaluationSuiteConfigEvaluatorRelationUpdateSchema, EvaluationSuiteConfigInsertSchema, EvaluationSuiteConfigSelectSchema, EvaluationSuiteConfigUpdateSchema, EvaluatorApiInsertSchema, EvaluatorApiSelectSchema, EvaluatorApiUpdateSchema, EvaluatorInsertSchema, EvaluatorSelectSchema, EvaluatorUpdateSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentListResponse, ExternalAgentResponse, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FullAgentAgentInsertSchema, FullAgentSubAgentSelectSchema, FullAgentSubAgentSelectSchemaWithRelationIds, FullProjectDefinitionResponse, FullProjectDefinitionSchema, FullProjectSelectResponse, FullProjectSelectSchema, FullProjectSelectSchemaWithRelationIds, FullProjectSelectWithRelationIdsResponse, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionListResponse, FunctionResponse, FunctionSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiSelectSchema, FunctionToolApiUpdateSchema, FunctionToolConfigSchema, FunctionToolInsertSchema, FunctionToolListResponse, FunctionToolResponse, FunctionToolSelectSchema, FunctionToolUpdateSchema, FunctionUpdateSchema, HeadersScopeSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPCatalogListResponse, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolListResponse, McpToolResponse, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageListResponse, MessageResponse, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, OAuthCallbackQuerySchema, OAuthLoginQuerySchema, PaginationQueryParamsSchema, PaginationSchema, PaginationWithRefQueryParamsSchema, PrebuiltMCPServerSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectListResponse, ProjectMetadataInsertSchema, ProjectMetadataSelectSchema, ProjectModelSchema, ProjectResponse, ProjectSelectSchema, ProjectUpdateSchema, RefQueryParamSchema, RelatedAgentInfoListResponse, RelatedAgentInfoSchema, RemovedResponseSchema, ResourceIdSchema, SignatureSourceSchema, SignatureValidationOptionsSchema, SignatureVerificationConfigSchema, SignedComponentSchema, SimulationAgentSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, SubAgentApiInsertSchema, SubAgentApiSelectSchema, SubAgentApiUpdateSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiUpdateSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentListResponse, SubAgentArtifactComponentResponse, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentUpdateSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiUpdateSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentListResponse, SubAgentDataComponentResponse, SubAgentDataComponentSelectSchema, SubAgentDataComponentUpdateSchema, SubAgentExternalAgentRelationApiInsertSchema, SubAgentExternalAgentRelationApiSelectSchema, SubAgentExternalAgentRelationApiUpdateSchema, SubAgentExternalAgentRelationInsertSchema, SubAgentExternalAgentRelationListResponse, SubAgentExternalAgentRelationResponse, SubAgentExternalAgentRelationSelectSchema, SubAgentExternalAgentRelationUpdateSchema, SubAgentFunctionToolRelationApiInsertSchema, SubAgentFunctionToolRelationApiSelectSchema, SubAgentFunctionToolRelationInsertSchema, SubAgentFunctionToolRelationListResponse, SubAgentFunctionToolRelationResponse, SubAgentFunctionToolRelationSelectSchema, SubAgentInsertSchema, SubAgentListResponse, SubAgentRelationApiInsertSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationInsertSchema, SubAgentRelationListResponse, SubAgentRelationQuerySchema, SubAgentRelationResponse, SubAgentRelationSelectSchema, SubAgentRelationUpdateSchema, SubAgentResponse, SubAgentSelectSchema, SubAgentStopWhenSchema, SubAgentTeamAgentRelationApiInsertSchema, SubAgentTeamAgentRelationApiSelectSchema, SubAgentTeamAgentRelationApiUpdateSchema, SubAgentTeamAgentRelationInsertSchema, SubAgentTeamAgentRelationListResponse, SubAgentTeamAgentRelationResponse, SubAgentTeamAgentRelationSelectSchema, SubAgentTeamAgentRelationUpdateSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiUpdateSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationListResponse, SubAgentToolRelationResponse, SubAgentToolRelationSelectSchema, SubAgentToolRelationUpdateSchema, SubAgentUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TeamAgentSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ThirdPartyMCPServerResponse, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolListResponse, ToolResponse, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, TriggerApiInsertSchema, TriggerApiSelectSchema, TriggerApiUpdateSchema, TriggerAuthHeaderInputSchema, TriggerAuthHeaderStoredSchema, TriggerAuthHeaderUpdateSchema, TriggerAuthenticationInputSchema, TriggerAuthenticationSchema, TriggerAuthenticationStoredSchema, TriggerAuthenticationUpdateSchema, TriggerBatchConversationEvaluationSchema, TriggerConversationEvaluationSchema, TriggerDatasetRunSchema, TriggerEvaluationJobSchema, TriggerInsertSchema, TriggerInvocationApiInsertSchema, TriggerInvocationApiSelectSchema, TriggerInvocationApiUpdateSchema, TriggerInvocationInsertSchema, TriggerInvocationListResponse, TriggerInvocationResponse, TriggerInvocationSelectSchema, TriggerInvocationStatusEnum, TriggerInvocationUpdateSchema, TriggerListResponse, TriggerOutputTransformSchema, TriggerResponse, TriggerSelectSchema, TriggerUpdateSchema, TriggerWithWebhookUrlListResponse, TriggerWithWebhookUrlResponse, TriggerWithWebhookUrlSchema, URL_SAFE_ID_PATTERN, WorkAppConfigApiInsertSchema, WorkAppConfigApiSelectSchema, WorkAppConfigApiUpdateSchema, WorkAppConfigInsertSchema, WorkAppConfigMetadataSchema, WorkAppConfigSelectSchema, WorkAppConfigUpdateSchema, WorkAppGitHubAccessGetResponseSchema, WorkAppGitHubAccessModeSchema, WorkAppGitHubAccessSetRequestSchema, WorkAppGitHubAccessSetResponseSchema, WorkAppGitHubAccountTypeSchema, WorkAppGitHubInstallationApiInsertSchema, WorkAppGitHubInstallationInsertSchema, WorkAppGitHubInstallationSelectSchema, WorkAppGitHubInstallationStatusSchema, WorkAppGitHubMcpToolRepositoryAccessSelectSchema, WorkAppGitHubProjectRepositoryAccessSelectSchema, WorkAppGitHubRepositoryApiInsertSchema, WorkAppGitHubRepositoryInsertSchema, WorkAppGitHubRepositorySelectSchema, WorkAppGithubInstallationApiSelectSchema, WorkAppSlackChannelAgentConfigApiInsertSchema, WorkAppSlackChannelAgentConfigApiSelectSchema, WorkAppSlackChannelAgentConfigApiUpdateSchema, WorkAppSlackChannelAgentConfigInsertSchema, WorkAppSlackChannelAgentConfigSelectSchema, WorkAppSlackChannelAgentConfigUpdateSchema, WorkAppSlackUserMappingApiInsertSchema, WorkAppSlackUserMappingApiSelectSchema, WorkAppSlackUserMappingApiUpdateSchema, WorkAppSlackUserMappingInsertSchema, WorkAppSlackUserMappingSelectSchema, WorkAppSlackUserMappingUpdateSchema, WorkAppSlackUserSettingsApiInsertSchema, WorkAppSlackUserSettingsApiSelectSchema, WorkAppSlackUserSettingsApiUpdateSchema, WorkAppSlackUserSettingsInsertSchema, WorkAppSlackUserSettingsSelectSchema, WorkAppSlackUserSettingsUpdateSchema, WorkAppSlackWorkspaceApiInsertSchema, WorkAppSlackWorkspaceApiSelectSchema, WorkAppSlackWorkspaceApiUpdateSchema, WorkAppSlackWorkspaceInsertSchema, WorkAppSlackWorkspaceSelectSchema, WorkAppSlackWorkspaceStatusSchema, WorkAppSlackWorkspaceUpdateSchema, WorkAppTypeSchema, canDelegateToExternalAgentInsertSchema, canDelegateToExternalAgentSchema, canDelegateToTeamAgentInsertSchema, canDelegateToTeamAgentSchema, canRelateToInternalSubAgentSchema };
|
|
1446
|
+
export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentInsertSchema, AgentListResponse, AgentResponse, AgentSelectSchema, AgentStopWhenSchema, AgentUpdateSchema, AgentWithinContextOfProjectResponse, AgentWithinContextOfProjectSchema, AgentWithinContextOfProjectSelectResponse, AgentWithinContextOfProjectSelectSchema, AgentWithinContextOfProjectSelectSchemaWithRelationIds, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeyListResponse, ApiKeyResponse, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentArrayResponse, ArtifactComponentInsertSchema, ArtifactComponentListResponse, ArtifactComponentResponse, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ComponentAssociationListResponse, ComponentAssociationSchema, ComponentJoinSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigListResponse, ContextConfigResponse, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationListResponse, ConversationResponse, ConversationSelectSchema, ConversationUpdateSchema, CreateCredentialInStoreRequestSchema, CreateCredentialInStoreResponseSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceListResponse, CredentialReferenceResponse, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, CredentialStoreListResponseSchema, CredentialStoreSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentArrayResponse, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentListResponse, DataComponentResponse, DataComponentSelectSchema, DataComponentUpdateSchema, DatasetApiInsertSchema, DatasetApiSelectSchema, DatasetApiUpdateSchema, DatasetInsertSchema, DatasetItemApiInsertSchema, DatasetItemApiSelectSchema, DatasetItemApiUpdateSchema, DatasetItemInsertSchema, DatasetItemSelectSchema, DatasetItemUpdateSchema, DatasetRunApiInsertSchema, DatasetRunApiSelectSchema, DatasetRunApiUpdateSchema, DatasetRunConfigAgentRelationApiInsertSchema, DatasetRunConfigAgentRelationApiSelectSchema, DatasetRunConfigAgentRelationApiUpdateSchema, DatasetRunConfigAgentRelationInsertSchema, DatasetRunConfigAgentRelationSelectSchema, DatasetRunConfigAgentRelationUpdateSchema, DatasetRunConfigApiInsertSchema, DatasetRunConfigApiSelectSchema, DatasetRunConfigApiUpdateSchema, DatasetRunConfigInsertSchema, DatasetRunConfigSelectSchema, DatasetRunConfigUpdateSchema, DatasetRunConversationRelationApiInsertSchema, DatasetRunConversationRelationApiSelectSchema, DatasetRunConversationRelationApiUpdateSchema, DatasetRunConversationRelationInsertSchema, DatasetRunConversationRelationSelectSchema, DatasetRunConversationRelationUpdateSchema, DatasetRunInsertSchema, DatasetRunItemSchema, DatasetRunSelectSchema, DatasetRunUpdateSchema, DatasetSelectSchema, DatasetUpdateSchema, ErrorResponseSchema, EvaluationJobConfigApiInsertSchema, EvaluationJobConfigApiSelectSchema, EvaluationJobConfigApiUpdateSchema, EvaluationJobConfigEvaluatorRelationApiInsertSchema, EvaluationJobConfigEvaluatorRelationApiSelectSchema, EvaluationJobConfigEvaluatorRelationApiUpdateSchema, EvaluationJobConfigEvaluatorRelationInsertSchema, EvaluationJobConfigEvaluatorRelationSelectSchema, EvaluationJobConfigEvaluatorRelationUpdateSchema, EvaluationJobConfigInsertSchema, EvaluationJobConfigSelectSchema, EvaluationJobConfigUpdateSchema, EvaluationJobFilterCriteriaSchema, EvaluationResultApiInsertSchema, EvaluationResultApiSelectSchema, EvaluationResultApiUpdateSchema, EvaluationResultInsertSchema, EvaluationResultSelectSchema, EvaluationResultUpdateSchema, EvaluationRunApiInsertSchema, EvaluationRunApiSelectSchema, EvaluationRunApiUpdateSchema, EvaluationRunConfigApiInsertSchema, EvaluationRunConfigApiSelectSchema, EvaluationRunConfigApiUpdateSchema, EvaluationRunConfigEvaluationSuiteConfigRelationApiInsertSchema, EvaluationRunConfigEvaluationSuiteConfigRelationApiSelectSchema, EvaluationRunConfigEvaluationSuiteConfigRelationApiUpdateSchema, EvaluationRunConfigEvaluationSuiteConfigRelationInsertSchema, EvaluationRunConfigEvaluationSuiteConfigRelationSelectSchema, EvaluationRunConfigEvaluationSuiteConfigRelationUpdateSchema, EvaluationRunConfigInsertSchema, EvaluationRunConfigSelectSchema, EvaluationRunConfigUpdateSchema, EvaluationRunConfigWithSuiteConfigsApiSelectSchema, EvaluationRunInsertSchema, EvaluationRunSelectSchema, EvaluationRunUpdateSchema, EvaluationSuiteConfigApiInsertSchema, EvaluationSuiteConfigApiSelectSchema, EvaluationSuiteConfigApiUpdateSchema, EvaluationSuiteConfigEvaluatorRelationApiInsertSchema, EvaluationSuiteConfigEvaluatorRelationApiSelectSchema, EvaluationSuiteConfigEvaluatorRelationApiUpdateSchema, EvaluationSuiteConfigEvaluatorRelationInsertSchema, EvaluationSuiteConfigEvaluatorRelationSelectSchema, EvaluationSuiteConfigEvaluatorRelationUpdateSchema, EvaluationSuiteConfigInsertSchema, EvaluationSuiteConfigSelectSchema, EvaluationSuiteConfigUpdateSchema, EvaluatorApiInsertSchema, EvaluatorApiSelectSchema, EvaluatorApiUpdateSchema, EvaluatorInsertSchema, EvaluatorSelectSchema, EvaluatorUpdateSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentListResponse, ExternalAgentResponse, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FullAgentAgentInsertSchema, FullAgentSubAgentSelectSchema, FullAgentSubAgentSelectSchemaWithRelationIds, FullProjectDefinitionResponse, FullProjectDefinitionSchema, FullProjectSelectResponse, FullProjectSelectSchema, FullProjectSelectSchemaWithRelationIds, FullProjectSelectWithRelationIdsResponse, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionListResponse, FunctionResponse, FunctionSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiSelectSchema, FunctionToolApiUpdateSchema, FunctionToolConfigSchema, FunctionToolInsertSchema, FunctionToolListResponse, FunctionToolResponse, FunctionToolSelectSchema, FunctionToolUpdateSchema, FunctionUpdateSchema, HeadersScopeSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPCatalogListResponse, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolListResponse, McpToolResponse, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageListResponse, MessageResponse, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, OAuthCallbackQuerySchema, OAuthLoginQuerySchema, PaginationQueryParamsSchema, PaginationSchema, PaginationWithRefQueryParamsSchema, PrebuiltMCPServerSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectListResponse, ProjectMetadataInsertSchema, ProjectMetadataSelectSchema, ProjectModelSchema, ProjectResponse, ProjectSelectSchema, ProjectUpdateSchema, RefQueryParamSchema, RelatedAgentInfoListResponse, RelatedAgentInfoSchema, RemovedResponseSchema, ResourceIdSchema, SignatureSourceSchema, SignatureValidationOptionsSchema, SignatureVerificationConfigSchema, SignedComponentSchema, SimulationAgentSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, SubAgentApiInsertSchema, SubAgentApiSelectSchema, SubAgentApiUpdateSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiUpdateSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentListResponse, SubAgentArtifactComponentResponse, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentUpdateSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiUpdateSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentListResponse, SubAgentDataComponentResponse, SubAgentDataComponentSelectSchema, SubAgentDataComponentUpdateSchema, SubAgentExternalAgentRelationApiInsertSchema, SubAgentExternalAgentRelationApiSelectSchema, SubAgentExternalAgentRelationApiUpdateSchema, SubAgentExternalAgentRelationInsertSchema, SubAgentExternalAgentRelationListResponse, SubAgentExternalAgentRelationResponse, SubAgentExternalAgentRelationSelectSchema, SubAgentExternalAgentRelationUpdateSchema, SubAgentFunctionToolRelationApiInsertSchema, SubAgentFunctionToolRelationApiSelectSchema, SubAgentFunctionToolRelationInsertSchema, SubAgentFunctionToolRelationListResponse, SubAgentFunctionToolRelationResponse, SubAgentFunctionToolRelationSelectSchema, SubAgentInsertSchema, SubAgentListResponse, SubAgentRelationApiInsertSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationInsertSchema, SubAgentRelationListResponse, SubAgentRelationQuerySchema, SubAgentRelationResponse, SubAgentRelationSelectSchema, SubAgentRelationUpdateSchema, SubAgentResponse, SubAgentSelectSchema, SubAgentStopWhenSchema, SubAgentTeamAgentRelationApiInsertSchema, SubAgentTeamAgentRelationApiSelectSchema, SubAgentTeamAgentRelationApiUpdateSchema, SubAgentTeamAgentRelationInsertSchema, SubAgentTeamAgentRelationListResponse, SubAgentTeamAgentRelationResponse, SubAgentTeamAgentRelationSelectSchema, SubAgentTeamAgentRelationUpdateSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiUpdateSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationListResponse, SubAgentToolRelationResponse, SubAgentToolRelationSelectSchema, SubAgentToolRelationUpdateSchema, SubAgentUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TeamAgentSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ThirdPartyMCPServerResponse, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolListResponse, ToolResponse, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, TriggerApiInsertSchema, TriggerApiSelectSchema, TriggerApiUpdateSchema, TriggerAuthHeaderInputSchema, TriggerAuthHeaderStoredSchema, TriggerAuthHeaderUpdateSchema, TriggerAuthenticationInputSchema, TriggerAuthenticationSchema, TriggerAuthenticationStoredSchema, TriggerAuthenticationUpdateSchema, TriggerBatchConversationEvaluationSchema, TriggerConversationEvaluationSchema, TriggerDatasetRunSchema, TriggerEvaluationJobSchema, TriggerInsertSchema, TriggerInvocationApiInsertSchema, TriggerInvocationApiSelectSchema, TriggerInvocationApiUpdateSchema, TriggerInvocationInsertSchema, TriggerInvocationListResponse, TriggerInvocationResponse, TriggerInvocationSelectSchema, TriggerInvocationStatusEnum, TriggerInvocationUpdateSchema, TriggerListResponse, TriggerOutputTransformSchema, TriggerResponse, TriggerSelectSchema, TriggerUpdateSchema, TriggerWithWebhookUrlListResponse, TriggerWithWebhookUrlResponse, TriggerWithWebhookUrlSchema, URL_SAFE_ID_PATTERN, WorkAppGitHubAccessGetResponseSchema, WorkAppGitHubAccessModeSchema, WorkAppGitHubAccessSetRequestSchema, WorkAppGitHubAccessSetResponseSchema, WorkAppGitHubAccountTypeSchema, WorkAppGitHubInstallationApiInsertSchema, WorkAppGitHubInstallationInsertSchema, WorkAppGitHubInstallationSelectSchema, WorkAppGitHubInstallationStatusSchema, WorkAppGitHubMcpToolRepositoryAccessSelectSchema, WorkAppGitHubProjectRepositoryAccessSelectSchema, WorkAppGitHubRepositoryApiInsertSchema, WorkAppGitHubRepositoryInsertSchema, WorkAppGitHubRepositorySelectSchema, WorkAppGithubInstallationApiSelectSchema, canDelegateToExternalAgentInsertSchema, canDelegateToExternalAgentSchema, canDelegateToTeamAgentInsertSchema, canDelegateToTeamAgentSchema, canRelateToInternalSubAgentSchema };
|
|
@@ -78,20 +78,6 @@
|
|
|
78
78
|
"when": 1769703627877,
|
|
79
79
|
"tag": "0010_previous_black_knight",
|
|
80
80
|
"breakpoints": true
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
"idx": 11,
|
|
84
|
-
"version": "7",
|
|
85
|
-
"when": 1770129891538,
|
|
86
|
-
"tag": "0011_grey_energizer",
|
|
87
|
-
"breakpoints": true
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"idx": 12,
|
|
91
|
-
"version": "7",
|
|
92
|
-
"when": 1770225068948,
|
|
93
|
-
"tag": "0012_salty_zuras",
|
|
94
|
-
"breakpoints": true
|
|
95
81
|
}
|
|
96
82
|
]
|
|
97
83
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-core",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20260204185956",
|
|
4
4
|
"description": "Agents Core contains the database schema, types, and validation schemas for Inkeep Agent Framework, along with core components.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { OrgRoles } from "./authz/config.js";
|
|
2
|
-
import { loadEnvironmentFiles } from "../env.js";
|
|
3
|
-
import { createAgentsRunDatabaseClient } from "../db/runtime/runtime-client.js";
|
|
4
|
-
import { addUserToOrganization, upsertOrganization } from "../data-access/runtime/organizations.js";
|
|
5
|
-
import { getUserByEmail } from "../data-access/runtime/users.js";
|
|
6
|
-
import { createAuth } from "./auth.js";
|
|
7
|
-
|
|
8
|
-
//#region src/auth/create-test-users.ts
|
|
9
|
-
/**
|
|
10
|
-
* Script to create test users for development/testing.
|
|
11
|
-
*
|
|
12
|
-
* Usage: pnpm db:auth:create-test-users
|
|
13
|
-
*
|
|
14
|
-
* Creates multiple test users with different roles:
|
|
15
|
-
* - admin2@test.com (admin role)
|
|
16
|
-
* - member1@test.com (member role)
|
|
17
|
-
* - member2@test.com (member role)
|
|
18
|
-
*
|
|
19
|
-
* All test users have password: testpass123
|
|
20
|
-
*/
|
|
21
|
-
loadEnvironmentFiles();
|
|
22
|
-
const TENANT_ID = process.env.TENANT_ID || "default";
|
|
23
|
-
const TEST_PASSWORD = "testpass123";
|
|
24
|
-
const TEST_USERS = [
|
|
25
|
-
{
|
|
26
|
-
email: "admin2@test.com",
|
|
27
|
-
name: "Admin Two",
|
|
28
|
-
role: "admin"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
email: "member1@test.com",
|
|
32
|
-
name: "Member One",
|
|
33
|
-
role: "member"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
email: "member2@test.com",
|
|
37
|
-
name: "Member Two",
|
|
38
|
-
role: "member"
|
|
39
|
-
}
|
|
40
|
-
];
|
|
41
|
-
async function createTestUsers() {
|
|
42
|
-
console.log("🧪 Creating test users for development...\n");
|
|
43
|
-
const dbClient = createAgentsRunDatabaseClient();
|
|
44
|
-
const authSecret = process.env.BETTER_AUTH_SECRET;
|
|
45
|
-
if (!authSecret) {
|
|
46
|
-
console.error("❌ BETTER_AUTH_SECRET is required");
|
|
47
|
-
process.exit(1);
|
|
48
|
-
}
|
|
49
|
-
const auth = createAuth({
|
|
50
|
-
baseURL: process.env.INKEEP_AGENTS_API_URL || "http://localhost:3002",
|
|
51
|
-
secret: authSecret,
|
|
52
|
-
dbClient
|
|
53
|
-
});
|
|
54
|
-
console.log(`📦 Ensuring organization exists: ${TENANT_ID}`);
|
|
55
|
-
await upsertOrganization(dbClient)({
|
|
56
|
-
organizationId: TENANT_ID,
|
|
57
|
-
name: TENANT_ID,
|
|
58
|
-
slug: TENANT_ID,
|
|
59
|
-
logo: null,
|
|
60
|
-
metadata: null
|
|
61
|
-
});
|
|
62
|
-
console.log("\n👥 Creating test users:\n");
|
|
63
|
-
console.log("┌────────────────────────┬────────────────┬──────────┐");
|
|
64
|
-
console.log("│ Email │ Password │ Role │");
|
|
65
|
-
console.log("├────────────────────────┼────────────────┼──────────┤");
|
|
66
|
-
for (const testUser of TEST_USERS) {
|
|
67
|
-
let user = await getUserByEmail(dbClient)(testUser.email);
|
|
68
|
-
if (user) console.log(`│ ${testUser.email.padEnd(22)} │ (exists) │ ${testUser.role.padEnd(8)} │`);
|
|
69
|
-
else try {
|
|
70
|
-
await auth.api.signUpEmail({ body: {
|
|
71
|
-
email: testUser.email,
|
|
72
|
-
password: TEST_PASSWORD,
|
|
73
|
-
name: testUser.name
|
|
74
|
-
} });
|
|
75
|
-
user = await getUserByEmail(dbClient)(testUser.email);
|
|
76
|
-
if (user) {
|
|
77
|
-
await addUserToOrganization(dbClient)({
|
|
78
|
-
userId: user.id,
|
|
79
|
-
organizationId: TENANT_ID,
|
|
80
|
-
role: testUser.role === "admin" ? OrgRoles.ADMIN : OrgRoles.MEMBER
|
|
81
|
-
});
|
|
82
|
-
console.log(`│ ${testUser.email.padEnd(22)} │ ${TEST_PASSWORD.padEnd(14)} │ ${testUser.role.padEnd(8)} │`);
|
|
83
|
-
}
|
|
84
|
-
} catch {
|
|
85
|
-
console.log(`│ ${testUser.email.padEnd(22)} │ FAILED │ ${testUser.role.padEnd(8)} │`);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
console.log("└────────────────────────┴────────────────┴──────────┘");
|
|
89
|
-
console.log("\n✅ Test users created!");
|
|
90
|
-
console.log("\nRole permissions:");
|
|
91
|
-
console.log(" • admin → Can install Slack workspace, configure agents");
|
|
92
|
-
console.log(" • member → Can only link account and use agents");
|
|
93
|
-
console.log("");
|
|
94
|
-
process.exit(0);
|
|
95
|
-
}
|
|
96
|
-
createTestUsers().catch((error) => {
|
|
97
|
-
console.error("\n❌ Failed to create test users:", error);
|
|
98
|
-
process.exit(1);
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
//#endregion
|
|
102
|
-
export { };
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import "../../types/index.js";
|
|
2
|
-
import { WorkAppConfigMetadata, WorkAppType } from "../../db/manage/manage-schema.js";
|
|
3
|
-
import { AgentsManageDatabaseClient } from "../../db/manage/manage-client.js";
|
|
4
|
-
import "../../index.js";
|
|
5
|
-
import { WorkAppConfigInsert, WorkAppConfigUpdate } from "../../types/entities.js";
|
|
6
|
-
|
|
7
|
-
//#region src/data-access/manage/workAppConfigs.d.ts
|
|
8
|
-
type TenantScopeConfig = {
|
|
9
|
-
tenantId: string;
|
|
10
|
-
};
|
|
11
|
-
type WorkAppConfigScopeConfig = TenantScopeConfig & {
|
|
12
|
-
appType: 'slack' | 'teams';
|
|
13
|
-
workspaceId: string;
|
|
14
|
-
channelId?: string | null;
|
|
15
|
-
};
|
|
16
|
-
declare const getWorkAppConfigById: (db: AgentsManageDatabaseClient) => (params: {
|
|
17
|
-
scopes: TenantScopeConfig;
|
|
18
|
-
id: string;
|
|
19
|
-
}) => Promise<{
|
|
20
|
-
id: string;
|
|
21
|
-
createdAt: string;
|
|
22
|
-
updatedAt: string;
|
|
23
|
-
agentId: string;
|
|
24
|
-
projectId: string;
|
|
25
|
-
tenantId: string;
|
|
26
|
-
enabled: boolean;
|
|
27
|
-
metadata: WorkAppConfigMetadata | null;
|
|
28
|
-
appType: WorkAppType;
|
|
29
|
-
workspaceId: string;
|
|
30
|
-
channelId: string | null;
|
|
31
|
-
} | null>;
|
|
32
|
-
declare const getWorkAppConfig: (db: AgentsManageDatabaseClient) => (params: {
|
|
33
|
-
scopes: WorkAppConfigScopeConfig;
|
|
34
|
-
}) => Promise<{
|
|
35
|
-
id: string;
|
|
36
|
-
createdAt: string;
|
|
37
|
-
updatedAt: string;
|
|
38
|
-
agentId: string;
|
|
39
|
-
projectId: string;
|
|
40
|
-
tenantId: string;
|
|
41
|
-
enabled: boolean;
|
|
42
|
-
metadata: WorkAppConfigMetadata | null;
|
|
43
|
-
appType: WorkAppType;
|
|
44
|
-
workspaceId: string;
|
|
45
|
-
channelId: string | null;
|
|
46
|
-
} | null>;
|
|
47
|
-
declare const getWorkspaceDefaultConfig: (db: AgentsManageDatabaseClient) => (params: {
|
|
48
|
-
scopes: Omit<WorkAppConfigScopeConfig, "channelId">;
|
|
49
|
-
}) => Promise<{
|
|
50
|
-
id: string;
|
|
51
|
-
createdAt: string;
|
|
52
|
-
updatedAt: string;
|
|
53
|
-
agentId: string;
|
|
54
|
-
projectId: string;
|
|
55
|
-
tenantId: string;
|
|
56
|
-
enabled: boolean;
|
|
57
|
-
metadata: WorkAppConfigMetadata | null;
|
|
58
|
-
appType: WorkAppType;
|
|
59
|
-
workspaceId: string;
|
|
60
|
-
channelId: string | null;
|
|
61
|
-
} | null>;
|
|
62
|
-
declare const getChannelConfig: (db: AgentsManageDatabaseClient) => (params: {
|
|
63
|
-
scopes: WorkAppConfigScopeConfig & {
|
|
64
|
-
channelId: string;
|
|
65
|
-
};
|
|
66
|
-
}) => Promise<{
|
|
67
|
-
id: string;
|
|
68
|
-
createdAt: string;
|
|
69
|
-
updatedAt: string;
|
|
70
|
-
agentId: string;
|
|
71
|
-
projectId: string;
|
|
72
|
-
tenantId: string;
|
|
73
|
-
enabled: boolean;
|
|
74
|
-
metadata: WorkAppConfigMetadata | null;
|
|
75
|
-
appType: WorkAppType;
|
|
76
|
-
workspaceId: string;
|
|
77
|
-
channelId: string | null;
|
|
78
|
-
} | null>;
|
|
79
|
-
declare const getEffectiveAgentConfig: (db: AgentsManageDatabaseClient) => (params: {
|
|
80
|
-
scopes: WorkAppConfigScopeConfig;
|
|
81
|
-
}) => Promise<{
|
|
82
|
-
config: {
|
|
83
|
-
id: string;
|
|
84
|
-
createdAt: string;
|
|
85
|
-
updatedAt: string;
|
|
86
|
-
agentId: string;
|
|
87
|
-
projectId: string;
|
|
88
|
-
tenantId: string;
|
|
89
|
-
enabled: boolean;
|
|
90
|
-
metadata: WorkAppConfigMetadata | null;
|
|
91
|
-
appType: WorkAppType;
|
|
92
|
-
workspaceId: string;
|
|
93
|
-
channelId: string | null;
|
|
94
|
-
};
|
|
95
|
-
source: "channel";
|
|
96
|
-
} | {
|
|
97
|
-
config: {
|
|
98
|
-
id: string;
|
|
99
|
-
createdAt: string;
|
|
100
|
-
updatedAt: string;
|
|
101
|
-
agentId: string;
|
|
102
|
-
projectId: string;
|
|
103
|
-
tenantId: string;
|
|
104
|
-
enabled: boolean;
|
|
105
|
-
metadata: WorkAppConfigMetadata | null;
|
|
106
|
-
appType: WorkAppType;
|
|
107
|
-
workspaceId: string;
|
|
108
|
-
channelId: string | null;
|
|
109
|
-
};
|
|
110
|
-
source: "workspace";
|
|
111
|
-
} | null>;
|
|
112
|
-
declare const listWorkAppConfigs: (db: AgentsManageDatabaseClient) => (params: {
|
|
113
|
-
scopes: TenantScopeConfig & {
|
|
114
|
-
appType: "slack" | "teams";
|
|
115
|
-
workspaceId: string;
|
|
116
|
-
};
|
|
117
|
-
}) => Promise<{
|
|
118
|
-
createdAt: string;
|
|
119
|
-
updatedAt: string;
|
|
120
|
-
appType: WorkAppType;
|
|
121
|
-
workspaceId: string;
|
|
122
|
-
channelId: string | null;
|
|
123
|
-
projectId: string;
|
|
124
|
-
agentId: string;
|
|
125
|
-
enabled: boolean;
|
|
126
|
-
metadata: WorkAppConfigMetadata | null;
|
|
127
|
-
tenantId: string;
|
|
128
|
-
id: string;
|
|
129
|
-
}[]>;
|
|
130
|
-
declare const listWorkAppConfigsPaginated: (db: AgentsManageDatabaseClient) => (params: {
|
|
131
|
-
scopes: TenantScopeConfig & {
|
|
132
|
-
appType: "slack" | "teams";
|
|
133
|
-
workspaceId: string;
|
|
134
|
-
};
|
|
135
|
-
pagination?: {
|
|
136
|
-
page?: number;
|
|
137
|
-
limit?: number;
|
|
138
|
-
};
|
|
139
|
-
}) => Promise<{
|
|
140
|
-
data: {
|
|
141
|
-
createdAt: string;
|
|
142
|
-
updatedAt: string;
|
|
143
|
-
appType: WorkAppType;
|
|
144
|
-
workspaceId: string;
|
|
145
|
-
channelId: string | null;
|
|
146
|
-
projectId: string;
|
|
147
|
-
agentId: string;
|
|
148
|
-
enabled: boolean;
|
|
149
|
-
metadata: WorkAppConfigMetadata | null;
|
|
150
|
-
tenantId: string;
|
|
151
|
-
id: string;
|
|
152
|
-
}[];
|
|
153
|
-
pagination: {
|
|
154
|
-
page: number;
|
|
155
|
-
limit: number;
|
|
156
|
-
total: number;
|
|
157
|
-
pages: number;
|
|
158
|
-
};
|
|
159
|
-
}>;
|
|
160
|
-
declare const createWorkAppConfig: (db: AgentsManageDatabaseClient) => (params: {
|
|
161
|
-
data: Omit<WorkAppConfigInsert, "id" | "createdAt" | "updatedAt">;
|
|
162
|
-
}) => Promise<{
|
|
163
|
-
id: string;
|
|
164
|
-
createdAt: string;
|
|
165
|
-
updatedAt: string;
|
|
166
|
-
agentId: string;
|
|
167
|
-
projectId: string;
|
|
168
|
-
tenantId: string;
|
|
169
|
-
enabled: boolean;
|
|
170
|
-
metadata: WorkAppConfigMetadata | null;
|
|
171
|
-
appType: WorkAppType;
|
|
172
|
-
workspaceId: string;
|
|
173
|
-
channelId: string | null;
|
|
174
|
-
}>;
|
|
175
|
-
declare const updateWorkAppConfig: (db: AgentsManageDatabaseClient) => (params: {
|
|
176
|
-
scopes: TenantScopeConfig;
|
|
177
|
-
id: string;
|
|
178
|
-
data: WorkAppConfigUpdate;
|
|
179
|
-
}) => Promise<{
|
|
180
|
-
createdAt: string;
|
|
181
|
-
updatedAt: string;
|
|
182
|
-
appType: WorkAppType;
|
|
183
|
-
workspaceId: string;
|
|
184
|
-
channelId: string | null;
|
|
185
|
-
projectId: string;
|
|
186
|
-
agentId: string;
|
|
187
|
-
enabled: boolean;
|
|
188
|
-
metadata: WorkAppConfigMetadata | null;
|
|
189
|
-
tenantId: string;
|
|
190
|
-
id: string;
|
|
191
|
-
}>;
|
|
192
|
-
declare const upsertWorkAppConfig: (db: AgentsManageDatabaseClient) => (params: {
|
|
193
|
-
scopes: WorkAppConfigScopeConfig;
|
|
194
|
-
data: Omit<WorkAppConfigInsert, "id" | "createdAt" | "updatedAt" | "tenantId" | "appType" | "workspaceId" | "channelId">;
|
|
195
|
-
}) => Promise<{
|
|
196
|
-
id: string;
|
|
197
|
-
createdAt: string;
|
|
198
|
-
updatedAt: string;
|
|
199
|
-
agentId: string;
|
|
200
|
-
projectId: string;
|
|
201
|
-
tenantId: string;
|
|
202
|
-
enabled: boolean;
|
|
203
|
-
metadata: WorkAppConfigMetadata | null;
|
|
204
|
-
appType: WorkAppType;
|
|
205
|
-
workspaceId: string;
|
|
206
|
-
channelId: string | null;
|
|
207
|
-
}>;
|
|
208
|
-
declare const deleteWorkAppConfig: (db: AgentsManageDatabaseClient) => (params: {
|
|
209
|
-
scopes: TenantScopeConfig;
|
|
210
|
-
id: string;
|
|
211
|
-
}) => Promise<boolean>;
|
|
212
|
-
declare const deleteWorkAppConfigByScope: (db: AgentsManageDatabaseClient) => (params: {
|
|
213
|
-
scopes: WorkAppConfigScopeConfig;
|
|
214
|
-
}) => Promise<boolean>;
|
|
215
|
-
declare const dbResultToWorkAppConfigApi: (dbResult: NonNullable<Awaited<ReturnType<ReturnType<typeof getWorkAppConfigById>>>>) => {
|
|
216
|
-
createdAt: string;
|
|
217
|
-
updatedAt: string;
|
|
218
|
-
id: string;
|
|
219
|
-
agentId: string;
|
|
220
|
-
projectId: string;
|
|
221
|
-
enabled: boolean;
|
|
222
|
-
metadata: WorkAppConfigMetadata | null;
|
|
223
|
-
appType: WorkAppType;
|
|
224
|
-
workspaceId: string;
|
|
225
|
-
channelId: string | null;
|
|
226
|
-
};
|
|
227
|
-
//#endregion
|
|
228
|
-
export { TenantScopeConfig, WorkAppConfigScopeConfig, createWorkAppConfig, dbResultToWorkAppConfigApi, deleteWorkAppConfig, deleteWorkAppConfigByScope, getChannelConfig, getEffectiveAgentConfig, getWorkAppConfig, getWorkAppConfigById, getWorkspaceDefaultConfig, listWorkAppConfigs, listWorkAppConfigsPaginated, updateWorkAppConfig, upsertWorkAppConfig };
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { workAppConfigs } from "../../db/manage/manage-schema.js";
|
|
2
|
-
import { generateId } from "../../utils/conversations.js";
|
|
3
|
-
import { toISODateString } from "../../utils/date.js";
|
|
4
|
-
import "../../utils/index.js";
|
|
5
|
-
import { and, count, desc, eq, isNull } from "drizzle-orm";
|
|
6
|
-
|
|
7
|
-
//#region src/data-access/manage/workAppConfigs.ts
|
|
8
|
-
const getWorkAppConfigById = (db) => async (params) => {
|
|
9
|
-
return await db.query.workAppConfigs.findFirst({ where: and(eq(workAppConfigs.tenantId, params.scopes.tenantId), eq(workAppConfigs.id, params.id)) }) ?? null;
|
|
10
|
-
};
|
|
11
|
-
const getWorkAppConfig = (db) => async (params) => {
|
|
12
|
-
const whereClause = and(eq(workAppConfigs.tenantId, params.scopes.tenantId), eq(workAppConfigs.appType, params.scopes.appType), eq(workAppConfigs.workspaceId, params.scopes.workspaceId), params.scopes.channelId ? eq(workAppConfigs.channelId, params.scopes.channelId) : isNull(workAppConfigs.channelId));
|
|
13
|
-
return await db.query.workAppConfigs.findFirst({ where: whereClause }) ?? null;
|
|
14
|
-
};
|
|
15
|
-
const getWorkspaceDefaultConfig = (db) => async (params) => {
|
|
16
|
-
return getWorkAppConfig(db)({ scopes: {
|
|
17
|
-
...params.scopes,
|
|
18
|
-
channelId: null
|
|
19
|
-
} });
|
|
20
|
-
};
|
|
21
|
-
const getChannelConfig = (db) => async (params) => {
|
|
22
|
-
return getWorkAppConfig(db)({ scopes: params.scopes });
|
|
23
|
-
};
|
|
24
|
-
const getEffectiveAgentConfig = (db) => async (params) => {
|
|
25
|
-
if (params.scopes.channelId) {
|
|
26
|
-
const channelConfig = await getChannelConfig(db)({ scopes: params.scopes });
|
|
27
|
-
if (channelConfig) return {
|
|
28
|
-
config: channelConfig,
|
|
29
|
-
source: "channel"
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
const workspaceConfig = await getWorkspaceDefaultConfig(db)({ scopes: {
|
|
33
|
-
tenantId: params.scopes.tenantId,
|
|
34
|
-
appType: params.scopes.appType,
|
|
35
|
-
workspaceId: params.scopes.workspaceId
|
|
36
|
-
} });
|
|
37
|
-
if (workspaceConfig) return {
|
|
38
|
-
config: workspaceConfig,
|
|
39
|
-
source: "workspace"
|
|
40
|
-
};
|
|
41
|
-
return null;
|
|
42
|
-
};
|
|
43
|
-
const listWorkAppConfigs = (db) => async (params) => {
|
|
44
|
-
const whereClause = and(eq(workAppConfigs.tenantId, params.scopes.tenantId), eq(workAppConfigs.appType, params.scopes.appType), eq(workAppConfigs.workspaceId, params.scopes.workspaceId));
|
|
45
|
-
return await db.select().from(workAppConfigs).where(whereClause).orderBy(desc(workAppConfigs.createdAt));
|
|
46
|
-
};
|
|
47
|
-
const listWorkAppConfigsPaginated = (db) => async (params) => {
|
|
48
|
-
const page = params.pagination?.page || 1;
|
|
49
|
-
const limit = Math.min(params.pagination?.limit || 10, 100);
|
|
50
|
-
const offset = (page - 1) * limit;
|
|
51
|
-
const whereClause = and(eq(workAppConfigs.tenantId, params.scopes.tenantId), eq(workAppConfigs.appType, params.scopes.appType), eq(workAppConfigs.workspaceId, params.scopes.workspaceId));
|
|
52
|
-
const [configs, totalResult] = await Promise.all([db.select().from(workAppConfigs).where(whereClause).limit(limit).offset(offset).orderBy(desc(workAppConfigs.createdAt)), db.select({ count: count() }).from(workAppConfigs).where(whereClause)]);
|
|
53
|
-
const total = totalResult[0]?.count || 0;
|
|
54
|
-
return {
|
|
55
|
-
data: configs,
|
|
56
|
-
pagination: {
|
|
57
|
-
page,
|
|
58
|
-
limit,
|
|
59
|
-
total,
|
|
60
|
-
pages: Math.ceil(total / limit)
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
const createWorkAppConfig = (db) => async (params) => {
|
|
65
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
66
|
-
const id = generateId();
|
|
67
|
-
const [created] = await db.insert(workAppConfigs).values({
|
|
68
|
-
...params.data,
|
|
69
|
-
id,
|
|
70
|
-
createdAt: now,
|
|
71
|
-
updatedAt: now
|
|
72
|
-
}).returning();
|
|
73
|
-
return created;
|
|
74
|
-
};
|
|
75
|
-
const updateWorkAppConfig = (db) => async (params) => {
|
|
76
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
77
|
-
const [updated] = await db.update(workAppConfigs).set({
|
|
78
|
-
...params.data,
|
|
79
|
-
updatedAt: now
|
|
80
|
-
}).where(and(eq(workAppConfigs.tenantId, params.scopes.tenantId), eq(workAppConfigs.id, params.id))).returning();
|
|
81
|
-
return updated ?? null;
|
|
82
|
-
};
|
|
83
|
-
const upsertWorkAppConfig = (db) => async (params) => {
|
|
84
|
-
const existing = await getWorkAppConfig(db)({ scopes: params.scopes });
|
|
85
|
-
if (existing) return await updateWorkAppConfig(db)({
|
|
86
|
-
scopes: { tenantId: params.scopes.tenantId },
|
|
87
|
-
id: existing.id,
|
|
88
|
-
data: params.data
|
|
89
|
-
});
|
|
90
|
-
return await createWorkAppConfig(db)({ data: {
|
|
91
|
-
tenantId: params.scopes.tenantId,
|
|
92
|
-
appType: params.scopes.appType,
|
|
93
|
-
workspaceId: params.scopes.workspaceId,
|
|
94
|
-
channelId: params.scopes.channelId ?? null,
|
|
95
|
-
...params.data
|
|
96
|
-
} });
|
|
97
|
-
};
|
|
98
|
-
const deleteWorkAppConfig = (db) => async (params) => {
|
|
99
|
-
const [deleted] = await db.delete(workAppConfigs).where(and(eq(workAppConfigs.tenantId, params.scopes.tenantId), eq(workAppConfigs.id, params.id))).returning();
|
|
100
|
-
return !!deleted;
|
|
101
|
-
};
|
|
102
|
-
const deleteWorkAppConfigByScope = (db) => async (params) => {
|
|
103
|
-
const config = await getWorkAppConfig(db)({ scopes: params.scopes });
|
|
104
|
-
if (!config) return false;
|
|
105
|
-
return await deleteWorkAppConfig(db)({
|
|
106
|
-
scopes: { tenantId: params.scopes.tenantId },
|
|
107
|
-
id: config.id
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
|
-
const dbResultToWorkAppConfigApi = (dbResult) => {
|
|
111
|
-
const { tenantId, createdAt, updatedAt, ...rest } = dbResult;
|
|
112
|
-
return {
|
|
113
|
-
...rest,
|
|
114
|
-
createdAt: toISODateString(createdAt),
|
|
115
|
-
updatedAt: toISODateString(updatedAt)
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
//#endregion
|
|
120
|
-
export { createWorkAppConfig, dbResultToWorkAppConfigApi, deleteWorkAppConfig, deleteWorkAppConfigByScope, getChannelConfig, getEffectiveAgentConfig, getWorkAppConfig, getWorkAppConfigById, getWorkspaceDefaultConfig, listWorkAppConfigs, listWorkAppConfigsPaginated, updateWorkAppConfig, upsertWorkAppConfig };
|