@inkeep/agents-core 0.34.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-UMFCT6A6.js → chunk-DYGTCLJO.js} +1 -1
- package/dist/{chunk-4VUM4EJL.js → chunk-J5AHY6M2.js} +1 -1
- package/dist/{chunk-E6R6PML7.js → chunk-SIAA4J6H.js} +1 -3
- package/dist/{chunk-YECQCT5N.js → chunk-W3L4M7FO.js} +6 -8
- package/dist/{chunk-EKV6C5GS.js → chunk-YZ5ZBVHJ.js} +104 -5
- package/dist/client-exports.cjs +92 -1
- package/dist/client-exports.d.cts +5 -5
- package/dist/client-exports.d.ts +5 -5
- package/dist/client-exports.js +2 -2
- package/dist/db/schema.cjs +100 -1
- package/dist/db/schema.d.cts +2 -2
- package/dist/db/schema.d.ts +2 -2
- package/dist/db/schema.js +1 -1
- package/dist/index.cjs +1541 -1317
- package/dist/index.d.cts +462 -252
- package/dist/index.d.ts +462 -252
- package/dist/index.js +589 -478
- package/dist/{schema-CaEvIRdT.d.cts → schema-DQBYINXB.d.cts} +1105 -3
- package/dist/{schema-DvYv9PQ1.d.ts → schema-DlcSfZRM.d.ts} +1105 -3
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/{utility-htaewQEL.d.cts → utility-Ct1UMzr_.d.cts} +305 -305
- package/dist/{utility-htaewQEL.d.ts → utility-Ct1UMzr_.d.ts} +305 -305
- package/dist/utils/schema-conversion.cjs +6 -10
- package/dist/utils/schema-conversion.js +1 -1
- package/dist/validation/index.cjs +92 -1
- package/dist/validation/index.d.cts +2 -2
- package/dist/validation/index.d.ts +2 -2
- package/dist/validation/index.js +2 -2
- package/drizzle/0001_fair_malice.sql +115 -0
- package/drizzle/meta/0001_snapshot.json +3520 -0
- package/drizzle/meta/_journal.json +8 -1
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -2,31 +2,28 @@ import { detectAuthenticationRequired } from './chunk-OP3KPT4T.js';
|
|
|
2
2
|
export { ACTIVITY_NAMES, ACTIVITY_STATUS, ACTIVITY_TYPES, AGENT_IDS, AGGREGATE_OPERATORS, AI_OPERATIONS, AI_TOOL_TYPES, DATA_SOURCES, DATA_TYPES, DELEGATION_FROM_SUB_AGENT_ID, DELEGATION_ID, DELEGATION_TO_SUB_AGENT_ID, FIELD_TYPES, OPERATORS, ORDER_DIRECTIONS, PANEL_TYPES, QUERY_DEFAULTS, QUERY_EXPRESSIONS, QUERY_FIELD_CONFIGS, QUERY_TYPES, REDUCE_OPERATIONS, SPAN_KEYS, SPAN_NAMES, TRANSFER_FROM_SUB_AGENT_ID, TRANSFER_TO_SUB_AGENT_ID, UNKNOWN_VALUE, detectAuthenticationRequired, exchangeMcpAuthorizationCode, initiateMcpOAuthFlow } from './chunk-OP3KPT4T.js';
|
|
3
3
|
export { ANTHROPIC_MODELS, GOOGLE_MODELS, OPENAI_MODELS } from './chunk-7CLFCY6J.js';
|
|
4
4
|
export { TaskState } from './chunk-H2F72PDA.js';
|
|
5
|
-
import { getLogger, convertZodToJsonSchema } from './chunk-
|
|
6
|
-
export { PinoLogger, convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, getLogger, isZodSchema, loggerFactory, preview } from './chunk-
|
|
7
|
-
import { validateRender, validateAndTypeAgentData, validateAgentStructure } from './chunk-
|
|
8
|
-
export { A2AMessageMetadataSchema, DataComponentStreamEventSchema, DataOperationDetailsSchema, DataOperationEventSchema, DataOperationStreamEventSchema, DataSummaryStreamEventSchema, DelegationReturnedDataSchema, DelegationSentDataSchema, StreamErrorEventSchema, StreamEventSchema, StreamFinishEventSchema, TextDeltaEventSchema, TextEndEventSchema, TextStartEventSchema, TransferDataSchema, generateIdFromName, isValidResourceId, validateAgentRelationships, validateAgentStructure, validateAndTypeAgentData, validateArtifactComponentReferences, validateDataComponentReferences, validateRender, validateSubAgentExternalAgentRelations, validateToolReferences } from './chunk-
|
|
9
|
-
import { schemaValidationDefaults, ContextConfigApiUpdateSchema, validatePropsAsJsonSchema } from './chunk-
|
|
10
|
-
export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentInsertSchema, AgentListResponse, AgentResponse, AgentSelectSchema, AgentStopWhenSchema, AgentUpdateSchema, AgentWithinContextOfProjectResponse, AgentWithinContextOfProjectSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeyListResponse, ApiKeyResponse, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentArrayResponse, ArtifactComponentInsertSchema, ArtifactComponentListResponse, ArtifactComponentResponse, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ComponentAssociationListResponse, ComponentAssociationSchema, 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, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentListResponse, ExternalAgentResponse, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FullAgentAgentInsertSchema, FullProjectDefinitionResponse, FullProjectDefinitionSchema, 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, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolListResponse, McpToolResponse, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageListResponse, MessageResponse, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, OAuthCallbackQuerySchema, OAuthLoginQuerySchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectListResponse, ProjectModelSchema, ProjectResponse, ProjectSelectSchema, ProjectUpdateSchema, RelatedAgentInfoListResponse, RelatedAgentInfoSchema, RemovedResponseSchema, 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, 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, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolListResponse, ToolResponse, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, canDelegateToExternalAgentSchema, canDelegateToTeamAgentSchema, resourceIdSchema, schemaValidationDefaults, validatePropsAsJsonSchema } from './chunk-
|
|
11
|
-
import { schema_exports, contextConfigs, externalAgents, functions, functionTools, subAgentFunctionToolRelations, subAgentExternalAgentRelations, subAgents, subAgentRelations, subAgentToolRelations, tools, subAgentTeamAgentRelations, agents, credentialReferences, subAgentDataComponents, subAgentArtifactComponents, dataComponents, artifactComponents, projects, apiKeys, contextCache, conversations, messages, ledgerArtifacts, tasks, taskRelations } from './chunk-
|
|
12
|
-
export { agentRelations, agentToolRelationsRelations, agents, apiKeys, apiKeysRelations, artifactComponents, artifactComponentsRelations, contextCache, contextCacheRelations, contextConfigs, contextConfigsRelations, conversations, conversationsRelations, credentialReferences, credentialReferencesRelations, dataComponents, dataComponentsRelations, externalAgents, externalAgentsRelations, functionTools, functionToolsRelations, functions, functionsRelations, ledgerArtifacts, ledgerArtifactsRelations, messages, messagesRelations, projects, projectsRelations, subAgentArtifactComponents, subAgentArtifactComponentsRelations, subAgentDataComponents, subAgentDataComponentsRelations, subAgentExternalAgentRelations, subAgentExternalAgentRelationsRelations, subAgentFunctionToolRelations, subAgentFunctionToolRelationsRelations, subAgentRelations, subAgentRelationsRelations, subAgentTeamAgentRelations, subAgentTeamAgentRelationsRelations, subAgentToolRelations, subAgents, subAgentsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations } from './chunk-
|
|
5
|
+
import { getLogger, convertZodToJsonSchema } from './chunk-W3L4M7FO.js';
|
|
6
|
+
export { PinoLogger, convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, getLogger, isZodSchema, loggerFactory, preview } from './chunk-W3L4M7FO.js';
|
|
7
|
+
import { validateRender, validateAndTypeAgentData, validateAgentStructure } from './chunk-J5AHY6M2.js';
|
|
8
|
+
export { A2AMessageMetadataSchema, DataComponentStreamEventSchema, DataOperationDetailsSchema, DataOperationEventSchema, DataOperationStreamEventSchema, DataSummaryStreamEventSchema, DelegationReturnedDataSchema, DelegationSentDataSchema, StreamErrorEventSchema, StreamEventSchema, StreamFinishEventSchema, TextDeltaEventSchema, TextEndEventSchema, TextStartEventSchema, TransferDataSchema, generateIdFromName, isValidResourceId, validateAgentRelationships, validateAgentStructure, validateAndTypeAgentData, validateArtifactComponentReferences, validateDataComponentReferences, validateRender, validateSubAgentExternalAgentRelations, validateToolReferences } from './chunk-J5AHY6M2.js';
|
|
9
|
+
import { schemaValidationDefaults, ContextConfigApiUpdateSchema, validatePropsAsJsonSchema } from './chunk-DYGTCLJO.js';
|
|
10
|
+
export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentInsertSchema, AgentListResponse, AgentResponse, AgentSelectSchema, AgentStopWhenSchema, AgentUpdateSchema, AgentWithinContextOfProjectResponse, AgentWithinContextOfProjectSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeyListResponse, ApiKeyResponse, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentArrayResponse, ArtifactComponentInsertSchema, ArtifactComponentListResponse, ArtifactComponentResponse, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ComponentAssociationListResponse, ComponentAssociationSchema, 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, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentListResponse, ExternalAgentResponse, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FullAgentAgentInsertSchema, FullProjectDefinitionResponse, FullProjectDefinitionSchema, 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, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolListResponse, McpToolResponse, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageListResponse, MessageResponse, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, OAuthCallbackQuerySchema, OAuthLoginQuerySchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectListResponse, ProjectModelSchema, ProjectResponse, ProjectSelectSchema, ProjectUpdateSchema, RelatedAgentInfoListResponse, RelatedAgentInfoSchema, RemovedResponseSchema, 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, 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, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolListResponse, ToolResponse, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, canDelegateToExternalAgentSchema, canDelegateToTeamAgentSchema, resourceIdSchema, schemaValidationDefaults, validatePropsAsJsonSchema } from './chunk-DYGTCLJO.js';
|
|
11
|
+
import { schema_exports, contextConfigs, externalAgents, functions, functionTools, subAgentFunctionToolRelations, subAgentExternalAgentRelations, subAgents, subAgentRelations, subAgentToolRelations, tools, subAgentTeamAgentRelations, agents, credentialReferences, subAgentDataComponents, subAgentArtifactComponents, dataComponents, artifactComponents, projects, apiKeys, contextCache, conversations, messages, ledgerArtifacts, organization, member, invitation, tasks, taskRelations, user } from './chunk-YZ5ZBVHJ.js';
|
|
12
|
+
export { account, agentRelations, agentToolRelationsRelations, agents, apiKeys, apiKeysRelations, artifactComponents, artifactComponentsRelations, contextCache, contextCacheRelations, contextConfigs, contextConfigsRelations, conversations, conversationsRelations, credentialReferences, credentialReferencesRelations, dataComponents, dataComponentsRelations, externalAgents, externalAgentsRelations, functionTools, functionToolsRelations, functions, functionsRelations, invitation, ledgerArtifacts, ledgerArtifactsRelations, member, messages, messagesRelations, organization, projects, projectsRelations, session, ssoProvider, subAgentArtifactComponents, subAgentArtifactComponentsRelations, subAgentDataComponents, subAgentDataComponentsRelations, subAgentExternalAgentRelations, subAgentExternalAgentRelationsRelations, subAgentFunctionToolRelations, subAgentFunctionToolRelationsRelations, subAgentRelations, subAgentRelationsRelations, subAgentTeamAgentRelations, subAgentTeamAgentRelationsRelations, subAgentToolRelations, subAgents, subAgentsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations, user, verification } from './chunk-YZ5ZBVHJ.js';
|
|
13
13
|
import { CredentialStoreType, MCPServerType, MCPTransportType } from './chunk-YFHT5M2R.js';
|
|
14
14
|
export { CredentialStoreType, MCPServerType, MCPTransportType, TOOL_STATUS_VALUES, VALID_RELATION_TYPES } from './chunk-YFHT5M2R.js';
|
|
15
|
-
import { __commonJS, __require
|
|
15
|
+
import { __commonJS, __require } from './chunk-SIAA4J6H.js';
|
|
16
16
|
import { z } from 'zod';
|
|
17
17
|
import fs from 'fs';
|
|
18
18
|
import os from 'os';
|
|
19
|
-
import path, { dirname } from 'path';
|
|
19
|
+
import path, { dirname, join } from 'path';
|
|
20
20
|
import dotenv from 'dotenv';
|
|
21
21
|
import { expand } from 'dotenv-expand';
|
|
22
22
|
import { findUpSync } from 'find-up';
|
|
23
23
|
import jmespath from 'jmespath';
|
|
24
24
|
import { drizzle } from 'drizzle-orm/node-postgres';
|
|
25
25
|
import { Pool } from 'pg';
|
|
26
|
-
import { fileURLToPath } from 'url';
|
|
27
|
-
import { PGlite } from '@electric-sql/pglite';
|
|
28
26
|
import { and, eq, desc, sql, count, asc, isNotNull, inArray, not } from 'drizzle-orm';
|
|
29
|
-
import { drizzle as drizzle$1 } from 'drizzle-orm/pglite';
|
|
30
27
|
import { customAlphabet, nanoid } from 'nanoid';
|
|
31
28
|
import crypto, { scrypt, randomBytes, timingSafeEqual } from 'crypto';
|
|
32
29
|
import { promisify } from 'util';
|
|
@@ -44,6 +41,10 @@ import { SignJWT, jwtVerify } from 'jose';
|
|
|
44
41
|
import { trace, SpanStatusCode } from '@opentelemetry/api';
|
|
45
42
|
import Ajv from 'ajv';
|
|
46
43
|
import { Nango } from '@nangohq/node';
|
|
44
|
+
import { fileURLToPath } from 'url';
|
|
45
|
+
import { PGlite } from '@electric-sql/pglite';
|
|
46
|
+
import { drizzle as drizzle$1 } from 'drizzle-orm/pglite';
|
|
47
|
+
import { migrate } from 'drizzle-orm/pglite/migrator';
|
|
47
48
|
|
|
48
49
|
// ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64.js
|
|
49
50
|
var require_base64 = __commonJS({
|
|
@@ -2501,7 +2502,7 @@ var require_typescript = __commonJS({
|
|
|
2501
2502
|
affectsEmitOptionDeclarations: () => affectsEmitOptionDeclarations,
|
|
2502
2503
|
allKeysStartWithDot: () => allKeysStartWithDot,
|
|
2503
2504
|
altDirectorySeparator: () => altDirectorySeparator,
|
|
2504
|
-
and: () =>
|
|
2505
|
+
and: () => and24,
|
|
2505
2506
|
append: () => append,
|
|
2506
2507
|
appendIfUnique: () => appendIfUnique,
|
|
2507
2508
|
arrayFrom: () => arrayFrom,
|
|
@@ -5952,7 +5953,7 @@ var require_typescript = __commonJS({
|
|
|
5952
5953
|
function isPatternMatch({ prefix, suffix }, candidate) {
|
|
5953
5954
|
return candidate.length >= prefix.length + suffix.length && startsWith(candidate, prefix) && endsWith(candidate, suffix);
|
|
5954
5955
|
}
|
|
5955
|
-
function
|
|
5956
|
+
function and24(f, g) {
|
|
5956
5957
|
return (arg) => f(arg) && g(arg);
|
|
5957
5958
|
}
|
|
5958
5959
|
function or(...fs2) {
|
|
@@ -6209,8 +6210,8 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
6209
6210
|
return value;
|
|
6210
6211
|
}
|
|
6211
6212
|
Debug2.checkEachDefined = checkEachDefined;
|
|
6212
|
-
function assertNever(
|
|
6213
|
-
const detail = typeof
|
|
6213
|
+
function assertNever(member2, message = "Illegal value:", stackCrawlMark) {
|
|
6214
|
+
const detail = typeof member2 === "object" && hasProperty(member2, "kind") && hasProperty(member2, "pos") ? "SyntaxKind: " + formatSyntaxKind(member2.kind) : JSON.stringify(member2);
|
|
6214
6215
|
return fail(`${message} ${detail}`, stackCrawlMark || assertNever);
|
|
6215
6216
|
}
|
|
6216
6217
|
Debug2.assertNever = assertNever;
|
|
@@ -10995,11 +10996,11 @@ ${lanes.join("\n")}
|
|
|
10995
10996
|
cb();
|
|
10996
10997
|
return false;
|
|
10997
10998
|
}
|
|
10998
|
-
const
|
|
10999
|
-
|
|
11000
|
-
|
|
11001
|
-
|
|
11002
|
-
activeSession =
|
|
10999
|
+
const session2 = new inspector.Session();
|
|
11000
|
+
session2.connect();
|
|
11001
|
+
session2.post("Profiler.enable", () => {
|
|
11002
|
+
session2.post("Profiler.start", () => {
|
|
11003
|
+
activeSession = session2;
|
|
11003
11004
|
profilePath = path2;
|
|
11004
11005
|
cb();
|
|
11005
11006
|
});
|
|
@@ -23235,7 +23236,7 @@ ${lanes.join("\n")}
|
|
|
23235
23236
|
return computeLineOfPosition(lineMap, pos);
|
|
23236
23237
|
}
|
|
23237
23238
|
function getFirstConstructorWithBody(node) {
|
|
23238
|
-
return find(node.members, (
|
|
23239
|
+
return find(node.members, (member2) => isConstructorDeclaration(member2) && nodeIsPresent(member2.body));
|
|
23239
23240
|
}
|
|
23240
23241
|
function getSetAccessorValueParameter(accessor) {
|
|
23241
23242
|
if (accessor && accessor.parameters.length > 0) {
|
|
@@ -23294,21 +23295,21 @@ ${lanes.join("\n")}
|
|
|
23294
23295
|
Debug.fail("Accessor has wrong kind");
|
|
23295
23296
|
}
|
|
23296
23297
|
} else {
|
|
23297
|
-
forEach(declarations, (
|
|
23298
|
-
if (isAccessor(
|
|
23299
|
-
const memberName = getPropertyNameForPropertyNameNode(
|
|
23298
|
+
forEach(declarations, (member2) => {
|
|
23299
|
+
if (isAccessor(member2) && isStatic(member2) === isStatic(accessor)) {
|
|
23300
|
+
const memberName = getPropertyNameForPropertyNameNode(member2.name);
|
|
23300
23301
|
const accessorName = getPropertyNameForPropertyNameNode(accessor.name);
|
|
23301
23302
|
if (memberName === accessorName) {
|
|
23302
23303
|
if (!firstAccessor) {
|
|
23303
|
-
firstAccessor =
|
|
23304
|
+
firstAccessor = member2;
|
|
23304
23305
|
} else if (!secondAccessor) {
|
|
23305
|
-
secondAccessor =
|
|
23306
|
+
secondAccessor = member2;
|
|
23306
23307
|
}
|
|
23307
|
-
if (
|
|
23308
|
-
getAccessor =
|
|
23308
|
+
if (member2.kind === 178 && !getAccessor) {
|
|
23309
|
+
getAccessor = member2;
|
|
23309
23310
|
}
|
|
23310
|
-
if (
|
|
23311
|
-
setAccessor =
|
|
23311
|
+
if (member2.kind === 179 && !setAccessor) {
|
|
23312
|
+
setAccessor = member2;
|
|
23312
23313
|
}
|
|
23313
23314
|
}
|
|
23314
23315
|
}
|
|
@@ -26497,9 +26498,9 @@ ${lanes.join("\n")}
|
|
|
26497
26498
|
}
|
|
26498
26499
|
function findConstructorDeclaration(node) {
|
|
26499
26500
|
const members = node.members;
|
|
26500
|
-
for (const
|
|
26501
|
-
if (
|
|
26502
|
-
return
|
|
26501
|
+
for (const member2 of members) {
|
|
26502
|
+
if (member2.kind === 177 && nodeIsPresent(member2.body)) {
|
|
26503
|
+
return member2;
|
|
26503
26504
|
}
|
|
26504
26505
|
}
|
|
26505
26506
|
}
|
|
@@ -56947,7 +56948,7 @@ ${lanes.join("\n")}
|
|
|
56947
56948
|
SignatureCheckMode3[SignatureCheckMode3["Callback"] = 3] = "Callback";
|
|
56948
56949
|
return SignatureCheckMode3;
|
|
56949
56950
|
})(SignatureCheckMode || {});
|
|
56950
|
-
var isNotOverloadAndNotAccessor =
|
|
56951
|
+
var isNotOverloadAndNotAccessor = and24(isNotOverload, isNotAccessor);
|
|
56951
56952
|
var intrinsicTypeKinds = new Map(Object.entries({
|
|
56952
56953
|
Uppercase: 0,
|
|
56953
56954
|
Lowercase: 1,
|
|
@@ -60845,8 +60846,8 @@ ${lanes.join("\n")}
|
|
|
60845
60846
|
});
|
|
60846
60847
|
return result || emptyArray;
|
|
60847
60848
|
}
|
|
60848
|
-
function isNamedMember(
|
|
60849
|
-
return !isReservedMemberName(escapedName) && symbolIsValue(
|
|
60849
|
+
function isNamedMember(member2, escapedName) {
|
|
60850
|
+
return !isReservedMemberName(escapedName) && symbolIsValue(member2);
|
|
60850
60851
|
}
|
|
60851
60852
|
function getNamedOrIndexSignatureMembers(members) {
|
|
60852
60853
|
const result = getNamedMembers(members);
|
|
@@ -65481,11 +65482,11 @@ ${lanes.join("\n")}
|
|
|
65481
65482
|
const initializedValue = last2.declarations && last2.declarations[0] && isEnumMember(last2.declarations[0]) ? getConstantValue2(last2.declarations[0]) : void 0;
|
|
65482
65483
|
const initializer2 = initializedValue === void 0 ? void 0 : typeof initializedValue === "string" ? factory.createStringLiteral(initializedValue) : factory.createNumericLiteral(initializedValue);
|
|
65483
65484
|
const memberName2 = unescapeLeadingUnderscores(last2.escapedName);
|
|
65484
|
-
const
|
|
65485
|
+
const member22 = factory.createEnumMember(
|
|
65485
65486
|
memberName2,
|
|
65486
65487
|
initializer2
|
|
65487
65488
|
);
|
|
65488
|
-
members.push(
|
|
65489
|
+
members.push(member22);
|
|
65489
65490
|
break;
|
|
65490
65491
|
}
|
|
65491
65492
|
const memberDecl = p.declarations && p.declarations[0] && isEnumMember(p.declarations[0]) ? p.declarations[0] : void 0;
|
|
@@ -65501,11 +65502,11 @@ ${lanes.join("\n")}
|
|
|
65501
65502
|
}
|
|
65502
65503
|
const memberName = unescapeLeadingUnderscores(p.escapedName);
|
|
65503
65504
|
context.approximateLength += 4 + memberName.length + initializerLength;
|
|
65504
|
-
const
|
|
65505
|
+
const member2 = factory.createEnumMember(
|
|
65505
65506
|
memberName,
|
|
65506
65507
|
initializer
|
|
65507
65508
|
);
|
|
65508
|
-
members.push(
|
|
65509
|
+
members.push(member2);
|
|
65509
65510
|
}
|
|
65510
65511
|
addResult(
|
|
65511
65512
|
factory.createEnumDeclaration(
|
|
@@ -67794,11 +67795,11 @@ ${lanes.join("\n")}
|
|
|
67794
67795
|
);
|
|
67795
67796
|
const members = createSymbolTable();
|
|
67796
67797
|
forEach(node.elements, (attr) => {
|
|
67797
|
-
const
|
|
67798
|
-
|
|
67799
|
-
|
|
67800
|
-
|
|
67801
|
-
members.set(
|
|
67798
|
+
const member2 = createSymbol(4, getNameFromImportAttribute(attr));
|
|
67799
|
+
member2.parent = symbol;
|
|
67800
|
+
member2.links.type = checkImportAttribute(attr);
|
|
67801
|
+
member2.links.target = member2;
|
|
67802
|
+
members.set(member2.escapedName, member2);
|
|
67802
67803
|
});
|
|
67803
67804
|
const type = createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
|
|
67804
67805
|
type.objectFlags |= 128 | 262144;
|
|
@@ -68756,10 +68757,10 @@ ${lanes.join("\n")}
|
|
|
68756
68757
|
if (symbol.declarations) {
|
|
68757
68758
|
for (const declaration of symbol.declarations) {
|
|
68758
68759
|
if (declaration.kind === 267) {
|
|
68759
|
-
for (const
|
|
68760
|
-
if (hasBindableName(
|
|
68761
|
-
const memberSymbol = getSymbolOfDeclaration(
|
|
68762
|
-
const value = getEnumMemberValue(
|
|
68760
|
+
for (const member2 of declaration.members) {
|
|
68761
|
+
if (hasBindableName(member2)) {
|
|
68762
|
+
const memberSymbol = getSymbolOfDeclaration(member2);
|
|
68763
|
+
const value = getEnumMemberValue(member2).value;
|
|
68763
68764
|
const memberType = getFreshTypeOfLiteralType(
|
|
68764
68765
|
value !== void 0 ? getEnumLiteralType(value, getSymbolId(symbol), memberSymbol) : createComputedEnumType(memberSymbol)
|
|
68765
68766
|
);
|
|
@@ -68965,17 +68966,17 @@ ${lanes.join("\n")}
|
|
|
68965
68966
|
function isNonBindableDynamicName(node) {
|
|
68966
68967
|
return isDynamicName(node) && !isLateBindableName(node);
|
|
68967
68968
|
}
|
|
68968
|
-
function addDeclarationToLateBoundSymbol(symbol,
|
|
68969
|
+
function addDeclarationToLateBoundSymbol(symbol, member2, symbolFlags) {
|
|
68969
68970
|
Debug.assert(!!(getCheckFlags(symbol) & 4096), "Expected a late-bound symbol.");
|
|
68970
68971
|
symbol.flags |= symbolFlags;
|
|
68971
|
-
getSymbolLinks(
|
|
68972
|
+
getSymbolLinks(member2.symbol).lateSymbol = symbol;
|
|
68972
68973
|
if (!symbol.declarations) {
|
|
68973
|
-
symbol.declarations = [
|
|
68974
|
-
} else if (!
|
|
68975
|
-
symbol.declarations.push(
|
|
68974
|
+
symbol.declarations = [member2];
|
|
68975
|
+
} else if (!member2.symbol.isReplaceableByMethod) {
|
|
68976
|
+
symbol.declarations.push(member2);
|
|
68976
68977
|
}
|
|
68977
68978
|
if (symbolFlags & 111551) {
|
|
68978
|
-
setValueDeclaration(symbol,
|
|
68979
|
+
setValueDeclaration(symbol, member2);
|
|
68979
68980
|
}
|
|
68980
68981
|
}
|
|
68981
68982
|
function lateBindMember(parent2, earlySymbols, lateSymbols, decl) {
|
|
@@ -69059,12 +69060,12 @@ ${lanes.join("\n")}
|
|
|
69059
69060
|
for (const decl of symbol.declarations || emptyArray) {
|
|
69060
69061
|
const members = getMembersOfDeclaration(decl);
|
|
69061
69062
|
if (members) {
|
|
69062
|
-
for (const
|
|
69063
|
-
if (isStatic2 === hasStaticModifier(
|
|
69064
|
-
if (hasLateBindableName(
|
|
69065
|
-
lateBindMember(symbol, earlySymbols, lateSymbols,
|
|
69066
|
-
} else if (hasLateBindableIndexSignature(
|
|
69067
|
-
lateBindIndexSignature(symbol, earlySymbols, lateSymbols,
|
|
69063
|
+
for (const member2 of members) {
|
|
69064
|
+
if (isStatic2 === hasStaticModifier(member2)) {
|
|
69065
|
+
if (hasLateBindableName(member2)) {
|
|
69066
|
+
lateBindMember(symbol, earlySymbols, lateSymbols, member2);
|
|
69067
|
+
} else if (hasLateBindableIndexSignature(member2)) {
|
|
69068
|
+
lateBindIndexSignature(symbol, earlySymbols, lateSymbols, member2);
|
|
69068
69069
|
}
|
|
69069
69070
|
}
|
|
69070
69071
|
}
|
|
@@ -69073,12 +69074,12 @@ ${lanes.join("\n")}
|
|
|
69073
69074
|
const assignments = getFunctionExpressionParentSymbolOrSymbol(symbol).assignmentDeclarationMembers;
|
|
69074
69075
|
if (assignments) {
|
|
69075
69076
|
const decls = arrayFrom(assignments.values());
|
|
69076
|
-
for (const
|
|
69077
|
-
const assignmentKind = getAssignmentDeclarationKind(
|
|
69078
|
-
const isInstanceMember = assignmentKind === 3 || isBinaryExpression(
|
|
69077
|
+
for (const member2 of decls) {
|
|
69078
|
+
const assignmentKind = getAssignmentDeclarationKind(member2);
|
|
69079
|
+
const isInstanceMember = assignmentKind === 3 || isBinaryExpression(member2) && isPossiblyAliasedThisProperty(member2, assignmentKind) || assignmentKind === 9 || assignmentKind === 6;
|
|
69079
69080
|
if (isStatic2 === !isInstanceMember) {
|
|
69080
|
-
if (hasLateBindableName(
|
|
69081
|
-
lateBindMember(symbol, earlySymbols, lateSymbols,
|
|
69081
|
+
if (hasLateBindableName(member2)) {
|
|
69082
|
+
lateBindMember(symbol, earlySymbols, lateSymbols, member2);
|
|
69082
69083
|
}
|
|
69083
69084
|
}
|
|
69084
69085
|
}
|
|
@@ -72580,8 +72581,8 @@ ${lanes.join("\n")}
|
|
|
72580
72581
|
const elementFlags = map(node.elements, getTupleElementFlags);
|
|
72581
72582
|
return getTupleTargetType(elementFlags, readonly, map(node.elements, memberIfLabeledElementDeclaration));
|
|
72582
72583
|
}
|
|
72583
|
-
function memberIfLabeledElementDeclaration(
|
|
72584
|
-
return isNamedTupleMember(
|
|
72584
|
+
function memberIfLabeledElementDeclaration(member2) {
|
|
72585
|
+
return isNamedTupleMember(member2) || isParameter(member2) ? member2 : void 0;
|
|
72585
72586
|
}
|
|
72586
72587
|
function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) {
|
|
72587
72588
|
return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 189 ? mayResolveTypeAlias(node.elementType) : node.kind === 190 ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias));
|
|
@@ -86448,7 +86449,7 @@ ${lanes.join("\n")}
|
|
|
86448
86449
|
}
|
|
86449
86450
|
let offset = 0;
|
|
86450
86451
|
for (const memberDecl of node.properties) {
|
|
86451
|
-
let
|
|
86452
|
+
let member2 = getSymbolOfDeclaration(memberDecl);
|
|
86452
86453
|
const computedNameType = memberDecl.name && memberDecl.name.kind === 168 ? checkComputedPropertyName(memberDecl.name) : void 0;
|
|
86453
86454
|
if (memberDecl.kind === 304 || memberDecl.kind === 305 || isObjectLiteralMethod(memberDecl)) {
|
|
86454
86455
|
let type = memberDecl.kind === 304 ? checkPropertyAssignment(memberDecl, checkMode) : (
|
|
@@ -86469,32 +86470,32 @@ ${lanes.join("\n")}
|
|
|
86469
86470
|
objectFlags |= getObjectFlags(type) & 458752;
|
|
86470
86471
|
const nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : void 0;
|
|
86471
86472
|
const prop = nameType ? createSymbol(
|
|
86472
|
-
4 |
|
|
86473
|
+
4 | member2.flags,
|
|
86473
86474
|
getPropertyNameFromType(nameType),
|
|
86474
86475
|
checkFlags | 4096
|
|
86475
86476
|
/* Late */
|
|
86476
|
-
) : createSymbol(4 |
|
|
86477
|
+
) : createSymbol(4 | member2.flags, member2.escapedName, checkFlags);
|
|
86477
86478
|
if (nameType) {
|
|
86478
86479
|
prop.links.nameType = nameType;
|
|
86479
86480
|
}
|
|
86480
86481
|
if (inDestructuringPattern && hasDefaultValue(memberDecl)) {
|
|
86481
86482
|
prop.flags |= 16777216;
|
|
86482
86483
|
} else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) & 512)) {
|
|
86483
|
-
const impliedProp = getPropertyOfType(contextualType,
|
|
86484
|
+
const impliedProp = getPropertyOfType(contextualType, member2.escapedName);
|
|
86484
86485
|
if (impliedProp) {
|
|
86485
86486
|
prop.flags |= impliedProp.flags & 16777216;
|
|
86486
86487
|
} else if (!getIndexInfoOfType(contextualType, stringType)) {
|
|
86487
|
-
error2(memberDecl.name, Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(
|
|
86488
|
+
error2(memberDecl.name, Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(member2), typeToString(contextualType));
|
|
86488
86489
|
}
|
|
86489
86490
|
}
|
|
86490
|
-
prop.declarations =
|
|
86491
|
-
prop.parent =
|
|
86492
|
-
if (
|
|
86493
|
-
prop.valueDeclaration =
|
|
86491
|
+
prop.declarations = member2.declarations;
|
|
86492
|
+
prop.parent = member2.parent;
|
|
86493
|
+
if (member2.valueDeclaration) {
|
|
86494
|
+
prop.valueDeclaration = member2.valueDeclaration;
|
|
86494
86495
|
}
|
|
86495
86496
|
prop.links.type = type;
|
|
86496
|
-
prop.links.target =
|
|
86497
|
-
|
|
86497
|
+
prop.links.target = member2;
|
|
86498
|
+
member2 = prop;
|
|
86498
86499
|
allPropertiesTable == null ? void 0 : allPropertiesTable.set(prop.escapedName, prop);
|
|
86499
86500
|
if (contextualType && checkMode & 2 && !(checkMode & 4) && (memberDecl.kind === 304 || memberDecl.kind === 175) && isContextSensitive(memberDecl)) {
|
|
86500
86501
|
const inferenceContext = getInferenceContext(node);
|
|
@@ -86559,9 +86560,9 @@ ${lanes.join("\n")}
|
|
|
86559
86560
|
}
|
|
86560
86561
|
}
|
|
86561
86562
|
} else {
|
|
86562
|
-
propertiesTable.set(
|
|
86563
|
+
propertiesTable.set(member2.escapedName, member2);
|
|
86563
86564
|
}
|
|
86564
|
-
propertiesArray.push(
|
|
86565
|
+
propertiesArray.push(member2);
|
|
86565
86566
|
}
|
|
86566
86567
|
popContextualType();
|
|
86567
86568
|
if (isErrorType(spread)) {
|
|
@@ -86666,25 +86667,25 @@ ${lanes.join("\n")}
|
|
|
86666
86667
|
/* None */
|
|
86667
86668
|
);
|
|
86668
86669
|
for (const attributeDecl of attributes.properties) {
|
|
86669
|
-
const
|
|
86670
|
+
const member2 = attributeDecl.symbol;
|
|
86670
86671
|
if (isJsxAttribute(attributeDecl)) {
|
|
86671
86672
|
const exprType = checkJsxAttribute(attributeDecl, checkMode);
|
|
86672
86673
|
objectFlags |= getObjectFlags(exprType) & 458752;
|
|
86673
|
-
const attributeSymbol = createSymbol(4 |
|
|
86674
|
-
attributeSymbol.declarations =
|
|
86675
|
-
attributeSymbol.parent =
|
|
86676
|
-
if (
|
|
86677
|
-
attributeSymbol.valueDeclaration =
|
|
86674
|
+
const attributeSymbol = createSymbol(4 | member2.flags, member2.escapedName);
|
|
86675
|
+
attributeSymbol.declarations = member2.declarations;
|
|
86676
|
+
attributeSymbol.parent = member2.parent;
|
|
86677
|
+
if (member2.valueDeclaration) {
|
|
86678
|
+
attributeSymbol.valueDeclaration = member2.valueDeclaration;
|
|
86678
86679
|
}
|
|
86679
86680
|
attributeSymbol.links.type = exprType;
|
|
86680
|
-
attributeSymbol.links.target =
|
|
86681
|
+
attributeSymbol.links.target = member2;
|
|
86681
86682
|
attributesTable.set(attributeSymbol.escapedName, attributeSymbol);
|
|
86682
86683
|
allAttributesTable == null ? void 0 : allAttributesTable.set(attributeSymbol.escapedName, attributeSymbol);
|
|
86683
86684
|
if (getEscapedTextOfJsxAttributeName(attributeDecl.name) === jsxChildrenPropertyName) {
|
|
86684
86685
|
explicitlySpecifyChildrenAttribute = true;
|
|
86685
86686
|
}
|
|
86686
86687
|
if (contextualType) {
|
|
86687
|
-
const prop = getPropertyOfType(contextualType,
|
|
86688
|
+
const prop = getPropertyOfType(contextualType, member2.escapedName);
|
|
86688
86689
|
if (prop && prop.declarations && isDeprecatedSymbol(prop) && isIdentifier(attributeDecl.name)) {
|
|
86689
86690
|
addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
|
|
86690
86691
|
}
|
|
@@ -94350,10 +94351,10 @@ ${lanes.join("\n")}
|
|
|
94350
94351
|
const instanceNames = /* @__PURE__ */ new Map();
|
|
94351
94352
|
const staticNames = /* @__PURE__ */ new Map();
|
|
94352
94353
|
const privateIdentifiers = /* @__PURE__ */ new Map();
|
|
94353
|
-
for (const
|
|
94354
|
-
if (
|
|
94355
|
-
for (const param of
|
|
94356
|
-
if (isParameterPropertyDeclaration(param,
|
|
94354
|
+
for (const member2 of node.members) {
|
|
94355
|
+
if (member2.kind === 177) {
|
|
94356
|
+
for (const param of member2.parameters) {
|
|
94357
|
+
if (isParameterPropertyDeclaration(param, member2) && !isBindingPattern(param.name)) {
|
|
94357
94358
|
addName(
|
|
94358
94359
|
instanceNames,
|
|
94359
94360
|
param.name,
|
|
@@ -94364,8 +94365,8 @@ ${lanes.join("\n")}
|
|
|
94364
94365
|
}
|
|
94365
94366
|
}
|
|
94366
94367
|
} else {
|
|
94367
|
-
const isStaticMember = isStatic(
|
|
94368
|
-
const name =
|
|
94368
|
+
const isStaticMember = isStatic(member2);
|
|
94369
|
+
const name = member2.name;
|
|
94369
94370
|
if (!name) {
|
|
94370
94371
|
continue;
|
|
94371
94372
|
}
|
|
@@ -94374,7 +94375,7 @@ ${lanes.join("\n")}
|
|
|
94374
94375
|
const names = isPrivate ? privateIdentifiers : isStaticMember ? staticNames : instanceNames;
|
|
94375
94376
|
const memberName = name && getEffectivePropertyNameForPropertyNameNode(name);
|
|
94376
94377
|
if (memberName) {
|
|
94377
|
-
switch (
|
|
94378
|
+
switch (member2.kind) {
|
|
94378
94379
|
case 178:
|
|
94379
94380
|
addName(names, name, memberName, 1 | privateStaticFlags);
|
|
94380
94381
|
break;
|
|
@@ -94415,9 +94416,9 @@ ${lanes.join("\n")}
|
|
|
94415
94416
|
}
|
|
94416
94417
|
}
|
|
94417
94418
|
function checkClassForStaticPropertyNameConflicts(node) {
|
|
94418
|
-
for (const
|
|
94419
|
-
const memberNameNode =
|
|
94420
|
-
const isStaticMember = isStatic(
|
|
94419
|
+
for (const member2 of node.members) {
|
|
94420
|
+
const memberNameNode = member2.name;
|
|
94421
|
+
const isStaticMember = isStatic(member2);
|
|
94421
94422
|
if (isStaticMember && memberNameNode) {
|
|
94422
94423
|
const memberName = getEffectivePropertyNameForPropertyNameNode(memberNameNode);
|
|
94423
94424
|
switch (memberName) {
|
|
@@ -94440,10 +94441,10 @@ ${lanes.join("\n")}
|
|
|
94440
94441
|
}
|
|
94441
94442
|
function checkObjectTypeForDuplicateDeclarations(node) {
|
|
94442
94443
|
const names = /* @__PURE__ */ new Map();
|
|
94443
|
-
for (const
|
|
94444
|
-
if (
|
|
94444
|
+
for (const member2 of node.members) {
|
|
94445
|
+
if (member2.kind === 172) {
|
|
94445
94446
|
let memberName;
|
|
94446
|
-
const name =
|
|
94447
|
+
const name = member2.name;
|
|
94447
94448
|
switch (name.kind) {
|
|
94448
94449
|
case 11:
|
|
94449
94450
|
case 9:
|
|
@@ -94456,8 +94457,8 @@ ${lanes.join("\n")}
|
|
|
94456
94457
|
continue;
|
|
94457
94458
|
}
|
|
94458
94459
|
if (names.get(memberName)) {
|
|
94459
|
-
error2(getNameOfDeclaration(
|
|
94460
|
-
error2(
|
|
94460
|
+
error2(getNameOfDeclaration(member2.symbol.valueDeclaration), Diagnostics.Duplicate_identifier_0, memberName);
|
|
94461
|
+
error2(member2.name, Diagnostics.Duplicate_identifier_0, memberName);
|
|
94461
94462
|
} else {
|
|
94462
94463
|
names.set(memberName, true);
|
|
94463
94464
|
}
|
|
@@ -95789,8 +95790,8 @@ ${lanes.join("\n")}
|
|
|
95789
95790
|
/* SetFunctionName */
|
|
95790
95791
|
);
|
|
95791
95792
|
} else {
|
|
95792
|
-
const
|
|
95793
|
-
if (
|
|
95793
|
+
const member2 = getFirstTransformableStaticClassElement(node);
|
|
95794
|
+
if (member2) {
|
|
95794
95795
|
checkExternalEmitHelpers(
|
|
95795
95796
|
firstDecorator,
|
|
95796
95797
|
4194304
|
|
@@ -96051,26 +96052,26 @@ ${lanes.join("\n")}
|
|
|
96051
96052
|
return isIdentifier(node) && idText(node).charCodeAt(0) === 95;
|
|
96052
96053
|
}
|
|
96053
96054
|
function checkUnusedClassMembers(node, addDiagnostic) {
|
|
96054
|
-
for (const
|
|
96055
|
-
switch (
|
|
96055
|
+
for (const member2 of node.members) {
|
|
96056
|
+
switch (member2.kind) {
|
|
96056
96057
|
case 175:
|
|
96057
96058
|
case 173:
|
|
96058
96059
|
case 178:
|
|
96059
96060
|
case 179:
|
|
96060
|
-
if (
|
|
96061
|
+
if (member2.kind === 179 && member2.symbol.flags & 32768) {
|
|
96061
96062
|
break;
|
|
96062
96063
|
}
|
|
96063
|
-
const symbol = getSymbolOfDeclaration(
|
|
96064
|
+
const symbol = getSymbolOfDeclaration(member2);
|
|
96064
96065
|
if (!symbol.isReferenced && (hasEffectiveModifier(
|
|
96065
|
-
|
|
96066
|
+
member2,
|
|
96066
96067
|
2
|
|
96067
96068
|
/* Private */
|
|
96068
|
-
) || isNamedDeclaration(
|
|
96069
|
-
addDiagnostic(
|
|
96069
|
+
) || isNamedDeclaration(member2) && isPrivateIdentifier(member2.name)) && !(member2.flags & 33554432)) {
|
|
96070
|
+
addDiagnostic(member2, 0, createDiagnosticForNode(member2.name, Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)));
|
|
96070
96071
|
}
|
|
96071
96072
|
break;
|
|
96072
96073
|
case 177:
|
|
96073
|
-
for (const parameter of
|
|
96074
|
+
for (const parameter of member2.parameters) {
|
|
96074
96075
|
if (!parameter.symbol.isReferenced && hasSyntacticModifier(
|
|
96075
96076
|
parameter,
|
|
96076
96077
|
2
|
|
@@ -96385,8 +96386,8 @@ ${lanes.join("\n")}
|
|
|
96385
96386
|
function checkReflectCollision(node) {
|
|
96386
96387
|
let hasCollision = false;
|
|
96387
96388
|
if (isClassExpression(node)) {
|
|
96388
|
-
for (const
|
|
96389
|
-
if (getNodeCheckFlags(
|
|
96389
|
+
for (const member2 of node.members) {
|
|
96390
|
+
if (getNodeCheckFlags(member2) & 2097152) {
|
|
96390
96391
|
hasCollision = true;
|
|
96391
96392
|
break;
|
|
96392
96393
|
}
|
|
@@ -97839,10 +97840,10 @@ ${lanes.join("\n")}
|
|
|
97839
97840
|
}
|
|
97840
97841
|
const typeDeclaration = symbol.valueDeclaration;
|
|
97841
97842
|
if (typeDeclaration && isClassLike(typeDeclaration)) {
|
|
97842
|
-
for (const
|
|
97843
|
-
if ((!isStaticIndex && !isStatic(
|
|
97844
|
-
const symbol2 = getSymbolOfDeclaration(
|
|
97845
|
-
checkIndexConstraintForProperty(type, symbol2, getTypeOfExpression(
|
|
97843
|
+
for (const member2 of typeDeclaration.members) {
|
|
97844
|
+
if ((!isStaticIndex && !isStatic(member2) || isStaticIndex && isStatic(member2)) && !hasBindableName(member2)) {
|
|
97845
|
+
const symbol2 = getSymbolOfDeclaration(member2);
|
|
97846
|
+
checkIndexConstraintForProperty(type, symbol2, getTypeOfExpression(member2.name.expression), getNonMissingTypeOfSymbol(symbol2));
|
|
97846
97847
|
}
|
|
97847
97848
|
}
|
|
97848
97849
|
}
|
|
@@ -98055,20 +98056,20 @@ ${lanes.join("\n")}
|
|
|
98055
98056
|
const willTransformPrivateElementsOrClassStaticBlocks = languageVersion < LanguageFeatureMinimumTarget.PrivateNamesAndClassStaticBlocks || languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators;
|
|
98056
98057
|
const willTransformInitializers = !emitStandardClassFields;
|
|
98057
98058
|
if (willTransformStaticElementsOfDecoratedClass || willTransformPrivateElementsOrClassStaticBlocks) {
|
|
98058
|
-
for (const
|
|
98059
|
+
for (const member2 of node.members) {
|
|
98059
98060
|
if (willTransformStaticElementsOfDecoratedClass && classElementOrClassElementParameterIsDecorated(
|
|
98060
98061
|
/*useLegacyDecorators*/
|
|
98061
98062
|
false,
|
|
98062
|
-
|
|
98063
|
+
member2,
|
|
98063
98064
|
node
|
|
98064
98065
|
)) {
|
|
98065
98066
|
return firstOrUndefined(getDecorators(node)) ?? node;
|
|
98066
98067
|
} else if (willTransformPrivateElementsOrClassStaticBlocks) {
|
|
98067
|
-
if (isClassStaticBlockDeclaration(
|
|
98068
|
-
return
|
|
98069
|
-
} else if (isStatic(
|
|
98070
|
-
if (isPrivateIdentifierClassElementDeclaration(
|
|
98071
|
-
return
|
|
98068
|
+
if (isClassStaticBlockDeclaration(member2)) {
|
|
98069
|
+
return member2;
|
|
98070
|
+
} else if (isStatic(member2)) {
|
|
98071
|
+
if (isPrivateIdentifierClassElementDeclaration(member2) || willTransformInitializers && isInitializedProperty(member2)) {
|
|
98072
|
+
return member2;
|
|
98072
98073
|
}
|
|
98073
98074
|
}
|
|
98074
98075
|
}
|
|
@@ -98269,13 +98270,13 @@ ${lanes.join("\n")}
|
|
|
98269
98270
|
const baseTypes = baseTypeNode && getBaseTypes(type);
|
|
98270
98271
|
const baseWithThis = (baseTypes == null ? void 0 : baseTypes.length) ? getTypeWithThisArgument(first(baseTypes), type.thisType) : void 0;
|
|
98271
98272
|
const baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
98272
|
-
for (const
|
|
98273
|
-
if (hasAmbientModifier(
|
|
98273
|
+
for (const member2 of node.members) {
|
|
98274
|
+
if (hasAmbientModifier(member2)) {
|
|
98274
98275
|
continue;
|
|
98275
98276
|
}
|
|
98276
|
-
if (isConstructorDeclaration(
|
|
98277
|
-
forEach(
|
|
98278
|
-
if (isParameterPropertyDeclaration(param,
|
|
98277
|
+
if (isConstructorDeclaration(member2)) {
|
|
98278
|
+
forEach(member2.parameters, (param) => {
|
|
98279
|
+
if (isParameterPropertyDeclaration(param, member2)) {
|
|
98279
98280
|
checkExistingMemberForOverrideModifier(
|
|
98280
98281
|
node,
|
|
98281
98282
|
staticType,
|
|
@@ -98297,14 +98298,14 @@ ${lanes.join("\n")}
|
|
|
98297
98298
|
baseWithThis,
|
|
98298
98299
|
type,
|
|
98299
98300
|
typeWithThis,
|
|
98300
|
-
|
|
98301
|
+
member2,
|
|
98301
98302
|
/*memberIsParameterProperty*/
|
|
98302
98303
|
false
|
|
98303
98304
|
);
|
|
98304
98305
|
}
|
|
98305
98306
|
}
|
|
98306
|
-
function checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis,
|
|
98307
|
-
const declaredProp =
|
|
98307
|
+
function checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, member2, memberIsParameterProperty, reportErrors2 = true) {
|
|
98308
|
+
const declaredProp = member2.name && getSymbolAtLocation(member2.name) || getSymbolAtLocation(member2);
|
|
98308
98309
|
if (!declaredProp) {
|
|
98309
98310
|
return 0;
|
|
98310
98311
|
}
|
|
@@ -98315,18 +98316,18 @@ ${lanes.join("\n")}
|
|
|
98315
98316
|
baseWithThis,
|
|
98316
98317
|
type,
|
|
98317
98318
|
typeWithThis,
|
|
98318
|
-
hasOverrideModifier(
|
|
98319
|
-
hasAbstractModifier(
|
|
98320
|
-
isStatic(
|
|
98319
|
+
hasOverrideModifier(member2),
|
|
98320
|
+
hasAbstractModifier(member2),
|
|
98321
|
+
isStatic(member2),
|
|
98321
98322
|
memberIsParameterProperty,
|
|
98322
98323
|
declaredProp,
|
|
98323
|
-
reportErrors2 ?
|
|
98324
|
+
reportErrors2 ? member2 : void 0
|
|
98324
98325
|
);
|
|
98325
98326
|
}
|
|
98326
|
-
function checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, memberHasOverrideModifier, memberHasAbstractModifier, memberIsStatic, memberIsParameterProperty,
|
|
98327
|
+
function checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, memberHasOverrideModifier, memberHasAbstractModifier, memberIsStatic, memberIsParameterProperty, member2, errorNode) {
|
|
98327
98328
|
const isJs = isInJSFile(node);
|
|
98328
98329
|
const nodeInAmbientContext = !!(node.flags & 33554432);
|
|
98329
|
-
if (memberHasOverrideModifier && (
|
|
98330
|
+
if (memberHasOverrideModifier && (member2 == null ? void 0 : member2.valueDeclaration) && isClassElement(member2.valueDeclaration) && member2.valueDeclaration.name && isNonBindableDynamicName(member2.valueDeclaration.name)) {
|
|
98330
98331
|
error2(
|
|
98331
98332
|
errorNode,
|
|
98332
98333
|
isJs ? Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic : Diagnostics.This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic
|
|
@@ -98336,12 +98337,12 @@ ${lanes.join("\n")}
|
|
|
98336
98337
|
if (baseWithThis && (memberHasOverrideModifier || compilerOptions.noImplicitOverride)) {
|
|
98337
98338
|
const thisType = memberIsStatic ? staticType : typeWithThis;
|
|
98338
98339
|
const baseType = memberIsStatic ? baseStaticType : baseWithThis;
|
|
98339
|
-
const prop = getPropertyOfType(thisType,
|
|
98340
|
-
const baseProp = getPropertyOfType(baseType,
|
|
98340
|
+
const prop = getPropertyOfType(thisType, member2.escapedName);
|
|
98341
|
+
const baseProp = getPropertyOfType(baseType, member2.escapedName);
|
|
98341
98342
|
const baseClassName = typeToString(baseWithThis);
|
|
98342
98343
|
if (prop && !baseProp && memberHasOverrideModifier) {
|
|
98343
98344
|
if (errorNode) {
|
|
98344
|
-
const suggestion = getSuggestedSymbolForNonexistentClassMember(symbolName(
|
|
98345
|
+
const suggestion = getSuggestedSymbolForNonexistentClassMember(symbolName(member2), baseType);
|
|
98345
98346
|
suggestion ? error2(
|
|
98346
98347
|
errorNode,
|
|
98347
98348
|
isJs ? Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1 : Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1,
|
|
@@ -98387,11 +98388,11 @@ ${lanes.join("\n")}
|
|
|
98387
98388
|
}
|
|
98388
98389
|
function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
|
|
98389
98390
|
let issuedMemberError = false;
|
|
98390
|
-
for (const
|
|
98391
|
-
if (isStatic(
|
|
98391
|
+
for (const member2 of node.members) {
|
|
98392
|
+
if (isStatic(member2)) {
|
|
98392
98393
|
continue;
|
|
98393
98394
|
}
|
|
98394
|
-
const declaredProp =
|
|
98395
|
+
const declaredProp = member2.name && getSymbolAtLocation(member2.name) || getSymbolAtLocation(member2);
|
|
98395
98396
|
if (declaredProp) {
|
|
98396
98397
|
const prop = getPropertyOfType(typeWithThis, declaredProp.escapedName);
|
|
98397
98398
|
const baseProp = getPropertyOfType(baseWithThis, declaredProp.escapedName);
|
|
@@ -98407,7 +98408,7 @@ ${lanes.join("\n")}
|
|
|
98407
98408
|
if (!checkTypeAssignableTo(
|
|
98408
98409
|
getTypeOfSymbol(prop),
|
|
98409
98410
|
getTypeOfSymbol(baseProp),
|
|
98410
|
-
|
|
98411
|
+
member2.name || member2,
|
|
98411
98412
|
/*headMessage*/
|
|
98412
98413
|
void 0,
|
|
98413
98414
|
rootChain
|
|
@@ -98441,8 +98442,8 @@ ${lanes.join("\n")}
|
|
|
98441
98442
|
}
|
|
98442
98443
|
}
|
|
98443
98444
|
}
|
|
98444
|
-
function getMemberOverrideModifierStatus(node,
|
|
98445
|
-
if (!
|
|
98445
|
+
function getMemberOverrideModifierStatus(node, member2, memberSymbol) {
|
|
98446
|
+
if (!member2.name) {
|
|
98446
98447
|
return 0;
|
|
98447
98448
|
}
|
|
98448
98449
|
const classSymbol = getSymbolOfDeclaration(node);
|
|
@@ -98453,8 +98454,8 @@ ${lanes.join("\n")}
|
|
|
98453
98454
|
const baseTypes = baseTypeNode && getBaseTypes(type);
|
|
98454
98455
|
const baseWithThis = (baseTypes == null ? void 0 : baseTypes.length) ? getTypeWithThisArgument(first(baseTypes), type.thisType) : void 0;
|
|
98455
98456
|
const baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
98456
|
-
const memberHasOverrideModifier =
|
|
98457
|
-
|
|
98457
|
+
const memberHasOverrideModifier = member2.parent ? hasOverrideModifier(member2) : hasSyntacticModifier(
|
|
98458
|
+
member2,
|
|
98458
98459
|
16
|
|
98459
98460
|
/* Override */
|
|
98460
98461
|
);
|
|
@@ -98466,8 +98467,8 @@ ${lanes.join("\n")}
|
|
|
98466
98467
|
type,
|
|
98467
98468
|
typeWithThis,
|
|
98468
98469
|
memberHasOverrideModifier,
|
|
98469
|
-
hasAbstractModifier(
|
|
98470
|
-
isStatic(
|
|
98470
|
+
hasAbstractModifier(member2),
|
|
98471
|
+
isStatic(member2),
|
|
98471
98472
|
/*memberIsParameterProperty*/
|
|
98472
98473
|
false,
|
|
98473
98474
|
memberSymbol
|
|
@@ -98654,17 +98655,17 @@ ${lanes.join("\n")}
|
|
|
98654
98655
|
return;
|
|
98655
98656
|
}
|
|
98656
98657
|
const constructor = findConstructorDeclaration(node);
|
|
98657
|
-
for (const
|
|
98658
|
-
if (getEffectiveModifierFlags(
|
|
98658
|
+
for (const member2 of node.members) {
|
|
98659
|
+
if (getEffectiveModifierFlags(member2) & 128) {
|
|
98659
98660
|
continue;
|
|
98660
98661
|
}
|
|
98661
|
-
if (!isStatic(
|
|
98662
|
-
const propName =
|
|
98662
|
+
if (!isStatic(member2) && isPropertyWithoutInitializer(member2)) {
|
|
98663
|
+
const propName = member2.name;
|
|
98663
98664
|
if (isIdentifier(propName) || isPrivateIdentifier(propName) || isComputedPropertyName(propName)) {
|
|
98664
|
-
const type = getTypeOfSymbol(getSymbolOfDeclaration(
|
|
98665
|
+
const type = getTypeOfSymbol(getSymbolOfDeclaration(member2));
|
|
98665
98666
|
if (!(type.flags & 3 || containsUndefinedType(type))) {
|
|
98666
98667
|
if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
98667
|
-
error2(
|
|
98668
|
+
error2(member2.name, Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor, declarationNameToString(propName));
|
|
98668
98669
|
}
|
|
98669
98670
|
}
|
|
98670
98671
|
}
|
|
@@ -98762,36 +98763,36 @@ ${lanes.join("\n")}
|
|
|
98762
98763
|
nodeLinks2.flags |= 1024;
|
|
98763
98764
|
let autoValue = 0;
|
|
98764
98765
|
let previous;
|
|
98765
|
-
for (const
|
|
98766
|
-
const result = computeEnumMemberValue(
|
|
98767
|
-
getNodeLinks(
|
|
98766
|
+
for (const member2 of node.members) {
|
|
98767
|
+
const result = computeEnumMemberValue(member2, autoValue, previous);
|
|
98768
|
+
getNodeLinks(member2).enumMemberValue = result;
|
|
98768
98769
|
autoValue = typeof result.value === "number" ? result.value + 1 : void 0;
|
|
98769
|
-
previous =
|
|
98770
|
+
previous = member2;
|
|
98770
98771
|
}
|
|
98771
98772
|
}
|
|
98772
98773
|
}
|
|
98773
|
-
function computeEnumMemberValue(
|
|
98774
|
-
if (isComputedNonLiteralName(
|
|
98775
|
-
error2(
|
|
98776
|
-
} else if (isBigIntLiteral(
|
|
98777
|
-
error2(
|
|
98774
|
+
function computeEnumMemberValue(member2, autoValue, previous) {
|
|
98775
|
+
if (isComputedNonLiteralName(member2.name)) {
|
|
98776
|
+
error2(member2.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums);
|
|
98777
|
+
} else if (isBigIntLiteral(member2.name)) {
|
|
98778
|
+
error2(member2.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name);
|
|
98778
98779
|
} else {
|
|
98779
|
-
const text = getTextOfPropertyName(
|
|
98780
|
+
const text = getTextOfPropertyName(member2.name);
|
|
98780
98781
|
if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) {
|
|
98781
|
-
error2(
|
|
98782
|
+
error2(member2.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name);
|
|
98782
98783
|
}
|
|
98783
98784
|
}
|
|
98784
|
-
if (
|
|
98785
|
-
return computeConstantEnumMemberValue(
|
|
98785
|
+
if (member2.initializer) {
|
|
98786
|
+
return computeConstantEnumMemberValue(member2);
|
|
98786
98787
|
}
|
|
98787
|
-
if (
|
|
98788
|
+
if (member2.parent.flags & 33554432 && !isEnumConst(member2.parent)) {
|
|
98788
98789
|
return evaluatorResult(
|
|
98789
98790
|
/*value*/
|
|
98790
98791
|
void 0
|
|
98791
98792
|
);
|
|
98792
98793
|
}
|
|
98793
98794
|
if (autoValue === void 0) {
|
|
98794
|
-
error2(
|
|
98795
|
+
error2(member2.name, Diagnostics.Enum_member_must_have_initializer);
|
|
98795
98796
|
return evaluatorResult(
|
|
98796
98797
|
/*value*/
|
|
98797
98798
|
void 0
|
|
@@ -98801,17 +98802,17 @@ ${lanes.join("\n")}
|
|
|
98801
98802
|
const prevValue = getEnumMemberValue(previous);
|
|
98802
98803
|
if (!(typeof prevValue.value === "number" && !prevValue.resolvedOtherFiles)) {
|
|
98803
98804
|
error2(
|
|
98804
|
-
|
|
98805
|
+
member2.name,
|
|
98805
98806
|
Diagnostics.Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled
|
|
98806
98807
|
);
|
|
98807
98808
|
}
|
|
98808
98809
|
}
|
|
98809
98810
|
return evaluatorResult(autoValue);
|
|
98810
98811
|
}
|
|
98811
|
-
function computeConstantEnumMemberValue(
|
|
98812
|
-
const isConstEnum = isEnumConst(
|
|
98813
|
-
const initializer =
|
|
98814
|
-
const result = evaluate(initializer,
|
|
98812
|
+
function computeConstantEnumMemberValue(member2) {
|
|
98813
|
+
const isConstEnum = isEnumConst(member2.parent);
|
|
98814
|
+
const initializer = member2.initializer;
|
|
98815
|
+
const result = evaluate(initializer, member2);
|
|
98815
98816
|
if (result.value !== void 0) {
|
|
98816
98817
|
if (isConstEnum && typeof result.value === "number" && !isFinite(result.value)) {
|
|
98817
98818
|
error2(
|
|
@@ -98822,12 +98823,12 @@ ${lanes.join("\n")}
|
|
|
98822
98823
|
error2(
|
|
98823
98824
|
initializer,
|
|
98824
98825
|
Diagnostics._0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is_enabled,
|
|
98825
|
-
`${idText(
|
|
98826
|
+
`${idText(member2.parent.name)}.${getTextOfPropertyName(member2.name)}`
|
|
98826
98827
|
);
|
|
98827
98828
|
}
|
|
98828
98829
|
} else if (isConstEnum) {
|
|
98829
98830
|
error2(initializer, Diagnostics.const_enum_member_initializers_must_be_constant_expressions);
|
|
98830
|
-
} else if (
|
|
98831
|
+
} else if (member2.parent.flags & 33554432) {
|
|
98831
98832
|
error2(initializer, Diagnostics.In_ambient_enum_declarations_member_initializer_must_be_constant_expression);
|
|
98832
98833
|
} else {
|
|
98833
98834
|
checkTypeAssignableTo(checkExpression(initializer), numberType, initializer, Diagnostics.Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values);
|
|
@@ -98903,10 +98904,10 @@ ${lanes.join("\n")}
|
|
|
98903
98904
|
);
|
|
98904
98905
|
if (rootSymbol && rootSymbol.flags & 384) {
|
|
98905
98906
|
const name = escapeLeadingUnderscores(expr.argumentExpression.text);
|
|
98906
|
-
const
|
|
98907
|
-
if (
|
|
98908
|
-
Debug.assert(getSourceFileOfNode(
|
|
98909
|
-
return location ? evaluateEnumMember(expr,
|
|
98907
|
+
const member2 = rootSymbol.exports.get(name);
|
|
98908
|
+
if (member2) {
|
|
98909
|
+
Debug.assert(getSourceFileOfNode(member2.valueDeclaration) === getSourceFileOfNode(rootSymbol.valueDeclaration));
|
|
98910
|
+
return location ? evaluateEnumMember(expr, member2, location) : getEnumMemberValue(member2.valueDeclaration);
|
|
98910
98911
|
}
|
|
98911
98912
|
}
|
|
98912
98913
|
}
|
|
@@ -99758,7 +99759,7 @@ ${lanes.join("\n")}
|
|
|
99758
99759
|
if (flags & (1920 | 384)) {
|
|
99759
99760
|
return;
|
|
99760
99761
|
}
|
|
99761
|
-
const exportedDeclarationsCount = countWhere(declarations,
|
|
99762
|
+
const exportedDeclarationsCount = countWhere(declarations, and24(isNotOverloadAndNotAccessor, not2(isInterfaceDeclaration)));
|
|
99762
99763
|
if (flags & 524288 && exportedDeclarationsCount <= 2) {
|
|
99763
99764
|
return;
|
|
99764
99765
|
}
|
|
@@ -101513,9 +101514,9 @@ ${lanes.join("\n")}
|
|
|
101513
101514
|
true
|
|
101514
101515
|
) : void 0);
|
|
101515
101516
|
if (symbol && symbol.flags & 8) {
|
|
101516
|
-
const
|
|
101517
|
-
if (isEnumConst(
|
|
101518
|
-
return getEnumMemberValue(
|
|
101517
|
+
const member2 = symbol.valueDeclaration;
|
|
101518
|
+
if (isEnumConst(member2.parent)) {
|
|
101519
|
+
return getEnumMemberValue(member2).value;
|
|
101519
101520
|
}
|
|
101520
101521
|
}
|
|
101521
101522
|
return void 0;
|
|
@@ -106772,17 +106773,17 @@ ${lanes.join("\n")}
|
|
|
106772
106773
|
function getStaticPropertiesAndClassStaticBlock(node) {
|
|
106773
106774
|
return filter(node.members, isStaticPropertyDeclarationOrClassStaticBlockDeclaration);
|
|
106774
106775
|
}
|
|
106775
|
-
function isInitializedOrStaticProperty(
|
|
106776
|
-
return isPropertyDeclaration(
|
|
106776
|
+
function isInitializedOrStaticProperty(member2, requireInitializer, isStatic2) {
|
|
106777
|
+
return isPropertyDeclaration(member2) && (!!member2.initializer || !requireInitializer) && hasStaticModifier(member2) === isStatic2;
|
|
106777
106778
|
}
|
|
106778
|
-
function isStaticPropertyDeclaration(
|
|
106779
|
-
return isPropertyDeclaration(
|
|
106779
|
+
function isStaticPropertyDeclaration(member2) {
|
|
106780
|
+
return isPropertyDeclaration(member2) && hasStaticModifier(member2);
|
|
106780
106781
|
}
|
|
106781
|
-
function isInitializedProperty(
|
|
106782
|
-
return
|
|
106782
|
+
function isInitializedProperty(member2) {
|
|
106783
|
+
return member2.kind === 173 && member2.initializer !== void 0;
|
|
106783
106784
|
}
|
|
106784
|
-
function isNonStaticMethodOrAccessorWithPrivateName(
|
|
106785
|
-
return !isStatic(
|
|
106785
|
+
function isNonStaticMethodOrAccessorWithPrivateName(member2) {
|
|
106786
|
+
return !isStatic(member2) && (isMethodOrAccessor(member2) || isAutoAccessorPropertyDeclaration(member2)) && isPrivateIdentifier(member2.name);
|
|
106786
106787
|
}
|
|
106787
106788
|
function getDecoratorsOfParameters(node) {
|
|
106788
106789
|
let decorators;
|
|
@@ -106814,24 +106815,24 @@ ${lanes.join("\n")}
|
|
|
106814
106815
|
parameters
|
|
106815
106816
|
};
|
|
106816
106817
|
}
|
|
106817
|
-
function getAllDecoratorsOfClassElement(
|
|
106818
|
-
switch (
|
|
106818
|
+
function getAllDecoratorsOfClassElement(member2, parent2, useLegacyDecorators) {
|
|
106819
|
+
switch (member2.kind) {
|
|
106819
106820
|
case 178:
|
|
106820
106821
|
case 179:
|
|
106821
106822
|
if (!useLegacyDecorators) {
|
|
106822
106823
|
return getAllDecoratorsOfMethod(
|
|
106823
|
-
|
|
106824
|
+
member2,
|
|
106824
106825
|
/*useLegacyDecorators*/
|
|
106825
106826
|
false
|
|
106826
106827
|
);
|
|
106827
106828
|
}
|
|
106828
106829
|
return getAllDecoratorsOfAccessors(
|
|
106829
|
-
|
|
106830
|
+
member2,
|
|
106830
106831
|
parent2);
|
|
106831
106832
|
case 175:
|
|
106832
|
-
return getAllDecoratorsOfMethod(
|
|
106833
|
+
return getAllDecoratorsOfMethod(member2, useLegacyDecorators);
|
|
106833
106834
|
case 173:
|
|
106834
|
-
return getAllDecoratorsOfProperty(
|
|
106835
|
+
return getAllDecoratorsOfProperty(member2);
|
|
106835
106836
|
default:
|
|
106836
106837
|
return void 0;
|
|
106837
106838
|
}
|
|
@@ -108372,8 +108373,8 @@ ${lanes.join("\n")}
|
|
|
108372
108373
|
}
|
|
108373
108374
|
return false;
|
|
108374
108375
|
}
|
|
108375
|
-
function getExpressionForPropertyName(
|
|
108376
|
-
const name =
|
|
108376
|
+
function getExpressionForPropertyName(member2, generateNameForComputedPropertyName) {
|
|
108377
|
+
const name = member2.name;
|
|
108377
108378
|
if (isPrivateIdentifier(name)) {
|
|
108378
108379
|
return factory2.createIdentifier("");
|
|
108379
108380
|
} else if (isComputedPropertyName(name)) {
|
|
@@ -108384,9 +108385,9 @@ ${lanes.join("\n")}
|
|
|
108384
108385
|
return factory2.cloneNode(name);
|
|
108385
108386
|
}
|
|
108386
108387
|
}
|
|
108387
|
-
function visitPropertyNameOfClassElement(
|
|
108388
|
-
const name =
|
|
108389
|
-
if (legacyDecorators && isComputedPropertyName(name) && hasDecorators(
|
|
108388
|
+
function visitPropertyNameOfClassElement(member2) {
|
|
108389
|
+
const name = member2.name;
|
|
108390
|
+
if (legacyDecorators && isComputedPropertyName(name) && hasDecorators(member2)) {
|
|
108390
108391
|
const expression = visitNode(name.expression, visitor, isExpression);
|
|
108391
108392
|
Debug.assert(expression);
|
|
108392
108393
|
const innerExpression = skipPartiallyEmittedExpressions(expression);
|
|
@@ -108956,11 +108957,11 @@ ${lanes.join("\n")}
|
|
|
108956
108957
|
true
|
|
108957
108958
|
);
|
|
108958
108959
|
}
|
|
108959
|
-
function transformEnumMember(
|
|
108960
|
+
function transformEnumMember(member2) {
|
|
108960
108961
|
const name = getExpressionForPropertyName(
|
|
108961
|
-
|
|
108962
|
-
const evaluated = resolver.getEnumMemberValue(
|
|
108963
|
-
const valueExpression = transformEnumMemberDeclarationValue(
|
|
108962
|
+
member2);
|
|
108963
|
+
const evaluated = resolver.getEnumMemberValue(member2);
|
|
108964
|
+
const valueExpression = transformEnumMemberDeclarationValue(member2, evaluated == null ? void 0 : evaluated.value);
|
|
108964
108965
|
const innerAssignment = factory2.createAssignment(
|
|
108965
108966
|
factory2.createElementAccessExpression(
|
|
108966
108967
|
currentNamespaceContainerName,
|
|
@@ -108979,19 +108980,19 @@ ${lanes.join("\n")}
|
|
|
108979
108980
|
factory2.createExpressionStatement(
|
|
108980
108981
|
setTextRange(
|
|
108981
108982
|
outerAssignment,
|
|
108982
|
-
|
|
108983
|
+
member2
|
|
108983
108984
|
)
|
|
108984
108985
|
),
|
|
108985
|
-
|
|
108986
|
+
member2
|
|
108986
108987
|
);
|
|
108987
108988
|
}
|
|
108988
|
-
function transformEnumMemberDeclarationValue(
|
|
108989
|
+
function transformEnumMemberDeclarationValue(member2, constantValue) {
|
|
108989
108990
|
if (constantValue !== void 0) {
|
|
108990
108991
|
return typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41, factory2.createNumericLiteral(-constantValue)) : factory2.createNumericLiteral(constantValue);
|
|
108991
108992
|
} else {
|
|
108992
108993
|
enableSubstitutionForNonQualifiedEnumMembers();
|
|
108993
|
-
if (
|
|
108994
|
-
return Debug.checkDefined(visitNode(
|
|
108994
|
+
if (member2.initializer) {
|
|
108995
|
+
return Debug.checkDefined(visitNode(member2.initializer, visitor, isExpression));
|
|
108995
108996
|
} else {
|
|
108996
108997
|
return factory2.createVoidZero();
|
|
108997
108998
|
}
|
|
@@ -110585,42 +110586,42 @@ ${lanes.join("\n")}
|
|
|
110585
110586
|
let containsInitializedPublicInstanceFields = false;
|
|
110586
110587
|
let containsInstancePrivateElements = false;
|
|
110587
110588
|
let containsInstanceAutoAccessors = false;
|
|
110588
|
-
for (const
|
|
110589
|
-
if (isStatic(
|
|
110590
|
-
if (
|
|
110589
|
+
for (const member2 of node.members) {
|
|
110590
|
+
if (isStatic(member2)) {
|
|
110591
|
+
if (member2.name && (isPrivateIdentifier(member2.name) || isAutoAccessorPropertyDeclaration(member2)) && shouldTransformPrivateElementsOrClassStaticBlocks) {
|
|
110591
110592
|
facts |= 2;
|
|
110592
|
-
} else if (isAutoAccessorPropertyDeclaration(
|
|
110593
|
+
} else if (isAutoAccessorPropertyDeclaration(member2) && shouldTransformAutoAccessors === -1 && !node.name && !((_a = node.emitNode) == null ? void 0 : _a.classThis)) {
|
|
110593
110594
|
facts |= 2;
|
|
110594
110595
|
}
|
|
110595
|
-
if (isPropertyDeclaration(
|
|
110596
|
-
if (shouldTransformThisInStaticInitializers &&
|
|
110596
|
+
if (isPropertyDeclaration(member2) || isClassStaticBlockDeclaration(member2)) {
|
|
110597
|
+
if (shouldTransformThisInStaticInitializers && member2.transformFlags & 16384) {
|
|
110597
110598
|
facts |= 8;
|
|
110598
110599
|
if (!(facts & 1)) {
|
|
110599
110600
|
facts |= 2;
|
|
110600
110601
|
}
|
|
110601
110602
|
}
|
|
110602
|
-
if (shouldTransformSuperInStaticInitializers &&
|
|
110603
|
+
if (shouldTransformSuperInStaticInitializers && member2.transformFlags & 134217728) {
|
|
110603
110604
|
if (!(facts & 1)) {
|
|
110604
110605
|
facts |= 2 | 4;
|
|
110605
110606
|
}
|
|
110606
110607
|
}
|
|
110607
110608
|
}
|
|
110608
|
-
} else if (!hasAbstractModifier(getOriginalNode(
|
|
110609
|
-
if (isAutoAccessorPropertyDeclaration(
|
|
110609
|
+
} else if (!hasAbstractModifier(getOriginalNode(member2))) {
|
|
110610
|
+
if (isAutoAccessorPropertyDeclaration(member2)) {
|
|
110610
110611
|
containsInstanceAutoAccessors = true;
|
|
110611
|
-
containsInstancePrivateElements || (containsInstancePrivateElements = isPrivateIdentifierClassElementDeclaration(
|
|
110612
|
-
} else if (isPrivateIdentifierClassElementDeclaration(
|
|
110612
|
+
containsInstancePrivateElements || (containsInstancePrivateElements = isPrivateIdentifierClassElementDeclaration(member2));
|
|
110613
|
+
} else if (isPrivateIdentifierClassElementDeclaration(member2)) {
|
|
110613
110614
|
containsInstancePrivateElements = true;
|
|
110614
110615
|
if (resolver.hasNodeCheckFlag(
|
|
110615
|
-
|
|
110616
|
+
member2,
|
|
110616
110617
|
262144
|
|
110617
110618
|
/* ContainsConstructorReference */
|
|
110618
110619
|
)) {
|
|
110619
110620
|
facts |= 2;
|
|
110620
110621
|
}
|
|
110621
|
-
} else if (isPropertyDeclaration(
|
|
110622
|
+
} else if (isPropertyDeclaration(member2)) {
|
|
110622
110623
|
containsPublicInstanceFields = true;
|
|
110623
|
-
containsInitializedPublicInstanceFields || (containsInitializedPublicInstanceFields = !!
|
|
110624
|
+
containsInitializedPublicInstanceFields || (containsInitializedPublicInstanceFields = !!member2.initializer);
|
|
110624
110625
|
}
|
|
110625
110626
|
}
|
|
110626
110627
|
}
|
|
@@ -110901,13 +110902,13 @@ ${lanes.join("\n")}
|
|
|
110901
110902
|
function transformClassMembers(node) {
|
|
110902
110903
|
const shouldTransformPrivateStaticElementsInClass = !!(getInternalEmitFlags(node) & 32);
|
|
110903
110904
|
if (shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformPrivateStaticElementsInFile) {
|
|
110904
|
-
for (const
|
|
110905
|
-
if (isPrivateIdentifierClassElementDeclaration(
|
|
110906
|
-
if (shouldTransformClassElementToWeakMap(
|
|
110907
|
-
addPrivateIdentifierToEnvironment(
|
|
110905
|
+
for (const member2 of node.members) {
|
|
110906
|
+
if (isPrivateIdentifierClassElementDeclaration(member2)) {
|
|
110907
|
+
if (shouldTransformClassElementToWeakMap(member2)) {
|
|
110908
|
+
addPrivateIdentifierToEnvironment(member2, member2.name, addPrivateIdentifierClassElementToEnvironment);
|
|
110908
110909
|
} else {
|
|
110909
110910
|
const privateEnv = getPrivateIdentifierEnvironment();
|
|
110910
|
-
setPrivateIdentifier(privateEnv,
|
|
110911
|
+
setPrivateIdentifier(privateEnv, member2.name, { kind: "untransformed" });
|
|
110911
110912
|
}
|
|
110912
110913
|
}
|
|
110913
110914
|
}
|
|
@@ -110917,16 +110918,16 @@ ${lanes.join("\n")}
|
|
|
110917
110918
|
}
|
|
110918
110919
|
}
|
|
110919
110920
|
if (shouldTransformAutoAccessorsInCurrentClass()) {
|
|
110920
|
-
for (const
|
|
110921
|
-
if (isAutoAccessorPropertyDeclaration(
|
|
110921
|
+
for (const member2 of node.members) {
|
|
110922
|
+
if (isAutoAccessorPropertyDeclaration(member2)) {
|
|
110922
110923
|
const storageName = factory2.getGeneratedPrivateNameForNode(
|
|
110923
|
-
|
|
110924
|
+
member2.name,
|
|
110924
110925
|
/*prefix*/
|
|
110925
110926
|
void 0,
|
|
110926
110927
|
"_accessor_storage"
|
|
110927
110928
|
);
|
|
110928
|
-
if (shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformPrivateStaticElementsInClass && hasStaticModifier(
|
|
110929
|
-
addPrivateIdentifierToEnvironment(
|
|
110929
|
+
if (shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformPrivateStaticElementsInClass && hasStaticModifier(member2)) {
|
|
110930
|
+
addPrivateIdentifierToEnvironment(member2, storageName, addPrivateIdentifierPropertyDeclarationToEnvironment);
|
|
110930
110931
|
} else {
|
|
110931
110932
|
const privateEnv = getPrivateIdentifierEnvironment();
|
|
110932
110933
|
setPrivateIdentifier(privateEnv, storageName, { kind: "untransformed" });
|
|
@@ -110983,7 +110984,7 @@ ${lanes.join("\n")}
|
|
|
110983
110984
|
membersArray = append(membersArray, classNamedEvaluationHelperBlock);
|
|
110984
110985
|
membersArray = append(membersArray, syntheticConstructor);
|
|
110985
110986
|
membersArray = append(membersArray, syntheticStaticBlock);
|
|
110986
|
-
const remainingMembers = classThisAssignmentBlock || classNamedEvaluationHelperBlock ? filter(members, (
|
|
110987
|
+
const remainingMembers = classThisAssignmentBlock || classNamedEvaluationHelperBlock ? filter(members, (member2) => member2 !== classThisAssignmentBlock && member2 !== classNamedEvaluationHelperBlock) : members;
|
|
110987
110988
|
membersArray = addRange(membersArray, remainingMembers);
|
|
110988
110989
|
members = setTextRange(
|
|
110989
110990
|
factory2.createNodeArray(membersArray),
|
|
@@ -112350,10 +112351,10 @@ ${lanes.join("\n")}
|
|
|
112350
112351
|
return some(parameterDecorators, decoratorContainsPrivateIdentifierInExpression);
|
|
112351
112352
|
}
|
|
112352
112353
|
function hasClassElementWithDecoratorContainingPrivateIdentifierInExpression(node) {
|
|
112353
|
-
for (const
|
|
112354
|
-
if (!canHaveDecorators(
|
|
112354
|
+
for (const member2 of node.members) {
|
|
112355
|
+
if (!canHaveDecorators(member2)) continue;
|
|
112355
112356
|
const allDecorators = getAllDecoratorsOfClassElement(
|
|
112356
|
-
|
|
112357
|
+
member2,
|
|
112357
112358
|
node,
|
|
112358
112359
|
/*useLegacyDecorators*/
|
|
112359
112360
|
true
|
|
@@ -112443,11 +112444,11 @@ ${lanes.join("\n")}
|
|
|
112443
112444
|
let members = visitNodes2(node.members, visitor, isClassElement);
|
|
112444
112445
|
let decorationStatements = [];
|
|
112445
112446
|
({ members, decorationStatements } = transformDecoratorsOfClassElements(node, members));
|
|
112446
|
-
const assignClassAliasInStaticBlock = languageVersion >= 9 && !!classAlias && some(members, (
|
|
112447
|
-
|
|
112447
|
+
const assignClassAliasInStaticBlock = languageVersion >= 9 && !!classAlias && some(members, (member2) => isPropertyDeclaration(member2) && hasSyntacticModifier(
|
|
112448
|
+
member2,
|
|
112448
112449
|
256
|
|
112449
112450
|
/* Static */
|
|
112450
|
-
) || isClassStaticBlockDeclaration(
|
|
112451
|
+
) || isClassStaticBlockDeclaration(member2));
|
|
112451
112452
|
if (assignClassAliasInStaticBlock) {
|
|
112452
112453
|
members = setTextRange(
|
|
112453
112454
|
factory2.createNodeArray([
|
|
@@ -112644,13 +112645,13 @@ ${lanes.join("\n")}
|
|
|
112644
112645
|
function addClassElementDecorationStatements(statements, node, isStatic2) {
|
|
112645
112646
|
addRange(statements, map(generateClassElementDecorationExpressions(node, isStatic2), (expr) => factory2.createExpressionStatement(expr)));
|
|
112646
112647
|
}
|
|
112647
|
-
function isDecoratedClassElement(
|
|
112648
|
+
function isDecoratedClassElement(member2, isStaticElement, parent2) {
|
|
112648
112649
|
return nodeOrChildIsDecorated(
|
|
112649
112650
|
/*useLegacyDecorators*/
|
|
112650
112651
|
true,
|
|
112651
|
-
|
|
112652
|
+
member2,
|
|
112652
112653
|
parent2
|
|
112653
|
-
) && isStaticElement === isStatic(
|
|
112654
|
+
) && isStaticElement === isStatic(member2);
|
|
112654
112655
|
}
|
|
112655
112656
|
function getDecoratedClassElements(node, isStatic2) {
|
|
112656
112657
|
return filter(node.members, (m) => isDecoratedClassElement(m, isStatic2, node));
|
|
@@ -112658,14 +112659,14 @@ ${lanes.join("\n")}
|
|
|
112658
112659
|
function generateClassElementDecorationExpressions(node, isStatic2) {
|
|
112659
112660
|
const members = getDecoratedClassElements(node, isStatic2);
|
|
112660
112661
|
let expressions;
|
|
112661
|
-
for (const
|
|
112662
|
-
expressions = append(expressions, generateClassElementDecorationExpression(node,
|
|
112662
|
+
for (const member2 of members) {
|
|
112663
|
+
expressions = append(expressions, generateClassElementDecorationExpression(node, member2));
|
|
112663
112664
|
}
|
|
112664
112665
|
return expressions;
|
|
112665
112666
|
}
|
|
112666
|
-
function generateClassElementDecorationExpression(node,
|
|
112667
|
+
function generateClassElementDecorationExpression(node, member2) {
|
|
112667
112668
|
const allDecorators = getAllDecoratorsOfClassElement(
|
|
112668
|
-
|
|
112669
|
+
member2,
|
|
112669
112670
|
node,
|
|
112670
112671
|
/*useLegacyDecorators*/
|
|
112671
112672
|
true
|
|
@@ -112674,17 +112675,17 @@ ${lanes.join("\n")}
|
|
|
112674
112675
|
if (!decoratorExpressions) {
|
|
112675
112676
|
return void 0;
|
|
112676
112677
|
}
|
|
112677
|
-
const prefix = getClassMemberPrefix(node,
|
|
112678
|
+
const prefix = getClassMemberPrefix(node, member2);
|
|
112678
112679
|
const memberName = getExpressionForPropertyName(
|
|
112679
|
-
|
|
112680
|
+
member2,
|
|
112680
112681
|
/*generateNameForComputedPropertyName*/
|
|
112681
112682
|
!hasSyntacticModifier(
|
|
112682
|
-
|
|
112683
|
+
member2,
|
|
112683
112684
|
128
|
|
112684
112685
|
/* Ambient */
|
|
112685
112686
|
)
|
|
112686
112687
|
);
|
|
112687
|
-
const descriptor = isPropertyDeclaration(
|
|
112688
|
+
const descriptor = isPropertyDeclaration(member2) && !hasAccessorModifier(member2) ? factory2.createVoidZero() : factory2.createNull();
|
|
112688
112689
|
const helper = emitHelpers().createDecorateHelper(
|
|
112689
112690
|
decoratorExpressions,
|
|
112690
112691
|
prefix,
|
|
@@ -112696,7 +112697,7 @@ ${lanes.join("\n")}
|
|
|
112696
112697
|
3072
|
|
112697
112698
|
/* NoComments */
|
|
112698
112699
|
);
|
|
112699
|
-
setSourceMapRange(helper, moveRangePastModifiers(
|
|
112700
|
+
setSourceMapRange(helper, moveRangePastModifiers(member2));
|
|
112700
112701
|
return helper;
|
|
112701
112702
|
}
|
|
112702
112703
|
function addConstructorDecorationStatement(statements, node) {
|
|
@@ -112762,8 +112763,8 @@ ${lanes.join("\n")}
|
|
|
112762
112763
|
}
|
|
112763
112764
|
return expressions;
|
|
112764
112765
|
}
|
|
112765
|
-
function getExpressionForPropertyName(
|
|
112766
|
-
const name =
|
|
112766
|
+
function getExpressionForPropertyName(member2, generateNameForComputedPropertyName) {
|
|
112767
|
+
const name = member2.name;
|
|
112767
112768
|
if (isPrivateIdentifier(name)) {
|
|
112768
112769
|
return factory2.createIdentifier("");
|
|
112769
112770
|
} else if (isComputedPropertyName(name)) {
|
|
@@ -112799,8 +112800,8 @@ ${lanes.join("\n")}
|
|
|
112799
112800
|
function getClassPrototype(node) {
|
|
112800
112801
|
return factory2.createPropertyAccessExpression(factory2.getDeclarationName(node), "prototype");
|
|
112801
112802
|
}
|
|
112802
|
-
function getClassMemberPrefix(node,
|
|
112803
|
-
return isStatic(
|
|
112803
|
+
function getClassMemberPrefix(node, member2) {
|
|
112804
|
+
return isStatic(member2) ? factory2.getDeclarationName(node) : getClassPrototype(node);
|
|
112804
112805
|
}
|
|
112805
112806
|
function onSubstituteNode(hint, node) {
|
|
112806
112807
|
node = previousOnSubstituteNode(hint, node);
|
|
@@ -113168,21 +113169,21 @@ ${lanes.join("\n")}
|
|
|
113168
113169
|
false,
|
|
113169
113170
|
node
|
|
113170
113171
|
)) {
|
|
113171
|
-
const needsUniqueClassThis = some(node.members, (
|
|
113172
|
+
const needsUniqueClassThis = some(node.members, (member2) => (isPrivateIdentifierClassElementDeclaration(member2) || isAutoAccessorPropertyDeclaration(member2)) && hasStaticModifier(member2));
|
|
113172
113173
|
classThis2 = factory2.createUniqueName(
|
|
113173
113174
|
"_classThis",
|
|
113174
113175
|
needsUniqueClassThis ? 16 | 8 : 16 | 32
|
|
113175
113176
|
/* FileLevel */
|
|
113176
113177
|
);
|
|
113177
113178
|
}
|
|
113178
|
-
for (const
|
|
113179
|
-
if (isMethodOrAccessor(
|
|
113179
|
+
for (const member2 of node.members) {
|
|
113180
|
+
if (isMethodOrAccessor(member2) && nodeOrChildIsDecorated(
|
|
113180
113181
|
/*useLegacyDecorators*/
|
|
113181
113182
|
false,
|
|
113182
|
-
|
|
113183
|
+
member2,
|
|
113183
113184
|
node
|
|
113184
113185
|
)) {
|
|
113185
|
-
if (hasStaticModifier(
|
|
113186
|
+
if (hasStaticModifier(member2)) {
|
|
113186
113187
|
if (!staticMethodExtraInitializersName) {
|
|
113187
113188
|
staticMethodExtraInitializersName = factory2.createUniqueName(
|
|
113188
113189
|
"_staticExtraInitializers",
|
|
@@ -113213,18 +113214,18 @@ ${lanes.join("\n")}
|
|
|
113213
113214
|
));
|
|
113214
113215
|
}
|
|
113215
113216
|
}
|
|
113216
|
-
if (isClassStaticBlockDeclaration(
|
|
113217
|
-
if (!isClassNamedEvaluationHelperBlock(
|
|
113217
|
+
if (isClassStaticBlockDeclaration(member2)) {
|
|
113218
|
+
if (!isClassNamedEvaluationHelperBlock(member2)) {
|
|
113218
113219
|
hasStaticInitializers = true;
|
|
113219
113220
|
}
|
|
113220
|
-
} else if (isPropertyDeclaration(
|
|
113221
|
-
if (hasStaticModifier(
|
|
113222
|
-
hasStaticInitializers || (hasStaticInitializers = !!
|
|
113221
|
+
} else if (isPropertyDeclaration(member2)) {
|
|
113222
|
+
if (hasStaticModifier(member2)) {
|
|
113223
|
+
hasStaticInitializers || (hasStaticInitializers = !!member2.initializer || hasDecorators(member2));
|
|
113223
113224
|
} else {
|
|
113224
|
-
hasNonAmbientInstanceFields || (hasNonAmbientInstanceFields = !isAmbientPropertyDeclaration(
|
|
113225
|
+
hasNonAmbientInstanceFields || (hasNonAmbientInstanceFields = !isAmbientPropertyDeclaration(member2));
|
|
113225
113226
|
}
|
|
113226
113227
|
}
|
|
113227
|
-
if ((isPrivateIdentifierClassElementDeclaration(
|
|
113228
|
+
if ((isPrivateIdentifierClassElementDeclaration(member2) || isAutoAccessorPropertyDeclaration(member2)) && hasStaticModifier(member2)) {
|
|
113228
113229
|
hasStaticPrivateClassElements = true;
|
|
113229
113230
|
}
|
|
113230
113231
|
if (staticMethodExtraInitializersName && instanceMethodExtraInitializersName && hasStaticInitializers && hasNonAmbientInstanceFields && hasStaticPrivateClassElements) {
|
|
@@ -113402,8 +113403,8 @@ ${lanes.join("\n")}
|
|
|
113402
113403
|
);
|
|
113403
113404
|
}
|
|
113404
113405
|
if (classInfo2.memberInfos) {
|
|
113405
|
-
forEachEntry(classInfo2.memberInfos, (memberInfo,
|
|
113406
|
-
if (isStatic(
|
|
113406
|
+
forEachEntry(classInfo2.memberInfos, (memberInfo, member2) => {
|
|
113407
|
+
if (isStatic(member2)) {
|
|
113407
113408
|
classDefinitionStatements.push(createLet(memberInfo.memberDecoratorsName));
|
|
113408
113409
|
if (memberInfo.memberInitializersName) {
|
|
113409
113410
|
classDefinitionStatements.push(createLet(memberInfo.memberInitializersName, factory2.createArrayLiteralExpression()));
|
|
@@ -113418,8 +113419,8 @@ ${lanes.join("\n")}
|
|
|
113418
113419
|
});
|
|
113419
113420
|
}
|
|
113420
113421
|
if (classInfo2.memberInfos) {
|
|
113421
|
-
forEachEntry(classInfo2.memberInfos, (memberInfo,
|
|
113422
|
-
if (!isStatic(
|
|
113422
|
+
forEachEntry(classInfo2.memberInfos, (memberInfo, member2) => {
|
|
113423
|
+
if (!isStatic(member2)) {
|
|
113423
113424
|
classDefinitionStatements.push(createLet(memberInfo.memberDecoratorsName));
|
|
113424
113425
|
if (memberInfo.memberInitializersName) {
|
|
113425
113426
|
classDefinitionStatements.push(createLet(memberInfo.memberInitializersName, factory2.createArrayLiteralExpression()));
|
|
@@ -113565,10 +113566,10 @@ ${lanes.join("\n")}
|
|
|
113565
113566
|
32
|
|
113566
113567
|
/* TransformPrivateStaticElements */
|
|
113567
113568
|
);
|
|
113568
|
-
for (const
|
|
113569
|
-
if ((isPrivateIdentifierClassElementDeclaration(
|
|
113569
|
+
for (const member2 of classExpression.members) {
|
|
113570
|
+
if ((isPrivateIdentifierClassElementDeclaration(member2) || isAutoAccessorPropertyDeclaration(member2)) && hasStaticModifier(member2)) {
|
|
113570
113571
|
addInternalEmitFlags(
|
|
113571
|
-
|
|
113572
|
+
member2,
|
|
113572
113573
|
32
|
|
113573
113574
|
/* TransformPrivateStaticElements */
|
|
113574
113575
|
);
|
|
@@ -113808,7 +113809,7 @@ ${lanes.join("\n")}
|
|
|
113808
113809
|
}
|
|
113809
113810
|
return updated;
|
|
113810
113811
|
}
|
|
113811
|
-
function partialTransformClassElement(
|
|
113812
|
+
function partialTransformClassElement(member2, classInfo2, createDescriptor) {
|
|
113812
113813
|
let referencedName;
|
|
113813
113814
|
let name;
|
|
113814
113815
|
let initializersName;
|
|
@@ -113816,42 +113817,42 @@ ${lanes.join("\n")}
|
|
|
113816
113817
|
let thisArg;
|
|
113817
113818
|
let descriptorName;
|
|
113818
113819
|
if (!classInfo2) {
|
|
113819
|
-
const modifiers2 = visitNodes2(
|
|
113820
|
+
const modifiers2 = visitNodes2(member2.modifiers, modifierVisitor, isModifier);
|
|
113820
113821
|
enterName();
|
|
113821
|
-
name = visitPropertyName(
|
|
113822
|
+
name = visitPropertyName(member2.name);
|
|
113822
113823
|
exitName();
|
|
113823
113824
|
return { modifiers: modifiers2, referencedName, name, initializersName, descriptorName, thisArg };
|
|
113824
113825
|
}
|
|
113825
113826
|
const memberDecorators = transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClassElement(
|
|
113826
|
-
|
|
113827
|
+
member2,
|
|
113827
113828
|
classInfo2.class,
|
|
113828
113829
|
/*useLegacyDecorators*/
|
|
113829
113830
|
false
|
|
113830
113831
|
));
|
|
113831
|
-
const modifiers = visitNodes2(
|
|
113832
|
+
const modifiers = visitNodes2(member2.modifiers, modifierVisitor, isModifier);
|
|
113832
113833
|
if (memberDecorators) {
|
|
113833
|
-
const memberDecoratorsName = createHelperVariable(
|
|
113834
|
+
const memberDecoratorsName = createHelperVariable(member2, "decorators");
|
|
113834
113835
|
const memberDecoratorsArray = factory2.createArrayLiteralExpression(memberDecorators);
|
|
113835
113836
|
const memberDecoratorsAssignment = factory2.createAssignment(memberDecoratorsName, memberDecoratorsArray);
|
|
113836
113837
|
const memberInfo = { memberDecoratorsName };
|
|
113837
113838
|
classInfo2.memberInfos ?? (classInfo2.memberInfos = /* @__PURE__ */ new Map());
|
|
113838
|
-
classInfo2.memberInfos.set(
|
|
113839
|
+
classInfo2.memberInfos.set(member2, memberInfo);
|
|
113839
113840
|
pendingExpressions ?? (pendingExpressions = []);
|
|
113840
113841
|
pendingExpressions.push(memberDecoratorsAssignment);
|
|
113841
|
-
const statements = isMethodOrAccessor(
|
|
113842
|
-
const kind = isGetAccessorDeclaration(
|
|
113842
|
+
const statements = isMethodOrAccessor(member2) || isAutoAccessorPropertyDeclaration(member2) ? isStatic(member2) ? classInfo2.staticNonFieldDecorationStatements ?? (classInfo2.staticNonFieldDecorationStatements = []) : classInfo2.nonStaticNonFieldDecorationStatements ?? (classInfo2.nonStaticNonFieldDecorationStatements = []) : isPropertyDeclaration(member2) && !isAutoAccessorPropertyDeclaration(member2) ? isStatic(member2) ? classInfo2.staticFieldDecorationStatements ?? (classInfo2.staticFieldDecorationStatements = []) : classInfo2.nonStaticFieldDecorationStatements ?? (classInfo2.nonStaticFieldDecorationStatements = []) : Debug.fail();
|
|
113843
|
+
const kind = isGetAccessorDeclaration(member2) ? "getter" : isSetAccessorDeclaration(member2) ? "setter" : isMethodDeclaration(member2) ? "method" : isAutoAccessorPropertyDeclaration(member2) ? "accessor" : isPropertyDeclaration(member2) ? "field" : Debug.fail();
|
|
113843
113844
|
let propertyName;
|
|
113844
|
-
if (isIdentifier(
|
|
113845
|
-
propertyName = { computed: false, name:
|
|
113846
|
-
} else if (isPropertyNameLiteral(
|
|
113847
|
-
propertyName = { computed: true, name: factory2.createStringLiteralFromNode(
|
|
113845
|
+
if (isIdentifier(member2.name) || isPrivateIdentifier(member2.name)) {
|
|
113846
|
+
propertyName = { computed: false, name: member2.name };
|
|
113847
|
+
} else if (isPropertyNameLiteral(member2.name)) {
|
|
113848
|
+
propertyName = { computed: true, name: factory2.createStringLiteralFromNode(member2.name) };
|
|
113848
113849
|
} else {
|
|
113849
|
-
const expression =
|
|
113850
|
+
const expression = member2.name.expression;
|
|
113850
113851
|
if (isPropertyNameLiteral(expression) && !isIdentifier(expression)) {
|
|
113851
113852
|
propertyName = { computed: true, name: factory2.createStringLiteralFromNode(expression) };
|
|
113852
113853
|
} else {
|
|
113853
113854
|
enterName();
|
|
113854
|
-
({ referencedName, name } = visitReferencedPropertyName(
|
|
113855
|
+
({ referencedName, name } = visitReferencedPropertyName(member2.name));
|
|
113855
113856
|
propertyName = { computed: true, name: referencedName };
|
|
113856
113857
|
exitName();
|
|
113857
113858
|
}
|
|
@@ -113859,48 +113860,48 @@ ${lanes.join("\n")}
|
|
|
113859
113860
|
const context2 = {
|
|
113860
113861
|
kind,
|
|
113861
113862
|
name: propertyName,
|
|
113862
|
-
static: isStatic(
|
|
113863
|
-
private: isPrivateIdentifier(
|
|
113863
|
+
static: isStatic(member2),
|
|
113864
|
+
private: isPrivateIdentifier(member2.name),
|
|
113864
113865
|
access: {
|
|
113865
113866
|
// 15.7.3 CreateDecoratorAccessObject (kind, name)
|
|
113866
113867
|
// 2. If _kind_ is ~field~, ~method~, ~accessor~, or ~getter~, then ...
|
|
113867
|
-
get: isPropertyDeclaration(
|
|
113868
|
+
get: isPropertyDeclaration(member2) || isGetAccessorDeclaration(member2) || isMethodDeclaration(member2),
|
|
113868
113869
|
// 3. If _kind_ is ~field~, ~accessor~, or ~setter~, then ...
|
|
113869
|
-
set: isPropertyDeclaration(
|
|
113870
|
+
set: isPropertyDeclaration(member2) || isSetAccessorDeclaration(member2)
|
|
113870
113871
|
},
|
|
113871
113872
|
metadata: classInfo2.metadataReference
|
|
113872
113873
|
};
|
|
113873
|
-
if (isMethodOrAccessor(
|
|
113874
|
-
const methodExtraInitializersName = isStatic(
|
|
113874
|
+
if (isMethodOrAccessor(member2)) {
|
|
113875
|
+
const methodExtraInitializersName = isStatic(member2) ? classInfo2.staticMethodExtraInitializersName : classInfo2.instanceMethodExtraInitializersName;
|
|
113875
113876
|
Debug.assertIsDefined(methodExtraInitializersName);
|
|
113876
113877
|
let descriptor;
|
|
113877
|
-
if (isPrivateIdentifierClassElementDeclaration(
|
|
113878
|
-
descriptor = createDescriptor(
|
|
113879
|
-
memberInfo.memberDescriptorName = descriptorName = createHelperVariable(
|
|
113878
|
+
if (isPrivateIdentifierClassElementDeclaration(member2) && createDescriptor) {
|
|
113879
|
+
descriptor = createDescriptor(member2, visitNodes2(modifiers, (node) => tryCast(node, isAsyncModifier), isModifier));
|
|
113880
|
+
memberInfo.memberDescriptorName = descriptorName = createHelperVariable(member2, "descriptor");
|
|
113880
113881
|
descriptor = factory2.createAssignment(descriptorName, descriptor);
|
|
113881
113882
|
}
|
|
113882
113883
|
const esDecorateExpression = emitHelpers().createESDecorateHelper(factory2.createThis(), descriptor ?? factory2.createNull(), memberDecoratorsName, context2, factory2.createNull(), methodExtraInitializersName);
|
|
113883
113884
|
const esDecorateStatement = factory2.createExpressionStatement(esDecorateExpression);
|
|
113884
|
-
setSourceMapRange(esDecorateStatement, moveRangePastDecorators(
|
|
113885
|
+
setSourceMapRange(esDecorateStatement, moveRangePastDecorators(member2));
|
|
113885
113886
|
statements.push(esDecorateStatement);
|
|
113886
|
-
} else if (isPropertyDeclaration(
|
|
113887
|
-
initializersName = memberInfo.memberInitializersName ?? (memberInfo.memberInitializersName = createHelperVariable(
|
|
113888
|
-
extraInitializersName = memberInfo.memberExtraInitializersName ?? (memberInfo.memberExtraInitializersName = createHelperVariable(
|
|
113889
|
-
if (isStatic(
|
|
113887
|
+
} else if (isPropertyDeclaration(member2)) {
|
|
113888
|
+
initializersName = memberInfo.memberInitializersName ?? (memberInfo.memberInitializersName = createHelperVariable(member2, "initializers"));
|
|
113889
|
+
extraInitializersName = memberInfo.memberExtraInitializersName ?? (memberInfo.memberExtraInitializersName = createHelperVariable(member2, "extraInitializers"));
|
|
113890
|
+
if (isStatic(member2)) {
|
|
113890
113891
|
thisArg = classInfo2.classThis;
|
|
113891
113892
|
}
|
|
113892
113893
|
let descriptor;
|
|
113893
|
-
if (isPrivateIdentifierClassElementDeclaration(
|
|
113894
|
+
if (isPrivateIdentifierClassElementDeclaration(member2) && hasAccessorModifier(member2) && createDescriptor) {
|
|
113894
113895
|
descriptor = createDescriptor(
|
|
113895
|
-
|
|
113896
|
+
member2,
|
|
113896
113897
|
/*modifiers*/
|
|
113897
113898
|
void 0
|
|
113898
113899
|
);
|
|
113899
|
-
memberInfo.memberDescriptorName = descriptorName = createHelperVariable(
|
|
113900
|
+
memberInfo.memberDescriptorName = descriptorName = createHelperVariable(member2, "descriptor");
|
|
113900
113901
|
descriptor = factory2.createAssignment(descriptorName, descriptor);
|
|
113901
113902
|
}
|
|
113902
113903
|
const esDecorateExpression = emitHelpers().createESDecorateHelper(
|
|
113903
|
-
isAutoAccessorPropertyDeclaration(
|
|
113904
|
+
isAutoAccessorPropertyDeclaration(member2) ? factory2.createThis() : factory2.createNull(),
|
|
113904
113905
|
descriptor ?? factory2.createNull(),
|
|
113905
113906
|
memberDecoratorsName,
|
|
113906
113907
|
context2,
|
|
@@ -113908,16 +113909,16 @@ ${lanes.join("\n")}
|
|
|
113908
113909
|
extraInitializersName
|
|
113909
113910
|
);
|
|
113910
113911
|
const esDecorateStatement = factory2.createExpressionStatement(esDecorateExpression);
|
|
113911
|
-
setSourceMapRange(esDecorateStatement, moveRangePastDecorators(
|
|
113912
|
+
setSourceMapRange(esDecorateStatement, moveRangePastDecorators(member2));
|
|
113912
113913
|
statements.push(esDecorateStatement);
|
|
113913
113914
|
}
|
|
113914
113915
|
}
|
|
113915
113916
|
if (name === void 0) {
|
|
113916
113917
|
enterName();
|
|
113917
|
-
name = visitPropertyName(
|
|
113918
|
+
name = visitPropertyName(member2.name);
|
|
113918
113919
|
exitName();
|
|
113919
113920
|
}
|
|
113920
|
-
if (!some(modifiers) && (isMethodDeclaration(
|
|
113921
|
+
if (!some(modifiers) && (isMethodDeclaration(member2) || isPropertyDeclaration(member2))) {
|
|
113921
113922
|
setEmitFlags(
|
|
113922
113923
|
name,
|
|
113923
113924
|
1024
|
|
@@ -120543,45 +120544,45 @@ ${lanes.join("\n")}
|
|
|
120543
120544
|
return statements;
|
|
120544
120545
|
}
|
|
120545
120546
|
function addClassMembers(statements, node) {
|
|
120546
|
-
for (const
|
|
120547
|
-
switch (
|
|
120547
|
+
for (const member2 of node.members) {
|
|
120548
|
+
switch (member2.kind) {
|
|
120548
120549
|
case 241:
|
|
120549
|
-
statements.push(transformSemicolonClassElementToStatement(
|
|
120550
|
+
statements.push(transformSemicolonClassElementToStatement(member2));
|
|
120550
120551
|
break;
|
|
120551
120552
|
case 175:
|
|
120552
|
-
statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node,
|
|
120553
|
+
statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member2), member2, node));
|
|
120553
120554
|
break;
|
|
120554
120555
|
case 178:
|
|
120555
120556
|
case 179:
|
|
120556
|
-
const accessors = getAllAccessorDeclarations(node.members,
|
|
120557
|
-
if (
|
|
120558
|
-
statements.push(transformAccessorsToStatement(getClassMemberPrefix(node,
|
|
120557
|
+
const accessors = getAllAccessorDeclarations(node.members, member2);
|
|
120558
|
+
if (member2 === accessors.firstAccessor) {
|
|
120559
|
+
statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member2), accessors, node));
|
|
120559
120560
|
}
|
|
120560
120561
|
break;
|
|
120561
120562
|
case 177:
|
|
120562
120563
|
case 176:
|
|
120563
120564
|
break;
|
|
120564
120565
|
default:
|
|
120565
|
-
Debug.failBadSyntaxKind(
|
|
120566
|
+
Debug.failBadSyntaxKind(member2, currentSourceFile && currentSourceFile.fileName);
|
|
120566
120567
|
break;
|
|
120567
120568
|
}
|
|
120568
120569
|
}
|
|
120569
120570
|
}
|
|
120570
|
-
function transformSemicolonClassElementToStatement(
|
|
120571
|
-
return setTextRange(factory2.createEmptyStatement(),
|
|
120571
|
+
function transformSemicolonClassElementToStatement(member2) {
|
|
120572
|
+
return setTextRange(factory2.createEmptyStatement(), member2);
|
|
120572
120573
|
}
|
|
120573
|
-
function transformClassMethodDeclarationToStatement(receiver,
|
|
120574
|
-
const commentRange = getCommentRange(
|
|
120575
|
-
const sourceMapRange = getSourceMapRange(
|
|
120574
|
+
function transformClassMethodDeclarationToStatement(receiver, member2, container) {
|
|
120575
|
+
const commentRange = getCommentRange(member2);
|
|
120576
|
+
const sourceMapRange = getSourceMapRange(member2);
|
|
120576
120577
|
const memberFunction = transformFunctionLikeToExpression(
|
|
120577
|
-
|
|
120578
|
+
member2,
|
|
120578
120579
|
/*location*/
|
|
120579
|
-
|
|
120580
|
+
member2,
|
|
120580
120581
|
/*name*/
|
|
120581
120582
|
void 0,
|
|
120582
120583
|
container
|
|
120583
120584
|
);
|
|
120584
|
-
const propertyName = visitNode(
|
|
120585
|
+
const propertyName = visitNode(member2.name, visitor, isPropertyName);
|
|
120585
120586
|
Debug.assert(propertyName);
|
|
120586
120587
|
let e;
|
|
120587
120588
|
if (!isPrivateIdentifier(propertyName) && getUseDefineForClassFields(context.getCompilerOptions())) {
|
|
@@ -120593,7 +120594,7 @@ ${lanes.join("\n")}
|
|
|
120593
120594
|
receiver,
|
|
120594
120595
|
propertyName,
|
|
120595
120596
|
/*location*/
|
|
120596
|
-
|
|
120597
|
+
member2.name
|
|
120597
120598
|
);
|
|
120598
120599
|
e = factory2.createAssignment(memberName, memberFunction);
|
|
120599
120600
|
}
|
|
@@ -120606,9 +120607,9 @@ ${lanes.join("\n")}
|
|
|
120606
120607
|
const statement = setTextRange(
|
|
120607
120608
|
factory2.createExpressionStatement(e),
|
|
120608
120609
|
/*location*/
|
|
120609
|
-
|
|
120610
|
+
member2
|
|
120610
120611
|
);
|
|
120611
|
-
setOriginalNode(statement,
|
|
120612
|
+
setOriginalNode(statement, member2);
|
|
120612
120613
|
setCommentRange(statement, commentRange);
|
|
120613
120614
|
setEmitFlags(
|
|
120614
120615
|
statement,
|
|
@@ -122847,8 +122848,8 @@ ${lanes.join("\n")}
|
|
|
122847
122848
|
}
|
|
122848
122849
|
return node;
|
|
122849
122850
|
}
|
|
122850
|
-
function getClassMemberPrefix(node,
|
|
122851
|
-
return isStatic(
|
|
122851
|
+
function getClassMemberPrefix(node, member2) {
|
|
122852
|
+
return isStatic(member2) ? factory2.getInternalName(node) : factory2.createPropertyAccessExpression(factory2.getInternalName(node), "prototype");
|
|
122852
122853
|
}
|
|
122853
122854
|
function hasSynthesizedDefaultSuperCall(constructor, hasExtendsClause) {
|
|
122854
122855
|
if (!constructor || !hasExtendsClause) {
|
|
@@ -130786,7 +130787,7 @@ ${lanes.join("\n")}
|
|
|
130786
130787
|
}));
|
|
130787
130788
|
getSymbolAccessibilityDiagnostic = oldDiag2;
|
|
130788
130789
|
}
|
|
130789
|
-
const hasPrivateIdentifier = some(input.members, (
|
|
130790
|
+
const hasPrivateIdentifier = some(input.members, (member2) => !!member2.name && isPrivateIdentifier(member2.name));
|
|
130790
130791
|
const privateIdentifier = hasPrivateIdentifier ? [
|
|
130791
130792
|
factory2.createPropertyDeclaration(
|
|
130792
130793
|
/*modifiers*/
|
|
@@ -157738,9 +157739,9 @@ interface Symbol {
|
|
|
157738
157739
|
break;
|
|
157739
157740
|
case 267:
|
|
157740
157741
|
startNode(node);
|
|
157741
|
-
for (const
|
|
157742
|
-
if (!isComputedProperty(
|
|
157743
|
-
addLeafNode(
|
|
157742
|
+
for (const member2 of node.members) {
|
|
157743
|
+
if (!isComputedProperty(member2)) {
|
|
157744
|
+
addLeafNode(member2);
|
|
157744
157745
|
}
|
|
157745
157746
|
}
|
|
157746
157747
|
endNode();
|
|
@@ -157749,8 +157750,8 @@ interface Symbol {
|
|
|
157749
157750
|
case 232:
|
|
157750
157751
|
case 265:
|
|
157751
157752
|
startNode(node);
|
|
157752
|
-
for (const
|
|
157753
|
-
addChildrenRecursively(
|
|
157753
|
+
for (const member2 of node.members) {
|
|
157754
|
+
addChildrenRecursively(member2);
|
|
157754
157755
|
}
|
|
157755
157756
|
endNode();
|
|
157756
157757
|
break;
|
|
@@ -158242,8 +158243,8 @@ interface Symbol {
|
|
|
158242
158243
|
function getInteriorModule(decl) {
|
|
158243
158244
|
return decl.body && isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl;
|
|
158244
158245
|
}
|
|
158245
|
-
function isComputedProperty(
|
|
158246
|
-
return !
|
|
158246
|
+
function isComputedProperty(member2) {
|
|
158247
|
+
return !member2.name || member2.name.kind === 168;
|
|
158247
158248
|
}
|
|
158248
158249
|
function getNodeSpan(node) {
|
|
158249
158250
|
return node.kind === 308 ? createTextSpanFromRange(node) : createTextSpanFromNode(node, curSourceFile);
|
|
@@ -163179,17 +163180,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
163179
163180
|
Debug.assert(members.length > 0, "Found no members");
|
|
163180
163181
|
let prevMember;
|
|
163181
163182
|
let allProperties = true;
|
|
163182
|
-
for (const
|
|
163183
|
-
if (
|
|
163183
|
+
for (const member2 of members) {
|
|
163184
|
+
if (member2.pos > maxPos) {
|
|
163184
163185
|
return prevMember || members[0];
|
|
163185
163186
|
}
|
|
163186
|
-
if (allProperties && !isPropertyDeclaration(
|
|
163187
|
+
if (allProperties && !isPropertyDeclaration(member2)) {
|
|
163187
163188
|
if (prevMember !== void 0) {
|
|
163188
|
-
return
|
|
163189
|
+
return member2;
|
|
163189
163190
|
}
|
|
163190
163191
|
allProperties = false;
|
|
163191
163192
|
}
|
|
163192
|
-
prevMember =
|
|
163193
|
+
prevMember = member2;
|
|
163193
163194
|
}
|
|
163194
163195
|
if (prevMember === void 0) return Debug.fail();
|
|
163195
163196
|
return prevMember;
|
|
@@ -165352,7 +165353,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
165352
165353
|
return true;
|
|
165353
165354
|
}
|
|
165354
165355
|
const childResult = [];
|
|
165355
|
-
const members = node.members.filter((
|
|
165356
|
+
const members = node.members.filter((member2) => chooseOverlappingNodes(span, member2, childResult));
|
|
165356
165357
|
if (members.length === node.members.length) {
|
|
165357
165358
|
addSourceElement(node, result);
|
|
165358
165359
|
return true;
|
|
@@ -167228,9 +167229,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
167228
167229
|
}
|
|
167229
167230
|
if (isValidCallHierarchyDeclaration(node)) {
|
|
167230
167231
|
if (isClassLike(node)) {
|
|
167231
|
-
for (const
|
|
167232
|
-
if (
|
|
167233
|
-
collect(
|
|
167232
|
+
for (const member2 of node.members) {
|
|
167233
|
+
if (member2.name && isComputedPropertyName(member2.name)) {
|
|
167234
|
+
collect(member2.name.expression);
|
|
167234
167235
|
}
|
|
167235
167236
|
}
|
|
167236
167237
|
}
|
|
@@ -167325,17 +167326,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
167325
167326
|
if (heritage) {
|
|
167326
167327
|
collect(heritage.expression);
|
|
167327
167328
|
}
|
|
167328
|
-
for (const
|
|
167329
|
-
if (canHaveModifiers(
|
|
167330
|
-
forEach(
|
|
167329
|
+
for (const member2 of node.members) {
|
|
167330
|
+
if (canHaveModifiers(member2)) {
|
|
167331
|
+
forEach(member2.modifiers, collect);
|
|
167331
167332
|
}
|
|
167332
|
-
if (isPropertyDeclaration(
|
|
167333
|
-
collect(
|
|
167334
|
-
} else if (isConstructorDeclaration(
|
|
167335
|
-
forEach(
|
|
167336
|
-
collect(
|
|
167337
|
-
} else if (isClassStaticBlockDeclaration(
|
|
167338
|
-
collect(
|
|
167333
|
+
if (isPropertyDeclaration(member2)) {
|
|
167334
|
+
collect(member2.initializer);
|
|
167335
|
+
} else if (isConstructorDeclaration(member2) && member2.body) {
|
|
167336
|
+
forEach(member2.parameters, collect);
|
|
167337
|
+
collect(member2.body);
|
|
167338
|
+
} else if (isClassStaticBlockDeclaration(member2)) {
|
|
167339
|
+
collect(member2);
|
|
167339
167340
|
}
|
|
167340
167341
|
}
|
|
167341
167342
|
}
|
|
@@ -168458,10 +168459,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
168458
168459
|
function createClassElementsFromSymbol(symbol) {
|
|
168459
168460
|
const memberElements = [];
|
|
168460
168461
|
if (symbol.exports) {
|
|
168461
|
-
symbol.exports.forEach((
|
|
168462
|
-
if (
|
|
168463
|
-
const firstDeclaration =
|
|
168464
|
-
if (
|
|
168462
|
+
symbol.exports.forEach((member2) => {
|
|
168463
|
+
if (member2.name === "prototype" && member2.declarations) {
|
|
168464
|
+
const firstDeclaration = member2.declarations[0];
|
|
168465
|
+
if (member2.declarations.length === 1 && isPropertyAccessExpression(firstDeclaration) && isBinaryExpression(firstDeclaration.parent) && firstDeclaration.parent.operatorToken.kind === 64 && isObjectLiteralExpression(firstDeclaration.parent.right)) {
|
|
168465
168466
|
const prototypes = firstDeclaration.parent.right;
|
|
168466
168467
|
createClassElement(
|
|
168467
168468
|
prototypes.symbol,
|
|
@@ -168471,7 +168472,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
168471
168472
|
);
|
|
168472
168473
|
}
|
|
168473
168474
|
} else {
|
|
168474
|
-
createClassElement(
|
|
168475
|
+
createClassElement(member2, [factory.createToken(
|
|
168475
168476
|
126
|
|
168476
168477
|
/* StaticKeyword */
|
|
168477
168478
|
)], memberElements);
|
|
@@ -168479,17 +168480,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
168479
168480
|
});
|
|
168480
168481
|
}
|
|
168481
168482
|
if (symbol.members) {
|
|
168482
|
-
symbol.members.forEach((
|
|
168483
|
+
symbol.members.forEach((member2, key) => {
|
|
168483
168484
|
var _a, _b, _c, _d;
|
|
168484
|
-
if (key === "constructor" &&
|
|
168485
|
+
if (key === "constructor" && member2.valueDeclaration) {
|
|
168485
168486
|
const prototypeAssignment = (_d = (_c = (_b = (_a = symbol.exports) == null ? void 0 : _a.get("prototype")) == null ? void 0 : _b.declarations) == null ? void 0 : _c[0]) == null ? void 0 : _d.parent;
|
|
168486
168487
|
if (prototypeAssignment && isBinaryExpression(prototypeAssignment) && isObjectLiteralExpression(prototypeAssignment.right) && some(prototypeAssignment.right.properties, isConstructorAssignment)) ; else {
|
|
168487
|
-
changes.delete(sourceFile,
|
|
168488
|
+
changes.delete(sourceFile, member2.valueDeclaration.parent);
|
|
168488
168489
|
}
|
|
168489
168490
|
return;
|
|
168490
168491
|
}
|
|
168491
168492
|
createClassElement(
|
|
168492
|
-
|
|
168493
|
+
member2,
|
|
168493
168494
|
/*modifiers*/
|
|
168494
168495
|
void 0,
|
|
168495
168496
|
memberElements
|
|
@@ -170546,7 +170547,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
170546
170547
|
const maybeHeritageClauseSymbol = getHeritageClauseSymbolTable(classDeclaration, checker);
|
|
170547
170548
|
const implementedType = checker.getTypeAtLocation(implementedTypeNode);
|
|
170548
170549
|
const implementedTypeSymbols = checker.getPropertiesOfType(implementedType);
|
|
170549
|
-
const nonPrivateAndNotExistedInHeritageClauseMembers = implementedTypeSymbols.filter(
|
|
170550
|
+
const nonPrivateAndNotExistedInHeritageClauseMembers = implementedTypeSymbols.filter(and24(symbolPointsToNonPrivateMember, (symbol) => !maybeHeritageClauseSymbol.has(symbol.escapedName)));
|
|
170550
170551
|
const classType = checker.getTypeAtLocation(classDeclaration);
|
|
170551
170552
|
const constructor = find(classDeclaration.members, (m) => isConstructorDeclaration(m));
|
|
170552
170553
|
if (!classType.getNumberIndexType()) {
|
|
@@ -170564,7 +170565,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
170564
170565
|
);
|
|
170565
170566
|
}
|
|
170566
170567
|
const importAdder = createImportAdder(sourceFile, context.program, preferences, context.host);
|
|
170567
|
-
createMissingMemberNodes(classDeclaration, nonPrivateAndNotExistedInHeritageClauseMembers, sourceFile, context, preferences, importAdder, (
|
|
170568
|
+
createMissingMemberNodes(classDeclaration, nonPrivateAndNotExistedInHeritageClauseMembers, sourceFile, context, preferences, importAdder, (member2) => insertInterfaceMemberNode(sourceFile, classDeclaration, member2));
|
|
170568
170569
|
importAdder.writeFixes(changeTracker);
|
|
170569
170570
|
function createMissingIndexSignatureDeclaration(type, kind) {
|
|
170570
170571
|
const indexInfoOfKind = checker.getIndexInfoOfType(type, kind);
|
|
@@ -172955,9 +172956,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
172955
172956
|
})
|
|
172956
172957
|
});
|
|
172957
172958
|
function createObjectTypeFromLabeledExpression(checker, label, expression) {
|
|
172958
|
-
const
|
|
172959
|
-
|
|
172960
|
-
const members = createSymbolTable([
|
|
172959
|
+
const member2 = checker.createSymbol(4, label.escapedText);
|
|
172960
|
+
member2.links.type = checker.getTypeAtLocation(expression);
|
|
172961
|
+
const members = createSymbolTable([member2]);
|
|
172961
172962
|
return checker.createAnonymousType(
|
|
172962
172963
|
/*symbol*/
|
|
172963
172964
|
void 0,
|
|
@@ -173484,9 +173485,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
173484
173485
|
}
|
|
173485
173486
|
function getNodeToInsertPropertyAfter(node) {
|
|
173486
173487
|
let res;
|
|
173487
|
-
for (const
|
|
173488
|
-
if (!isPropertyDeclaration(
|
|
173489
|
-
res =
|
|
173488
|
+
for (const member2 of node.members) {
|
|
173489
|
+
if (!isPropertyDeclaration(member2)) break;
|
|
173490
|
+
res = member2;
|
|
173490
173491
|
}
|
|
173491
173492
|
return res;
|
|
173492
173493
|
}
|
|
@@ -173548,8 +173549,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
173548
173549
|
importAdder.writeFixes(changes);
|
|
173549
173550
|
}
|
|
173550
173551
|
function addEnumMemberDeclaration(changes, checker, { token, parentDeclaration }) {
|
|
173551
|
-
const hasStringInitializer = some(parentDeclaration.members, (
|
|
173552
|
-
const type = checker.getTypeAtLocation(
|
|
173552
|
+
const hasStringInitializer = some(parentDeclaration.members, (member2) => {
|
|
173553
|
+
const type = checker.getTypeAtLocation(member2);
|
|
173553
173554
|
return !!(type && type.flags & 402653316);
|
|
173554
173555
|
});
|
|
173555
173556
|
const sourceFile = parentDeclaration.getSourceFile();
|
|
@@ -174205,7 +174206,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
174205
174206
|
const instantiatedExtendsType = checker.getTypeAtLocation(extendsNode);
|
|
174206
174207
|
const abstractAndNonPrivateExtendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType).filter(symbolPointsToNonPrivateAndAbstractMember);
|
|
174207
174208
|
const importAdder = createImportAdder(sourceFile, context.program, preferences, context.host);
|
|
174208
|
-
createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, sourceFile, context, preferences, importAdder, (
|
|
174209
|
+
createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, sourceFile, context, preferences, importAdder, (member2) => changeTracker.insertMemberAtStart(sourceFile, classDeclaration, member2));
|
|
174209
174210
|
importAdder.writeFixes(changeTracker);
|
|
174210
174211
|
}
|
|
174211
174212
|
function symbolPointsToNonPrivateAndAbstractMember(symbol) {
|
|
@@ -178997,7 +178998,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
178997
178998
|
}
|
|
178998
178999
|
function doChange39(changes, sourceFile, { indexSignature, container }) {
|
|
178999
179000
|
const members = isInterfaceDeclaration(container) ? container.members : container.type.members;
|
|
179000
|
-
const otherMembers = members.filter((
|
|
179001
|
+
const otherMembers = members.filter((member2) => !isIndexSignatureDeclaration(member2));
|
|
179001
179002
|
const parameter = first(indexSignature.parameters);
|
|
179002
179003
|
const mappedTypeParameter = factory.createTypeParameterDeclaration(
|
|
179003
179004
|
/*modifiers*/
|
|
@@ -182209,12 +182210,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
182209
182210
|
if (isInJSFile(location)) {
|
|
182210
182211
|
return;
|
|
182211
182212
|
}
|
|
182212
|
-
members.forEach((
|
|
182213
|
-
if (!isObjectLiteralMethodSymbol(
|
|
182213
|
+
members.forEach((member2) => {
|
|
182214
|
+
if (!isObjectLiteralMethodSymbol(member2)) {
|
|
182214
182215
|
return;
|
|
182215
182216
|
}
|
|
182216
182217
|
const displayName = getCompletionEntryDisplayNameForSymbol(
|
|
182217
|
-
|
|
182218
|
+
member2,
|
|
182218
182219
|
getEmitScriptTarget(compilerOptions),
|
|
182219
182220
|
/*origin*/
|
|
182220
182221
|
void 0,
|
|
@@ -182227,7 +182228,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
182227
182228
|
}
|
|
182228
182229
|
const { name } = displayName;
|
|
182229
182230
|
const entryProps = getEntryForObjectLiteralMethodCompletion(
|
|
182230
|
-
|
|
182231
|
+
member2,
|
|
182231
182232
|
name,
|
|
182232
182233
|
enclosingDeclaration,
|
|
182233
182234
|
program,
|
|
@@ -182242,7 +182243,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
182242
182243
|
const origin = { kind: 128, ...entryProps };
|
|
182243
182244
|
flags |= 32;
|
|
182244
182245
|
symbolToOriginInfoMap[symbols.length] = origin;
|
|
182245
|
-
symbols.push(
|
|
182246
|
+
symbols.push(member2);
|
|
182246
182247
|
});
|
|
182247
182248
|
}
|
|
182248
182249
|
function isObjectLiteralMethodSymbol(symbol) {
|
|
@@ -183184,9 +183185,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
183184
183185
|
const type = hasCompletionsType && !(completionsType.flags & 3) ? checker.getUnionType([promiseFilteredContextualType, completionsType]) : promiseFilteredContextualType;
|
|
183185
183186
|
const properties = getApparentProperties(type, obj, checker);
|
|
183186
183187
|
return type.isClass() && containsNonPublicProperties(properties) ? [] : hasCompletionsType ? filter(properties, hasDeclarationOtherThanSelf) : properties;
|
|
183187
|
-
function hasDeclarationOtherThanSelf(
|
|
183188
|
-
if (!length(
|
|
183189
|
-
return some(
|
|
183188
|
+
function hasDeclarationOtherThanSelf(member2) {
|
|
183189
|
+
if (!length(member2.declarations)) return true;
|
|
183190
|
+
return some(member2.declarations, (decl) => decl.parent !== obj);
|
|
183190
183191
|
}
|
|
183191
183192
|
}
|
|
183192
183193
|
function getApparentProperties(type, node, checker) {
|
|
@@ -185203,8 +185204,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
185203
185204
|
function isAmbientModuleDeclaration(node) {
|
|
185204
185205
|
return node.kind === 268 && node.name.kind === 11;
|
|
185205
185206
|
}
|
|
185206
|
-
function isExternalModuleImportEquals(
|
|
185207
|
-
return
|
|
185207
|
+
function isExternalModuleImportEquals(eq25) {
|
|
185208
|
+
return eq25.moduleReference.kind === 284 && eq25.moduleReference.expression.kind === 11;
|
|
185208
185209
|
}
|
|
185209
185210
|
var DefinitionKind = /* @__PURE__ */ ((DefinitionKind2) => {
|
|
185210
185211
|
DefinitionKind2[DefinitionKind2["Symbol"] = 0] = "Symbol";
|
|
@@ -186644,12 +186645,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
186644
186645
|
if (state.options.use === 2 || !isClassLike(classLike)) return;
|
|
186645
186646
|
Debug.assert(classLike.name === referenceLocation);
|
|
186646
186647
|
const addRef = state.referenceAdder(search.symbol);
|
|
186647
|
-
for (const
|
|
186648
|
-
if (!(isMethodOrAccessor(
|
|
186648
|
+
for (const member2 of classLike.members) {
|
|
186649
|
+
if (!(isMethodOrAccessor(member2) && isStatic(member2))) {
|
|
186649
186650
|
continue;
|
|
186650
186651
|
}
|
|
186651
|
-
if (
|
|
186652
|
-
|
|
186652
|
+
if (member2.body) {
|
|
186653
|
+
member2.body.forEachChild(function cb(node) {
|
|
186653
186654
|
if (node.kind === 110) {
|
|
186654
186655
|
addRef(node);
|
|
186655
186656
|
} else if (!isFunctionLike(node) && !isClassLike(node)) {
|
|
@@ -186669,8 +186670,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
186669
186670
|
}
|
|
186670
186671
|
}
|
|
186671
186672
|
if (classSymbol.exports) {
|
|
186672
|
-
classSymbol.exports.forEach((
|
|
186673
|
-
const decl =
|
|
186673
|
+
classSymbol.exports.forEach((member2) => {
|
|
186674
|
+
const decl = member2.valueDeclaration;
|
|
186674
186675
|
if (decl && decl.kind === 175) {
|
|
186675
186676
|
const body = decl.body;
|
|
186676
186677
|
if (body) {
|
|
@@ -187874,13 +187875,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
187874
187875
|
whitespaceBefore: true
|
|
187875
187876
|
});
|
|
187876
187877
|
}
|
|
187877
|
-
function visitEnumMember(
|
|
187878
|
-
if (
|
|
187878
|
+
function visitEnumMember(member2) {
|
|
187879
|
+
if (member2.initializer) {
|
|
187879
187880
|
return;
|
|
187880
187881
|
}
|
|
187881
|
-
const enumValue = checker.getConstantValue(
|
|
187882
|
+
const enumValue = checker.getConstantValue(member2);
|
|
187882
187883
|
if (enumValue !== void 0) {
|
|
187883
|
-
addEnumMemberValueHints(enumValue.toString(),
|
|
187884
|
+
addEnumMemberValueHints(enumValue.toString(), member2.end);
|
|
187884
187885
|
}
|
|
187885
187886
|
}
|
|
187886
187887
|
function isModuleReferenceType(type) {
|
|
@@ -189105,11 +189106,11 @@ ${content}
|
|
|
189105
189106
|
if (!classOrInterface) {
|
|
189106
189107
|
return;
|
|
189107
189108
|
}
|
|
189108
|
-
const firstMatch = classOrInterface.members.find((
|
|
189109
|
+
const firstMatch = classOrInterface.members.find((member2) => changes.some((change) => matchNode(change, member2)));
|
|
189109
189110
|
if (firstMatch) {
|
|
189110
189111
|
const lastMatch = findLast(
|
|
189111
189112
|
classOrInterface.members,
|
|
189112
|
-
(
|
|
189113
|
+
(member2) => changes.some((change) => matchNode(change, member2))
|
|
189113
189114
|
);
|
|
189114
189115
|
forEach(changes, wipeNode);
|
|
189115
189116
|
changeTracker.replaceNodeRangeWithNodes(
|
|
@@ -192692,18 +192693,18 @@ ${content}
|
|
|
192692
192693
|
guessIndentationFromExistingMembers(sourceFile, node) {
|
|
192693
192694
|
let indentation;
|
|
192694
192695
|
let lastRange = node;
|
|
192695
|
-
for (const
|
|
192696
|
-
if (rangeStartPositionsAreOnSameLine(lastRange,
|
|
192696
|
+
for (const member2 of getMembersOrProperties(node)) {
|
|
192697
|
+
if (rangeStartPositionsAreOnSameLine(lastRange, member2, sourceFile)) {
|
|
192697
192698
|
return void 0;
|
|
192698
192699
|
}
|
|
192699
|
-
const memberStart =
|
|
192700
|
+
const memberStart = member2.getStart(sourceFile);
|
|
192700
192701
|
const memberIndentation = ts_formatting_exports.SmartIndenter.findFirstNonWhitespaceColumn(getLineStartPositionForPosition(memberStart, sourceFile), memberStart, sourceFile, this.formatContext.options);
|
|
192701
192702
|
if (indentation === void 0) {
|
|
192702
192703
|
indentation = memberIndentation;
|
|
192703
192704
|
} else if (memberIndentation !== indentation) {
|
|
192704
192705
|
return void 0;
|
|
192705
192706
|
}
|
|
192706
|
-
lastRange =
|
|
192707
|
+
lastRange = member2;
|
|
192707
192708
|
}
|
|
192708
192709
|
return indentation;
|
|
192709
192710
|
}
|
|
@@ -197836,7 +197837,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
197836
197837
|
affectsEmitOptionDeclarations: () => affectsEmitOptionDeclarations,
|
|
197837
197838
|
allKeysStartWithDot: () => allKeysStartWithDot,
|
|
197838
197839
|
altDirectorySeparator: () => altDirectorySeparator,
|
|
197839
|
-
and: () =>
|
|
197840
|
+
and: () => and24,
|
|
197840
197841
|
append: () => append,
|
|
197841
197842
|
appendIfUnique: () => appendIfUnique,
|
|
197842
197843
|
arrayFrom: () => arrayFrom,
|
|
@@ -213020,8 +213021,8 @@ var {
|
|
|
213020
213021
|
} = constants2;
|
|
213021
213022
|
var logger = getLogger("context-config");
|
|
213022
213023
|
var HeadersSchemaBuilder = class {
|
|
213024
|
+
schema;
|
|
213023
213025
|
constructor(options) {
|
|
213024
|
-
__publicField(this, "schema");
|
|
213025
213026
|
this.schema = options.schema;
|
|
213026
213027
|
}
|
|
213027
213028
|
/** Template function for headers paths with type-safe autocomplete */
|
|
@@ -213036,12 +213037,12 @@ var HeadersSchemaBuilder = class {
|
|
|
213036
213037
|
}
|
|
213037
213038
|
};
|
|
213038
213039
|
var ContextConfigBuilder = class {
|
|
213040
|
+
config;
|
|
213041
|
+
baseURL;
|
|
213042
|
+
tenantId;
|
|
213043
|
+
projectId;
|
|
213044
|
+
agentId;
|
|
213039
213045
|
constructor(options) {
|
|
213040
|
-
__publicField(this, "config");
|
|
213041
|
-
__publicField(this, "baseURL");
|
|
213042
|
-
__publicField(this, "tenantId");
|
|
213043
|
-
__publicField(this, "projectId");
|
|
213044
|
-
__publicField(this, "agentId");
|
|
213045
213046
|
this.tenantId = options.tenantId || "default";
|
|
213046
213047
|
this.projectId = options.projectId || "default";
|
|
213047
213048
|
this.agentId = options.agentId || "default";
|
|
@@ -213329,7 +213330,11 @@ function fetchDefinition(options) {
|
|
|
213329
213330
|
return result;
|
|
213330
213331
|
}
|
|
213331
213332
|
var logger2 = getLogger("template-engine");
|
|
213332
|
-
var
|
|
213333
|
+
var TemplateEngine = class _TemplateEngine {
|
|
213334
|
+
static DEFAULT_OPTIONS = {
|
|
213335
|
+
strict: false,
|
|
213336
|
+
preserveUnresolved: false
|
|
213337
|
+
};
|
|
213333
213338
|
/**
|
|
213334
213339
|
* Render a template string with context data using JMESPath
|
|
213335
213340
|
*/
|
|
@@ -213527,11 +213532,6 @@ var _TemplateEngine = class _TemplateEngine {
|
|
|
213527
213532
|
};
|
|
213528
213533
|
}
|
|
213529
213534
|
};
|
|
213530
|
-
__publicField(_TemplateEngine, "DEFAULT_OPTIONS", {
|
|
213531
|
-
strict: false,
|
|
213532
|
-
preserveUnresolved: false
|
|
213533
|
-
});
|
|
213534
|
-
var TemplateEngine = _TemplateEngine;
|
|
213535
213535
|
|
|
213536
213536
|
// src/utils/credential-store-utils.ts
|
|
213537
213537
|
function getCredentialStoreLookupKeyFromRetrievalParams({
|
|
@@ -213555,9 +213555,9 @@ var CredentialStuffer = class {
|
|
|
213555
213555
|
constructor(credentialStoreRegistry, contextResolver, logger14) {
|
|
213556
213556
|
this.credentialStoreRegistry = credentialStoreRegistry;
|
|
213557
213557
|
this.contextResolver = contextResolver;
|
|
213558
|
-
__publicField(this, "logger");
|
|
213559
213558
|
this.logger = logger14 || getLogger("credential-stuffer");
|
|
213560
213559
|
}
|
|
213560
|
+
logger;
|
|
213561
213561
|
/**
|
|
213562
213562
|
* Retrieve credentials from credential store registry
|
|
213563
213563
|
*/
|
|
@@ -213724,21 +213724,9 @@ var CredentialStuffer = class {
|
|
|
213724
213724
|
};
|
|
213725
213725
|
}
|
|
213726
213726
|
};
|
|
213727
|
-
var FILENAME = fileURLToPath(import.meta.url);
|
|
213728
|
-
dirname(FILENAME);
|
|
213729
|
-
function createTestDatabaseClientNoMigrations() {
|
|
213730
|
-
const client = new PGlite();
|
|
213731
|
-
const db = drizzle$1(client, { schema: schema_exports });
|
|
213732
|
-
return db;
|
|
213733
|
-
}
|
|
213734
|
-
|
|
213735
|
-
// src/db/client.ts
|
|
213736
213727
|
loadEnvironmentFiles();
|
|
213737
213728
|
function createDatabaseClient(config = {}) {
|
|
213738
213729
|
const connectionString = config.connectionString || process.env.DATABASE_URL;
|
|
213739
|
-
if (env.ENVIRONMENT === "test") {
|
|
213740
|
-
return createTestDatabaseClientNoMigrations();
|
|
213741
|
-
}
|
|
213742
213730
|
if (!connectionString) {
|
|
213743
213731
|
throw new Error(
|
|
213744
213732
|
"DATABASE_URL environment variable is required. Please set it to your PostgreSQL connection string."
|
|
@@ -215925,13 +215913,13 @@ function getRequestExecutionContext(c) {
|
|
|
215925
215913
|
return executionContext;
|
|
215926
215914
|
}
|
|
215927
215915
|
var McpClient = class {
|
|
215916
|
+
name;
|
|
215917
|
+
client;
|
|
215918
|
+
timeout;
|
|
215919
|
+
transport;
|
|
215920
|
+
serverConfig;
|
|
215921
|
+
connected = false;
|
|
215928
215922
|
constructor(opts) {
|
|
215929
|
-
__publicField(this, "name");
|
|
215930
|
-
__publicField(this, "client");
|
|
215931
|
-
__publicField(this, "timeout");
|
|
215932
|
-
__publicField(this, "transport");
|
|
215933
|
-
__publicField(this, "serverConfig");
|
|
215934
|
-
__publicField(this, "connected", false);
|
|
215935
215923
|
this.name = opts.name;
|
|
215936
215924
|
this.timeout = opts.timeout || DEFAULT_REQUEST_TIMEOUT_MSEC;
|
|
215937
215925
|
this.serverConfig = opts.server;
|
|
@@ -220122,6 +220110,58 @@ var countMessagesByConversation = (db) => async (params) => {
|
|
|
220122
220110
|
const total = result[0]?.count || 0;
|
|
220123
220111
|
return typeof total === "string" ? Number.parseInt(total, 10) : total;
|
|
220124
220112
|
};
|
|
220113
|
+
var getUserOrganizations = (db) => async (userId) => {
|
|
220114
|
+
const result = await db.select({
|
|
220115
|
+
id: member.id,
|
|
220116
|
+
userId: member.userId,
|
|
220117
|
+
organizationId: member.organizationId,
|
|
220118
|
+
role: member.role,
|
|
220119
|
+
createdAt: member.createdAt,
|
|
220120
|
+
organizationName: organization.name,
|
|
220121
|
+
organizationSlug: organization.slug
|
|
220122
|
+
}).from(member).leftJoin(organization, eq(member.organizationId, organization.id)).where(eq(member.userId, userId));
|
|
220123
|
+
return result.map((row) => ({
|
|
220124
|
+
...row,
|
|
220125
|
+
createdAt: new Date(row.createdAt)
|
|
220126
|
+
}));
|
|
220127
|
+
};
|
|
220128
|
+
var getPendingInvitationsByEmail = (db) => async (email) => {
|
|
220129
|
+
const now = /* @__PURE__ */ new Date();
|
|
220130
|
+
const result = await db.select({
|
|
220131
|
+
id: invitation.id,
|
|
220132
|
+
email: invitation.email,
|
|
220133
|
+
organizationId: invitation.organizationId,
|
|
220134
|
+
organizationName: organization.name,
|
|
220135
|
+
organizationSlug: organization.slug,
|
|
220136
|
+
role: invitation.role,
|
|
220137
|
+
status: invitation.status,
|
|
220138
|
+
expiresAt: invitation.expiresAt,
|
|
220139
|
+
inviterId: invitation.inviterId
|
|
220140
|
+
}).from(invitation).leftJoin(organization, eq(invitation.organizationId, organization.id)).where(
|
|
220141
|
+
and(
|
|
220142
|
+
eq(invitation.email, email),
|
|
220143
|
+
eq(invitation.status, "pending")
|
|
220144
|
+
)
|
|
220145
|
+
);
|
|
220146
|
+
return result.filter((inv) => new Date(inv.expiresAt) > now);
|
|
220147
|
+
};
|
|
220148
|
+
var addUserToOrganization = (db) => async (data) => {
|
|
220149
|
+
const existingOrg = await db.select().from(organization).where(eq(organization.id, data.organizationId)).limit(1);
|
|
220150
|
+
if (existingOrg.length === 0) {
|
|
220151
|
+
throw new Error(`Organization ${data.organizationId} does not exist`);
|
|
220152
|
+
}
|
|
220153
|
+
const existingMember = await db.select().from(member).where(and(eq(member.userId, data.userId), eq(member.organizationId, data.organizationId))).limit(1);
|
|
220154
|
+
if (existingMember.length > 0) {
|
|
220155
|
+
return;
|
|
220156
|
+
}
|
|
220157
|
+
await db.insert(member).values({
|
|
220158
|
+
id: `${data.userId}_${data.organizationId}`,
|
|
220159
|
+
userId: data.userId,
|
|
220160
|
+
organizationId: data.organizationId,
|
|
220161
|
+
role: data.role,
|
|
220162
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
220163
|
+
});
|
|
220164
|
+
};
|
|
220125
220165
|
var listProjects = (db) => async (params) => {
|
|
220126
220166
|
const projectsFromTable = await db.select({ projectId: projects.id }).from(projects).where(eq(projects.tenantId, params.tenantId));
|
|
220127
220167
|
if (projectsFromTable.length > 0) {
|
|
@@ -221452,6 +221492,14 @@ var listTaskIdsByContextId = (db) => async (params) => {
|
|
|
221452
221492
|
const result = await db.select({ id: tasks.id }).from(tasks).where(eq(tasks.contextId, contextId));
|
|
221453
221493
|
return result.map((r) => r.id);
|
|
221454
221494
|
};
|
|
221495
|
+
var getUserById = (db) => async (userId) => {
|
|
221496
|
+
const result = await db.select().from(user).where(eq(user.id, userId)).limit(1);
|
|
221497
|
+
return result[0] || null;
|
|
221498
|
+
};
|
|
221499
|
+
var getUserByEmail = (db) => async (email) => {
|
|
221500
|
+
const result = await db.select().from(user).where(eq(user.email, email)).limit(1);
|
|
221501
|
+
return result[0] || null;
|
|
221502
|
+
};
|
|
221455
221503
|
|
|
221456
221504
|
// src/data-access/validation.ts
|
|
221457
221505
|
var validateProjectExists = async (db, tenantId, projectId) => {
|
|
@@ -221496,10 +221544,10 @@ var tracer = getTracer("agents-core");
|
|
|
221496
221544
|
// src/context/contextCache.ts
|
|
221497
221545
|
var logger8 = getLogger("context-cache");
|
|
221498
221546
|
var ContextCache = class {
|
|
221547
|
+
tenantId;
|
|
221548
|
+
projectId;
|
|
221549
|
+
dbClient;
|
|
221499
221550
|
constructor(tenantId, projectId, dbClient) {
|
|
221500
|
-
__publicField(this, "tenantId");
|
|
221501
|
-
__publicField(this, "projectId");
|
|
221502
|
-
__publicField(this, "dbClient");
|
|
221503
221551
|
this.tenantId = tenantId;
|
|
221504
221552
|
this.projectId = projectId;
|
|
221505
221553
|
this.dbClient = dbClient;
|
|
@@ -221690,11 +221738,11 @@ var ContextCache = class {
|
|
|
221690
221738
|
// src/context/ContextResolver.ts
|
|
221691
221739
|
var logger9 = getLogger("context-resolver");
|
|
221692
221740
|
var ContextResolver = class {
|
|
221741
|
+
fetcher;
|
|
221742
|
+
cache;
|
|
221743
|
+
tenantId;
|
|
221744
|
+
projectId;
|
|
221693
221745
|
constructor(tenantId, projectId, dbClient, credentialStoreRegistry) {
|
|
221694
|
-
__publicField(this, "fetcher");
|
|
221695
|
-
__publicField(this, "cache");
|
|
221696
|
-
__publicField(this, "tenantId");
|
|
221697
|
-
__publicField(this, "projectId");
|
|
221698
221746
|
this.tenantId = tenantId;
|
|
221699
221747
|
this.projectId = projectId;
|
|
221700
221748
|
this.fetcher = new ContextFetcher(tenantId, projectId, dbClient, credentialStoreRegistry);
|
|
@@ -222401,12 +222449,12 @@ var responseErrorCheckers = [
|
|
|
222401
222449
|
// Add more error checkers here as needed
|
|
222402
222450
|
];
|
|
222403
222451
|
var ContextFetcher = class {
|
|
222452
|
+
tenantId;
|
|
222453
|
+
projectId;
|
|
222454
|
+
defaultTimeout;
|
|
222455
|
+
credentialStuffer;
|
|
222456
|
+
dbClient;
|
|
222404
222457
|
constructor(tenantId, projectId, dbClient, credentialStoreRegistry, defaultTimeout = 1e4) {
|
|
222405
|
-
__publicField(this, "tenantId");
|
|
222406
|
-
__publicField(this, "projectId");
|
|
222407
|
-
__publicField(this, "defaultTimeout");
|
|
222408
|
-
__publicField(this, "credentialStuffer");
|
|
222409
|
-
__publicField(this, "dbClient");
|
|
222410
222458
|
this.tenantId = tenantId;
|
|
222411
222459
|
this.projectId = projectId;
|
|
222412
222460
|
this.defaultTimeout = defaultTimeout;
|
|
@@ -222874,9 +222922,9 @@ async function handleContextResolution({
|
|
|
222874
222922
|
|
|
222875
222923
|
// src/credential-stores/CredentialStoreRegistry.ts
|
|
222876
222924
|
var CredentialStoreRegistry = class {
|
|
222925
|
+
stores = /* @__PURE__ */ new Map();
|
|
222926
|
+
logger = getLogger("credential-store-registry");
|
|
222877
222927
|
constructor(initialStores = []) {
|
|
222878
|
-
__publicField(this, "stores", /* @__PURE__ */ new Map());
|
|
222879
|
-
__publicField(this, "logger", getLogger("credential-store-registry"));
|
|
222880
222928
|
for (const store of initialStores) {
|
|
222881
222929
|
this.add(store);
|
|
222882
222930
|
}
|
|
@@ -222941,14 +222989,14 @@ var CredentialStoreRegistry = class {
|
|
|
222941
222989
|
|
|
222942
222990
|
// src/credential-stores/keychain-store.ts
|
|
222943
222991
|
var KeyChainStore = class {
|
|
222992
|
+
id;
|
|
222993
|
+
type = CredentialStoreType.keychain;
|
|
222994
|
+
service;
|
|
222995
|
+
logger = getLogger("KeyChainStore");
|
|
222996
|
+
keytarAvailable = false;
|
|
222997
|
+
keytar = null;
|
|
222998
|
+
initializationPromise;
|
|
222944
222999
|
constructor(id, servicePrefix = "inkeep-agent-framework") {
|
|
222945
|
-
__publicField(this, "id");
|
|
222946
|
-
__publicField(this, "type", CredentialStoreType.keychain);
|
|
222947
|
-
__publicField(this, "service");
|
|
222948
|
-
__publicField(this, "logger", getLogger("KeyChainStore"));
|
|
222949
|
-
__publicField(this, "keytarAvailable", false);
|
|
222950
|
-
__publicField(this, "keytar", null);
|
|
222951
|
-
__publicField(this, "initializationPromise");
|
|
222952
223000
|
this.id = id;
|
|
222953
223001
|
this.service = `${servicePrefix}-${id}`;
|
|
222954
223002
|
this.initializationPromise = this.initializeKeytar();
|
|
@@ -223158,10 +223206,10 @@ function createKeyChainStore(id, options) {
|
|
|
223158
223206
|
|
|
223159
223207
|
// src/credential-stores/memory-store.ts
|
|
223160
223208
|
var InMemoryCredentialStore = class {
|
|
223209
|
+
id;
|
|
223210
|
+
type = CredentialStoreType.memory;
|
|
223211
|
+
credentials = /* @__PURE__ */ new Map();
|
|
223161
223212
|
constructor(id = "memory-default") {
|
|
223162
|
-
__publicField(this, "id");
|
|
223163
|
-
__publicField(this, "type", CredentialStoreType.memory);
|
|
223164
|
-
__publicField(this, "credentials", /* @__PURE__ */ new Map());
|
|
223165
223213
|
this.id = id;
|
|
223166
223214
|
}
|
|
223167
223215
|
/**
|
|
@@ -223254,11 +223302,11 @@ function isSupportedAuthMode(mode) {
|
|
|
223254
223302
|
return SUPPORTED_AUTH_MODES.includes(mode);
|
|
223255
223303
|
}
|
|
223256
223304
|
var NangoCredentialStore = class {
|
|
223305
|
+
id;
|
|
223306
|
+
type = CredentialStoreType.nango;
|
|
223307
|
+
nangoConfig;
|
|
223308
|
+
nangoClient;
|
|
223257
223309
|
constructor(id, config) {
|
|
223258
|
-
__publicField(this, "id");
|
|
223259
|
-
__publicField(this, "type", CredentialStoreType.nango);
|
|
223260
|
-
__publicField(this, "nangoConfig");
|
|
223261
|
-
__publicField(this, "nangoClient");
|
|
223262
223310
|
this.id = id;
|
|
223263
223311
|
this.nangoConfig = config;
|
|
223264
223312
|
this.nangoClient = new Nango({
|
|
@@ -223628,6 +223676,69 @@ function createDefaultCredentialStores() {
|
|
|
223628
223676
|
}
|
|
223629
223677
|
return stores;
|
|
223630
223678
|
}
|
|
223679
|
+
var FILENAME = fileURLToPath(import.meta.url);
|
|
223680
|
+
var DIRNAME = dirname(FILENAME);
|
|
223681
|
+
async function createTestDatabaseClient(drizzleDir) {
|
|
223682
|
+
const client = new PGlite();
|
|
223683
|
+
const db = drizzle$1(client, { schema: schema_exports });
|
|
223684
|
+
try {
|
|
223685
|
+
if (!drizzleDir) {
|
|
223686
|
+
drizzleDir = join(DIRNAME, "../../drizzle");
|
|
223687
|
+
}
|
|
223688
|
+
await migrate(db, { migrationsFolder: drizzleDir });
|
|
223689
|
+
} catch (error) {
|
|
223690
|
+
console.error("Failed to initialize test database schema:", error);
|
|
223691
|
+
throw error;
|
|
223692
|
+
}
|
|
223693
|
+
return db;
|
|
223694
|
+
}
|
|
223695
|
+
async function cleanupTestDatabase(db) {
|
|
223696
|
+
try {
|
|
223697
|
+
const result = await db.execute(
|
|
223698
|
+
sql.raw(`
|
|
223699
|
+
SELECT tablename
|
|
223700
|
+
FROM pg_tables
|
|
223701
|
+
WHERE schemaname = 'public'
|
|
223702
|
+
`)
|
|
223703
|
+
);
|
|
223704
|
+
const tables = result.rows.map((row) => row.tablename);
|
|
223705
|
+
if (tables.length === 0) {
|
|
223706
|
+
return;
|
|
223707
|
+
}
|
|
223708
|
+
const tableList = tables.map((t) => `"${t}"`).join(", ");
|
|
223709
|
+
await db.execute(sql.raw(`TRUNCATE TABLE ${tableList} RESTART IDENTITY CASCADE`));
|
|
223710
|
+
} catch (error) {
|
|
223711
|
+
console.debug("Could not clean test database:", error);
|
|
223712
|
+
}
|
|
223713
|
+
}
|
|
223714
|
+
async function closeTestDatabase(db) {
|
|
223715
|
+
try {
|
|
223716
|
+
if ("close" in db && typeof db.close === "function") {
|
|
223717
|
+
db.close();
|
|
223718
|
+
}
|
|
223719
|
+
} catch (error) {
|
|
223720
|
+
console.debug("Error closing database:", error);
|
|
223721
|
+
}
|
|
223722
|
+
}
|
|
223723
|
+
async function createTestOrganization(db, tenantId) {
|
|
223724
|
+
const slug = tenantId.replace(/^test-tenant-/, "").substring(0, 50);
|
|
223725
|
+
await db.insert(organization).values({
|
|
223726
|
+
id: tenantId,
|
|
223727
|
+
name: `Test Organization ${tenantId}`,
|
|
223728
|
+
slug,
|
|
223729
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
223730
|
+
metadata: null
|
|
223731
|
+
}).onConflictDoNothing();
|
|
223732
|
+
}
|
|
223733
|
+
async function createTestProject(db, tenantId, projectId = "default") {
|
|
223734
|
+
await createTestOrganization(db, tenantId);
|
|
223735
|
+
await db.insert(projects).values({
|
|
223736
|
+
tenantId,
|
|
223737
|
+
id: projectId,
|
|
223738
|
+
name: `Test Project ${projectId}`,
|
|
223739
|
+
description: `Test project for ${projectId}`
|
|
223740
|
+
}).onConflictDoNothing();
|
|
223741
|
+
}
|
|
223631
223742
|
/*! Bundled license information:
|
|
223632
223743
|
|
|
223633
223744
|
typescript/lib/typescript.js:
|
|
@@ -223647,4 +223758,4 @@ typescript/lib/typescript.js:
|
|
|
223647
223758
|
***************************************************************************** *)
|
|
223648
223759
|
*/
|
|
223649
223760
|
|
|
223650
|
-
export { AGENT_EXECUTION_TRANSFER_COUNT_DEFAULT, AGENT_EXECUTION_TRANSFER_COUNT_MAX, AGENT_EXECUTION_TRANSFER_COUNT_MIN, CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT, CONVERSATION_HISTORY_DEFAULT_LIMIT, CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT, ContextCache, ContextConfigBuilder, ContextFetcher, ContextResolver, CredentialStoreRegistry, CredentialStuffer, ERROR_DOCS_BASE_URL, ErrorCode, HTTP_REQUEST_PARTS, InMemoryCredentialStore, KeyChainStore, MCP_TOOL_CONNECTION_TIMEOUT_MS, MCP_TOOL_INITIAL_RECONNECTION_DELAY_MS, MCP_TOOL_MAX_RECONNECTION_DELAY_MS, MCP_TOOL_MAX_RETRIES, MCP_TOOL_RECONNECTION_DELAY_GROWTH_FACTOR, McpClient, NangoCredentialStore, STATUS_UPDATE_MAX_INTERVAL_SECONDS, STATUS_UPDATE_MAX_NUM_EVENTS, SUB_AGENT_TURN_GENERATION_STEPS_DEFAULT, SUB_AGENT_TURN_GENERATION_STEPS_MAX, SUB_AGENT_TURN_GENERATION_STEPS_MIN, TemplateEngine, VALIDATION_AGENT_PROMPT_MAX_CHARS, VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS, addFunctionToolToSubAgent, addLedgerArtifacts, addToolToAgent, agentHasArtifactComponents, apiFetch, associateArtifactComponentWithAgent, associateDataComponentWithAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, contextConfig, contextValidationMiddleware, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, createAgent, createAgentToolRelation, createApiError, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDatabaseClient, createDefaultCredentialStores, createExecutionContext, createExternalAgent, createFullAgentServerSide, createFullProjectServerSide, createFunctionTool, createKeyChainStore, createMessage, createNangoCredentialStore, createOrGetConversation, createProject, createSubAgent, createSubAgentExternalAgentRelation, createSubAgentRelation, createSubAgentTeamAgentRelation, createTask, createTool, createValidatedDataAccess, dbResultToMcpTool, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentRelationsByAgent, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteApiKey, deleteArtifactComponent, deleteContextConfig, deleteConversation, deleteCredentialReference, deleteDataComponent, deleteExternalAgent, deleteFullAgent, deleteFullProject, deleteFunction, deleteFunctionTool, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteSubAgent, deleteSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelationsByAgent, deleteSubAgentExternalAgentRelationsBySubAgent, deleteSubAgentRelation, deleteSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelationsByAgent, deleteSubAgentTeamAgentRelationsBySubAgent, deleteTool, determineContextTrigger, errorResponseSchema, errorSchemaFactory, executionLimitsSharedDefaults, externalAgentExists, externalAgentUrlExists, extractPublicId, fetchComponentRelationships, fetchDefinition, generateAndCreateApiKey, generateApiKey, generateId, generateServiceToken, getActiveAgentForConversation, getAgentById, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByAgent, getAgentRelationsBySource, getAgentSubAgentInfos, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentWithDefaultSubAgent, getAgentsForTool, getAgentsUsingArtifactComponent, getAgentsUsingDataComponent, getApiKeyById, getApiKeyByPublicId, getArtifactComponentById, getArtifactComponentsForAgent, getCacheEntry, getCachedValidator, getContextConfigById, getContextConfigCacheEntries, getConversation, getConversationCacheEntries, getConversationHistory, getConversationId, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithResources, getCredentialStoreLookupKeyFromRetrievalParams, getDataComponent, getDataComponentsForAgent, getExternalAgent, getExternalAgentByUrl, getExternalAgentsForSubAgent, getFullAgent, getFullAgentDefinition, getFullProject, getFunction, getFunctionToolById, getFunctionToolsForSubAgent, getLedgerArtifacts, getLedgerArtifactsByContext, getMessageById, getMessagesByConversation, getMessagesByTask, getProject, getProjectResourceCounts, getRelatedAgentsForAgent, getRequestExecutionContext, getSubAgentById, getSubAgentExternalAgentRelationById, getSubAgentExternalAgentRelationByParams, getSubAgentExternalAgentRelations, getSubAgentExternalAgentRelationsByAgent, getSubAgentExternalAgentRelationsByExternalAgent, getSubAgentRelationsByTarget, getSubAgentTeamAgentRelationById, getSubAgentTeamAgentRelationByParams, getSubAgentTeamAgentRelations, getSubAgentTeamAgentRelationsByAgent, getSubAgentTeamAgentRelationsByTeamAgent, getSubAgentsByIds, getSubAgentsForExternalAgent, getSubAgentsForTeamAgent, getTask, getTeamAgentsForSubAgent, getToolById, getToolsForAgent, getTracer, getVisibleMessages, handleApiError, handleContextConfigChange, handleContextResolution, hasApiKey, hasContextConfig, hasCredentialReference, hashApiKey, headers, invalidateHeadersCache, invalidateInvocationDefinitionsCache, isApiKeyExpired, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, isValidHttpRequest, listAgentRelations, listAgentToolRelations, listAgents, listAgentsPaginated, listApiKeys, listApiKeysPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listExternalAgents, listExternalAgentsPaginated, listFunctionTools, listFunctions, listMessages, listProjects, listProjectsPaginated, listSubAgentExternalAgentRelations, listSubAgentTeamAgentRelations, listSubAgents, listSubAgentsPaginated, listTaskIdsByContextId, listTools, loadEnvironmentFiles, maskApiKey, normalizeDateString, problemDetailsSchema, projectExists, projectExistsInTable, projectHasResources, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, setSpanWithError, updateAgent, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveAgent, updateCredentialReference, updateDataComponent, updateExternalAgent, updateFullAgentServerSide, updateFullProjectServerSide, updateFunctionTool, updateMessage, updateProject, updateSubAgent, updateSubAgentExternalAgentRelation, updateSubAgentFunctionToolRelation, updateSubAgentTeamAgentRelation, updateTask, updateTool, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertFunction, upsertFunctionTool, upsertLedgerArtifact, upsertSubAgent, upsertSubAgentExternalAgentRelation, upsertSubAgentFunctionToolRelation, upsertSubAgentRelation, upsertSubAgentTeamAgentRelation, upsertSubAgentToolRelation, upsertTool, validateAgainstJsonSchema, validateAndGetApiKey, validateApiKey, validateHeaders, validateHttpRequestHeaders, validateProjectExists, validateSubAgent, validateTargetAgent, validateTenantId, validationHelper, verifyAuthorizationHeader, verifyServiceToken, withProjectValidation };
|
|
223761
|
+
export { AGENT_EXECUTION_TRANSFER_COUNT_DEFAULT, AGENT_EXECUTION_TRANSFER_COUNT_MAX, AGENT_EXECUTION_TRANSFER_COUNT_MIN, CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT, CONVERSATION_HISTORY_DEFAULT_LIMIT, CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT, ContextCache, ContextConfigBuilder, ContextFetcher, ContextResolver, CredentialStoreRegistry, CredentialStuffer, ERROR_DOCS_BASE_URL, ErrorCode, HTTP_REQUEST_PARTS, InMemoryCredentialStore, KeyChainStore, MCP_TOOL_CONNECTION_TIMEOUT_MS, MCP_TOOL_INITIAL_RECONNECTION_DELAY_MS, MCP_TOOL_MAX_RECONNECTION_DELAY_MS, MCP_TOOL_MAX_RETRIES, MCP_TOOL_RECONNECTION_DELAY_GROWTH_FACTOR, McpClient, NangoCredentialStore, STATUS_UPDATE_MAX_INTERVAL_SECONDS, STATUS_UPDATE_MAX_NUM_EVENTS, SUB_AGENT_TURN_GENERATION_STEPS_DEFAULT, SUB_AGENT_TURN_GENERATION_STEPS_MAX, SUB_AGENT_TURN_GENERATION_STEPS_MIN, TemplateEngine, VALIDATION_AGENT_PROMPT_MAX_CHARS, VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS, addFunctionToolToSubAgent, addLedgerArtifacts, addToolToAgent, addUserToOrganization, agentHasArtifactComponents, apiFetch, associateArtifactComponentWithAgent, associateDataComponentWithAgent, cleanupTenantCache, cleanupTestDatabase, clearContextConfigCache, clearConversationCache, closeTestDatabase, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, contextConfig, contextValidationMiddleware, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, createAgent, createAgentToolRelation, createApiError, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDatabaseClient, createDefaultCredentialStores, createExecutionContext, createExternalAgent, createFullAgentServerSide, createFullProjectServerSide, createFunctionTool, createKeyChainStore, createMessage, createNangoCredentialStore, createOrGetConversation, createProject, createSubAgent, createSubAgentExternalAgentRelation, createSubAgentRelation, createSubAgentTeamAgentRelation, createTask, createTestDatabaseClient, createTestOrganization, createTestProject, createTool, createValidatedDataAccess, dbResultToMcpTool, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentRelationsByAgent, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteApiKey, deleteArtifactComponent, deleteContextConfig, deleteConversation, deleteCredentialReference, deleteDataComponent, deleteExternalAgent, deleteFullAgent, deleteFullProject, deleteFunction, deleteFunctionTool, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteSubAgent, deleteSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelationsByAgent, deleteSubAgentExternalAgentRelationsBySubAgent, deleteSubAgentRelation, deleteSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelationsByAgent, deleteSubAgentTeamAgentRelationsBySubAgent, deleteTool, determineContextTrigger, errorResponseSchema, errorSchemaFactory, executionLimitsSharedDefaults, externalAgentExists, externalAgentUrlExists, extractPublicId, fetchComponentRelationships, fetchDefinition, generateAndCreateApiKey, generateApiKey, generateId, generateServiceToken, getActiveAgentForConversation, getAgentById, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByAgent, getAgentRelationsBySource, getAgentSubAgentInfos, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentWithDefaultSubAgent, getAgentsForTool, getAgentsUsingArtifactComponent, getAgentsUsingDataComponent, getApiKeyById, getApiKeyByPublicId, getArtifactComponentById, getArtifactComponentsForAgent, getCacheEntry, getCachedValidator, getContextConfigById, getContextConfigCacheEntries, getConversation, getConversationCacheEntries, getConversationHistory, getConversationId, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithResources, getCredentialStoreLookupKeyFromRetrievalParams, getDataComponent, getDataComponentsForAgent, getExternalAgent, getExternalAgentByUrl, getExternalAgentsForSubAgent, getFullAgent, getFullAgentDefinition, getFullProject, getFunction, getFunctionToolById, getFunctionToolsForSubAgent, getLedgerArtifacts, getLedgerArtifactsByContext, getMessageById, getMessagesByConversation, getMessagesByTask, getPendingInvitationsByEmail, getProject, getProjectResourceCounts, getRelatedAgentsForAgent, getRequestExecutionContext, getSubAgentById, getSubAgentExternalAgentRelationById, getSubAgentExternalAgentRelationByParams, getSubAgentExternalAgentRelations, getSubAgentExternalAgentRelationsByAgent, getSubAgentExternalAgentRelationsByExternalAgent, getSubAgentRelationsByTarget, getSubAgentTeamAgentRelationById, getSubAgentTeamAgentRelationByParams, getSubAgentTeamAgentRelations, getSubAgentTeamAgentRelationsByAgent, getSubAgentTeamAgentRelationsByTeamAgent, getSubAgentsByIds, getSubAgentsForExternalAgent, getSubAgentsForTeamAgent, getTask, getTeamAgentsForSubAgent, getToolById, getToolsForAgent, getTracer, getUserByEmail, getUserById, getUserOrganizations, getVisibleMessages, handleApiError, handleContextConfigChange, handleContextResolution, hasApiKey, hasContextConfig, hasCredentialReference, hashApiKey, headers, invalidateHeadersCache, invalidateInvocationDefinitionsCache, isApiKeyExpired, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, isValidHttpRequest, listAgentRelations, listAgentToolRelations, listAgents, listAgentsPaginated, listApiKeys, listApiKeysPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listExternalAgents, listExternalAgentsPaginated, listFunctionTools, listFunctions, listMessages, listProjects, listProjectsPaginated, listSubAgentExternalAgentRelations, listSubAgentTeamAgentRelations, listSubAgents, listSubAgentsPaginated, listTaskIdsByContextId, listTools, loadEnvironmentFiles, maskApiKey, normalizeDateString, problemDetailsSchema, projectExists, projectExistsInTable, projectHasResources, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, setSpanWithError, updateAgent, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveAgent, updateCredentialReference, updateDataComponent, updateExternalAgent, updateFullAgentServerSide, updateFullProjectServerSide, updateFunctionTool, updateMessage, updateProject, updateSubAgent, updateSubAgentExternalAgentRelation, updateSubAgentFunctionToolRelation, updateSubAgentTeamAgentRelation, updateTask, updateTool, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertFunction, upsertFunctionTool, upsertLedgerArtifact, upsertSubAgent, upsertSubAgentExternalAgentRelation, upsertSubAgentFunctionToolRelation, upsertSubAgentRelation, upsertSubAgentTeamAgentRelation, upsertSubAgentToolRelation, upsertTool, validateAgainstJsonSchema, validateAndGetApiKey, validateApiKey, validateHeaders, validateHttpRequestHeaders, validateProjectExists, validateSubAgent, validateTargetAgent, validateTenantId, validationHelper, verifyAuthorizationHeader, verifyServiceToken, withProjectValidation };
|