@flink-app/flink 0.14.3 → 2.0.0-alpha.100
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 +1051 -0
- package/SCHEMA_EXTRACTION_ANALYSIS.md +494 -0
- package/SIMPLE_AST_FEASIBILITY.md +570 -0
- package/bin/flink.ts +13 -2
- package/cli/build.ts +24 -44
- package/cli/clean.ts +13 -25
- package/cli/cli-utils.ts +190 -17
- package/cli/dev.ts +252 -0
- package/cli/loadEnvFiles.ts +116 -0
- package/cli/run.ts +45 -62
- package/dist/bin/flink.js +61 -2
- package/dist/cli/build.js +20 -25
- package/dist/cli/clean.js +12 -10
- package/dist/cli/cli-utils.d.ts +34 -3
- package/dist/cli/cli-utils.js +193 -12
- package/dist/cli/dev.d.ts +2 -0
- package/dist/cli/dev.js +279 -0
- package/dist/cli/loadEnvFiles.d.ts +30 -0
- package/dist/cli/loadEnvFiles.js +113 -0
- package/dist/cli/run.js +47 -46
- package/dist/src/DependencyTracker.d.ts +44 -0
- package/dist/src/DependencyTracker.js +239 -0
- package/dist/src/FlinkApp.d.ts +163 -10
- package/dist/src/FlinkApp.js +847 -184
- package/dist/src/FlinkContext.d.ts +41 -0
- package/dist/src/FlinkErrors.d.ts +19 -6
- package/dist/src/FlinkErrors.js +36 -42
- package/dist/src/FlinkHttpHandler.d.ts +219 -26
- package/dist/src/FlinkHttpHandler.js +37 -1
- package/dist/src/FlinkJob.d.ts +10 -0
- package/dist/src/FlinkLog.d.ts +82 -18
- package/dist/src/FlinkLog.js +165 -13
- package/dist/src/FlinkLogFactory.d.ts +288 -0
- package/dist/src/FlinkLogFactory.js +619 -0
- package/dist/src/FlinkRepo.d.ts +10 -2
- package/dist/src/FlinkRepo.js +11 -1
- package/dist/src/FlinkRequestContext.d.ts +63 -0
- package/dist/src/FlinkRequestContext.js +74 -0
- package/dist/src/FlinkResponse.d.ts +6 -0
- package/dist/src/FlinkService.d.ts +38 -0
- package/dist/src/FlinkService.js +46 -0
- package/dist/src/LeaderElection.d.ts +45 -0
- package/dist/src/LeaderElection.js +269 -0
- package/dist/src/SchemaCache.d.ts +84 -0
- package/dist/src/SchemaCache.js +289 -0
- package/dist/src/TypeScriptCompiler.d.ts +161 -51
- package/dist/src/TypeScriptCompiler.js +1253 -617
- package/dist/src/TypeScriptUtils.js +4 -0
- package/dist/src/ai/AgentRunner.d.ts +39 -0
- package/dist/src/ai/AgentRunner.js +760 -0
- package/dist/src/ai/ConversationAgent.d.ts +279 -0
- package/dist/src/ai/ConversationAgent.js +404 -0
- package/dist/src/ai/ConversationFlinkAgent.d.ts +278 -0
- package/dist/src/ai/ConversationFlinkAgent.js +404 -0
- package/dist/src/ai/FlinkAgent.d.ts +690 -0
- package/dist/src/ai/FlinkAgent.js +729 -0
- package/dist/src/ai/FlinkTool.d.ts +135 -0
- package/dist/src/ai/FlinkTool.js +2 -0
- package/dist/src/ai/InMemoryConversationAgent.d.ts +121 -0
- package/dist/src/ai/InMemoryConversationAgent.js +209 -0
- package/dist/src/ai/LLMAdapter.d.ts +148 -0
- package/dist/src/ai/LLMAdapter.js +2 -0
- package/dist/src/ai/PersistentFlinkAgent.d.ts +278 -0
- package/dist/src/ai/PersistentFlinkAgent.js +403 -0
- package/dist/src/ai/SubAgentExecutor.d.ts +38 -0
- package/dist/src/ai/SubAgentExecutor.js +223 -0
- package/dist/src/ai/ToolExecutor.d.ts +64 -0
- package/dist/src/ai/ToolExecutor.js +497 -0
- package/dist/src/ai/agentInstructions.d.ts +68 -0
- package/dist/src/ai/agentInstructions.js +286 -0
- package/dist/src/ai/index.d.ts +8 -0
- package/dist/src/ai/index.js +26 -0
- package/dist/src/ai/instructionFileLoader.d.ts +44 -0
- package/dist/src/ai/instructionFileLoader.js +179 -0
- package/dist/src/auth/FlinkAuthPlugin.d.ts +1 -1
- package/dist/src/handlers/StreamWriterFactory.d.ts +20 -0
- package/dist/src/handlers/StreamWriterFactory.js +83 -0
- package/dist/src/index.d.ts +14 -0
- package/dist/src/index.js +17 -0
- package/dist/src/loadPluginSchemas.d.ts +45 -0
- package/dist/src/loadPluginSchemas.js +143 -0
- package/dist/src/schema-extraction/ComplexTypeDetection.d.ts +40 -0
- package/dist/src/schema-extraction/ComplexTypeDetection.js +75 -0
- package/dist/src/schema-extraction/TypeScriptSourceParser.d.ts +321 -0
- package/dist/src/schema-extraction/TypeScriptSourceParser.js +925 -0
- package/dist/src/schema-extraction/TypeScriptSourceParser.spec.d.ts +1 -0
- package/dist/src/schema-extraction/TypeScriptSourceParser.spec.js +233 -0
- package/dist/src/schema-extraction/TypeScriptTokenizer.d.ts +57 -0
- package/dist/src/schema-extraction/TypeScriptTokenizer.js +177 -0
- package/dist/src/schema-extraction/index.d.ts +2 -0
- package/dist/src/schema-extraction/index.js +20 -0
- package/dist/src/schema-extraction/types.d.ts +31 -0
- package/dist/src/schema-extraction/types.js +2 -0
- package/dist/src/utils/loadFlinkConfig.d.ts +53 -0
- package/dist/src/utils/loadFlinkConfig.js +77 -0
- package/dist/src/utils.d.ts +30 -0
- package/dist/src/utils.js +52 -0
- package/dist/src/workers/SchemaGeneratorWorker.d.ts +1 -0
- package/dist/src/workers/SchemaGeneratorWorker.js +49 -0
- package/dist/src/workers/WorkerPool.d.ts +60 -0
- package/dist/src/workers/WorkerPool.js +306 -0
- package/examples/logging-hierarchical-example.ts +125 -0
- package/package.json +29 -4
- package/readme.md +499 -0
- package/spec/AgentDescendantDetection.spec.ts +335 -0
- package/spec/AgentDuplicateDetection.spec.ts +112 -0
- package/spec/AgentObserver.spec.ts +266 -0
- package/spec/AgentRunner.spec.ts +1062 -0
- package/spec/AsyncLocalStorageContext.spec.ts +223 -0
- package/spec/ConversationHooks.spec.ts +257 -0
- package/spec/FlinkAgent.spec.ts +681 -0
- package/spec/FlinkApp.htmlResponse.spec.ts +260 -0
- package/spec/FlinkApp.onError.invocation.spec.ts +151 -0
- package/spec/FlinkApp.onError.spec.ts +1 -2
- package/spec/FlinkApp.query.spec.ts +107 -0
- package/spec/FlinkApp.routeOrdering.spec.ts +61 -0
- package/spec/FlinkApp.undefinedResponse.spec.ts +123 -0
- package/spec/FlinkApp.validationMode.spec.ts +155 -0
- package/spec/FlinkJob.spec.ts +171 -0
- package/spec/FlinkLogFactory.spec.ts +337 -0
- package/spec/FlinkRepo.spec.ts +1 -1
- package/spec/LeaderElection.spec.ts +174 -0
- package/spec/StreamingIntegration.spec.ts +139 -0
- package/spec/ToolExecutor.spec.ts +465 -0
- package/spec/TypeScriptCompiler.spec.ts +1 -1
- package/spec/TypeScriptSourceParser.spec.ts +1215 -0
- package/spec/TypeScriptTokenizer.spec.ts +366 -0
- package/spec/ai/ContextCompaction.spec.ts +405 -0
- package/spec/ai/ConversationAgent.spec.ts +520 -0
- package/spec/ai/InMemoryConversationAgent.spec.ts +144 -0
- package/spec/ai/agentInstructions.spec.ts +358 -0
- package/spec/fixtures/agent-instructions/TestAgent.ts +24 -0
- package/spec/fixtures/agent-instructions/simple.md +3 -0
- package/spec/fixtures/agent-instructions/template.md +18 -0
- package/spec/fixtures/agent-instructions/yaml-format.yaml +9 -0
- package/spec/mock-project/dist/.tsbuildinfo +1 -0
- package/spec/mock-project/dist/spec/mock-project/src/handlers/GetCar.js +56 -0
- package/spec/mock-project/dist/spec/mock-project/src/handlers/GetCar2.js +58 -0
- package/spec/mock-project/dist/spec/mock-project/src/handlers/GetCarWithArraySchema.js +52 -0
- package/spec/mock-project/dist/spec/mock-project/src/handlers/GetCarWithArraySchema2.js +52 -0
- package/spec/mock-project/dist/spec/mock-project/src/handlers/GetCarWithArraySchema3.js +52 -0
- package/spec/mock-project/dist/spec/mock-project/src/handlers/GetCarWithLiteralSchema.js +54 -0
- package/spec/mock-project/dist/spec/mock-project/src/handlers/GetCarWithLiteralSchema2.js +54 -0
- package/spec/mock-project/dist/spec/mock-project/src/handlers/GetCarWithSchemaInFile.js +57 -0
- package/spec/mock-project/dist/spec/mock-project/src/handlers/GetCarWithSchemaInFile2.js +57 -0
- package/spec/mock-project/dist/spec/mock-project/src/handlers/ManuallyAddedHandler.js +53 -0
- package/spec/mock-project/dist/spec/mock-project/src/handlers/ManuallyAddedHandler2.js +55 -0
- package/spec/mock-project/dist/spec/mock-project/src/handlers/PatchCar.js +57 -0
- package/spec/mock-project/dist/spec/mock-project/src/handlers/PatchOnboardingSession.js +75 -0
- package/spec/mock-project/dist/spec/mock-project/src/handlers/PatchOrderWithComplexTypes.js +57 -0
- package/spec/mock-project/dist/spec/mock-project/src/handlers/PatchProductWithIntersection.js +58 -0
- package/spec/mock-project/dist/spec/mock-project/src/handlers/PatchUserWithUnion.js +58 -0
- package/spec/mock-project/dist/spec/mock-project/src/handlers/PostCar.js +54 -0
- package/spec/mock-project/dist/spec/mock-project/src/handlers/PostLogin.js +55 -0
- package/spec/mock-project/dist/spec/mock-project/src/handlers/PostLogout.js +54 -0
- package/spec/mock-project/dist/spec/mock-project/src/handlers/PutCar.js +54 -0
- package/spec/mock-project/dist/spec/mock-project/src/index.js +83 -0
- package/spec/mock-project/dist/spec/mock-project/src/repos/CarRepo.js +26 -0
- package/spec/mock-project/dist/spec/mock-project/src/schemas/Car.js +2 -0
- package/spec/mock-project/dist/spec/mock-project/src/schemas/DefaultExportSchema.js +2 -0
- package/spec/mock-project/dist/spec/mock-project/src/schemas/FileWithTwoSchemas.js +2 -0
- package/spec/mock-project/dist/src/FlinkApp.js +1000 -0
- package/spec/mock-project/dist/src/FlinkContext.js +2 -0
- package/spec/mock-project/dist/src/FlinkErrors.js +143 -0
- package/spec/mock-project/dist/src/FlinkHttpHandler.js +47 -0
- package/spec/mock-project/dist/src/FlinkJob.js +2 -0
- package/spec/mock-project/dist/src/FlinkLog.js +119 -0
- package/spec/mock-project/dist/src/FlinkLogFactory.js +617 -0
- package/spec/mock-project/dist/src/FlinkPlugin.js +2 -0
- package/spec/mock-project/dist/src/FlinkRepo.js +224 -0
- package/spec/mock-project/dist/src/FlinkRequestContext.js +74 -0
- package/spec/mock-project/dist/src/FlinkResponse.js +2 -0
- package/spec/mock-project/dist/src/ai/AgentExecutor.js +279 -0
- package/spec/mock-project/dist/src/ai/AgentRunner.js +632 -0
- package/spec/mock-project/dist/src/ai/ConversationAgent.js +402 -0
- package/spec/mock-project/dist/src/ai/ConversationFlinkAgent.js +422 -0
- package/spec/mock-project/dist/src/ai/FlinkAgent.js +699 -0
- package/spec/mock-project/dist/src/ai/FlinkTool.js +2 -0
- package/spec/mock-project/dist/src/ai/InMemoryConversationAgent.js +209 -0
- package/spec/mock-project/dist/src/ai/LLMAdapter.js +2 -0
- package/spec/mock-project/dist/src/ai/SubAgentExecutor.js +223 -0
- package/spec/mock-project/dist/src/ai/ToolExecutor.js +412 -0
- package/spec/mock-project/dist/src/ai/agentInstructions.js +246 -0
- package/spec/mock-project/dist/src/auth/FlinkAuthPlugin.js +2 -0
- package/spec/mock-project/dist/src/auth/FlinkAuthUser.js +2 -0
- package/spec/mock-project/dist/src/handlers/GetCar.js +26 -52
- package/spec/mock-project/dist/src/handlers/GetCar.js.map +1 -0
- package/spec/mock-project/dist/src/handlers/GetCar2.js +32 -54
- package/spec/mock-project/dist/src/handlers/GetCar2.js.map +1 -0
- package/spec/mock-project/dist/src/handlers/GetCarWithArraySchema.js +26 -48
- package/spec/mock-project/dist/src/handlers/GetCarWithArraySchema.js.map +1 -0
- package/spec/mock-project/dist/src/handlers/GetCarWithArraySchema2.js +28 -48
- package/spec/mock-project/dist/src/handlers/GetCarWithArraySchema2.js.map +1 -0
- package/spec/mock-project/dist/src/handlers/GetCarWithArraySchema3.js +29 -48
- package/spec/mock-project/dist/src/handlers/GetCarWithArraySchema3.js.map +1 -0
- package/spec/mock-project/dist/src/handlers/GetCarWithLiteralSchema.js +26 -50
- package/spec/mock-project/dist/src/handlers/GetCarWithLiteralSchema.js.map +1 -0
- package/spec/mock-project/dist/src/handlers/GetCarWithLiteralSchema2.js +28 -50
- package/spec/mock-project/dist/src/handlers/GetCarWithLiteralSchema2.js.map +1 -0
- package/spec/mock-project/dist/src/handlers/GetCarWithSchemaInFile.js +27 -53
- package/spec/mock-project/dist/src/handlers/GetCarWithSchemaInFile.js.map +1 -0
- package/spec/mock-project/dist/src/handlers/GetCarWithSchemaInFile2.js +29 -53
- package/spec/mock-project/dist/src/handlers/GetCarWithSchemaInFile2.js.map +1 -0
- package/spec/mock-project/dist/src/handlers/ManuallyAddedHandler.js +16 -49
- package/spec/mock-project/dist/src/handlers/ManuallyAddedHandler.js.map +1 -0
- package/spec/mock-project/dist/src/handlers/ManuallyAddedHandler2.js +25 -50
- package/spec/mock-project/dist/src/handlers/ManuallyAddedHandler2.js.map +1 -0
- package/spec/mock-project/dist/src/handlers/PatchCar.js +27 -53
- package/spec/mock-project/dist/src/handlers/PatchCar.js.map +1 -0
- package/spec/mock-project/dist/src/handlers/PatchOnboardingSession.js +44 -70
- package/spec/mock-project/dist/src/handlers/PatchOnboardingSession.js.map +1 -0
- package/spec/mock-project/dist/src/handlers/PatchOrderWithComplexTypes.js +27 -53
- package/spec/mock-project/dist/src/handlers/PatchOrderWithComplexTypes.js.map +1 -0
- package/spec/mock-project/dist/src/handlers/PatchProductWithIntersection.js +28 -54
- package/spec/mock-project/dist/src/handlers/PatchProductWithIntersection.js.map +1 -0
- package/spec/mock-project/dist/src/handlers/PatchUserWithUnion.js +28 -54
- package/spec/mock-project/dist/src/handlers/PatchUserWithUnion.js.map +1 -0
- package/spec/mock-project/dist/src/handlers/PostCar.js +24 -50
- package/spec/mock-project/dist/src/handlers/PostCar.js.map +1 -0
- package/spec/mock-project/dist/src/handlers/PostLogin.js +25 -51
- package/spec/mock-project/dist/src/handlers/PostLogin.js.map +1 -0
- package/spec/mock-project/dist/src/handlers/PostLogout.js +24 -50
- package/spec/mock-project/dist/src/handlers/PostLogout.js.map +1 -0
- package/spec/mock-project/dist/src/handlers/PutCar.js +24 -50
- package/spec/mock-project/dist/src/handlers/PutCar.js.map +1 -0
- package/spec/mock-project/dist/src/handlers/StreamWriterFactory.js +83 -0
- package/spec/mock-project/dist/src/index.js +52 -76
- package/spec/mock-project/dist/src/index.js.map +1 -0
- package/spec/mock-project/dist/src/mock-data-generator.js +9 -0
- package/spec/mock-project/dist/src/repos/CarRepo.js +12 -24
- package/spec/mock-project/dist/src/repos/CarRepo.js.map +1 -0
- package/spec/mock-project/dist/src/schemas/Car.js +3 -1
- package/spec/mock-project/dist/src/schemas/Car.js.map +1 -0
- package/spec/mock-project/dist/src/schemas/DefaultExportSchema.js +3 -1
- package/spec/mock-project/dist/src/schemas/DefaultExportSchema.js.map +1 -0
- package/spec/mock-project/dist/src/schemas/FileWithTwoSchemas.js +3 -1
- package/spec/mock-project/dist/src/schemas/FileWithTwoSchemas.js.map +1 -0
- package/spec/mock-project/dist/src/utils.js +290 -0
- package/spec/mock-project/tsconfig.json +6 -1
- package/spec/schema-generation-nested-objects.spec.ts +97 -0
- package/spec/testHelpers.ts +49 -0
- package/spec/utils.caseConversion.spec.ts +78 -0
- package/spec/utils.spec.ts +13 -13
- package/src/DependencyTracker.ts +166 -0
- package/src/FlinkApp.ts +919 -155
- package/src/FlinkContext.ts +43 -0
- package/src/FlinkErrors.ts +32 -12
- package/src/FlinkHttpHandler.ts +246 -28
- package/src/FlinkJob.ts +11 -0
- package/src/FlinkLog.ts +119 -12
- package/src/FlinkLogFactory.ts +699 -0
- package/src/FlinkRepo.ts +10 -3
- package/src/FlinkRequestContext.ts +95 -0
- package/src/FlinkResponse.ts +6 -0
- package/src/FlinkService.ts +49 -0
- package/src/LeaderElection.ts +203 -0
- package/src/SchemaCache.ts +232 -0
- package/src/TypeScriptCompiler.ts +1347 -610
- package/src/TypeScriptUtils.ts +5 -0
- package/src/ai/AgentRunner.ts +646 -0
- package/src/ai/ConversationAgent.ts +413 -0
- package/src/ai/FlinkAgent.ts +1069 -0
- package/src/ai/FlinkTool.ts +165 -0
- package/src/ai/InMemoryConversationAgent.ts +149 -0
- package/src/ai/LLMAdapter.ts +126 -0
- package/src/ai/ToolExecutor.ts +485 -0
- package/src/ai/agentInstructions.ts +245 -0
- package/src/ai/index.ts +8 -0
- package/src/ai/instructionFileLoader.ts +156 -0
- package/src/auth/FlinkAuthPlugin.ts +2 -1
- package/src/handlers/StreamWriterFactory.ts +84 -0
- package/src/index.ts +14 -0
- package/src/loadPluginSchemas.ts +141 -0
- package/src/schema-extraction/TypeScriptSourceParser.ts +1058 -0
- package/src/schema-extraction/TypeScriptTokenizer.ts +205 -0
- package/src/schema-extraction/index.ts +2 -0
- package/src/schema-extraction/types.ts +34 -0
- package/src/utils/loadFlinkConfig.ts +89 -0
- package/src/utils.ts +52 -0
- package/tsconfig.json +6 -1
|
@@ -1,76 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get Route () {
|
|
13
|
+
return Route;
|
|
14
|
+
},
|
|
15
|
+
get default () {
|
|
16
|
+
return _default;
|
|
36
17
|
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var flink_1 = require("@flink-app/flink");
|
|
41
|
-
exports.Route = {
|
|
18
|
+
});
|
|
19
|
+
const _flink = require("@flink-app/flink");
|
|
20
|
+
const Route = {
|
|
42
21
|
path: "/onboarding/:sessionId",
|
|
43
|
-
method:
|
|
22
|
+
method: _flink.HttpMethod.patch
|
|
44
23
|
};
|
|
45
|
-
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
city: "Stockholm",
|
|
59
|
-
postalCode: "12345",
|
|
60
|
-
},
|
|
61
|
-
contactInfo: {
|
|
62
|
-
email: "test@example.com",
|
|
63
|
-
phone: "+46701234567",
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
metadata: {
|
|
67
|
-
createdAt: new Date(),
|
|
68
|
-
updatedAt: new Date(),
|
|
69
|
-
},
|
|
24
|
+
const PatchOnboardingSession = async ({ req })=>{
|
|
25
|
+
var _req_body_extractedData, _req_body_extractedData1;
|
|
26
|
+
return {
|
|
27
|
+
data: {
|
|
28
|
+
sessionId: req.params.sessionId,
|
|
29
|
+
status: req.body.status || "pending",
|
|
30
|
+
extractedData: {
|
|
31
|
+
companyName: ((_req_body_extractedData = req.body.extractedData) === null || _req_body_extractedData === void 0 ? void 0 : _req_body_extractedData.companyName) || "Test Company",
|
|
32
|
+
orgNumber: ((_req_body_extractedData1 = req.body.extractedData) === null || _req_body_extractedData1 === void 0 ? void 0 : _req_body_extractedData1.orgNumber) || "123456",
|
|
33
|
+
address: {
|
|
34
|
+
street: "Main St",
|
|
35
|
+
city: "Stockholm",
|
|
36
|
+
postalCode: "12345"
|
|
70
37
|
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
38
|
+
contactInfo: {
|
|
39
|
+
email: "test@example.com",
|
|
40
|
+
phone: "+46701234567"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
metadata: {
|
|
44
|
+
createdAt: new Date(),
|
|
45
|
+
updatedAt: new Date()
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
const _default = PatchOnboardingSession;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/joel/projects/flink/flink-framework/packages/flink/spec/mock-project/src/handlers/PatchOnboardingSession.ts"],"sourcesContent":["import { Handler, HttpMethod, RouteProps } from \"@flink-app/flink\";\n\nexport const Route: RouteProps = {\n path: \"/onboarding/:sessionId\",\n method: HttpMethod.patch,\n};\n\n// Simulating a complex nested structure like in your example\ninterface OnboardingSession {\n sessionId: string;\n status: string;\n extractedData: {\n companyName: string;\n orgNumber: string;\n address: {\n street: string;\n city: string;\n postalCode: string;\n };\n contactInfo: {\n email: string;\n phone: string;\n };\n };\n metadata: {\n createdAt: Date;\n updatedAt: Date;\n };\n}\n\n// Test case: Partial of a nested property using bracket notation\ninterface PatchOnboardingSessionReq {\n status?: string;\n extractedData?: Partial<OnboardingSession[\"extractedData\"]>;\n metadata?: Partial<OnboardingSession[\"metadata\"]>;\n}\n\ntype Params = { sessionId: string };\n\nconst PatchOnboardingSession: Handler<any, PatchOnboardingSessionReq, OnboardingSession, Params> = async ({ req }) => {\n return {\n data: {\n sessionId: req.params.sessionId,\n status: req.body.status || \"pending\",\n extractedData: {\n companyName: req.body.extractedData?.companyName || \"Test Company\",\n orgNumber: req.body.extractedData?.orgNumber || \"123456\",\n address: {\n street: \"Main St\",\n city: \"Stockholm\",\n postalCode: \"12345\",\n },\n contactInfo: {\n email: \"test@example.com\",\n phone: \"+46701234567\",\n },\n },\n metadata: {\n createdAt: new Date(),\n updatedAt: new Date(),\n },\n },\n };\n};\n\nexport default PatchOnboardingSession;\n"],"names":["Route","path","method","HttpMethod","patch","PatchOnboardingSession","req","data","sessionId","params","status","body","extractedData","companyName","orgNumber","address","street","city","postalCode","contactInfo","email","phone","metadata","createdAt","Date","updatedAt"],"mappings":";;;;;;;;;;;QAEaA;eAAAA;;QA+Db;eAAA;;;uBAjEgD;AAEzC,MAAMA,QAAoB;IAC7BC,MAAM;IACNC,QAAQC,iBAAU,CAACC,KAAK;AAC5B;AAkCA,MAAMC,yBAA6F,OAAO,EAAEC,GAAG,EAAE;QAMpFA,yBACFA;IANvB,OAAO;QACHC,MAAM;YACFC,WAAWF,IAAIG,MAAM,CAACD,SAAS;YAC/BE,QAAQJ,IAAIK,IAAI,CAACD,MAAM,IAAI;YAC3BE,eAAe;gBACXC,aAAaP,EAAAA,0BAAAA,IAAIK,IAAI,CAACC,aAAa,cAAtBN,8CAAAA,wBAAwBO,WAAW,KAAI;gBACpDC,WAAWR,EAAAA,2BAAAA,IAAIK,IAAI,CAACC,aAAa,cAAtBN,+CAAAA,yBAAwBQ,SAAS,KAAI;gBAChDC,SAAS;oBACLC,QAAQ;oBACRC,MAAM;oBACNC,YAAY;gBAChB;gBACAC,aAAa;oBACTC,OAAO;oBACPC,OAAO;gBACX;YACJ;YACAC,UAAU;gBACNC,WAAW,IAAIC;gBACfC,WAAW,IAAID;YACnB;QACJ;IACJ;AACJ;MAEA,WAAenB"}
|
|
@@ -1,58 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get Route () {
|
|
13
|
+
return Route;
|
|
14
|
+
},
|
|
15
|
+
get default () {
|
|
16
|
+
return _default;
|
|
36
17
|
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var flink_1 = require("@flink-app/flink");
|
|
41
|
-
exports.Route = {
|
|
18
|
+
});
|
|
19
|
+
const _flink = require("@flink-app/flink");
|
|
20
|
+
const Route = {
|
|
42
21
|
path: "/order/:orderId",
|
|
43
|
-
method:
|
|
22
|
+
method: _flink.HttpMethod.patch
|
|
44
23
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
});
|
|
55
|
-
}); };
|
|
56
|
-
exports.default = PatchOrderWithComplexTypes;
|
|
57
|
-
exports.__assumedHttpMethod = "patch", exports.__file = "PatchOrderWithComplexTypes.ts", exports.__query = [], exports.__params = [{ description: "", name: "orderId" }];
|
|
58
|
-
exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "customerCity": { "type": "object", "properties": { "street": { "type": "string" }, "city": { "type": "string" }, "country": { "type": "string" } }, "additionalProperties": false }, "items": { "type": "object", "additionalProperties": false, "properties": { "items": { "type": "array", "items": { "type": "object", "properties": { "productId": { "type": "string" }, "quantity": { "type": "number" }, "price": { "type": "number" } }, "required": ["productId", "quantity", "price"], "additionalProperties": false } }, "subtotal": { "type": "number" } }, "required": ["items", "subtotal"] }, "shipping": { "type": "object", "additionalProperties": false, "properties": { "method": { "type": "string" } }, "required": ["method"] }, "paymentOrShipping": { "type": "object", "additionalProperties": false }, "itemUpdates": { "type": "array", "items": { "type": "object", "properties": { "productId": { "type": "string" }, "quantity": { "type": "number" }, "price": { "type": "number" } }, "additionalProperties": false } } }, "additionalProperties": false, "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "orderId": { "type": "string" }, "status": { "type": "string" } }, "required": ["orderId", "status"], "additionalProperties": false, "definitions": {} } };
|
|
24
|
+
const PatchOrderWithComplexTypes = async ({ req })=>{
|
|
25
|
+
return {
|
|
26
|
+
data: {
|
|
27
|
+
orderId: req.params.orderId,
|
|
28
|
+
status: "updated"
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
const _default = PatchOrderWithComplexTypes;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/joel/projects/flink/flink-framework/packages/flink/spec/mock-project/src/handlers/PatchOrderWithComplexTypes.ts"],"sourcesContent":["import { Handler, HttpMethod, RouteProps } from \"@flink-app/flink\";\n\nexport const Route: RouteProps = {\n path: \"/order/:orderId\",\n method: HttpMethod.patch,\n};\n\n// Complex nested structures for testing edge cases\ninterface OrderCustomer {\n customerId: string;\n name: string;\n email: string;\n address: {\n street: string;\n city: string;\n country: string;\n };\n}\n\ninterface OrderItem {\n productId: string;\n quantity: number;\n price: number;\n}\n\ninterface OrderItems {\n items: Array<OrderItem>;\n subtotal: number;\n tax: number;\n}\n\ninterface OrderShipping {\n method: string;\n trackingNumber: string;\n estimatedDelivery: Date;\n}\n\ninterface OrderPayment {\n method: string;\n status: string;\n transactionId: string;\n}\n\n// Test case: Complex combinations of utility types\ninterface PatchOrderWithComplexTypesReq {\n // Nested indexed access - should extract OrderCustomer\n customerCity?: Partial<OrderCustomer[\"address\"]>;\n\n // Omit with indexed access - should extract OrderItems\n items?: Omit<OrderItems, \"tax\"> & Partial<OrderItems[\"subtotal\"]>;\n\n // Pick with indexed access - should extract OrderShipping\n shipping?: Pick<OrderShipping, \"method\"> & Partial<OrderShipping[\"trackingNumber\"]>;\n\n // Union of Partial with indexed access\n paymentOrShipping?:\n Partial<OrderPayment[\"status\"]> | Partial<OrderShipping[\"method\"]>;\n\n // Array of Partial types\n itemUpdates?: Array<Partial<OrderItem>>;\n}\n\ntype Params = { orderId: string };\n\ninterface OrderResponse {\n orderId: string;\n status: string;\n}\n\nconst PatchOrderWithComplexTypes: Handler<any, PatchOrderWithComplexTypesReq, OrderResponse, Params> = async ({ req }) => {\n return {\n data: {\n orderId: req.params.orderId,\n status: \"updated\",\n },\n };\n};\n\nexport default PatchOrderWithComplexTypes;\n"],"names":["Route","path","method","HttpMethod","patch","PatchOrderWithComplexTypes","req","data","orderId","params","status"],"mappings":";;;;;;;;;;;QAEaA;eAAAA;;QA4Eb;eAAA;;;uBA9EgD;AAEzC,MAAMA,QAAoB;IAC7BC,MAAM;IACNC,QAAQC,iBAAU,CAACC,KAAK;AAC5B;AAgEA,MAAMC,6BAAiG,OAAO,EAAEC,GAAG,EAAE;IACjH,OAAO;QACHC,MAAM;YACFC,SAASF,IAAIG,MAAM,CAACD,OAAO;YAC3BE,QAAQ;QACZ;IACJ;AACJ;MAEA,WAAeL"}
|
|
@@ -1,59 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get Route () {
|
|
13
|
+
return Route;
|
|
14
|
+
},
|
|
15
|
+
get default () {
|
|
16
|
+
return _default;
|
|
36
17
|
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var flink_1 = require("@flink-app/flink");
|
|
41
|
-
exports.Route = {
|
|
18
|
+
});
|
|
19
|
+
const _flink = require("@flink-app/flink");
|
|
20
|
+
const Route = {
|
|
42
21
|
path: "/product/:productId",
|
|
43
|
-
method:
|
|
22
|
+
method: _flink.HttpMethod.patch
|
|
44
23
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
});
|
|
56
|
-
}); };
|
|
57
|
-
exports.default = PatchProductWithIntersection;
|
|
58
|
-
exports.__assumedHttpMethod = "patch", exports.__file = "PatchProductWithIntersection.ts", exports.__query = [], exports.__params = [{ description: "", name: "productId" }];
|
|
59
|
-
exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "update": { "type": "object", "additionalProperties": false }, "fullUpdate": { "type": "object", "additionalProperties": false, "properties": { "notes": { "type": "string" }, "stock": { "type": "number" }, "warehouse": { "type": "string" }, "sku": { "type": "string" }, "name": { "type": "string" }, "description": { "type": "string" }, "price": { "type": "number" } }, "required": ["notes"] }, "metadataUpdate": { "type": "object", "additionalProperties": false, "properties": { "updatedBy": { "type": "string" } }, "required": ["updatedBy"] } }, "additionalProperties": false, "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "price": { "type": "number" } }, "required": ["name", "description", "price"], "additionalProperties": false, "definitions": {} } };
|
|
24
|
+
const PatchProductWithIntersection = async ({ req })=>{
|
|
25
|
+
return {
|
|
26
|
+
data: {
|
|
27
|
+
name: "Test Product",
|
|
28
|
+
description: "Test Description",
|
|
29
|
+
price: req.body.update || 99.99
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
const _default = PatchProductWithIntersection;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/joel/projects/flink/flink-framework/packages/flink/spec/mock-project/src/handlers/PatchProductWithIntersection.ts"],"sourcesContent":["import { Handler, HttpMethod, RouteProps } from \"@flink-app/flink\";\n\nexport const Route: RouteProps = {\n path: \"/product/:productId\",\n method: HttpMethod.patch,\n};\n\n// Base interfaces for testing intersection types\ninterface ProductDetails {\n name: string;\n description: string;\n price: number;\n}\n\ninterface ProductInventory {\n stock: number;\n warehouse: string;\n sku: string;\n}\n\ninterface ProductMetadata {\n createdAt: Date;\n updatedAt: Date;\n createdBy: string;\n}\n\n// Test case: Intersection type with Partial indexed access patterns\ninterface PatchProductWithIntersectionReq {\n // Intersection of Partial types - should extract ProductDetails and ProductInventory\n update?: Partial<ProductDetails[\"price\"]> & Partial<ProductInventory[\"stock\"]>;\n // More realistic intersection pattern\n fullUpdate?: Partial<ProductDetails> & Partial<ProductInventory> & { notes: string };\n // Intersection with indexed access\n metadataUpdate?: Partial<ProductMetadata[\"updatedAt\"]> & { updatedBy: string };\n}\n\ntype Params = { productId: string };\n\nconst PatchProductWithIntersection: Handler<any, PatchProductWithIntersectionReq, ProductDetails, Params> = async ({ req }) => {\n return {\n data: {\n name: \"Test Product\",\n description: \"Test Description\",\n price: (req.body.update as any) || 99.99,\n },\n };\n};\n\nexport default PatchProductWithIntersection;\n"],"names":["Route","path","method","HttpMethod","patch","PatchProductWithIntersection","req","data","name","description","price","body","update"],"mappings":";;;;;;;;;;;QAEaA;eAAAA;;QA8Cb;eAAA;;;uBAhDgD;AAEzC,MAAMA,QAAoB;IAC7BC,MAAM;IACNC,QAAQC,iBAAU,CAACC,KAAK;AAC5B;AAiCA,MAAMC,+BAAsG,OAAO,EAAEC,GAAG,EAAE;IACtH,OAAO;QACHC,MAAM;YACFC,MAAM;YACNC,aAAa;YACbC,OAAO,AAACJ,IAAIK,IAAI,CAACC,MAAM,IAAY;QACvC;IACJ;AACJ;MAEA,WAAeP"}
|
|
@@ -1,59 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get Route () {
|
|
13
|
+
return Route;
|
|
14
|
+
},
|
|
15
|
+
get default () {
|
|
16
|
+
return _default;
|
|
36
17
|
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var flink_1 = require("@flink-app/flink");
|
|
41
|
-
exports.Route = {
|
|
18
|
+
});
|
|
19
|
+
const _flink = require("@flink-app/flink");
|
|
20
|
+
const Route = {
|
|
42
21
|
path: "/user/:userId",
|
|
43
|
-
method:
|
|
22
|
+
method: _flink.HttpMethod.patch
|
|
44
23
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
});
|
|
56
|
-
}); };
|
|
57
|
-
exports.default = PatchUserWithUnion;
|
|
58
|
-
exports.__assumedHttpMethod = "patch", exports.__file = "PatchUserWithUnion.ts", exports.__query = [], exports.__params = [{ description: "", name: "userId" }];
|
|
59
|
-
exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "data": { "type": "object", "additionalProperties": false }, "profileUpdate": { "anyOf": [{ "type": "object", "properties": { "firstName": { "type": "string" }, "lastName": { "type": "string" }, "bio": { "type": "string" } }, "additionalProperties": false }, { "type": "object", "properties": { "theme": { "type": "string" }, "notifications": { "type": "boolean" }, "language": { "type": "string" } }, "additionalProperties": false }] } }, "additionalProperties": false, "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "firstName": { "type": "string" }, "lastName": { "type": "string" }, "bio": { "type": "string" } }, "required": ["firstName", "lastName", "bio"], "additionalProperties": false, "definitions": {} } };
|
|
24
|
+
const PatchUserWithUnion = async ({ req })=>{
|
|
25
|
+
return {
|
|
26
|
+
data: {
|
|
27
|
+
firstName: "Test",
|
|
28
|
+
lastName: "User",
|
|
29
|
+
bio: req.body.data || "Default bio"
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
const _default = PatchUserWithUnion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/joel/projects/flink/flink-framework/packages/flink/spec/mock-project/src/handlers/PatchUserWithUnion.ts"],"sourcesContent":["import { Handler, HttpMethod, RouteProps } from \"@flink-app/flink\";\n\nexport const Route: RouteProps = {\n path: \"/user/:userId\",\n method: HttpMethod.patch,\n};\n\n// Base interfaces for testing union types\ninterface UserProfile {\n firstName: string;\n lastName: string;\n bio: string;\n}\n\ninterface UserSettings {\n theme: string;\n notifications: boolean;\n language: string;\n}\n\ninterface UserPreferences {\n emailFrequency: string;\n newsletter: boolean;\n}\n\n// Test case: Union type with multiple Partial indexed access patterns\ninterface PatchUserWithUnionReq {\n // Union of Partial types - should extract UserProfile, UserSettings, UserPreferences\n data?: Partial<UserProfile[\"firstName\"]> | Partial<UserSettings[\"theme\"]> | Partial<UserPreferences[\"emailFrequency\"]>;\n // More realistic union pattern\n profileUpdate?: Partial<UserProfile> | Partial<UserSettings>;\n}\n\ntype Params = { userId: string };\n\nconst PatchUserWithUnion: Handler<any, PatchUserWithUnionReq, UserProfile, Params> = async ({ req }) => {\n return {\n data: {\n firstName: \"Test\",\n lastName: \"User\",\n bio: req.body.data as string || \"Default bio\",\n },\n };\n};\n\nexport default PatchUserWithUnion;\n"],"names":["Route","path","method","HttpMethod","patch","PatchUserWithUnion","req","data","firstName","lastName","bio","body"],"mappings":";;;;;;;;;;;QAEaA;eAAAA;;QA2Cb;eAAA;;;uBA7CgD;AAEzC,MAAMA,QAAoB;IAC7BC,MAAM;IACNC,QAAQC,iBAAU,CAACC,KAAK;AAC5B;AA8BA,MAAMC,qBAA+E,OAAO,EAAEC,GAAG,EAAE;IAC/F,OAAO;QACHC,MAAM;YACFC,WAAW;YACXC,UAAU;YACVC,KAAKJ,IAAIK,IAAI,CAACJ,IAAI,IAAc;QACpC;IACJ;AACJ;MAEA,WAAeF"}
|
|
@@ -1,55 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get Route () {
|
|
13
|
+
return Route;
|
|
14
|
+
},
|
|
15
|
+
get default () {
|
|
16
|
+
return _default;
|
|
36
17
|
}
|
|
18
|
+
});
|
|
19
|
+
const Route = {
|
|
20
|
+
path: "/car"
|
|
37
21
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
22
|
+
const PostCar = async ({ ctx, req })=>{
|
|
23
|
+
return {
|
|
24
|
+
data: {
|
|
25
|
+
model: "Volvo"
|
|
26
|
+
}
|
|
27
|
+
};
|
|
42
28
|
};
|
|
43
|
-
|
|
44
|
-
var ctx = _b.ctx, req = _b.req;
|
|
45
|
-
return __generator(this, function (_c) {
|
|
46
|
-
return [2 /*return*/, {
|
|
47
|
-
data: {
|
|
48
|
-
model: "Volvo",
|
|
49
|
-
},
|
|
50
|
-
}];
|
|
51
|
-
});
|
|
52
|
-
}); };
|
|
53
|
-
exports.default = PostCar;
|
|
54
|
-
exports.__assumedHttpMethod = "post", exports.__file = "PostCar.ts", exports.__query = [], exports.__params = [];
|
|
55
|
-
exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "model": { "type": "string" }, "metadata": { "type": "object", "properties": { "created": { "type": "string", "format": "date-time" } }, "additionalProperties": false } }, "required": ["model"], "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "model": { "type": "string" }, "metadata": { "type": "object", "properties": { "created": { "type": "string", "format": "date-time" } }, "additionalProperties": false } }, "required": ["model"], "definitions": {} } };
|
|
29
|
+
const _default = PostCar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/joel/projects/flink/flink-framework/packages/flink/spec/mock-project/src/handlers/PostCar.ts"],"sourcesContent":["import { Handler, RouteProps } from \"@flink-app/flink\";\nimport Car from \"../schemas/Car\";\n\nexport const Route: RouteProps = {\n path: \"/car\",\n};\n\nconst PostCar: Handler<any, Car, Car> = async ({ ctx, req }) => {\n return {\n data: {\n model: \"Volvo\",\n },\n };\n};\n\nexport default PostCar;\n"],"names":["Route","path","PostCar","ctx","req","data","model"],"mappings":";;;;;;;;;;;QAGaA;eAAAA;;QAYb;eAAA;;;AAZO,MAAMA,QAAoB;IAC/BC,MAAM;AACR;AAEA,MAAMC,UAAkC,OAAO,EAAEC,GAAG,EAAEC,GAAG,EAAE;IACzD,OAAO;QACLC,MAAM;YACJC,OAAO;QACT;IACF;AACF;MAEA,WAAeJ"}
|
|
@@ -1,56 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get Route () {
|
|
13
|
+
return Route;
|
|
14
|
+
},
|
|
15
|
+
get default () {
|
|
16
|
+
return _default;
|
|
36
17
|
}
|
|
18
|
+
});
|
|
19
|
+
const Route = {
|
|
20
|
+
path: "/login"
|
|
37
21
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
22
|
+
const PostLogin = async ({ ctx, req })=>{
|
|
23
|
+
return {
|
|
24
|
+
data: {},
|
|
25
|
+
headers: {
|
|
26
|
+
"x-test": "hello world"
|
|
27
|
+
}
|
|
28
|
+
};
|
|
42
29
|
};
|
|
43
|
-
|
|
44
|
-
var ctx = _b.ctx, req = _b.req;
|
|
45
|
-
return __generator(this, function (_c) {
|
|
46
|
-
return [2 /*return*/, {
|
|
47
|
-
data: {},
|
|
48
|
-
headers: {
|
|
49
|
-
"x-test": "hello world",
|
|
50
|
-
},
|
|
51
|
-
}];
|
|
52
|
-
});
|
|
53
|
-
}); };
|
|
54
|
-
exports.default = PostLogin;
|
|
55
|
-
exports.__assumedHttpMethod = "post", exports.__file = "PostLogin.ts", exports.__query = [], exports.__params = [];
|
|
56
|
-
exports.__schemas = { reqSchema: undefined, resSchema: undefined };
|
|
30
|
+
const _default = PostLogin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/joel/projects/flink/flink-framework/packages/flink/spec/mock-project/src/handlers/PostLogin.ts"],"sourcesContent":["import { Handler, RouteProps } from \"@flink-app/flink\";\n\nexport const Route: RouteProps = {\n path: \"/login\",\n};\n\nconst PostLogin: Handler<any> = async ({ ctx, req }) => {\n return {\n data: {},\n headers: {\n \"x-test\": \"hello world\",\n },\n };\n};\n\nexport default PostLogin;\n"],"names":["Route","path","PostLogin","ctx","req","data","headers"],"mappings":";;;;;;;;;;;QAEaA;eAAAA;;QAab;eAAA;;;AAbO,MAAMA,QAAoB;IAC/BC,MAAM;AACR;AAEA,MAAMC,YAA0B,OAAO,EAAEC,GAAG,EAAEC,GAAG,EAAE;IACjD,OAAO;QACLC,MAAM,CAAC;QACPC,SAAS;YACP,UAAU;QACZ;IACF;AACF;MAEA,WAAeJ"}
|