@pikku/inspector 0.12.75 → 0.12.81
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/CHANGELOG.md +330 -0
- package/dist/add/add-analytics.d.ts +9 -0
- package/dist/add/add-analytics.js +178 -0
- package/dist/add/add-auth.js +0 -54
- package/dist/add/add-feature-flag.d.ts +2 -0
- package/dist/add/add-feature-flag.js +162 -0
- package/dist/add/add-wire-addon.js +1 -0
- package/dist/add/add-wire-remote-addon.js +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/inspector.js +4 -0
- package/dist/surface/collect-surface.d.ts +58 -0
- package/dist/surface/collect-surface.js +613 -0
- package/dist/types.d.ts +20 -11
- package/dist/utils/filter-inspector-state.js +14 -0
- package/dist/utils/post-process.js +15 -0
- package/dist/utils/read-module-specifiers.d.ts +8 -0
- package/dist/utils/read-module-specifiers.js +23 -0
- package/dist/utils/read-tsconfig-out-dir.d.ts +5 -0
- package/dist/utils/read-tsconfig-out-dir.js +12 -0
- package/dist/utils/resolve-deploy-target.d.ts +7 -0
- package/dist/utils/resolve-deploy-target.js +15 -7
- package/dist/utils/serialize-inspector-state.d.ts +5 -0
- package/dist/utils/serialize-inspector-state.js +8 -0
- package/dist/visit.js +4 -0
- package/package.json +16 -6
- package/run-tests.sh +21 -6
- package/src/add/add-addon-bans.ts +0 -85
- package/src/add/add-agent-scorer.test.ts +0 -197
- package/src/add/add-agent-scorer.ts +0 -83
- package/src/add/add-agent.test.ts +0 -87
- package/src/add/add-agent.ts +0 -638
- package/src/add/add-approval-description.ts +0 -76
- package/src/add/add-auth.test.ts +0 -791
- package/src/add/add-auth.ts +0 -424
- package/src/add/add-channel.ts +0 -778
- package/src/add/add-cli-renderers.test.ts +0 -74
- package/src/add/add-cli.ts +0 -1006
- package/src/add/add-credential.ts +0 -186
- package/src/add/add-feature.test.ts +0 -306
- package/src/add/add-feature.ts +0 -253
- package/src/add/add-file-extends-core-type.ts +0 -66
- package/src/add/add-file-with-config.ts +0 -45
- package/src/add/add-file-with-factory.test.ts +0 -134
- package/src/add/add-file-with-factory.ts +0 -288
- package/src/add/add-functions.test.ts +0 -743
- package/src/add/add-functions.ts +0 -1548
- package/src/add/add-gateway.ts +0 -143
- package/src/add/add-http-route-ref.test.ts +0 -149
- package/src/add/add-http-route.ts +0 -530
- package/src/add/add-http-routes.ts +0 -471
- package/src/add/add-keyed-wiring.ts +0 -180
- package/src/add/add-mcp-prompt.ts +0 -157
- package/src/add/add-mcp-resource.ts +0 -175
- package/src/add/add-middleware.test.ts +0 -196
- package/src/add/add-middleware.ts +0 -879
- package/src/add/add-permission-auth.test.ts +0 -59
- package/src/add/add-permission.ts +0 -311
- package/src/add/add-personas.test.ts +0 -406
- package/src/add/add-personas.ts +0 -287
- package/src/add/add-queue-worker.ts +0 -117
- package/src/add/add-rpc-invocations.test.ts +0 -287
- package/src/add/add-rpc-invocations.ts +0 -221
- package/src/add/add-scenario-step.test.ts +0 -509
- package/src/add/add-schedule.ts +0 -120
- package/src/add/add-scope.test.ts +0 -419
- package/src/add/add-scope.ts +0 -221
- package/src/add/add-secret.ts +0 -10
- package/src/add/add-subject-scenario-steps.test.ts +0 -161
- package/src/add/add-system-role.test.ts +0 -297
- package/src/add/add-system-role.ts +0 -162
- package/src/add/add-trigger.ts +0 -165
- package/src/add/add-variable.ts +0 -10
- package/src/add/add-wire-addon.test.ts +0 -185
- package/src/add/add-wire-addon.ts +0 -146
- package/src/add/add-wire-remote-addon.ts +0 -80
- package/src/add/add-workflow-edge-cases.test.ts +0 -201
- package/src/add/add-workflow-fanout.test.ts +0 -166
- package/src/add/add-workflow-graph-foreach.test.ts +0 -174
- package/src/add/add-workflow-graph-input.test.ts +0 -94
- package/src/add/add-workflow-graph-notes.test.ts +0 -74
- package/src/add/add-workflow-graph.ts +0 -644
- package/src/add/add-workflow-on-error.test.ts +0 -118
- package/src/add/add-workflow-return-switch.test.ts +0 -121
- package/src/add/add-workflow-silent-drops.test.ts +0 -261
- package/src/add/add-workflow-sleep-expression.test.ts +0 -96
- package/src/add/add-workflow.test.ts +0 -155
- package/src/add/add-workflow.ts +0 -482
- package/src/add/addon-bans.test.ts +0 -121
- package/src/add/addon-contracts.test.ts +0 -221
- package/src/add/allow-escape-hatches.test.ts +0 -144
- package/src/add/audit-meta.test.ts +0 -75
- package/src/add/classified-sink-check.test.ts +0 -347
- package/src/add/config-value-metadata.test.ts +0 -263
- package/src/add/dynamic-import-check.test.ts +0 -119
- package/src/add/expect-eventually-scenario-only.test.ts +0 -108
- package/src/add/function-body-span.test.ts +0 -96
- package/src/add/inline-wiring-function.test.ts +0 -104
- package/src/add/pii-check.test.ts +0 -258
- package/src/add/rpc-type-cast.test.ts +0 -123
- package/src/add/scenario-instrumentation.test.ts +0 -89
- package/src/add/scenario-instrumentation.ts +0 -42
- package/src/add/scenario-marker.test.ts +0 -89
- package/src/add/scenario-not-extractable.test.ts +0 -159
- package/src/add/scenario-services.test.ts +0 -103
- package/src/add/scenario-skip.test.ts +0 -83
- package/src/add/validate-workflow-graph-addons.test.ts +0 -102
- package/src/add/wire-name-literal.test.ts +0 -117
- package/src/error-codes-emitted.test.ts +0 -76
- package/src/error-codes.ts +0 -145
- package/src/index.ts +0 -66
- package/src/inspector.ts +0 -575
- package/src/schema-generator.ts +0 -1
- package/src/source-file-cache.ts +0 -73
- package/src/tsconfig-paths.test.ts +0 -90
- package/src/types-map.ts +0 -141
- package/src/types.ts +0 -775
- package/src/utils/annotate-http-route-auth.test.ts +0 -161
- package/src/utils/annotate-http-route-auth.ts +0 -53
- package/src/utils/check-classified-sinks.ts +0 -215
- package/src/utils/check-pii-output.ts +0 -120
- package/src/utils/compute-diagnostics.test.ts +0 -106
- package/src/utils/compute-required-schemas.ts +0 -48
- package/src/utils/contract-hashes.test.ts +0 -553
- package/src/utils/contract-hashes.ts +0 -387
- package/src/utils/custom-types-generator.test.ts +0 -124
- package/src/utils/custom-types-generator.ts +0 -150
- package/src/utils/detect-schema-vendor.test.ts +0 -123
- package/src/utils/detect-schema-vendor.ts +0 -120
- package/src/utils/does-type-extend-core-type.ts +0 -53
- package/src/utils/ensure-function-metadata.ts +0 -385
- package/src/utils/extract-function-name.ts +0 -612
- package/src/utils/extract-function-node.ts +0 -70
- package/src/utils/extract-node-value.test.ts +0 -117
- package/src/utils/extract-node-value.ts +0 -172
- package/src/utils/extract-secret-usage.test.ts +0 -81
- package/src/utils/extract-secret-usage.ts +0 -73
- package/src/utils/extract-services.ts +0 -70
- package/src/utils/extract-surface-usage.test.ts +0 -147
- package/src/utils/extract-surface-usage.ts +0 -121
- package/src/utils/filter-inspector-state.test.ts +0 -2232
- package/src/utils/filter-inspector-state.ts +0 -1298
- package/src/utils/filter-utils.test.ts +0 -843
- package/src/utils/filter-utils.ts +0 -161
- package/src/utils/find-root-dir.ts +0 -68
- package/src/utils/find-zod-transform.test.ts +0 -70
- package/src/utils/find-zod-transform.ts +0 -103
- package/src/utils/get-exported-variable-name.ts +0 -48
- package/src/utils/get-files-and-methods.ts +0 -157
- package/src/utils/get-property-value.test.ts +0 -141
- package/src/utils/get-property-value.ts +0 -331
- package/src/utils/hash.ts +0 -26
- package/src/utils/literal-properties.ts +0 -97
- package/src/utils/load-addon-functions-meta.test.ts +0 -157
- package/src/utils/load-addon-functions-meta.ts +0 -508
- package/src/utils/load-addon-scopes.test.ts +0 -138
- package/src/utils/middleware.test.ts +0 -204
- package/src/utils/middleware.ts +0 -303
- package/src/utils/nested-project-filter.test.ts +0 -53
- package/src/utils/nested-project-filter.ts +0 -28
- package/src/utils/permissions-shorthand.test.ts +0 -79
- package/src/utils/permissions.test.ts +0 -125
- package/src/utils/permissions.ts +0 -129
- package/src/utils/post-process.test.ts +0 -1094
- package/src/utils/post-process.ts +0 -1604
- package/src/utils/resolve-addon-package.ts +0 -106
- package/src/utils/resolve-core-type.test.ts +0 -142
- package/src/utils/resolve-core-type.ts +0 -35
- package/src/utils/resolve-deploy-target.test.ts +0 -135
- package/src/utils/resolve-deploy-target.ts +0 -65
- package/src/utils/resolve-function-meta.ts +0 -25
- package/src/utils/resolve-function-types.ts +0 -42
- package/src/utils/resolve-identifier.ts +0 -46
- package/src/utils/resolve-ref-contract.ts +0 -71
- package/src/utils/resolve-versions.test.ts +0 -499
- package/src/utils/resolve-versions.ts +0 -228
- package/src/utils/schema-cache.test.ts +0 -124
- package/src/utils/schema-generator.test.ts +0 -272
- package/src/utils/schema-generator.ts +0 -780
- package/src/utils/secret-alias-services.test.ts +0 -146
- package/src/utils/secret-alias-services.ts +0 -58
- package/src/utils/serialize-inspector-state.ts +0 -742
- package/src/utils/serialize-mcp-json.ts +0 -150
- package/src/utils/serialize-middleware-groups-meta.ts +0 -36
- package/src/utils/serialize-openapi-json.ts +0 -277
- package/src/utils/serialize-permissions-groups-meta.ts +0 -7
- package/src/utils/single-declaration.ts +0 -57
- package/src/utils/type-utils.ts +0 -145
- package/src/utils/validate-auth-sessionless.ts +0 -30
- package/src/utils/validate-exposed-functions-gated.test.ts +0 -230
- package/src/utils/validate-exposed-functions-gated.ts +0 -103
- package/src/utils/validate-tags-resolve-to-middleware.test.ts +0 -108
- package/src/utils/validate-tags-resolve-to-middleware.ts +0 -48
- package/src/utils/workflow/derive-workflow-plan.test.ts +0 -178
- package/src/utils/workflow/derive-workflow-plan.ts +0 -117
- package/src/utils/workflow/dsl/deserialize-dsl-workflow.ts +0 -1465
- package/src/utils/workflow/dsl/deserialize-fanout-body.test.ts +0 -71
- package/src/utils/workflow/dsl/deserialize-fanout-fidelity.test.ts +0 -99
- package/src/utils/workflow/dsl/deserialize-graph-next.test.ts +0 -161
- package/src/utils/workflow/dsl/deserialize-roundtrip-bindings.test.ts +0 -121
- package/src/utils/workflow/dsl/deserialize-roundtrip-values.test.ts +0 -116
- package/src/utils/workflow/dsl/deserialize-roundtrip.test.ts +0 -145
- package/src/utils/workflow/dsl/extract-approval-policy.test.ts +0 -71
- package/src/utils/workflow/dsl/extract-dsl-workflow.ts +0 -2254
- package/src/utils/workflow/dsl/index.ts +0 -11
- package/src/utils/workflow/dsl/patterns.ts +0 -440
- package/src/utils/workflow/dsl/validation.ts +0 -203
- package/src/utils/workflow/graph/convert-dsl-to-graph-skip.test.ts +0 -35
- package/src/utils/workflow/graph/convert-dsl-to-graph.ts +0 -543
- package/src/utils/workflow/graph/fanout-node-identity.test.ts +0 -105
- package/src/utils/workflow/graph/finalize-workflow-wires.ts +0 -310
- package/src/utils/workflow/graph/finalize-workflows.test.ts +0 -50
- package/src/utils/workflow/graph/finalize-workflows.ts +0 -130
- package/src/utils/workflow/graph/index.ts +0 -28
- package/src/utils/workflow/graph/serialize-workflow-graph.ts +0 -240
- package/src/utils/workflow/graph/workflow-graph.types.ts +0 -281
- package/src/visit.ts +0 -181
- package/tsconfig.json +0 -19
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { strict as assert } from 'assert'
|
|
2
|
-
import { describe, test } from 'node:test'
|
|
3
|
-
import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises'
|
|
4
|
-
import { tmpdir } from 'node:os'
|
|
5
|
-
import { join } from 'node:path'
|
|
6
|
-
import { inspect } from './inspector.js'
|
|
7
|
-
import type { InspectorLogger } from './types.js'
|
|
8
|
-
|
|
9
|
-
const logger: InspectorLogger = {
|
|
10
|
-
debug: () => {},
|
|
11
|
-
info: () => {},
|
|
12
|
-
warn: () => {},
|
|
13
|
-
error: () => {},
|
|
14
|
-
diagnostic: () => {},
|
|
15
|
-
critical: () => {},
|
|
16
|
-
hasCriticalErrors: () => false,
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const FACTORY = [
|
|
20
|
-
'export type Config = {',
|
|
21
|
-
' name: string',
|
|
22
|
-
' func: (services: any, data: { qty: number }) => Promise<{ ok: boolean }>',
|
|
23
|
-
'}',
|
|
24
|
-
'export const pikkuSessionlessFunc = (config: Config): Config => config',
|
|
25
|
-
].join('\n')
|
|
26
|
-
|
|
27
|
-
// The parameter is deliberately unannotated: its type can only come from the
|
|
28
|
-
// factory's contextual type, which is exactly what an unresolved import loses.
|
|
29
|
-
const funcSource = (specifier: string) =>
|
|
30
|
-
[
|
|
31
|
-
`import { pikkuSessionlessFunc } from '${specifier}'`,
|
|
32
|
-
'export const buysAnApple = pikkuSessionlessFunc({',
|
|
33
|
-
" name: 'buysAnApple',",
|
|
34
|
-
' func: async (_services, data) => ({ ok: data.qty > 0 }),',
|
|
35
|
-
'})',
|
|
36
|
-
].join('\n')
|
|
37
|
-
|
|
38
|
-
const makeProject = async (specifier: string) => {
|
|
39
|
-
const rootDir = await mkdtemp(join(tmpdir(), 'pikku-tsconfig-paths-'))
|
|
40
|
-
await mkdir(join(rootDir, 'generated'))
|
|
41
|
-
await mkdir(join(rootDir, 'src'))
|
|
42
|
-
await writeFile(
|
|
43
|
-
join(rootDir, 'tsconfig.json'),
|
|
44
|
-
JSON.stringify({
|
|
45
|
-
compilerOptions: {
|
|
46
|
-
module: 'NodeNext',
|
|
47
|
-
moduleResolution: 'NodeNext',
|
|
48
|
-
paths: { '#gen/*': ['./generated/*'] },
|
|
49
|
-
},
|
|
50
|
-
})
|
|
51
|
-
)
|
|
52
|
-
await writeFile(
|
|
53
|
-
join(rootDir, 'package.json'),
|
|
54
|
-
JSON.stringify({ type: 'module' })
|
|
55
|
-
)
|
|
56
|
-
await writeFile(join(rootDir, 'generated', 'factory.ts'), FACTORY)
|
|
57
|
-
const funcFile = join(rootDir, 'src', 'apple.func.ts')
|
|
58
|
-
await writeFile(funcFile, funcSource(specifier))
|
|
59
|
-
return { rootDir, funcFile, tsconfig: join(rootDir, 'tsconfig.json') }
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
describe('tsconfig path mappings', () => {
|
|
63
|
-
test('a relative import gives the function its input type', async () => {
|
|
64
|
-
const { rootDir, funcFile } = await makeProject('../generated/factory.js')
|
|
65
|
-
try {
|
|
66
|
-
const state = await inspect(logger, [funcFile], { rootDir })
|
|
67
|
-
const meta = state.functions.meta['buysAnApple']
|
|
68
|
-
assert.ok(meta, 'buysAnApple meta should exist')
|
|
69
|
-
assert.deepStrictEqual(meta!.inputs, ['BuysAnAppleInput'])
|
|
70
|
-
} finally {
|
|
71
|
-
await rm(rootDir, { recursive: true, force: true })
|
|
72
|
-
}
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
test('an import that only resolves through tsconfig paths keeps its input type', async () => {
|
|
76
|
-
const { rootDir, funcFile, tsconfig } = await makeProject('#gen/factory.js')
|
|
77
|
-
try {
|
|
78
|
-
const state = await inspect(logger, [funcFile], { rootDir, tsconfig })
|
|
79
|
-
const meta = state.functions.meta['buysAnApple']
|
|
80
|
-
assert.ok(meta, 'buysAnApple meta should exist')
|
|
81
|
-
assert.deepStrictEqual(
|
|
82
|
-
meta!.inputs,
|
|
83
|
-
['BuysAnAppleInput'],
|
|
84
|
-
'without the project path mappings the factory resolves to `any`, and the input is silently dropped'
|
|
85
|
-
)
|
|
86
|
-
} finally {
|
|
87
|
-
await rm(rootDir, { recursive: true, force: true })
|
|
88
|
-
}
|
|
89
|
-
})
|
|
90
|
-
})
|
package/src/types-map.ts
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
export class TypesMap {
|
|
2
|
-
private map: Map<string, { originalName: string; path: string | null }> =
|
|
3
|
-
new Map()
|
|
4
|
-
public customTypes: Map<string, { type: string; references: string[] }> =
|
|
5
|
-
new Map()
|
|
6
|
-
|
|
7
|
-
public addCustomType(name: string, type: string, references: string[]) {
|
|
8
|
-
this.customTypes.set(name, { type, references })
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
public addType(originalName: string, path: string) {
|
|
12
|
-
this.map.set(originalName, { originalName, path })
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public addUniqueType(originalName: string, path: string): string {
|
|
16
|
-
const uniqueName = `${originalName}_${Math.random().toString(36).substring(7)}`
|
|
17
|
-
this.map.set(uniqueName, { originalName, path })
|
|
18
|
-
return uniqueName
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
public getUniqueName(name: string): string {
|
|
22
|
-
const meta = this.getTypeMeta(name)
|
|
23
|
-
return meta.uniqueName
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
public getTypeMeta(name: string): {
|
|
27
|
-
originalName: string
|
|
28
|
-
uniqueName: string
|
|
29
|
-
path: string | null
|
|
30
|
-
} {
|
|
31
|
-
if (
|
|
32
|
-
[
|
|
33
|
-
'string',
|
|
34
|
-
'number',
|
|
35
|
-
'boolean',
|
|
36
|
-
'null',
|
|
37
|
-
'undefined',
|
|
38
|
-
'void',
|
|
39
|
-
'unknown',
|
|
40
|
-
'never',
|
|
41
|
-
].includes(name)
|
|
42
|
-
) {
|
|
43
|
-
return {
|
|
44
|
-
originalName: name,
|
|
45
|
-
uniqueName: name,
|
|
46
|
-
path: null,
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (this.customTypes.has(name)) {
|
|
51
|
-
return {
|
|
52
|
-
originalName: name,
|
|
53
|
-
uniqueName: name,
|
|
54
|
-
path: null,
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
let meta = this.map.get(name)
|
|
59
|
-
if (!meta) {
|
|
60
|
-
meta = Array.from(this.map.entries()).find(
|
|
61
|
-
([_, { originalName }]) => originalName === name
|
|
62
|
-
)?.[1]
|
|
63
|
-
}
|
|
64
|
-
if (!meta) {
|
|
65
|
-
throw new Error(`Type ${name} not found in typesMap`)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const getName = this.squash()
|
|
69
|
-
return {
|
|
70
|
-
uniqueName: getName(name),
|
|
71
|
-
originalName: meta.originalName,
|
|
72
|
-
path: meta?.path,
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
public exists(originalName: string, path: string): string | undefined {
|
|
77
|
-
const found = Array.from(this.map.entries()).find(([_, type]) => {
|
|
78
|
-
return type.path === path && type.originalName === originalName
|
|
79
|
-
})
|
|
80
|
-
return found ? found[0] : undefined
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
private squash() {
|
|
84
|
-
const duplicateNames = new Set<string>()
|
|
85
|
-
const pathToNamesMap = new Map<string, Map<string, string>>()
|
|
86
|
-
const nameOccurrences = new Map<string, Set<string>>()
|
|
87
|
-
|
|
88
|
-
// First pass: Track occurrences of each original name across paths
|
|
89
|
-
this.map.forEach(({ path, originalName }) => {
|
|
90
|
-
if (path) {
|
|
91
|
-
if (!nameOccurrences.has(originalName)) {
|
|
92
|
-
nameOccurrences.set(originalName, new Set())
|
|
93
|
-
}
|
|
94
|
-
nameOccurrences.get(originalName)!.add(path)
|
|
95
|
-
}
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
// Second pass: Populate pathToNamesMap
|
|
99
|
-
this.map.forEach(({ path, originalName }, uniqueName) => {
|
|
100
|
-
if (!path) return
|
|
101
|
-
|
|
102
|
-
if (!pathToNamesMap.has(path)) {
|
|
103
|
-
pathToNamesMap.set(path, new Map())
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const isDuplicate = nameOccurrences.get(originalName)!.size > 1
|
|
107
|
-
if (isDuplicate) {
|
|
108
|
-
duplicateNames.add(uniqueName)
|
|
109
|
-
}
|
|
110
|
-
// Use uniqueName only if the originalName is duplicated across files
|
|
111
|
-
const nameToUse = isDuplicate ? uniqueName : originalName
|
|
112
|
-
pathToNamesMap.get(path)!.set(nameToUse, originalName)
|
|
113
|
-
})
|
|
114
|
-
|
|
115
|
-
const getName = (uniqueName: string) => {
|
|
116
|
-
if (duplicateNames.has(uniqueName)) {
|
|
117
|
-
return uniqueName
|
|
118
|
-
}
|
|
119
|
-
if (
|
|
120
|
-
uniqueName === 'string' ||
|
|
121
|
-
uniqueName === 'number' ||
|
|
122
|
-
uniqueName === 'boolean' ||
|
|
123
|
-
uniqueName === 'null'
|
|
124
|
-
) {
|
|
125
|
-
return uniqueName
|
|
126
|
-
}
|
|
127
|
-
if (!this.map.has(uniqueName)) {
|
|
128
|
-
const found = Array.from(this.map.entries()).find(
|
|
129
|
-
([_, { originalName }]) => originalName === uniqueName
|
|
130
|
-
)?.[1]
|
|
131
|
-
if (!found) {
|
|
132
|
-
throw new Error(`Type ${uniqueName} not found in typesMap`)
|
|
133
|
-
}
|
|
134
|
-
return found.originalName
|
|
135
|
-
}
|
|
136
|
-
return this.map.get(uniqueName)!.originalName
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
return getName
|
|
140
|
-
}
|
|
141
|
-
}
|