@medusajs/framework 0.0.2-snapshot-20240821132459 → 0.0.2-snapshot-20240821152538
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/config/__fixtures__/medusa-config-2.d.ts +3 -0
- package/dist/config/__fixtures__/medusa-config-2.d.ts.map +1 -0
- package/dist/config/__fixtures__/medusa-config-2.js +8 -0
- package/dist/config/__fixtures__/medusa-config.d.ts +3 -0
- package/dist/config/__fixtures__/medusa-config.d.ts.map +1 -0
- package/dist/config/__fixtures__/medusa-config.js +4 -0
- package/dist/config/__tests__/index.spec.d.ts +2 -0
- package/dist/config/__tests__/index.spec.d.ts.map +1 -0
- package/dist/config/__tests__/index.spec.js +28 -0
- package/dist/config/types.d.ts +120 -58
- package/dist/config/types.d.ts.map +1 -1
- package/dist/feature-flags/__tests__/feature-flags.spec.d.ts +2 -0
- package/dist/feature-flags/__tests__/feature-flags.spec.d.ts.map +1 -0
- package/dist/feature-flags/__tests__/feature-flags.spec.js +82 -0
- package/dist/http/__fixtures__/mocks/index.d.ts +7 -0
- package/dist/http/__fixtures__/mocks/index.d.ts.map +1 -0
- package/dist/http/__fixtures__/mocks/index.js +20 -0
- package/dist/http/__fixtures__/routers/_private/route.d.ts +3 -0
- package/dist/http/__fixtures__/routers/_private/route.d.ts.map +1 -0
- package/dist/http/__fixtures__/routers/_private/route.js +7 -0
- package/dist/http/__fixtures__/routers/admin/orders/[id]/route.d.ts +4 -0
- package/dist/http/__fixtures__/routers/admin/orders/[id]/route.d.ts.map +1 -0
- package/dist/http/__fixtures__/routers/admin/orders/[id]/route.js +21 -0
- package/dist/http/__fixtures__/routers/admin/orders/route.d.ts +3 -0
- package/dist/http/__fixtures__/routers/admin/orders/route.d.ts.map +1 -0
- package/dist/http/__fixtures__/routers/admin/orders/route.js +7 -0
- package/dist/http/__fixtures__/routers/admin/products/[id]/route.d.ts +3 -0
- package/dist/http/__fixtures__/routers/admin/products/[id]/route.d.ts.map +1 -0
- package/dist/http/__fixtures__/routers/admin/products/[id]/route.js +7 -0
- package/dist/http/__fixtures__/routers/admin/products/route.d.ts +9 -0
- package/dist/http/__fixtures__/routers/admin/products/route.d.ts.map +1 -0
- package/dist/http/__fixtures__/routers/admin/products/route.js +31 -0
- package/dist/http/__fixtures__/routers/admin/route.d.ts +4 -0
- package/dist/http/__fixtures__/routers/admin/route.d.ts.map +1 -0
- package/dist/http/__fixtures__/routers/admin/route.js +11 -0
- package/dist/http/__fixtures__/routers/customers/[customer_id]/orders/[order_id]/route.d.ts +3 -0
- package/dist/http/__fixtures__/routers/customers/[customer_id]/orders/[order_id]/route.d.ts.map +1 -0
- package/dist/http/__fixtures__/routers/customers/[customer_id]/orders/[order_id]/route.js +9 -0
- package/dist/http/__fixtures__/routers/customers/route.d.ts +3 -0
- package/dist/http/__fixtures__/routers/customers/route.d.ts.map +1 -0
- package/dist/http/__fixtures__/routers/customers/route.js +7 -0
- package/dist/http/__fixtures__/routers-duplicate-parameter/admin/customers/[id]/orders/[id]/route.d.ts +4 -0
- package/dist/http/__fixtures__/routers-duplicate-parameter/admin/customers/[id]/orders/[id]/route.d.ts.map +1 -0
- package/dist/http/__fixtures__/routers-duplicate-parameter/admin/customers/[id]/orders/[id]/route.js +11 -0
- package/dist/http/__fixtures__/routers-error-handler/middlewares.d.ts +3 -0
- package/dist/http/__fixtures__/routers-error-handler/middlewares.d.ts.map +1 -0
- package/dist/http/__fixtures__/routers-error-handler/middlewares.js +39 -0
- package/dist/http/__fixtures__/routers-error-handler/store/route.d.ts +5 -0
- package/dist/http/__fixtures__/routers-error-handler/store/route.d.ts.map +1 -0
- package/dist/http/__fixtures__/routers-error-handler/store/route.js +31 -0
- package/dist/http/__fixtures__/routers-middleware/admin/protected/route.d.ts +3 -0
- package/dist/http/__fixtures__/routers-middleware/admin/protected/route.d.ts.map +1 -0
- package/dist/http/__fixtures__/routers-middleware/admin/protected/route.js +7 -0
- package/dist/http/__fixtures__/routers-middleware/admin/unprotected/route.d.ts +4 -0
- package/dist/http/__fixtures__/routers-middleware/admin/unprotected/route.d.ts.map +1 -0
- package/dist/http/__fixtures__/routers-middleware/admin/unprotected/route.js +8 -0
- package/dist/http/__fixtures__/routers-middleware/customers/error/route.d.ts +3 -0
- package/dist/http/__fixtures__/routers-middleware/customers/error/route.d.ts.map +1 -0
- package/dist/http/__fixtures__/routers-middleware/customers/error/route.js +8 -0
- package/dist/http/__fixtures__/routers-middleware/customers/route.d.ts +4 -0
- package/dist/http/__fixtures__/routers-middleware/customers/route.d.ts.map +1 -0
- package/dist/http/__fixtures__/routers-middleware/customers/route.js +11 -0
- package/dist/http/__fixtures__/routers-middleware/middlewares.d.ts +3 -0
- package/dist/http/__fixtures__/routers-middleware/middlewares.d.ts.map +1 -0
- package/dist/http/__fixtures__/routers-middleware/middlewares.js +38 -0
- package/dist/http/__fixtures__/routers-middleware/store/customers/me/protected/route.d.ts +3 -0
- package/dist/http/__fixtures__/routers-middleware/store/customers/me/protected/route.d.ts.map +1 -0
- package/dist/http/__fixtures__/routers-middleware/store/customers/me/protected/route.js +7 -0
- package/dist/http/__fixtures__/routers-middleware/store/customers/me/unprotected/route.d.ts +4 -0
- package/dist/http/__fixtures__/routers-middleware/store/customers/me/unprotected/route.d.ts.map +1 -0
- package/dist/http/__fixtures__/routers-middleware/store/customers/me/unprotected/route.js +8 -0
- package/dist/http/__fixtures__/routers-middleware/store/products/[id]/sync/route.d.ts +3 -0
- package/dist/http/__fixtures__/routers-middleware/store/products/[id]/sync/route.d.ts.map +1 -0
- package/dist/http/__fixtures__/routers-middleware/store/products/[id]/sync/route.js +7 -0
- package/dist/http/__fixtures__/routers-middleware/webhooks/payment/route.d.ts +3 -0
- package/dist/http/__fixtures__/routers-middleware/webhooks/payment/route.d.ts.map +1 -0
- package/dist/http/__fixtures__/routers-middleware/webhooks/payment/route.js +10 -0
- package/dist/http/__fixtures__/server/index.d.ts +9 -0
- package/dist/http/__fixtures__/server/index.d.ts.map +1 -0
- package/dist/http/__fixtures__/server/index.js +142 -0
- package/dist/http/__tests__/index.spec.d.ts +2 -0
- package/dist/http/__tests__/index.spec.d.ts.map +1 -0
- package/dist/http/__tests__/index.spec.js +182 -0
- package/dist/jobs/__fixtures__/mock-scheduler-storage.d.ts +9 -0
- package/dist/jobs/__fixtures__/mock-scheduler-storage.d.ts.map +1 -0
- package/dist/jobs/__fixtures__/mock-scheduler-storage.js +15 -0
- package/dist/jobs/__fixtures__/plugin/jobs/order-summary.d.ts +8 -0
- package/dist/jobs/__fixtures__/plugin/jobs/order-summary.d.ts.map +1 -0
- package/dist/jobs/__fixtures__/plugin/jobs/order-summary.js +12 -0
- package/dist/jobs/__tests__/register-jobs.spec.d.ts +2 -0
- package/dist/jobs/__tests__/register-jobs.spec.d.ts.map +1 -0
- package/dist/jobs/__tests__/register-jobs.spec.js +22 -0
- package/dist/links/__fixtures__/links/link.d.ts +2 -0
- package/dist/links/__fixtures__/links/link.d.ts.map +1 -0
- package/dist/links/__fixtures__/links/link.js +19 -0
- package/dist/links/__fixtures__/links/sub-links/link.d.ts +2 -0
- package/dist/links/__fixtures__/links/sub-links/link.d.ts.map +1 -0
- package/dist/links/__fixtures__/links/sub-links/link.js +19 -0
- package/dist/links/__tests__/index.spec.d.ts +2 -0
- package/dist/links/__tests__/index.spec.d.ts.map +1 -0
- package/dist/links/__tests__/index.spec.js +15 -0
- package/dist/subscribers/__fixtures__/subscribers/order-notifier.d.ts +4 -0
- package/dist/subscribers/__fixtures__/subscribers/order-notifier.d.ts.map +1 -0
- package/dist/subscribers/__fixtures__/subscribers/order-notifier.js +11 -0
- package/dist/subscribers/__fixtures__/subscribers/product-updater.d.ts +4 -0
- package/dist/subscribers/__fixtures__/subscribers/product-updater.d.ts.map +1 -0
- package/dist/subscribers/__fixtures__/subscribers/product-updater.js +13 -0
- package/dist/subscribers/__fixtures__/subscribers/variant-created.d.ts +4 -0
- package/dist/subscribers/__fixtures__/subscribers/variant-created.d.ts.map +1 -0
- package/dist/subscribers/__fixtures__/subscribers/variant-created.js +10 -0
- package/dist/subscribers/__mocks__/index.d.ts +5 -0
- package/dist/subscribers/__mocks__/index.d.ts.map +1 -0
- package/dist/subscribers/__mocks__/index.js +8 -0
- package/dist/subscribers/__tests__/index.spec.d.ts +2 -0
- package/dist/subscribers/__tests__/index.spec.d.ts.map +1 -0
- package/dist/subscribers/__tests__/index.spec.js +81 -0
- package/dist/workflows/__fixtures__/workflows/deep-workflows/product-updater.d.ts +3 -0
- package/dist/workflows/__fixtures__/workflows/deep-workflows/product-updater.d.ts.map +1 -0
- package/dist/workflows/__fixtures__/workflows/deep-workflows/product-updater.js +12 -0
- package/dist/workflows/__fixtures__/workflows/order-notifier.d.ts +3 -0
- package/dist/workflows/__fixtures__/workflows/order-notifier.d.ts.map +1 -0
- package/dist/workflows/__fixtures__/workflows/order-notifier.js +12 -0
- package/dist/workflows/__tests__/index.spec.d.ts +2 -0
- package/dist/workflows/__tests__/index.spec.d.ts.map +1 -0
- package/dist/workflows/__tests__/index.spec.js +19 -0
- package/package.json +10 -10
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../src/http/__fixtures__/routers/_private/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE3C,eAAO,MAAM,GAAG,QAAe,OAAO,OAAO,QAAQ,KAAG,QAAQ,IAAI,CAEnE,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../src/http/__fixtures__/routers/admin/orders/[id]/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE3C,wBAAsB,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAMpE;AAED,wBAAsB,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAMrE"}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.POST = exports.GET = void 0;
|
4
|
+
async function GET(req, res) {
|
5
|
+
try {
|
6
|
+
res.send(`GET order ${req.params.id}`);
|
7
|
+
}
|
8
|
+
catch (err) {
|
9
|
+
res.status(400).send(err);
|
10
|
+
}
|
11
|
+
}
|
12
|
+
exports.GET = GET;
|
13
|
+
async function POST(req, res) {
|
14
|
+
try {
|
15
|
+
res.send(`POST order ${req.params.id}`);
|
16
|
+
}
|
17
|
+
catch (err) {
|
18
|
+
res.status(400).send(err);
|
19
|
+
}
|
20
|
+
}
|
21
|
+
exports.POST = POST;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/http/__fixtures__/routers/admin/orders/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE3C,wBAAgB,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,QAE9C"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../src/http/__fixtures__/routers/admin/products/[id]/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE3C,wBAAsB,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpE"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { Request, Response } from "express";
|
2
|
+
export declare function GET(req: Request, res: Response): Promise<void>;
|
3
|
+
export declare function POST(req: Request, res: Response): Promise<void>;
|
4
|
+
export declare function PUT(req: Request, res: Response): Promise<void>;
|
5
|
+
export declare function DELETE(req: Request, res: Response): Promise<void>;
|
6
|
+
export declare function PATCH(req: Request, res: Response): Promise<void>;
|
7
|
+
export declare function OPTIONS(req: Request, res: Response): Promise<void>;
|
8
|
+
export declare function HEAD(req: Request, res: Response): Promise<void>;
|
9
|
+
//# sourceMappingURL=route.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/http/__fixtures__/routers/admin/products/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE3C,wBAAsB,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpE;AAED,wBAAsB,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAErE;AAED,wBAAsB,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpE;AAED,wBAAsB,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAEvE;AAED,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAEtE;AAED,wBAAsB,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAExE;AAED,wBAAsB,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAErE"}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.HEAD = exports.OPTIONS = exports.PATCH = exports.DELETE = exports.PUT = exports.POST = exports.GET = void 0;
|
4
|
+
async function GET(req, res) {
|
5
|
+
console.log("hello world");
|
6
|
+
}
|
7
|
+
exports.GET = GET;
|
8
|
+
async function POST(req, res) {
|
9
|
+
console.log("hello world");
|
10
|
+
}
|
11
|
+
exports.POST = POST;
|
12
|
+
async function PUT(req, res) {
|
13
|
+
console.log("hello world");
|
14
|
+
}
|
15
|
+
exports.PUT = PUT;
|
16
|
+
async function DELETE(req, res) {
|
17
|
+
console.log("hello world");
|
18
|
+
}
|
19
|
+
exports.DELETE = DELETE;
|
20
|
+
async function PATCH(req, res) {
|
21
|
+
console.log("hello world");
|
22
|
+
}
|
23
|
+
exports.PATCH = PATCH;
|
24
|
+
async function OPTIONS(req, res) {
|
25
|
+
console.log("hello world");
|
26
|
+
}
|
27
|
+
exports.OPTIONS = OPTIONS;
|
28
|
+
async function HEAD(req, res) {
|
29
|
+
console.log("hello world");
|
30
|
+
}
|
31
|
+
exports.HEAD = HEAD;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../src/http/__fixtures__/routers/admin/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE3C,wBAAsB,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpE;AAED,wBAAsB,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAErE"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.POST = exports.GET = void 0;
|
4
|
+
async function GET(req, res) {
|
5
|
+
console.log("hello world");
|
6
|
+
}
|
7
|
+
exports.GET = GET;
|
8
|
+
async function POST(req, res) {
|
9
|
+
console.log("hello world");
|
10
|
+
}
|
11
|
+
exports.POST = POST;
|
package/dist/http/__fixtures__/routers/customers/[customer_id]/orders/[order_id]/route.d.ts.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../../src/http/__fixtures__/routers/customers/[customer_id]/orders/[order_id]/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE3C,wBAAgB,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,QAI9C"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.GET = void 0;
|
4
|
+
function GET(req, res) {
|
5
|
+
/* const customerId = req.params.id;
|
6
|
+
const orderId = req.params.id;*/
|
7
|
+
res.send("list customers " + JSON.stringify(req.params));
|
8
|
+
}
|
9
|
+
exports.GET = GET;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../src/http/__fixtures__/routers/customers/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEzD,wBAAgB,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,QAE9C"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/http/__fixtures__/routers-duplicate-parameter/admin/customers/[id]/orders/[id]/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE3C,eAAO,MAAM,GAAG,QAAS,OAAO,OAAO,QAAQ,SAE9C,CAAA;AAED,eAAO,MAAM,IAAI,QAAS,OAAO,OAAO,QAAQ,SAE/C,CAAA"}
|
package/dist/http/__fixtures__/routers-duplicate-parameter/admin/customers/[id]/orders/[id]/route.js
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.POST = exports.GET = void 0;
|
4
|
+
const GET = (req, res) => {
|
5
|
+
res.send("get customer order");
|
6
|
+
};
|
7
|
+
exports.GET = GET;
|
8
|
+
const POST = (req, res) => {
|
9
|
+
res.send("update customer order");
|
10
|
+
};
|
11
|
+
exports.POST = POST;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"middlewares.d.ts","sourceRoot":"","sources":["../../../../src/http/__fixtures__/routers-error-handler/middlewares.ts"],"names":[],"mappings":";AAEA,wBAoCE"}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const define_middlewares_1 = require("../../utils/define-middlewares");
|
4
|
+
exports.default = (0, define_middlewares_1.defineMiddlewares)({
|
5
|
+
errorHandler: (err, _req, res, _next) => {
|
6
|
+
const { code, message } = err;
|
7
|
+
switch (code) {
|
8
|
+
case "NOT_ALLOWED":
|
9
|
+
res.status(405).json({
|
10
|
+
type: code.toLowerCase(),
|
11
|
+
message,
|
12
|
+
});
|
13
|
+
break;
|
14
|
+
case "INVALID_DATA":
|
15
|
+
res.status(400).json({
|
16
|
+
type: code.toLowerCase(),
|
17
|
+
message,
|
18
|
+
});
|
19
|
+
break;
|
20
|
+
case "CONFLICT":
|
21
|
+
res.status(409).json({
|
22
|
+
type: code.toLowerCase(),
|
23
|
+
message,
|
24
|
+
});
|
25
|
+
break;
|
26
|
+
case "TEAPOT":
|
27
|
+
res.status(418).json({
|
28
|
+
type: code.toLowerCase(),
|
29
|
+
message,
|
30
|
+
});
|
31
|
+
break;
|
32
|
+
default:
|
33
|
+
res.status(500).json({
|
34
|
+
type: "unknown_error",
|
35
|
+
message: "An unknown error occurred.",
|
36
|
+
});
|
37
|
+
}
|
38
|
+
},
|
39
|
+
});
|
@@ -0,0 +1,5 @@
|
|
1
|
+
export declare const GET: (req: Request, res: Response) => Promise<never>;
|
2
|
+
export declare const POST: (req: Request, res: Response) => Promise<never>;
|
3
|
+
export declare const PUT: (req: Request, res: Response) => Promise<never>;
|
4
|
+
export declare const DELETE: (req: Request, res: Response) => Promise<never>;
|
5
|
+
//# sourceMappingURL=route.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../src/http/__fixtures__/routers-error-handler/store/route.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,GAAG,QAAe,OAAO,OAAO,QAAQ,mBAKpD,CAAA;AAED,eAAO,MAAM,IAAI,QAAe,OAAO,OAAO,QAAQ,mBAKrD,CAAA;AAED,eAAO,MAAM,GAAG,QAAe,OAAO,OAAO,QAAQ,mBAKpD,CAAA;AAED,eAAO,MAAM,MAAM,QAAe,OAAO,OAAO,QAAQ,mBAKvD,CAAA"}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.DELETE = exports.PUT = exports.POST = exports.GET = void 0;
|
4
|
+
const GET = async (req, res) => {
|
5
|
+
throw {
|
6
|
+
code: "NOT_ALLOWED",
|
7
|
+
message: "Not allowed to perform this action",
|
8
|
+
};
|
9
|
+
};
|
10
|
+
exports.GET = GET;
|
11
|
+
const POST = async (req, res) => {
|
12
|
+
throw {
|
13
|
+
code: "INVALID_DATA",
|
14
|
+
message: "Invalid data provided",
|
15
|
+
};
|
16
|
+
};
|
17
|
+
exports.POST = POST;
|
18
|
+
const PUT = async (req, res) => {
|
19
|
+
throw {
|
20
|
+
code: "CONFLICT",
|
21
|
+
message: "Conflict with another request",
|
22
|
+
};
|
23
|
+
};
|
24
|
+
exports.PUT = PUT;
|
25
|
+
const DELETE = async (req, res) => {
|
26
|
+
throw {
|
27
|
+
code: "TEAPOT",
|
28
|
+
message: "I'm a teapot",
|
29
|
+
};
|
30
|
+
};
|
31
|
+
exports.DELETE = DELETE;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/http/__fixtures__/routers-middleware/admin/protected/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE3C,eAAO,MAAM,GAAG,QAAS,OAAO,OAAO,QAAQ,SAE9C,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/http/__fixtures__/routers-middleware/admin/unprotected/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE3C,eAAO,MAAM,YAAY,QAAQ,CAAA;AAEjC,eAAO,MAAM,GAAG,QAAS,OAAO,OAAO,QAAQ,SAE9C,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/http/__fixtures__/routers-middleware/customers/error/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAG3C,eAAO,MAAM,GAAG,QAAe,OAAO,OAAO,QAAQ,mBAEpD,CAAA"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.GET = void 0;
|
4
|
+
const utils_1 = require("@medusajs/utils");
|
5
|
+
const GET = async (req, res) => {
|
6
|
+
throw new utils_1.MedusaError(utils_1.MedusaError.Types.NOT_ALLOWED, "Not allowed");
|
7
|
+
};
|
8
|
+
exports.GET = GET;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../src/http/__fixtures__/routers-middleware/customers/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE3C,wBAAgB,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,QAE9C;AAED,wBAAgB,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,QAE/C"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.POST = exports.GET = void 0;
|
4
|
+
function GET(req, res) {
|
5
|
+
res.send("list customers");
|
6
|
+
}
|
7
|
+
exports.GET = GET;
|
8
|
+
function POST(req, res) {
|
9
|
+
res.send("create customer");
|
10
|
+
}
|
11
|
+
exports.POST = POST;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"middlewares.d.ts","sourceRoot":"","sources":["../../../../src/http/__fixtures__/routers-middleware/middlewares.ts"],"names":[],"mappings":";AA+BA,wBAoBE"}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const express_1 = require("express");
|
4
|
+
const mocks_1 = require("../mocks");
|
5
|
+
const define_middlewares_1 = require("../../utils/define-middlewares");
|
6
|
+
const customersGlobalMiddleware = (req, res, next) => {
|
7
|
+
(0, mocks_1.customersGlobalMiddlewareMock)();
|
8
|
+
next();
|
9
|
+
};
|
10
|
+
const customersCreateMiddleware = (req, res, next) => {
|
11
|
+
(0, mocks_1.customersCreateMiddlewareMock)();
|
12
|
+
next();
|
13
|
+
};
|
14
|
+
const storeGlobal = (req, res, next) => {
|
15
|
+
(0, mocks_1.storeGlobalMiddlewareMock)();
|
16
|
+
next();
|
17
|
+
};
|
18
|
+
exports.default = (0, define_middlewares_1.defineMiddlewares)([
|
19
|
+
{
|
20
|
+
matcher: "/customers",
|
21
|
+
middlewares: [customersGlobalMiddleware],
|
22
|
+
},
|
23
|
+
{
|
24
|
+
method: "POST",
|
25
|
+
matcher: "/customers",
|
26
|
+
middlewares: [customersCreateMiddleware],
|
27
|
+
},
|
28
|
+
{
|
29
|
+
matcher: "/store/*",
|
30
|
+
middlewares: [storeGlobal],
|
31
|
+
},
|
32
|
+
{
|
33
|
+
matcher: "/webhooks/*",
|
34
|
+
method: "POST",
|
35
|
+
bodyParser: false,
|
36
|
+
middlewares: [(0, express_1.raw)({ type: "application/json" })],
|
37
|
+
},
|
38
|
+
]);
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../../src/http/__fixtures__/routers-middleware/store/customers/me/protected/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE3C,eAAO,MAAM,GAAG,QAAe,OAAO,OAAO,QAAQ,kBAEpD,CAAA"}
|
package/dist/http/__fixtures__/routers-middleware/store/customers/me/unprotected/route.d.ts.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../../src/http/__fixtures__/routers-middleware/store/customers/me/unprotected/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE3C,eAAO,MAAM,YAAY,QAAQ,CAAA;AAEjC,eAAO,MAAM,GAAG,QAAe,OAAO,OAAO,QAAQ,kBAEpD,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../../src/http/__fixtures__/routers-middleware/store/products/[id]/sync/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE3C,eAAO,MAAM,IAAI,QAAS,OAAO,OAAO,QAAQ,SAE/C,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../src/http/__fixtures__/routers-middleware/webhooks/payment/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE3C,eAAO,MAAM,IAAI,QAAS,OAAO,OAAO,QAAQ,SAM/C,CAAA"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.POST = void 0;
|
4
|
+
const POST = (req, res) => {
|
5
|
+
if (!(req.body instanceof Buffer)) {
|
6
|
+
res.status(400).send("Invalid body");
|
7
|
+
}
|
8
|
+
res.send("OK");
|
9
|
+
};
|
10
|
+
exports.POST = POST;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* Sets up a test server that injects API Routes using the RoutesLoader
|
3
|
+
*
|
4
|
+
* @param {String} rootDir - The root directory of the project
|
5
|
+
*/
|
6
|
+
export declare const createServer: (rootDir: any) => Promise<{
|
7
|
+
request: (method: any, url: any, opts?: any) => Promise<any>;
|
8
|
+
}>;
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/http/__fixtures__/server/index.ts"],"names":[],"mappings":"AA2BA;;;;GAIG;AACH,eAAO,MAAM,YAAY;4CAwEc,GAAG;EA4EzC,CAAA"}
|