@autobe/agent 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +1 -1
- package/lib/context/assertSchemaModel.d.ts +1 -1
- package/lib/context/assertSchemaModel.js +4 -7
- package/lib/context/assertSchemaModel.js.map +1 -1
- package/lib/index.mjs +18395 -8004
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js +164 -86
- package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +637 -321
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +143 -74
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +17 -52
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +25 -22
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +7 -23
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +165 -2
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js.map +1 -1
- package/lib/orchestrate/facade/createAutoBeFacadeController.js +773 -403
- package/lib/orchestrate/facade/createAutoBeFacadeController.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js +739 -2
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +1625 -9
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +248 -131
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +255 -133
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +339 -226
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +625 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js +776 -3
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js +205 -3
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js +107 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js +1664 -9
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +1625 -9
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +389 -196
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +1166 -590
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaReview.js +1184 -599
- package/lib/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +4 -2
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +360 -179
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +396 -197
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +130 -2
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js +165 -2
- package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js +130 -2
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js +131 -2
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +166 -2
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.js +255 -3
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js +281 -3
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestWrite.js +139 -2
- package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/package.json +9 -9
- package/src/constants/AutoBeSystemPromptConstant.ts +1 -1
- package/src/context/assertSchemaModel.ts +5 -8
- package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +7 -9
- package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +13 -9
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +7 -9
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.ts +19 -54
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +25 -22
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.ts +8 -24
- package/src/orchestrate/common/orchestrateCommonCorrectCasting.ts +15 -1
- package/src/orchestrate/facade/createAutoBeFacadeController.ts +7 -6
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +11 -1
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +11 -1
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +13 -9
- package/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.ts +13 -9
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +17 -14
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +11 -1
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +14 -1
- package/src/orchestrate/interface/orchestrateInterfacePrerequisites.ts +11 -1
- package/src/orchestrate/interface/orchestrateInterfaceSchemaRename.ts +9 -1
- package/src/orchestrate/interface/orchestrateInterfaceSchemaReview.ts +14 -1
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +11 -1
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +13 -9
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +7 -9
- package/src/orchestrate/prisma/orchestratePrismaReview.ts +7 -10
- package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +13 -9
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +13 -9
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +11 -1
- package/src/orchestrate/realize/orchestrateRealizeCorrectCasting.ts +15 -1
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +11 -1
- package/src/orchestrate/test/experimental/orchestrateTestWrite.ast +5 -1
- package/src/orchestrate/test/histories/transformTestWriteHistories.ts +1 -1
- package/src/orchestrate/test/orchestrateTestCorrect.ts +11 -1
- package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +18 -1
- package/src/orchestrate/test/orchestrateTestScenario.ts +11 -1
- package/src/orchestrate/test/orchestrateTestScenarioReview.ts +11 -1
- package/src/orchestrate/test/orchestrateTestWrite.ts +11 -1
|
@@ -148,7 +148,11 @@ function process(ctx, actor, templateFiles, progress, promptCacheKey) {
|
|
|
148
148
|
}
|
|
149
149
|
function createController(props) {
|
|
150
150
|
(0, assertSchemaModel_1.assertSchemaModel)(props.model);
|
|
151
|
-
const application = collection[props.model
|
|
151
|
+
const application = collection[props.model === "chatgpt"
|
|
152
|
+
? "chatgpt"
|
|
153
|
+
: props.model === "gemini"
|
|
154
|
+
? "gemini"
|
|
155
|
+
: "claude"];
|
|
152
156
|
return {
|
|
153
157
|
protocol: "class",
|
|
154
158
|
name: "Create Decorator",
|
|
@@ -160,209 +164,390 @@ function createController(props) {
|
|
|
160
164
|
},
|
|
161
165
|
};
|
|
162
166
|
}
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
167
|
+
const collection = {
|
|
168
|
+
chatgpt: {
|
|
169
|
+
model: "chatgpt",
|
|
170
|
+
options: {
|
|
171
|
+
reference: true,
|
|
172
|
+
strict: false,
|
|
173
|
+
separate: null
|
|
174
|
+
},
|
|
175
|
+
functions: [
|
|
176
|
+
{
|
|
177
|
+
name: "createDecorator",
|
|
178
|
+
parameters: {
|
|
179
|
+
description: " Properties containing provider, decorator, and payload type\nconfigurations\n\n------------------------------\n\nCurrent Type: {@link IAutoBeRealizeAuthorizationApplication.IProps}",
|
|
180
|
+
type: "object",
|
|
181
|
+
properties: {
|
|
182
|
+
provider: {
|
|
183
|
+
description: "Authentication Provider function configuration containing the function\nname and implementation code. The Provider handles JWT token\nverification, role validation, and database queries to authenticate\nusers.",
|
|
184
|
+
$ref: "#/$defs/IAutoBeRealizeAuthorizationApplication.IProvider"
|
|
185
|
+
},
|
|
186
|
+
decorator: {
|
|
187
|
+
description: "Authentication Decorator configuration containing the decorator name and\nimplementation code. The Decorator integrates with NestJS parameter\ndecorators to automatically inject authenticated user data into\nController methods.",
|
|
188
|
+
$ref: "#/$defs/IAutoBeRealizeAuthorizationApplication.IDecorator"
|
|
189
|
+
},
|
|
190
|
+
payload: {
|
|
191
|
+
description: "Authentication Payload Type configuration containing the payload type\nname and implementation code. The Payload Type is used to define the\nstructure of the authenticated user data that will be injected into\nController methods when using the decorator. It serves as the TypeScript\ntype for the parameter in Controller method signatures.",
|
|
192
|
+
$ref: "#/$defs/IAutoBeRealizeAuthorizationApplication.IPayloadType"
|
|
193
|
+
}
|
|
183
194
|
},
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
195
|
+
required: [
|
|
196
|
+
"provider",
|
|
197
|
+
"decorator",
|
|
198
|
+
"payload"
|
|
199
|
+
],
|
|
200
|
+
additionalProperties: false,
|
|
201
|
+
$defs: {
|
|
202
|
+
"IAutoBeRealizeAuthorizationApplication.IProvider": {
|
|
203
|
+
type: "object",
|
|
204
|
+
properties: {
|
|
205
|
+
name: {
|
|
206
|
+
description: "The name of the authentication Provider function in {role}Authorize\nformat (e.g., adminAuthorize, userAuthorize). This function will be\ncalled by the decorator to verify JWT tokens and return authenticated\nuser information for the specified role.\n\nDO: Use camelCase naming convention.\n\n\n@pattern ^[a-z][a-zA-Z0-9]*$",
|
|
207
|
+
type: "string"
|
|
208
|
+
},
|
|
209
|
+
content: {
|
|
210
|
+
description: "Complete TypeScript code for the authentication Provider function. Must\ninclude: JWT token verification using jwtAuthorize function, role type\nchecking against payload.type, database query using\nMyGlobal.prisma.{tableName} pattern to verify user existence, and proper\nerror handling with ForbiddenException and UnauthorizedException. The\nfunction should return the authenticated user payload data.",
|
|
211
|
+
type: "string"
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
required: [
|
|
215
|
+
"name",
|
|
216
|
+
"content"
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
"IAutoBeRealizeAuthorizationApplication.IDecorator": {
|
|
220
|
+
type: "object",
|
|
221
|
+
properties: {
|
|
222
|
+
name: {
|
|
223
|
+
description: "The name of the Decorator to be generated in {Actor}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.\n\nDO: Use PascalCase naming convention.\n\n\n@pattern ^[A-Z][a-zA-Z0-9]*$",
|
|
224
|
+
type: "string"
|
|
225
|
+
},
|
|
226
|
+
content: {
|
|
227
|
+
description: "Complete TypeScript code for the authentication Decorator implementation.\nMust include: SwaggerCustomizer integration to add bearer token security\nschema to API documentation, createParamDecorator implementation that\ncalls the corresponding Provider function for authentication, Singleton\npattern using tstl library for efficient decorator instance management,\nand proper TypeScript typing for the ParameterDecorator interface.",
|
|
228
|
+
type: "string"
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
required: [
|
|
232
|
+
"name",
|
|
233
|
+
"content"
|
|
234
|
+
]
|
|
235
|
+
},
|
|
236
|
+
"IAutoBeRealizeAuthorizationApplication.IPayloadType": {
|
|
237
|
+
type: "object",
|
|
238
|
+
properties: {
|
|
239
|
+
name: {
|
|
240
|
+
description: "The name of the Payload type to be generated in {Actor}Payload format\n(e.g., AdminPayload, UserPayload). This type defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator.\n\nDO: Use PascalCase naming convention.\n\n\n@pattern ^[A-Z][a-zA-Z0-9]*$",
|
|
241
|
+
type: "string"
|
|
242
|
+
},
|
|
243
|
+
content: {
|
|
244
|
+
description: "Complete TypeScript code for the Payload type interface in {Actor}Payload\nformat (e.g., AdminPayload, UserPayload). Must include: id field with\nUUID format validation, type field as role discriminator, and proper\ntypia tags for validation. This interface defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator and serves as the TypeScript type for the\nparameter in Controller method signatures.",
|
|
245
|
+
type: "string"
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
required: [
|
|
249
|
+
"name",
|
|
250
|
+
"content"
|
|
251
|
+
]
|
|
252
|
+
}
|
|
187
253
|
}
|
|
188
254
|
},
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
255
|
+
description: "Generates authentication provider, decorator, and payload type for\nrole-based authorization.\n\nThis method creates a complete authentication infrastructure for a specific\nrole in the NestJS application. It generates three interconnected\ncomponents that work together to provide JWT-based authentication and\nauthorization.\n\nThe generated components include:\n\n- **Provider Function**: Handles JWT verification and user validation from\n database\n- **Decorator**: NestJS parameter decorator for injecting authenticated user\n data\n- **Payload Type**: TypeScript interface defining the authenticated user\n structure\n\nAll components follow strict naming conventions and integrate with the\nexisting authentication architecture using the shared jwtAuthorize\nfunction.",
|
|
256
|
+
validate: (() => { const _io0 = input => "object" === typeof input.provider && null !== input.provider && _io1(input.provider) && ("object" === typeof input.decorator && null !== input.decorator && _io2(input.decorator)) && ("object" === typeof input.payload && null !== input.payload && _io3(input.payload)); const _io1 = input => "string" === typeof input.name && RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) && "string" === typeof input.content; const _io2 = input => "string" === typeof input.name && RegExp("^[A-Z][a-zA-Z0-9]*$").test(input.name) && "string" === typeof input.content; const _io3 = input => "string" === typeof input.name && RegExp("^[A-Z][a-zA-Z0-9]*$").test(input.name) && "string" === typeof input.content; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.provider && null !== input.provider || _report(_exceptionable, {
|
|
257
|
+
path: _path + ".provider",
|
|
258
|
+
expected: "IAutoBeRealizeAuthorizationApplication.IProvider",
|
|
259
|
+
value: input.provider
|
|
260
|
+
})) && _vo1(input.provider, _path + ".provider", true && _exceptionable) || _report(_exceptionable, {
|
|
261
|
+
path: _path + ".provider",
|
|
262
|
+
expected: "IAutoBeRealizeAuthorizationApplication.IProvider",
|
|
263
|
+
value: input.provider
|
|
264
|
+
}), ("object" === typeof input.decorator && null !== input.decorator || _report(_exceptionable, {
|
|
265
|
+
path: _path + ".decorator",
|
|
266
|
+
expected: "IAutoBeRealizeAuthorizationApplication.IDecorator",
|
|
267
|
+
value: input.decorator
|
|
268
|
+
})) && _vo2(input.decorator, _path + ".decorator", true && _exceptionable) || _report(_exceptionable, {
|
|
269
|
+
path: _path + ".decorator",
|
|
270
|
+
expected: "IAutoBeRealizeAuthorizationApplication.IDecorator",
|
|
271
|
+
value: input.decorator
|
|
272
|
+
}), ("object" === typeof input.payload && null !== input.payload || _report(_exceptionable, {
|
|
273
|
+
path: _path + ".payload",
|
|
274
|
+
expected: "IAutoBeRealizeAuthorizationApplication.IPayloadType",
|
|
275
|
+
value: input.payload
|
|
276
|
+
})) && _vo3(input.payload, _path + ".payload", true && _exceptionable) || _report(_exceptionable, {
|
|
277
|
+
path: _path + ".payload",
|
|
278
|
+
expected: "IAutoBeRealizeAuthorizationApplication.IPayloadType",
|
|
279
|
+
value: input.payload
|
|
280
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
|
|
281
|
+
path: _path + ".name",
|
|
282
|
+
expected: "string & CamelCasePattern",
|
|
283
|
+
value: input.name
|
|
284
|
+
})) || _report(_exceptionable, {
|
|
285
|
+
path: _path + ".name",
|
|
286
|
+
expected: "(string & CamelCasePattern)",
|
|
287
|
+
value: input.name
|
|
288
|
+
}), "string" === typeof input.content || _report(_exceptionable, {
|
|
289
|
+
path: _path + ".content",
|
|
290
|
+
expected: "string",
|
|
291
|
+
value: input.content
|
|
292
|
+
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[A-Z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
|
|
293
|
+
path: _path + ".name",
|
|
294
|
+
expected: "string & PascalCasePattern",
|
|
295
|
+
value: input.name
|
|
296
|
+
})) || _report(_exceptionable, {
|
|
297
|
+
path: _path + ".name",
|
|
298
|
+
expected: "(string & PascalCasePattern)",
|
|
299
|
+
value: input.name
|
|
300
|
+
}), "string" === typeof input.content || _report(_exceptionable, {
|
|
301
|
+
path: _path + ".content",
|
|
302
|
+
expected: "string",
|
|
303
|
+
value: input.content
|
|
304
|
+
})].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[A-Z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
|
|
305
|
+
path: _path + ".name",
|
|
306
|
+
expected: "string & PascalCasePattern",
|
|
307
|
+
value: input.name
|
|
308
|
+
})) || _report(_exceptionable, {
|
|
309
|
+
path: _path + ".name",
|
|
310
|
+
expected: "(string & PascalCasePattern)",
|
|
311
|
+
value: input.name
|
|
312
|
+
}), "string" === typeof input.content || _report(_exceptionable, {
|
|
313
|
+
path: _path + ".content",
|
|
314
|
+
expected: "string",
|
|
315
|
+
value: input.content
|
|
316
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
317
|
+
if (false === __is(input)) {
|
|
318
|
+
errors = [];
|
|
319
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
320
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
321
|
+
path: _path + "",
|
|
322
|
+
expected: "IAutoBeRealizeAuthorizationApplication.IProps",
|
|
323
|
+
value: input
|
|
324
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
325
|
+
path: _path + "",
|
|
326
|
+
expected: "IAutoBeRealizeAuthorizationApplication.IProps",
|
|
327
|
+
value: input
|
|
328
|
+
}))(input, "$input", true);
|
|
329
|
+
const success = 0 === errors.length;
|
|
330
|
+
return success ? {
|
|
331
|
+
success,
|
|
332
|
+
data: input
|
|
333
|
+
} : {
|
|
334
|
+
success,
|
|
335
|
+
errors,
|
|
336
|
+
data: input
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
return {
|
|
340
|
+
success: true,
|
|
341
|
+
data: input
|
|
342
|
+
};
|
|
343
|
+
}; })()
|
|
344
|
+
}
|
|
345
|
+
]
|
|
346
|
+
},
|
|
347
|
+
claude: {
|
|
348
|
+
model: "claude",
|
|
349
|
+
options: {
|
|
350
|
+
reference: true,
|
|
351
|
+
separate: null
|
|
352
|
+
},
|
|
353
|
+
functions: [
|
|
354
|
+
{
|
|
355
|
+
name: "createDecorator",
|
|
356
|
+
parameters: {
|
|
357
|
+
description: " Properties containing provider, decorator, and payload type\nconfigurations\n\n------------------------------\n\nCurrent Type: {@link IAutoBeRealizeAuthorizationApplication.IProps}",
|
|
358
|
+
type: "object",
|
|
359
|
+
properties: {
|
|
360
|
+
provider: {
|
|
361
|
+
description: "Authentication Provider function configuration containing the function\nname and implementation code. The Provider handles JWT token\nverification, role validation, and database queries to authenticate\nusers.",
|
|
362
|
+
$ref: "#/$defs/IAutoBeRealizeAuthorizationApplication.IProvider"
|
|
208
363
|
},
|
|
209
|
-
|
|
210
|
-
"name",
|
|
211
|
-
"
|
|
212
|
-
|
|
364
|
+
decorator: {
|
|
365
|
+
description: "Authentication Decorator configuration containing the decorator name and\nimplementation code. The Decorator integrates with NestJS parameter\ndecorators to automatically inject authenticated user data into\nController methods.",
|
|
366
|
+
$ref: "#/$defs/IAutoBeRealizeAuthorizationApplication.IDecorator"
|
|
367
|
+
},
|
|
368
|
+
payload: {
|
|
369
|
+
description: "Authentication Payload Type configuration containing the payload type\nname and implementation code. The Payload Type is used to define the\nstructure of the authenticated user data that will be injected into\nController methods when using the decorator. It serves as the TypeScript\ntype for the parameter in Controller method signatures.",
|
|
370
|
+
$ref: "#/$defs/IAutoBeRealizeAuthorizationApplication.IPayloadType"
|
|
371
|
+
}
|
|
213
372
|
},
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
373
|
+
required: [
|
|
374
|
+
"provider",
|
|
375
|
+
"decorator",
|
|
376
|
+
"payload"
|
|
377
|
+
],
|
|
378
|
+
additionalProperties: false,
|
|
379
|
+
$defs: {
|
|
380
|
+
"IAutoBeRealizeAuthorizationApplication.IProvider": {
|
|
381
|
+
type: "object",
|
|
382
|
+
properties: {
|
|
383
|
+
name: {
|
|
384
|
+
description: "The name of the authentication Provider function in {role}Authorize\nformat (e.g., adminAuthorize, userAuthorize). This function will be\ncalled by the decorator to verify JWT tokens and return authenticated\nuser information for the specified role.\n\nDO: Use camelCase naming convention.",
|
|
385
|
+
type: "string",
|
|
386
|
+
pattern: "^[a-z][a-zA-Z0-9]*$"
|
|
387
|
+
},
|
|
388
|
+
content: {
|
|
389
|
+
description: "Complete TypeScript code for the authentication Provider function. Must\ninclude: JWT token verification using jwtAuthorize function, role type\nchecking against payload.type, database query using\nMyGlobal.prisma.{tableName} pattern to verify user existence, and proper\nerror handling with ForbiddenException and UnauthorizedException. The\nfunction should return the authenticated user payload data.",
|
|
390
|
+
type: "string"
|
|
391
|
+
}
|
|
221
392
|
},
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
393
|
+
required: [
|
|
394
|
+
"name",
|
|
395
|
+
"content"
|
|
396
|
+
]
|
|
226
397
|
},
|
|
227
|
-
|
|
228
|
-
"
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
398
|
+
"IAutoBeRealizeAuthorizationApplication.IDecorator": {
|
|
399
|
+
type: "object",
|
|
400
|
+
properties: {
|
|
401
|
+
name: {
|
|
402
|
+
description: "The name of the Decorator to be generated in {Actor}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.\n\nDO: Use PascalCase naming convention.",
|
|
403
|
+
type: "string",
|
|
404
|
+
pattern: "^[A-Z][a-zA-Z0-9]*$"
|
|
405
|
+
},
|
|
406
|
+
content: {
|
|
407
|
+
description: "Complete TypeScript code for the authentication Decorator implementation.\nMust include: SwaggerCustomizer integration to add bearer token security\nschema to API documentation, createParamDecorator implementation that\ncalls the corresponding Provider function for authentication, Singleton\npattern using tstl library for efficient decorator instance management,\nand proper TypeScript typing for the ParameterDecorator interface.",
|
|
408
|
+
type: "string"
|
|
409
|
+
}
|
|
239
410
|
},
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
411
|
+
required: [
|
|
412
|
+
"name",
|
|
413
|
+
"content"
|
|
414
|
+
]
|
|
244
415
|
},
|
|
245
|
-
|
|
246
|
-
"
|
|
247
|
-
|
|
248
|
-
|
|
416
|
+
"IAutoBeRealizeAuthorizationApplication.IPayloadType": {
|
|
417
|
+
type: "object",
|
|
418
|
+
properties: {
|
|
419
|
+
name: {
|
|
420
|
+
description: "The name of the Payload type to be generated in {Actor}Payload format\n(e.g., AdminPayload, UserPayload). This type defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator.\n\nDO: Use PascalCase naming convention.",
|
|
421
|
+
type: "string",
|
|
422
|
+
pattern: "^[A-Z][a-zA-Z0-9]*$"
|
|
423
|
+
},
|
|
424
|
+
content: {
|
|
425
|
+
description: "Complete TypeScript code for the Payload type interface in {Actor}Payload\nformat (e.g., AdminPayload, UserPayload). Must include: id field with\nUUID format validation, type field as role discriminator, and proper\ntypia tags for validation. This interface defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator and serves as the TypeScript type for the\nparameter in Controller method signatures.",
|
|
426
|
+
type: "string"
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
required: [
|
|
430
|
+
"name",
|
|
431
|
+
"content"
|
|
432
|
+
]
|
|
433
|
+
}
|
|
249
434
|
}
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
435
|
+
},
|
|
436
|
+
description: "Generates authentication provider, decorator, and payload type for\nrole-based authorization.\n\nThis method creates a complete authentication infrastructure for a specific\nrole in the NestJS application. It generates three interconnected\ncomponents that work together to provide JWT-based authentication and\nauthorization.\n\nThe generated components include:\n\n- **Provider Function**: Handles JWT verification and user validation from\n database\n- **Decorator**: NestJS parameter decorator for injecting authenticated user\n data\n- **Payload Type**: TypeScript interface defining the authenticated user\n structure\n\nAll components follow strict naming conventions and integrate with the\nexisting authentication architecture using the shared jwtAuthorize\nfunction.",
|
|
437
|
+
validate: (() => { const _io0 = input => "object" === typeof input.provider && null !== input.provider && _io1(input.provider) && ("object" === typeof input.decorator && null !== input.decorator && _io2(input.decorator)) && ("object" === typeof input.payload && null !== input.payload && _io3(input.payload)); const _io1 = input => "string" === typeof input.name && RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) && "string" === typeof input.content; const _io2 = input => "string" === typeof input.name && RegExp("^[A-Z][a-zA-Z0-9]*$").test(input.name) && "string" === typeof input.content; const _io3 = input => "string" === typeof input.name && RegExp("^[A-Z][a-zA-Z0-9]*$").test(input.name) && "string" === typeof input.content; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.provider && null !== input.provider || _report(_exceptionable, {
|
|
438
|
+
path: _path + ".provider",
|
|
439
|
+
expected: "IAutoBeRealizeAuthorizationApplication.IProvider",
|
|
440
|
+
value: input.provider
|
|
441
|
+
})) && _vo1(input.provider, _path + ".provider", true && _exceptionable) || _report(_exceptionable, {
|
|
442
|
+
path: _path + ".provider",
|
|
443
|
+
expected: "IAutoBeRealizeAuthorizationApplication.IProvider",
|
|
444
|
+
value: input.provider
|
|
445
|
+
}), ("object" === typeof input.decorator && null !== input.decorator || _report(_exceptionable, {
|
|
446
|
+
path: _path + ".decorator",
|
|
447
|
+
expected: "IAutoBeRealizeAuthorizationApplication.IDecorator",
|
|
448
|
+
value: input.decorator
|
|
449
|
+
})) && _vo2(input.decorator, _path + ".decorator", true && _exceptionable) || _report(_exceptionable, {
|
|
450
|
+
path: _path + ".decorator",
|
|
451
|
+
expected: "IAutoBeRealizeAuthorizationApplication.IDecorator",
|
|
452
|
+
value: input.decorator
|
|
453
|
+
}), ("object" === typeof input.payload && null !== input.payload || _report(_exceptionable, {
|
|
454
|
+
path: _path + ".payload",
|
|
455
|
+
expected: "IAutoBeRealizeAuthorizationApplication.IPayloadType",
|
|
456
|
+
value: input.payload
|
|
457
|
+
})) && _vo3(input.payload, _path + ".payload", true && _exceptionable) || _report(_exceptionable, {
|
|
458
|
+
path: _path + ".payload",
|
|
459
|
+
expected: "IAutoBeRealizeAuthorizationApplication.IPayloadType",
|
|
460
|
+
value: input.payload
|
|
461
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
|
|
462
|
+
path: _path + ".name",
|
|
463
|
+
expected: "string & CamelCasePattern",
|
|
464
|
+
value: input.name
|
|
465
|
+
})) || _report(_exceptionable, {
|
|
466
|
+
path: _path + ".name",
|
|
467
|
+
expected: "(string & CamelCasePattern)",
|
|
468
|
+
value: input.name
|
|
469
|
+
}), "string" === typeof input.content || _report(_exceptionable, {
|
|
470
|
+
path: _path + ".content",
|
|
471
|
+
expected: "string",
|
|
472
|
+
value: input.content
|
|
473
|
+
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[A-Z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
|
|
474
|
+
path: _path + ".name",
|
|
475
|
+
expected: "string & PascalCasePattern",
|
|
476
|
+
value: input.name
|
|
477
|
+
})) || _report(_exceptionable, {
|
|
478
|
+
path: _path + ".name",
|
|
479
|
+
expected: "(string & PascalCasePattern)",
|
|
480
|
+
value: input.name
|
|
481
|
+
}), "string" === typeof input.content || _report(_exceptionable, {
|
|
482
|
+
path: _path + ".content",
|
|
483
|
+
expected: "string",
|
|
484
|
+
value: input.content
|
|
485
|
+
})].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[A-Z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
|
|
486
|
+
path: _path + ".name",
|
|
487
|
+
expected: "string & PascalCasePattern",
|
|
488
|
+
value: input.name
|
|
489
|
+
})) || _report(_exceptionable, {
|
|
490
|
+
path: _path + ".name",
|
|
491
|
+
expected: "(string & PascalCasePattern)",
|
|
492
|
+
value: input.name
|
|
493
|
+
}), "string" === typeof input.content || _report(_exceptionable, {
|
|
494
|
+
path: _path + ".content",
|
|
495
|
+
expected: "string",
|
|
496
|
+
value: input.content
|
|
497
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
498
|
+
if (false === __is(input)) {
|
|
499
|
+
errors = [];
|
|
500
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
501
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
502
|
+
path: _path + "",
|
|
503
|
+
expected: "IAutoBeRealizeAuthorizationApplication.IProps",
|
|
504
|
+
value: input
|
|
505
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
506
|
+
path: _path + "",
|
|
507
|
+
expected: "IAutoBeRealizeAuthorizationApplication.IProps",
|
|
508
|
+
value: input
|
|
509
|
+
}))(input, "$input", true);
|
|
510
|
+
const success = 0 === errors.length;
|
|
511
|
+
return success ? {
|
|
512
|
+
success,
|
|
513
|
+
data: input
|
|
514
|
+
} : {
|
|
515
|
+
success,
|
|
516
|
+
errors,
|
|
517
|
+
data: input
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
return {
|
|
521
|
+
success: true,
|
|
333
522
|
data: input
|
|
334
523
|
};
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
}
|
|
342
|
-
]
|
|
343
|
-
};
|
|
344
|
-
const collection = {
|
|
345
|
-
chatgpt: {
|
|
346
|
-
model: "chatgpt",
|
|
524
|
+
}; })()
|
|
525
|
+
}
|
|
526
|
+
]
|
|
527
|
+
},
|
|
528
|
+
gemini: {
|
|
529
|
+
model: "gemini",
|
|
347
530
|
options: {
|
|
348
531
|
reference: true,
|
|
349
|
-
strict: false,
|
|
350
532
|
separate: null
|
|
351
533
|
},
|
|
352
534
|
functions: [
|
|
353
535
|
{
|
|
354
536
|
name: "createDecorator",
|
|
355
537
|
parameters: {
|
|
356
|
-
description: " Properties containing provider, decorator, and payload type\nconfigurations\n\n------------------------------\n\nCurrent Type: {@link IAutoBeRealizeAuthorizationApplication.IProps}
|
|
538
|
+
description: " Properties containing provider, decorator, and payload type\nconfigurations\n\n------------------------------\n\nCurrent Type: {@link IAutoBeRealizeAuthorizationApplication.IProps}",
|
|
357
539
|
type: "object",
|
|
358
540
|
properties: {
|
|
359
541
|
provider: {
|
|
542
|
+
description: "Authentication Provider function configuration containing the function\nname and implementation code. The Provider handles JWT token\nverification, role validation, and database queries to authenticate\nusers.",
|
|
360
543
|
$ref: "#/$defs/IAutoBeRealizeAuthorizationApplication.IProvider"
|
|
361
544
|
},
|
|
362
545
|
decorator: {
|
|
546
|
+
description: "Authentication Decorator configuration containing the decorator name and\nimplementation code. The Decorator integrates with NestJS parameter\ndecorators to automatically inject authenticated user data into\nController methods.",
|
|
363
547
|
$ref: "#/$defs/IAutoBeRealizeAuthorizationApplication.IDecorator"
|
|
364
548
|
},
|
|
365
549
|
payload: {
|
|
550
|
+
description: "Authentication Payload Type configuration containing the payload type\nname and implementation code. The Payload Type is used to define the\nstructure of the authenticated user data that will be injected into\nController methods when using the decorator. It serves as the TypeScript\ntype for the parameter in Controller method signatures.",
|
|
366
551
|
$ref: "#/$defs/IAutoBeRealizeAuthorizationApplication.IPayloadType"
|
|
367
552
|
}
|
|
368
553
|
},
|
|
@@ -518,9 +703,5 @@ const collection = {
|
|
|
518
703
|
}
|
|
519
704
|
]
|
|
520
705
|
},
|
|
521
|
-
claude,
|
|
522
|
-
llama: claude,
|
|
523
|
-
deepseek: claude,
|
|
524
|
-
"3.1": claude,
|
|
525
706
|
};
|
|
526
707
|
//# sourceMappingURL=orchestrateRealizeAuthorization.js.map
|