@codeyam/codeyam-cli 0.1.0-staging.ad31e3e → 0.1.0-staging.bbe4da9
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/analyzer-template/.build-info.json +7 -7
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/packages/ai/index.ts +4 -1
- package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +18 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +56 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +64 -1
- package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +2 -0
- package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +29 -2
- package/analyzer-template/packages/analyze/src/lib/asts/nodes/getNodeType.ts +1 -1
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllExportedNodes.ts +4 -2
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllExports.ts +5 -3
- package/analyzer-template/packages/analyze/src/lib/files/analyzeRemixRoute.ts +21 -33
- package/analyzer-template/packages/analyze/src/lib/files/getImportedExports.ts +75 -10
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +26 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.ts +12 -2
- package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.d.ts.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.js +2 -2
- package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.js.map +1 -1
- package/analyzer-template/packages/aws/src/lib/s3/getPresignedUrl.ts +2 -2
- package/analyzer-template/packages/github/dist/supabase/src/lib/scenarioToDb.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/supabase/src/lib/scenarioToDb.js +1 -1
- package/analyzer-template/packages/github/dist/supabase/src/lib/scenarioToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/applyUniversalMocks.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/applyUniversalMocks.js +39 -5
- package/analyzer-template/packages/github/dist/utils/src/lib/applyUniversalMocks.js.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/lightweightEntityExtractor.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/lightweightEntityExtractor.js +17 -0
- package/analyzer-template/packages/github/dist/utils/src/lib/lightweightEntityExtractor.js.map +1 -1
- package/analyzer-template/packages/supabase/src/lib/scenarioToDb.ts +1 -0
- package/analyzer-template/packages/utils/dist/utils/src/lib/applyUniversalMocks.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/applyUniversalMocks.js +39 -5
- package/analyzer-template/packages/utils/dist/utils/src/lib/applyUniversalMocks.js.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/lightweightEntityExtractor.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/lightweightEntityExtractor.js +17 -0
- package/analyzer-template/packages/utils/dist/utils/src/lib/lightweightEntityExtractor.js.map +1 -1
- package/analyzer-template/packages/utils/src/lib/applyUniversalMocks.ts +46 -7
- package/analyzer-template/packages/utils/src/lib/lightweightEntityExtractor.ts +16 -0
- package/analyzer-template/project/constructMockCode.ts +29 -3
- package/analyzer-template/project/runMultiScenarioServer.ts +0 -4
- package/analyzer-template/project/runScenarioServer.ts +0 -4
- package/analyzer-template/project/start.ts +1 -11
- package/analyzer-template/project/startServer.ts +50 -70
- package/analyzer-template/project/writeMockDataTsx.ts +66 -3
- package/analyzer-template/project/writeScenarioComponents.ts +451 -25
- package/analyzer-template/scripts/postbuild.cjs +12 -1
- package/background/src/lib/virtualized/project/constructMockCode.js +25 -4
- package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
- package/background/src/lib/virtualized/project/runMultiScenarioServer.js +0 -3
- package/background/src/lib/virtualized/project/runMultiScenarioServer.js.map +1 -1
- package/background/src/lib/virtualized/project/start.js +1 -8
- package/background/src/lib/virtualized/project/start.js.map +1 -1
- package/background/src/lib/virtualized/project/startServer.js +40 -68
- package/background/src/lib/virtualized/project/startServer.js.map +1 -1
- package/background/src/lib/virtualized/project/writeMockDataTsx.js +61 -3
- package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioComponents.js +296 -20
- package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
- package/codeyam-cli/src/commands/debug.js +3 -2
- package/codeyam-cli/src/commands/debug.js.map +1 -1
- package/codeyam-cli/src/commands/setup-sandbox.js +2 -1
- package/codeyam-cli/src/commands/setup-sandbox.js.map +1 -1
- package/codeyam-cli/src/commands/test-startup.js +14 -5
- package/codeyam-cli/src/commands/test-startup.js.map +1 -1
- package/codeyam-cli/src/utils/analysisRunner.js +2 -1
- package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
- package/codeyam-cli/src/utils/analyzer.js +8 -16
- package/codeyam-cli/src/utils/analyzer.js.map +1 -1
- package/codeyam-cli/src/utils/generateReport.js +12 -6
- package/codeyam-cli/src/utils/generateReport.js.map +1 -1
- package/codeyam-cli/src/utils/queue/job.js +5 -4
- package/codeyam-cli/src/utils/queue/job.js.map +1 -1
- package/codeyam-cli/src/utils/sandbox.js +190 -0
- package/codeyam-cli/src/utils/sandbox.js.map +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-D5ZHFomX.js → EntityTypeIcon-Dp_FTAs1.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-TlHocYno.js +26 -0
- package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-BYVx9KFp.js → LibraryFunctionPreview-CVMmGuIc.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-CRcT5fOZ.js → LogViewer-JkfQ-VaI.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-Cqce0_KG.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-Bual6h18.js → SafeScreenshot-BrMAP1nP.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioPreview-Bi-__7HT.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-4D2vLLJz.js → ScenarioViewer-XmIpHcLJ.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/_index-BmfhU6CA.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-Dm8lM73z.js +10 -0
- package/codeyam-cli/src/webserver/build/client/assets/{chart-column-B8fb6wnw.js → chart-column-kA4jn9if.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chunk-WWGJGFF6-De6i8FUT.js → chunk-WWGJGFF6-CgXbbZRx.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-BACUUf75.js → circle-check-B2oHQ-zo.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{clock-vWeoCemX.js → clock-BAfbP_iK.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/codeyam-name-logo-CvKwUgHo.svg +9 -0
- package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-CS7XDrKv.js → createLucideIcon-BBYuR56H.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{dev.empty-DIOEw_3i.js → dev.empty-BgPXZbm0.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-C6fctQ5v.js → entity._sha._-BkoAXaOa.js} +10 -10
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-C3FZJx1w.js → entity._sha_.create-scenario-Bj5GHkhb.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-YJz_igar.js → entity._sha_.edit._scenarioId-eW5z9AyZ.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entityStatus-BEqj2qBy.js → entityStatus-C5Okl18j.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entityVersioning-Bk_YB1jM.js → entityVersioning-CU_Lchhc.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-DiP0q291.js → entry.client-B9tSboXM.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{file-text-LM0mgxXE.js → file-text-18aYHZGd.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-Df79EyEb.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/git-CDEwTVH_.js +12 -0
- package/codeyam-cli/src/webserver/build/client/assets/globals-DXRB6jBc.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{index-D-zYbzFZ.js → index-_LjBsTxX.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-BXPKbHEb.js → loader-circle-D_EGChhq.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-3e0ffbcc.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{root-D0s7DnXb.js → root-CGyT4J4b.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/{settings-5zF_GOcS.js → settings-CEPbAsom.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/settings-R8QF_mHX.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/simulations-B_PXvFom.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-D7k-ArFa.js → triangle-alert-BthANBVv.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-AlhS7g5F.js → useLastLogLine-Blr5oZDE.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-CANr3QJ5.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{useToast-Ddo4UQv7.js → useToast-Bbf4Hokd.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/{index-iaMjuNME.js → index-vf1FETCO.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-B5s58TvB.js +169 -0
- package/codeyam-cli/src/webserver/build/server/index.js +1 -1
- package/codeyam-cli/src/webserver/build-info.json +5 -5
- package/package.json +1 -1
- package/packages/ai/index.js +1 -1
- package/packages/ai/index.js.map +1 -1
- package/packages/ai/src/lib/astScopes/processExpression.js +12 -0
- package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +38 -0
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +55 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/FileAnalyzer.js +22 -2
- package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/asts/nodes/getNodeType.js +1 -1
- package/packages/analyze/src/lib/asts/nodes/getNodeType.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getAllExportedNodes.js +3 -2
- package/packages/analyze/src/lib/asts/sourceFiles/getAllExportedNodes.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js +4 -3
- package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeRemixRoute.js +18 -23
- package/packages/analyze/src/lib/files/analyzeRemixRoute.js.map +1 -1
- package/packages/analyze/src/lib/files/getImportedExports.js +56 -4
- package/packages/analyze/src/lib/files/getImportedExports.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +24 -0
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.js +8 -2
- package/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.js.map +1 -1
- package/packages/supabase/src/lib/scenarioToDb.js +1 -1
- package/packages/supabase/src/lib/scenarioToDb.js.map +1 -1
- package/packages/utils/src/lib/applyUniversalMocks.js +39 -5
- package/packages/utils/src/lib/applyUniversalMocks.js.map +1 -1
- package/packages/utils/src/lib/lightweightEntityExtractor.js +17 -0
- package/packages/utils/src/lib/lightweightEntityExtractor.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-XDSzQLOY.js +0 -26
- package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-BORLgi0X.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioPreview-Bi-YUMa-.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/_index-BC200mfN.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-CxvZPkCv.js +0 -10
- package/codeyam-cli/src/webserver/build/client/assets/circle-alert-IdsgAK39.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-Dxh9CcaV.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/git-BXmqrWCH.js +0 -12
- package/codeyam-cli/src/webserver/build/client/assets/globals-BGS74ED-.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-e039ab42.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/settings-Dc4MlMpK.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/simulations-BQ-02-jB.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/zap-_jw-9DCp.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-CpyX1FZX.js +0 -169
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"buildTimestamp": "2025-12-
|
|
3
|
-
"buildTime":
|
|
4
|
-
"gitCommit": "
|
|
2
|
+
"buildTimestamp": "2025-12-17T19:39:28.401Z",
|
|
3
|
+
"buildTime": 1766000368401,
|
|
4
|
+
"gitCommit": "bbe4da9b5873990798f51f39d49831246271496a",
|
|
5
5
|
"nodeVersion": "v20.19.6",
|
|
6
|
-
"contentHash": "
|
|
7
|
-
"buildNumber":
|
|
8
|
-
"semanticVersion": "0.1.
|
|
9
|
-
"version": "0.1.
|
|
6
|
+
"contentHash": "be7e64fc3bba85964ee680ed15541409c2e2b8872b75b862e387b8e1e25ed618",
|
|
7
|
+
"buildNumber": 121,
|
|
8
|
+
"semanticVersion": "0.1.121",
|
|
9
|
+
"version": "0.1.121 (2025-12-17T19:39+be7e64f)"
|
|
10
10
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
[12/
|
|
3
|
-
[12/
|
|
2
|
+
[12/17/2025, 7:39:28 PM] > codeyam-combo@1.0.0 mergeDependencies
|
|
3
|
+
[12/17/2025, 7:39:28 PM] > node ./scripts/mergePackageJsonFiles.cjs
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
[12/
|
|
6
|
+
[12/17/2025, 7:39:28 PM] Merged dependencies into root package.json
|
|
7
7
|
|
|
@@ -49,7 +49,10 @@ export {
|
|
|
49
49
|
functionArguments,
|
|
50
50
|
} from './src/lib/splitOutsideParentheses';
|
|
51
51
|
export { cleanKnownObjectFunctionsFromMapping } from './src/lib/dataStructure/helpers/cleanKnownObjectFunctions';
|
|
52
|
-
export {
|
|
52
|
+
export {
|
|
53
|
+
clearAttributesFromMapping,
|
|
54
|
+
removeDuplicateFunctionCalls,
|
|
55
|
+
} from './src/lib/dataStructure/helpers/cleanNonObjectFunctions';
|
|
53
56
|
export { default as convertDotNotation } from './src/lib/dataStructure/helpers/convertDotNotation';
|
|
54
57
|
export { default as cleanOutBoundary } from './src/lib/cleanOutBoundary';
|
|
55
58
|
export { fillInDirectSchemaGapsAndUnknowns } from './src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns';
|
|
@@ -1667,6 +1667,24 @@ export function processExpression({
|
|
|
1667
1667
|
return true;
|
|
1668
1668
|
}
|
|
1669
1669
|
|
|
1670
|
+
// Handle Void Expression: void x, void 0, void func()
|
|
1671
|
+
if (ts.isVoidExpression(unwrappedNode)) {
|
|
1672
|
+
// Process the inner expression for side effects
|
|
1673
|
+
processExpression({ node: unwrappedNode.expression, context });
|
|
1674
|
+
|
|
1675
|
+
// void always returns undefined
|
|
1676
|
+
if (targetPath) {
|
|
1677
|
+
const voidPath = StructuredPath.createLiteralPath(
|
|
1678
|
+
'undefined',
|
|
1679
|
+
'undefined',
|
|
1680
|
+
);
|
|
1681
|
+
context.addEquivalence(targetPath, voidPath);
|
|
1682
|
+
context.addType(targetPath, 'undefined');
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
return true;
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1670
1688
|
// Handle Prefix Unary Expressions: ++x, --y, !z, -a
|
|
1671
1689
|
if (ts.isPrefixUnaryExpression(unwrappedNode)) {
|
|
1672
1690
|
// Process the operand
|
|
@@ -204,6 +204,12 @@ export interface FunctionCallInfo {
|
|
|
204
204
|
schema?: Record<string, string>;
|
|
205
205
|
/** Traces argument data back to original source */
|
|
206
206
|
equivalencies?: Record<string, ScopeVariable[]>;
|
|
207
|
+
/**
|
|
208
|
+
* All call signatures that were merged into this entry.
|
|
209
|
+
* When multiple method calls on the same object (e.g., logger.info, logger.debug)
|
|
210
|
+
* are encountered, they get merged into one FunctionCallInfo but we track all signatures.
|
|
211
|
+
*/
|
|
212
|
+
allCallSignatures?: string[];
|
|
207
213
|
}
|
|
208
214
|
|
|
209
215
|
/**
|
|
@@ -1086,6 +1092,22 @@ export class ScopeDataStructure {
|
|
|
1086
1092
|
...existingFunctionCall.equivalencies,
|
|
1087
1093
|
...functionCallInfo.equivalencies,
|
|
1088
1094
|
};
|
|
1095
|
+
|
|
1096
|
+
// Track all call signatures that get merged (e.g., logger.info, logger.debug, etc.)
|
|
1097
|
+
if (!existingFunctionCall.allCallSignatures) {
|
|
1098
|
+
existingFunctionCall.allCallSignatures = [
|
|
1099
|
+
existingFunctionCall.callSignature,
|
|
1100
|
+
];
|
|
1101
|
+
}
|
|
1102
|
+
if (
|
|
1103
|
+
!existingFunctionCall.allCallSignatures.includes(
|
|
1104
|
+
functionCallInfo.callSignature,
|
|
1105
|
+
)
|
|
1106
|
+
) {
|
|
1107
|
+
existingFunctionCall.allCallSignatures.push(
|
|
1108
|
+
functionCallInfo.callSignature,
|
|
1109
|
+
);
|
|
1110
|
+
}
|
|
1089
1111
|
} else {
|
|
1090
1112
|
const functionCallInfoNameParts = this.splitPath(functionCallInfo.name);
|
|
1091
1113
|
const isExternal =
|
|
@@ -2890,6 +2912,40 @@ export class ScopeDataStructure {
|
|
|
2890
2912
|
this.validateSchema(scopeNode, true, fillInUnknowns);
|
|
2891
2913
|
|
|
2892
2914
|
const { schema } = scopeNode;
|
|
2915
|
+
|
|
2916
|
+
// For root scope, merge in external function call schemas
|
|
2917
|
+
// This ensures that imported objects used as method call targets (like logger.error())
|
|
2918
|
+
// appear in the schema as objects with function properties
|
|
2919
|
+
if (
|
|
2920
|
+
scopeName === undefined ||
|
|
2921
|
+
scopeName === this.scopeTreeManager.getRootName()
|
|
2922
|
+
) {
|
|
2923
|
+
const mergedSchema = { ...schema };
|
|
2924
|
+
for (const efc of this.externalFunctionCalls) {
|
|
2925
|
+
// Add the base object name (e.g., "logger") as an object
|
|
2926
|
+
const baseName = this.splitPath(efc.name)[0];
|
|
2927
|
+
if (!mergedSchema[baseName]) {
|
|
2928
|
+
mergedSchema[baseName] = 'object';
|
|
2929
|
+
}
|
|
2930
|
+
|
|
2931
|
+
// Get all call signatures (use allCallSignatures if available, otherwise just the single callSignature)
|
|
2932
|
+
const signatures = efc.allCallSignatures ?? [efc.callSignature];
|
|
2933
|
+
for (const signature of signatures) {
|
|
2934
|
+
// Add the method as a function (e.g., "logger.error")
|
|
2935
|
+
// Extract method name from callSignature like "logger.error(args...)"
|
|
2936
|
+
// Get everything before the first '(' to get "logger.error"
|
|
2937
|
+
const parenIndex = signature.indexOf('(');
|
|
2938
|
+
if (parenIndex > 0) {
|
|
2939
|
+
const methodPath = signature.substring(0, parenIndex);
|
|
2940
|
+
if (methodPath.includes('.') && !mergedSchema[methodPath]) {
|
|
2941
|
+
mergedSchema[methodPath] = 'function';
|
|
2942
|
+
}
|
|
2943
|
+
}
|
|
2944
|
+
}
|
|
2945
|
+
}
|
|
2946
|
+
return mergedSchema;
|
|
2947
|
+
}
|
|
2948
|
+
|
|
2893
2949
|
return schema;
|
|
2894
2950
|
}
|
|
2895
2951
|
|
package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts
CHANGED
|
@@ -30,7 +30,13 @@ export const nonTransformingArrayMethodsSet = new Set([
|
|
|
30
30
|
'reverse',
|
|
31
31
|
'entries',
|
|
32
32
|
]);
|
|
33
|
-
const isolatingArrayMethodsSet = new Set([
|
|
33
|
+
const isolatingArrayMethodsSet = new Set([
|
|
34
|
+
'find',
|
|
35
|
+
'findLast', // Returns element like find, but from end
|
|
36
|
+
'at',
|
|
37
|
+
'pop',
|
|
38
|
+
'shift',
|
|
39
|
+
]);
|
|
34
40
|
|
|
35
41
|
// Methods that are ambiguous - used on both arrays and non-arrays (e.g., router.push, history.pop)
|
|
36
42
|
// Don't infer array type from these alone without additional evidence
|
|
@@ -42,6 +48,12 @@ export const transformingArrayMethodsSet = new Set([
|
|
|
42
48
|
'concat',
|
|
43
49
|
'join',
|
|
44
50
|
'some',
|
|
51
|
+
'every', // Returns boolean
|
|
52
|
+
'findIndex', // Returns number (index)
|
|
53
|
+
'findLastIndex', // Returns number (index from end)
|
|
54
|
+
'indexOf', // Returns number (index)
|
|
55
|
+
'lastIndexOf', // Returns number (index from end)
|
|
56
|
+
'includes', // Returns boolean
|
|
45
57
|
]);
|
|
46
58
|
|
|
47
59
|
export const arrayMethodsSet = new Set([
|
|
@@ -225,6 +237,54 @@ export function clearAttributesFromMapping(
|
|
|
225
237
|
clearAttributes(mapping, knownBasePaths);
|
|
226
238
|
}
|
|
227
239
|
|
|
240
|
+
/**
|
|
241
|
+
* Remove duplicate function calls (same function with different arguments) that have no return data.
|
|
242
|
+
* Example: setSelectedFilter(arg1) and setSelectedFilter(arg2) where neither has functionCallReturnValue
|
|
243
|
+
* These create invalid mock code when spread together (orphan spread statements).
|
|
244
|
+
*
|
|
245
|
+
* This is a targeted fix that can be called independently without the full clearAttributes logic,
|
|
246
|
+
* which was disabled in constructMockCode.ts due to side effects on array method calls.
|
|
247
|
+
*/
|
|
248
|
+
export function removeDuplicateFunctionCalls(
|
|
249
|
+
mapping: Record<string, string>,
|
|
250
|
+
): void {
|
|
251
|
+
const allKeys = Object.keys(mapping);
|
|
252
|
+
const functionCallGroups: { [baseName: string]: string[] } = {};
|
|
253
|
+
|
|
254
|
+
for (const key of allKeys) {
|
|
255
|
+
// Only process paths that:
|
|
256
|
+
// 1. Are marked as 'function'
|
|
257
|
+
// 2. END with a function call (parentheses) - not just contain one somewhere
|
|
258
|
+
// 3. Are on an object path (contain '.')
|
|
259
|
+
if (mapping[key] === 'function' && key.endsWith(')') && key.includes('.')) {
|
|
260
|
+
// Extract base path + function name (without the arguments)
|
|
261
|
+
// e.g., "returnValue.setSelectedFilter(arg)" -> "returnValue.setSelectedFilter"
|
|
262
|
+
const baseName = key.replace(/\([^)]*\)$/, '');
|
|
263
|
+
functionCallGroups[baseName] ||= [];
|
|
264
|
+
functionCallGroups[baseName].push(key);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// For groups with multiple calls (same function, different args), remove those without return data
|
|
269
|
+
for (const baseName in functionCallGroups) {
|
|
270
|
+
const calls = functionCallGroups[baseName];
|
|
271
|
+
if (calls.length > 1) {
|
|
272
|
+
// Multiple calls to the same function with different arguments
|
|
273
|
+
for (const callPath of calls) {
|
|
274
|
+
// Check if this call has return data
|
|
275
|
+
const hasReturnData = allKeys.some(
|
|
276
|
+
(k: string) =>
|
|
277
|
+
k.startsWith(callPath + '.functionCallReturnValue') ||
|
|
278
|
+
k.startsWith(callPath + '.signature['),
|
|
279
|
+
);
|
|
280
|
+
if (!hasReturnData) {
|
|
281
|
+
delete mapping[callPath];
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
228
288
|
function transformPath({
|
|
229
289
|
oldPath,
|
|
230
290
|
newPath,
|
|
@@ -901,6 +961,9 @@ function clearAttributes(
|
|
|
901
961
|
}
|
|
902
962
|
}
|
|
903
963
|
|
|
964
|
+
// Remove duplicate function calls (same function with different arguments) that have no return data
|
|
965
|
+
removeDuplicateFunctionCalls(mapping);
|
|
966
|
+
|
|
904
967
|
for (const key in mapping) {
|
|
905
968
|
const value = mapping[key];
|
|
906
969
|
if (knownTypes.has(value)) {
|
|
@@ -22,6 +22,8 @@ export interface SerializableFunctionCallInfo {
|
|
|
22
22
|
callScope: string;
|
|
23
23
|
schema?: Record<string, string>;
|
|
24
24
|
equivalencies?: Record<string, SerializableScopeVariable[]>;
|
|
25
|
+
/** All call signatures merged into this entry (e.g., logger.info, logger.debug) */
|
|
26
|
+
allCallSignatures?: string[];
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
export interface SerializableFunctionResult {
|
|
@@ -348,14 +348,41 @@ export class FileAnalyzer {
|
|
|
348
348
|
}
|
|
349
349
|
|
|
350
350
|
const relativePath = this.projectAnalyzer.getRelativePath(importPath);
|
|
351
|
-
|
|
351
|
+
let projectPath = this.projectAnalyzer.getRelativePath(
|
|
352
352
|
resolvedImport.resolvedFileName,
|
|
353
353
|
);
|
|
354
354
|
|
|
355
|
-
|
|
355
|
+
let importedFile = this.projectAnalyzer.project.files.find(
|
|
356
356
|
(f) => f.path === projectPath,
|
|
357
357
|
);
|
|
358
358
|
|
|
359
|
+
// Workspace packages often resolve to dist/ paths (from package.json "types" or "main"),
|
|
360
|
+
// but our project.files contains source files in src/. Try mapping dist -> src.
|
|
361
|
+
if (!importedFile && projectPath.includes('/dist/')) {
|
|
362
|
+
const srcPath = projectPath.replace('/dist/', '/src/');
|
|
363
|
+
// Try exact match first (e.g., dist/index.d.ts -> src/index.ts)
|
|
364
|
+
importedFile = this.projectAnalyzer.project.files.find(
|
|
365
|
+
(f) => f.path === srcPath,
|
|
366
|
+
);
|
|
367
|
+
if (importedFile) {
|
|
368
|
+
projectPath = srcPath;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// If not found, try with different extensions
|
|
372
|
+
if (!importedFile) {
|
|
373
|
+
const basePath = srcPath
|
|
374
|
+
.replace(/\.d\.ts$/, '')
|
|
375
|
+
.replace(/\.js$/, '');
|
|
376
|
+
importedFile = this.projectAnalyzer.project.files.find(
|
|
377
|
+
(f) =>
|
|
378
|
+
f.path === basePath + '.ts' || f.path === basePath + '.tsx',
|
|
379
|
+
);
|
|
380
|
+
if (importedFile) {
|
|
381
|
+
projectPath = importedFile.path;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
359
386
|
if (!importedFile) {
|
|
360
387
|
// File not found in project.files, but still preserve resolvedPath
|
|
361
388
|
return [
|
|
@@ -54,13 +54,15 @@ export function getAllExportedNodes(
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
function processNamedExports(node: ts.NamedExports) {
|
|
57
|
+
const parent = node.parent as ts.ExportDeclaration | undefined;
|
|
58
|
+
|
|
57
59
|
node.elements.forEach((element) => {
|
|
58
60
|
const name = element.name.text;
|
|
59
61
|
const propertyName = element.propertyName
|
|
60
62
|
? element.propertyName.text
|
|
61
63
|
: name;
|
|
62
|
-
const importedSource =
|
|
63
|
-
?
|
|
64
|
+
const importedSource = parent?.moduleSpecifier
|
|
65
|
+
? parent.moduleSpecifier.getText(sourceFile)
|
|
64
66
|
: undefined;
|
|
65
67
|
|
|
66
68
|
if (importedSource) {
|
|
@@ -103,19 +103,21 @@ export function getAllExports(
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
function processNamedExports(node: ts.NamedExports) {
|
|
106
|
+
const parent = node.parent as ts.ExportDeclaration | undefined;
|
|
107
|
+
|
|
106
108
|
node.elements.forEach((element) => {
|
|
107
109
|
const name = element.name.text;
|
|
108
110
|
const propertyName = element.propertyName
|
|
109
111
|
? element.propertyName.text
|
|
110
112
|
: name;
|
|
111
|
-
const importedSource =
|
|
112
|
-
?
|
|
113
|
+
const importedSource = parent?.moduleSpecifier
|
|
114
|
+
? parent.moduleSpecifier.getText(sourceFile)
|
|
113
115
|
: undefined;
|
|
114
116
|
|
|
115
117
|
if (importedSource) {
|
|
116
118
|
const directImportPath = importedSource?.replace(/['"]/g, '');
|
|
117
119
|
const directImport = (
|
|
118
|
-
|
|
120
|
+
parent?.exportClause as ts.NamedExports | undefined
|
|
119
121
|
)?.elements?.find(
|
|
120
122
|
(e) => (e.propertyName || e.name).text === propertyName,
|
|
121
123
|
);
|
|
@@ -48,29 +48,20 @@ export default function analyzeRemixRoute(
|
|
|
48
48
|
const implicitRouteFileAnalyzer =
|
|
49
49
|
projectAnalyzer.getFileAnalyzer(implicitRoute);
|
|
50
50
|
const exports = implicitRouteFileAnalyzer.getAllExports();
|
|
51
|
-
const defaultExport = Object.values(exports).find(
|
|
52
|
-
(e) => e.isDefaultExport,
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
// Ensure entities array exists before trying to use it
|
|
56
|
-
if (!implicitRoute.entities) {
|
|
57
|
-
console.log(
|
|
58
|
-
`CodeYam Warning: implicitRoute.entities not populated for ${implicitRoute.path}, skipping implicit dependency`,
|
|
59
|
-
);
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
51
|
|
|
63
|
-
|
|
64
|
-
|
|
52
|
+
// Find the default export entry - the key is the entity name
|
|
53
|
+
const defaultExportEntry = Object.entries(exports).find(
|
|
54
|
+
([, e]) => e.isDefaultExport,
|
|
65
55
|
);
|
|
66
56
|
|
|
67
|
-
if (!
|
|
57
|
+
if (!defaultExportEntry) return;
|
|
68
58
|
|
|
59
|
+
const [entityName, defaultExport] = defaultExportEntry;
|
|
69
60
|
const code = defaultExport.code;
|
|
70
61
|
return {
|
|
71
62
|
code: code,
|
|
72
63
|
// sha: generateSha(implicitRoute.path, 'default', code),
|
|
73
|
-
name:
|
|
64
|
+
name: entityName,
|
|
74
65
|
filePath: implicitRoute.path,
|
|
75
66
|
projectId: entity.projectId,
|
|
76
67
|
entityType: 'visual' as EntityType,
|
|
@@ -108,26 +99,23 @@ export default function analyzeRemixRoute(
|
|
|
108
99
|
try {
|
|
109
100
|
const rootFileAnalyzer = projectAnalyzer.getFileAnalyzer(rootFile);
|
|
110
101
|
const exports = rootFileAnalyzer.getAllExports();
|
|
111
|
-
const defaultExport = Object.values(exports).find(
|
|
112
|
-
(e) => e.isDefaultExport,
|
|
113
|
-
);
|
|
114
102
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
103
|
+
// Find the default export entry - the key is the entity name
|
|
104
|
+
const defaultExportEntry = Object.entries(exports).find(
|
|
105
|
+
([, e]) => e.isDefaultExport,
|
|
106
|
+
);
|
|
119
107
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
108
|
+
if (defaultExportEntry) {
|
|
109
|
+
const [entityName, defaultExport] = defaultExportEntry;
|
|
110
|
+
rootDependencies.push({
|
|
111
|
+
code: defaultExport.code,
|
|
112
|
+
name: entityName,
|
|
113
|
+
filePath: rootFile.path,
|
|
114
|
+
entityType: 'visual' as EntityType,
|
|
115
|
+
isDefault: true,
|
|
116
|
+
isImplicitDependency: true,
|
|
117
|
+
isMocked: false,
|
|
118
|
+
});
|
|
131
119
|
}
|
|
132
120
|
} catch (e) {
|
|
133
121
|
console.log(
|
|
@@ -63,18 +63,83 @@ export default function getImportedExports(
|
|
|
63
63
|
imports[filePath].resolvedPath ??
|
|
64
64
|
filePath;
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
let importedExportFile = project.files.find(
|
|
67
67
|
(f) => f.path === searchPath,
|
|
68
68
|
);
|
|
69
69
|
|
|
70
|
+
// Track the actual path we found (may differ from searchPath after dist->src mapping)
|
|
71
|
+
let actualResolvedPath = imports[filePath].resolvedPath;
|
|
72
|
+
|
|
73
|
+
// Workspace packages often resolve to dist/ paths (from package.json "types" or "main"),
|
|
74
|
+
// but our project.files contains source files in src/. Try mapping dist -> src.
|
|
75
|
+
if (!importedExportFile && searchPath.includes('/dist/')) {
|
|
76
|
+
const srcPath = searchPath.replace('/dist/', '/src/');
|
|
77
|
+
// Try exact match first
|
|
78
|
+
importedExportFile = project.files.find((f) => f.path === srcPath);
|
|
79
|
+
if (importedExportFile) {
|
|
80
|
+
actualResolvedPath = srcPath;
|
|
81
|
+
console.log(
|
|
82
|
+
`CodeYam: Mapped dist->src path: ${searchPath} -> ${srcPath}`,
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// If not found, the dist file might be index.d.ts but src might be index.ts
|
|
87
|
+
// or the export might be re-exported from another file
|
|
88
|
+
if (!importedExportFile) {
|
|
89
|
+
// Try removing .d.ts extension and finding any matching src file
|
|
90
|
+
const basePath = srcPath
|
|
91
|
+
.replace(/\.d\.ts$/, '')
|
|
92
|
+
.replace(/\.js$/, '');
|
|
93
|
+
importedExportFile = project.files.find(
|
|
94
|
+
(f) =>
|
|
95
|
+
f.path === basePath + '.ts' ||
|
|
96
|
+
f.path === basePath + '.tsx' ||
|
|
97
|
+
(f.path.startsWith(basePath.replace('/index', '/')) &&
|
|
98
|
+
!f.path.includes('/dist/')),
|
|
99
|
+
);
|
|
100
|
+
if (importedExportFile) {
|
|
101
|
+
actualResolvedPath = importedExportFile.path;
|
|
102
|
+
console.log(
|
|
103
|
+
`CodeYam: Mapped dist->src path (extension): ${searchPath} -> ${importedExportFile.path}`,
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
70
109
|
if (!importedExportFile) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
110
|
+
// Check if this is a workspace package import (scoped npm package like @scope/package)
|
|
111
|
+
// but NOT a path alias like @/path or @components/...
|
|
112
|
+
// Scoped packages have format: @scope/package where scope is alphanumeric with hyphens
|
|
113
|
+
const isScopedPackage =
|
|
114
|
+
filePath.startsWith('@') &&
|
|
115
|
+
!filePath.startsWith('@/') && // Not a path alias like @/modules/...
|
|
116
|
+
!filePath.startsWith('@types/') &&
|
|
117
|
+
/^@[a-z0-9-]+\/[a-z0-9-]/.test(filePath); // Matches @scope/package pattern
|
|
118
|
+
if (isScopedPackage) {
|
|
119
|
+
// Treat unresolved scoped packages like node modules so they get mocked
|
|
120
|
+
// instead of being silently ignored
|
|
121
|
+
const name =
|
|
122
|
+
importedExportInfo.importName ?? importedExportInfo.importAlias;
|
|
123
|
+
console.log(
|
|
124
|
+
`CodeYam: Treating unresolved scoped package as node module: ${filePath} -> ${name}`,
|
|
125
|
+
);
|
|
126
|
+
return {
|
|
127
|
+
filePath,
|
|
128
|
+
name,
|
|
129
|
+
isDefault: importedExportInfo.isImportDefault,
|
|
130
|
+
isNodeModule: true, // Mark as node module so it gets mocked
|
|
131
|
+
entityType: 'library' as const, // Default to library since we can't determine the actual type
|
|
132
|
+
// No code since we couldn't resolve the source file
|
|
133
|
+
};
|
|
134
|
+
} else {
|
|
135
|
+
console.log(
|
|
136
|
+
'CodeYam Error: File not found for imported export',
|
|
137
|
+
file.path,
|
|
138
|
+
filePath,
|
|
139
|
+
importedExportInfo,
|
|
140
|
+
imports[filePath],
|
|
141
|
+
);
|
|
142
|
+
}
|
|
78
143
|
return;
|
|
79
144
|
}
|
|
80
145
|
|
|
@@ -96,10 +161,10 @@ export default function getImportedExports(
|
|
|
96
161
|
|
|
97
162
|
return {
|
|
98
163
|
fileId: importedExportFile.id,
|
|
99
|
-
filePath:
|
|
164
|
+
filePath: actualResolvedPath,
|
|
100
165
|
isDefault: importedExportInfo.isImportDefault,
|
|
101
166
|
resolvedFilePath:
|
|
102
|
-
resolvedFilePath ===
|
|
167
|
+
resolvedFilePath === actualResolvedPath
|
|
103
168
|
? undefined
|
|
104
169
|
: resolvedFilePath,
|
|
105
170
|
resolvedName: resolvedName === name ? undefined : resolvedName,
|
|
@@ -132,6 +132,32 @@ export default function gatherDataForMocks(
|
|
|
132
132
|
preprocessedSchema = mergedSchema;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
// Merge generic call (e.g., "foo()") data into specific argument calls (e.g., "foo(arg1, arg2)")
|
|
136
|
+
// This handles the case where the generic schema has richer nested data than the specific call
|
|
137
|
+
if (callName.includes('(') && !callName.includes('<')) {
|
|
138
|
+
// Extract the base function name and create generic call
|
|
139
|
+
const baseFunctionName = callName.split('(')[0];
|
|
140
|
+
const genericCall = baseFunctionName + '()';
|
|
141
|
+
|
|
142
|
+
// Only merge if the callName has arguments (not just empty parens)
|
|
143
|
+
if (callName !== genericCall) {
|
|
144
|
+
const mergedSchema: Record<string, string> = {
|
|
145
|
+
...preprocessedSchema,
|
|
146
|
+
};
|
|
147
|
+
for (const path of Object.keys(preprocessedSchema)) {
|
|
148
|
+
if (path.startsWith(genericCall)) {
|
|
149
|
+
// Create corresponding specific path
|
|
150
|
+
const specificPath = callName + path.slice(genericCall.length);
|
|
151
|
+
// Only add if the specific path doesn't already exist
|
|
152
|
+
if (!mergedSchema[specificPath]) {
|
|
153
|
+
mergedSchema[specificPath] = preprocessedSchema[path];
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
preprocessedSchema = mergedSchema;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
135
161
|
const relevantMergedDependencySchema = Object.keys(
|
|
136
162
|
preprocessedSchema,
|
|
137
163
|
).reduce(
|
package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.ts
CHANGED
|
@@ -176,9 +176,19 @@ export default function mergeValidatedDataStructures({
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
|
|
180
|
-
?.dataForMocks ?? {}
|
|
179
|
+
const dependencyDataForMocks =
|
|
180
|
+
dependentAnalysis?.metadata?.scenariosDataStructure?.dataForMocks ?? {};
|
|
181
|
+
for (const mockName in dependencyDataForMocks) {
|
|
181
182
|
addMockDataForEntity(mockName);
|
|
183
|
+
|
|
184
|
+
// If addMockDataForEntity didn't find matching entries in validatedVariables,
|
|
185
|
+
// copy the dependency's value directly. This handles cases like usePathname()
|
|
186
|
+
// which returns a simple "string" type but isn't in the root's validatedVariables.
|
|
187
|
+
if (dataForMocks[mockName] === undefined) {
|
|
188
|
+
dataForMocks[mockName] = dependencyDataForMocks[
|
|
189
|
+
mockName
|
|
190
|
+
] as JsonTypeDefinition;
|
|
191
|
+
}
|
|
182
192
|
}
|
|
183
193
|
}
|
|
184
194
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPresignedUrl.d.ts","sourceRoot":"","sources":["../../../../src/lib/s3/getPresignedUrl.ts"],"names":[],"mappings":"AAOA,UAAU,yBAAyB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,UAAU,2BAA2B;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAKD;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"getPresignedUrl.d.ts","sourceRoot":"","sources":["../../../../src/lib/s3/getPresignedUrl.ts"],"names":[],"mappings":"AAOA,UAAU,yBAAyB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,UAAU,2BAA2B;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAKD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,UAAU,EACV,GAAG,EACH,WAAgC,EAChC,gBAAwC,GACzC,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CAU7C;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,UAAU,EACV,GAAG,EACH,gBAA0C,GAC3C,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC,CAS/C"}
|
|
@@ -6,7 +6,7 @@ const DEFAULT_DOWNLOAD_EXPIRY = 24 * 60 * 60; // 24 hours
|
|
|
6
6
|
* Generate a presigned URL for uploading a file to S3.
|
|
7
7
|
* The client can PUT directly to this URL without AWS credentials.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export function getPresignedUploadUrl({ bucketName, key, contentType = 'application/gzip', expiresInSeconds = DEFAULT_UPLOAD_EXPIRY, }) {
|
|
10
10
|
const s3Client = new S3Client({});
|
|
11
11
|
const command = new PutObjectCommand({
|
|
12
12
|
Bucket: bucketName,
|
|
@@ -19,7 +19,7 @@ export async function getPresignedUploadUrl({ bucketName, key, contentType = 'ap
|
|
|
19
19
|
* Generate a presigned URL for downloading a file from S3.
|
|
20
20
|
* Anyone with this URL can GET the file without AWS credentials.
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
22
|
+
export function getPresignedDownloadUrl({ bucketName, key, expiresInSeconds = DEFAULT_DOWNLOAD_EXPIRY, }) {
|
|
23
23
|
const s3Client = new S3Client({});
|
|
24
24
|
const command = new GetObjectCommand({
|
|
25
25
|
Bucket: bucketName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPresignedUrl.js","sourceRoot":"","sources":["../../../../src/lib/s3/getPresignedUrl.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAe7D,MAAM,qBAAqB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU;AACrD,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW;AAEzD;;;GAGG;AACH,MAAM,
|
|
1
|
+
{"version":3,"file":"getPresignedUrl.js","sourceRoot":"","sources":["../../../../src/lib/s3/getPresignedUrl.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAe7D,MAAM,qBAAqB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU;AACrD,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW;AAEzD;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,EACpC,UAAU,EACV,GAAG,EACH,WAAW,GAAG,kBAAkB,EAChC,gBAAgB,GAAG,qBAAqB,GACd;IAC1B,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,EAAE,CAAC,CAAC;IAElC,MAAM,OAAO,GAAG,IAAI,gBAAgB,CAAC;QACnC,MAAM,EAAE,UAAU;QAClB,GAAG,EAAE,GAAG;QACR,WAAW,EAAE,WAAW;KACzB,CAAC,CAAC;IAEH,OAAO,YAAY,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,EACtC,UAAU,EACV,GAAG,EACH,gBAAgB,GAAG,uBAAuB,GACd;IAC5B,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,EAAE,CAAC,CAAC;IAElC,MAAM,OAAO,GAAG,IAAI,gBAAgB,CAAC;QACnC,MAAM,EAAE,UAAU;QAClB,GAAG,EAAE,GAAG;KACT,CAAC,CAAC;IAEH,OAAO,YAAY,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAC1E,CAAC"}
|
|
@@ -25,7 +25,7 @@ const DEFAULT_DOWNLOAD_EXPIRY = 24 * 60 * 60; // 24 hours
|
|
|
25
25
|
* Generate a presigned URL for uploading a file to S3.
|
|
26
26
|
* The client can PUT directly to this URL without AWS credentials.
|
|
27
27
|
*/
|
|
28
|
-
export
|
|
28
|
+
export function getPresignedUploadUrl({
|
|
29
29
|
bucketName,
|
|
30
30
|
key,
|
|
31
31
|
contentType = 'application/gzip',
|
|
@@ -46,7 +46,7 @@ export async function getPresignedUploadUrl({
|
|
|
46
46
|
* Generate a presigned URL for downloading a file from S3.
|
|
47
47
|
* Anyone with this URL can GET the file without AWS credentials.
|
|
48
48
|
*/
|
|
49
|
-
export
|
|
49
|
+
export function getPresignedDownloadUrl({
|
|
50
50
|
bucketName,
|
|
51
51
|
key,
|
|
52
52
|
expiresInSeconds = DEFAULT_DOWNLOAD_EXPIRY,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenarioToDb.d.ts","sourceRoot":"","sources":["../../../../../supabase/src/lib/scenarioToDb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAGhE,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAQ,EAAE,QAAQ,GACjB,UAAU,CAAC,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"scenarioToDb.d.ts","sourceRoot":"","sources":["../../../../../supabase/src/lib/scenarioToDb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAGhE,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAQ,EAAE,QAAQ,GACjB,UAAU,CAAC,cAAc,CAAC,CA2B5B"}
|