@geekmidas/constructs 3.0.8 → 3.0.10
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 +16 -0
- package/dist/{Endpoint-C991gK3T.d.cts → Endpoint-BoTfIVxN.d.cts} +15 -3
- package/dist/Endpoint-BoTfIVxN.d.cts.map +1 -0
- package/dist/{Endpoint-CRHpLPV3.d.mts → Endpoint-NvjIednd.d.mts} +14 -2
- package/dist/Endpoint-NvjIednd.d.mts.map +1 -0
- package/dist/{HonoEndpointAdaptor-BDz1qM4z.cjs → HonoEndpointAdaptor-DNn3-dHv.cjs} +13 -4
- package/dist/HonoEndpointAdaptor-DNn3-dHv.cjs.map +1 -0
- package/dist/{HonoEndpointAdaptor-DPBfEPZj.mjs → HonoEndpointAdaptor-cpttJfsS.mjs} +13 -4
- package/dist/HonoEndpointAdaptor-cpttJfsS.mjs.map +1 -0
- package/dist/adaptors/aws.cjs +10 -5
- package/dist/adaptors/aws.cjs.map +1 -1
- package/dist/adaptors/aws.d.cts +2 -2
- package/dist/adaptors/aws.d.cts.map +1 -1
- package/dist/adaptors/aws.d.mts +1 -1
- package/dist/adaptors/aws.d.mts.map +1 -1
- package/dist/adaptors/aws.mjs +10 -5
- package/dist/adaptors/aws.mjs.map +1 -1
- package/dist/adaptors/hono.cjs +3 -3
- package/dist/adaptors/hono.d.cts +2 -2
- package/dist/adaptors/hono.d.cts.map +1 -1
- package/dist/adaptors/hono.d.mts +1 -1
- package/dist/adaptors/hono.d.mts.map +1 -1
- package/dist/adaptors/hono.mjs +3 -3
- package/dist/adaptors/testing.cjs +3 -3
- package/dist/adaptors/testing.d.cts +2 -2
- package/dist/adaptors/testing.d.mts +1 -1
- package/dist/adaptors/testing.mjs +3 -3
- package/dist/crons/index.cjs +1 -1
- package/dist/crons/index.d.cts +5 -5
- package/dist/crons/index.mjs +1 -1
- package/dist/endpoints/index.cjs +27 -3
- package/dist/endpoints/index.cjs.map +1 -1
- package/dist/endpoints/index.d.cts +24 -4
- package/dist/endpoints/index.d.cts.map +1 -1
- package/dist/endpoints/index.d.mts +21 -1
- package/dist/endpoints/index.d.mts.map +1 -1
- package/dist/endpoints/index.mjs +27 -3
- package/dist/endpoints/index.mjs.map +1 -1
- package/dist/functions/index.cjs +1 -1
- package/dist/functions/index.d.cts +1 -1
- package/dist/functions/index.mjs +1 -1
- package/dist/{functions-GmSHFbpr.mjs → functions-DN9d6sgj.mjs} +1 -1
- package/dist/{functions-GmSHFbpr.mjs.map → functions-DN9d6sgj.mjs.map} +1 -1
- package/dist/{functions-DiaRAdfp.cjs → functions-yrAtvBor.cjs} +1 -1
- package/dist/{functions-DiaRAdfp.cjs.map → functions-yrAtvBor.cjs.map} +1 -1
- package/dist/{index-CzIMpK-e.d.cts → index-6U4XAuUI.d.cts} +5 -5
- package/dist/{index-CzIMpK-e.d.cts.map → index-6U4XAuUI.d.cts.map} +1 -1
- package/dist/{lazyAccessors-CJZYs9uM.mjs → lazyAccessors-BPPR05EA.mjs} +11 -4
- package/dist/{lazyAccessors-CJZYs9uM.mjs.map → lazyAccessors-BPPR05EA.mjs.map} +1 -1
- package/dist/{lazyAccessors-DHvDeww0.cjs → lazyAccessors-BzMEdmis.cjs} +11 -4
- package/dist/{lazyAccessors-DHvDeww0.cjs.map → lazyAccessors-BzMEdmis.cjs.map} +1 -1
- package/package.json +9 -9
- package/src/endpoints/AmazonApiGatewayEndpointAdaptor.ts +23 -4
- package/src/endpoints/Endpoint.ts +14 -1
- package/src/endpoints/EndpointBuilder.ts +25 -0
- package/src/endpoints/HonoEndpointAdaptor.ts +24 -1
- package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.responseType.spec.ts +111 -0
- package/src/endpoints/__tests__/Endpoint.spec.ts +29 -0
- package/src/endpoints/__tests__/EndpointBuilder.responseType.spec.ts +47 -0
- package/src/endpoints/__tests__/HonoEndpointAdaptor.pgboss-publisher.spec.ts +17 -1
- package/src/endpoints/__tests__/HonoEndpointAdaptor.responseType.spec.ts +128 -0
- package/dist/Endpoint-C991gK3T.d.cts.map +0 -1
- package/dist/Endpoint-CRHpLPV3.d.mts.map +0 -1
- package/dist/HonoEndpointAdaptor-BDz1qM4z.cjs.map +0 -1
- package/dist/HonoEndpointAdaptor-DPBfEPZj.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_Construct = require('./Construct-B14miJ6P.cjs');
|
|
2
|
-
const require_functions = require('./functions-
|
|
2
|
+
const require_functions = require('./functions-yrAtvBor.cjs');
|
|
3
3
|
const __geekmidas_schema_conversion = require_Construct.__toESM(require("@geekmidas/schema/conversion"));
|
|
4
4
|
const __geekmidas_schema_openapi = require_Construct.__toESM(require("@geekmidas/schema/openapi"));
|
|
5
5
|
const hono_cookie = require_Construct.__toESM(require("hono/cookie"));
|
|
@@ -1298,6 +1298,12 @@ var Endpoint = class Endpoint extends require_functions.Function {
|
|
|
1298
1298
|
tags;
|
|
1299
1299
|
/** The HTTP success status code to return (default: 200) */
|
|
1300
1300
|
status;
|
|
1301
|
+
/**
|
|
1302
|
+
* Response content type for this endpoint. Defaults to `'application/json'`.
|
|
1303
|
+
* Non-JSON types cause adaptors to emit the body as-is with the declared
|
|
1304
|
+
* Content-Type header instead of JSON-serializing.
|
|
1305
|
+
*/
|
|
1306
|
+
responseType;
|
|
1301
1307
|
/** Default headers to apply to all responses */
|
|
1302
1308
|
defaultHeaders = {};
|
|
1303
1309
|
/** Function to extract session data from the request context */
|
|
@@ -1529,7 +1535,7 @@ var Endpoint = class Endpoint extends require_functions.Function {
|
|
|
1529
1535
|
"responses",
|
|
1530
1536
|
"200",
|
|
1531
1537
|
"content",
|
|
1532
|
-
|
|
1538
|
+
this.responseType,
|
|
1533
1539
|
"schema"
|
|
1534
1540
|
], responseSchema);
|
|
1535
1541
|
}
|
|
@@ -1590,13 +1596,14 @@ var Endpoint = class Endpoint extends require_functions.Function {
|
|
|
1590
1596
|
* @param options.status - Success HTTP status code (default: 200)
|
|
1591
1597
|
* @param options.authorizer - Optional authorizer configuration
|
|
1592
1598
|
*/
|
|
1593
|
-
constructor({ fn, method, route, description, tags, input, logger, output: outputSchema, services, timeout, memorySize, getSession, authorize, rateLimit, status = SuccessStatus.OK, publisherService, events, authorizer, auditorStorageService, actorExtractor, audits, databaseService, rlsConfig, rlsBypass }) {
|
|
1599
|
+
constructor({ fn, method, route, description, tags, input, logger, output: outputSchema, services, timeout, memorySize, getSession, authorize, rateLimit, status = SuccessStatus.OK, publisherService, events, authorizer, auditorStorageService, actorExtractor, audits, databaseService, rlsConfig, rlsBypass, responseType }) {
|
|
1594
1600
|
super(fn, timeout, require_Construct.ConstructType.Endpoint, input, outputSchema, services, logger, publisherService, events, memorySize, auditorStorageService);
|
|
1595
1601
|
this.route = route;
|
|
1596
1602
|
this.method = method;
|
|
1597
1603
|
this.description = description;
|
|
1598
1604
|
this.tags = tags;
|
|
1599
1605
|
this.status = status;
|
|
1606
|
+
this.responseType = responseType ?? "application/json";
|
|
1600
1607
|
this.endpointFn = fn;
|
|
1601
1608
|
if (getSession) this.getSession = getSession;
|
|
1602
1609
|
if (authorize) this.authorize = authorize;
|
|
@@ -1961,4 +1968,4 @@ Object.defineProperty(exports, 'require_lodash', {
|
|
|
1961
1968
|
return require_lodash$1;
|
|
1962
1969
|
}
|
|
1963
1970
|
});
|
|
1964
|
-
//# sourceMappingURL=lazyAccessors-
|
|
1971
|
+
//# sourceMappingURL=lazyAccessors-BzMEdmis.cjs.map
|