@medusajs/medusa 1.1.63-adminc.21 → 1.1.63-alpha.9

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.
Files changed (46) hide show
  1. package/dist/api/index.d.ts +1 -0
  2. package/dist/api/index.js +1 -0
  3. package/dist/api/index.js.map +1 -1
  4. package/dist/api/routes/admin/index.js +2 -0
  5. package/dist/api/routes/admin/index.js.map +1 -1
  6. package/dist/api/routes/admin/product-tags/create-collection.d.ts +41 -0
  7. package/dist/api/routes/admin/product-tags/create-collection.js +125 -0
  8. package/dist/api/routes/admin/product-tags/create-collection.js.map +1 -0
  9. package/dist/api/routes/admin/product-tags/delete-collection.d.ts +28 -0
  10. package/dist/api/routes/admin/product-tags/delete-collection.js +84 -0
  11. package/dist/api/routes/admin/product-tags/delete-collection.js.map +1 -0
  12. package/dist/api/routes/admin/product-tags/get-collection.d.ts +22 -0
  13. package/dist/api/routes/admin/product-tags/get-collection.js +74 -0
  14. package/dist/api/routes/admin/product-tags/get-collection.js.map +1 -0
  15. package/dist/api/routes/admin/product-tags/index.d.ts +15 -0
  16. package/dist/api/routes/admin/product-tags/index.js +40 -0
  17. package/dist/api/routes/admin/product-tags/index.js.map +1 -0
  18. package/dist/api/routes/admin/product-tags/list-collections.d.ts +40 -0
  19. package/dist/api/routes/admin/product-tags/list-collections.js +215 -0
  20. package/dist/api/routes/admin/product-tags/list-collections.js.map +1 -0
  21. package/dist/api/routes/admin/product-tags/list-product-tags.d.ts +39 -0
  22. package/dist/api/routes/admin/product-tags/list-product-tags.js +211 -0
  23. package/dist/api/routes/admin/product-tags/list-product-tags.js.map +1 -0
  24. package/dist/api/routes/admin/product-tags/update-collection.d.ts +41 -0
  25. package/dist/api/routes/admin/product-tags/update-collection.js +127 -0
  26. package/dist/api/routes/admin/product-tags/update-collection.js.map +1 -0
  27. package/dist/api/routes/admin/products/list-products.js +27 -28
  28. package/dist/api/routes/admin/products/list-products.js.map +1 -1
  29. package/dist/api/routes/admin/variants/list-variants.js +24 -8
  30. package/dist/api/routes/admin/variants/list-variants.js.map +1 -1
  31. package/dist/repositories/product-variant.d.ts +12 -1
  32. package/dist/repositories/product-variant.js +304 -0
  33. package/dist/repositories/product-variant.js.map +1 -1
  34. package/dist/services/product-tag.d.ts +48 -0
  35. package/dist/services/product-tag.js +180 -0
  36. package/dist/services/product-tag.js.map +1 -0
  37. package/dist/services/product-variant.d.ts +30 -1
  38. package/dist/services/product-variant.js +92 -0
  39. package/dist/services/product-variant.js.map +1 -1
  40. package/dist/services/store.js +28 -16
  41. package/dist/services/store.js.map +1 -1
  42. package/dist/types/common.d.ts +3 -1
  43. package/dist/types/product.d.ts +7 -0
  44. package/dist/types/product.js +37 -1
  45. package/dist/types/product.js.map +1 -1
  46. package/package.json +3 -3
@@ -21,6 +21,7 @@ export * from "./routes/admin/uploads";
21
21
  export * from "./routes/admin/returns";
22
22
  export * from "./routes/admin/shipping-options";
23
23
  export * from "./routes/admin/regions";
24
+ export * from "./routes/admin/product-tags";
24
25
  export * from "./routes/store/auth";
25
26
  export * from "./routes/store/carts";
26
27
  export * from "./routes/store/collections";
package/dist/api/index.js CHANGED
@@ -47,6 +47,7 @@ __exportStar(require("./routes/admin/uploads"), exports);
47
47
  __exportStar(require("./routes/admin/returns"), exports);
48
48
  __exportStar(require("./routes/admin/shipping-options"), exports);
49
49
  __exportStar(require("./routes/admin/regions"), exports);
50
+ __exportStar(require("./routes/admin/product-tags"), exports);
50
51
  // Store
51
52
  __exportStar(require("./routes/store/auth"), exports);
52
53
  __exportStar(require("./routes/store/carts"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mCAAgC;AAChC,8EAAsD;AACtD,yDAAkC;AAClC,yDAAkC;AAElC,iCAAiC;AACjC,mBAAe,UAAC,SAAS,EAAE,MAAM;IAC/B,IAAM,GAAG,GAAG,IAAA,gBAAM,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AAG,CAAA;AACZ,CAAC,EAAA;AAED,QAAQ;AACR,6DAA0C;AAC1C,sDAAmC;AACnC,2DAAwC;AACxC,2DAAwC;AACxC,8DAA2C;AAC3C,4DAAyC;AACzC,yDAAsC;AACtC,uDAAoC;AACpC,+DAA4C;AAC5C,mEAAgD;AAChD,uDAAoC;AACpC,0DAAuC;AACvC,uDAAoC;AACpC,wDAAqC;AACrC,0DAAuC;AACvC,gEAA6C;AAC7C,uDAAoC;AACpC,yDAAsC;AACtC,yDAAsC;AACtC,kEAA+C;AAC/C,yDAAsC;AACtC,8DAA2C;AAE3C,QAAQ;AACR,sDAAmC;AACnC,uDAAoC;AACpC,6DAA0C;AAC1C,2DAAwC;AACxC,4DAAyC;AACzC,wDAAqC;AACrC,0DAAuC;AACvC,yDAAsC;AACtC,gEAA6C;AAC7C,yDAAsC;AACtC,kEAA+C;AAC/C,uDAAoC;AACpC,0DAAuC"}
@@ -45,6 +45,7 @@ var returns_1 = __importDefault(require("./returns"));
45
45
  var variants_1 = __importDefault(require("./variants"));
46
46
  var draft_orders_1 = __importDefault(require("./draft-orders"));
47
47
  var collections_1 = __importDefault(require("./collections"));
48
+ var product_tags_1 = __importDefault(require("./product-tags"));
48
49
  var notifications_1 = __importDefault(require("./notifications"));
49
50
  var notes_1 = __importDefault(require("./notes"));
50
51
  var route = (0, express_1.Router)();
@@ -87,6 +88,7 @@ exports.default = (function (app, container, config) {
87
88
  (0, collections_1.default)(route);
88
89
  (0, notifications_1.default)(route);
89
90
  (0, return_reasons_1.default)(route);
91
+ (0, product_tags_1.default)(route);
90
92
  (0, notes_1.default)(route);
91
93
  (0, invites_1.default)(route);
92
94
  return app;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/routes/admin/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAgC;AAChC,8CAAuB;AAEvB,kEAA2C;AAC3C,gDAA+B;AAC/B,wDAAsC;AACtC,+CA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AK,CAAC,CAAA;IACrB,IAAA,oBAAc,EAAC,KAAK,CAAC,CAAA;IACrB,IAAA,gBAAW,EAAC,KAAK,CAAC,CAAA;IAClB,IAAA,eAAW,EAAC,KAAK,CAAC,CAAA;IAClB,IAAA,iBAAY,EAAC,KAAK,CAAC,CAAA;IACnB,IAAA,mBAAc,EAAC,KAAK,CAAC,CAAA;IACrB,IAAA,eAAU,EAAC,KAAK,CAAC,CAAA;IACjB,IAAA,iBAAY,EAAC,KAAK,CAAC,CAAA;IACnB,IAAA,kBAAa,EAAC,KAAK,CAAC,CAAA;IACpB,IAAA,sBAAgB,EAAC,KAAK,CAAC,CAAA;IACvB,IAAA,qBAAgB,EAAC,KAAK,CAAC,CAAA;IACvB,IAAA,uBAAkB,EAAC,KAAK,CAAC,CAAA;IACzB,IAAA,wBAAkB,EAAC,KAAK,CAAC,CAAA;IACzB,IAAA,sBAAgB,EAAC,KAAK,CAAC,CAAA;IACvB,IAAA,eAAU,EAAC,KAAK,CAAC,CAAA;IACjB,IAAA,iBAAY,EAAC,KAAK,CAAC,CAAA;IAEnB,OAAO,GAAG,CAAA;AACZ,CAAC,EAAA"}
@@ -0,0 +1,41 @@
1
+ declare const _default: (req: any, res: any) => Promise<void>;
2
+ /**
3
+ * @oas [post] /collections
4
+ * operationId: "PostCollections"
5
+ * summary: "Create a Product Collection"
6
+ * description: "Creates a Product Collection."
7
+ * x-authenticated: true
8
+ * requestBody:
9
+ * content:
10
+ * application/json:
11
+ * schema:
12
+ * required:
13
+ * - title
14
+ * properties:
15
+ * title:
16
+ * type: string
17
+ * description: The title to identify the Collection by.
18
+ * handle:
19
+ * type: string
20
+ * description: An optional handle to be used in slugs, if none is provided we will kebab-case the title.
21
+ * metadata:
22
+ * description: An optional set of key-value pairs to hold additional information.
23
+ * type: object
24
+ * tags:
25
+ * - Collection
26
+ * responses:
27
+ * "200":
28
+ * description: OK
29
+ * content:
30
+ * application/json:
31
+ * schema:
32
+ * properties:
33
+ * collection:
34
+ * $ref: "#/components/schemas/product_collection"
35
+ */
36
+ export default _default;
37
+ export declare class AdminPostCollectionsReq {
38
+ title: string;
39
+ handle?: string;
40
+ metadata?: object;
41
+ }
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
+ return new (P || (P = Promise))(function (resolve, reject) {
14
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ var __generator = (this && this.__generator) || function (thisArg, body) {
21
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
22
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ function verb(n) { return function (v) { return step([n, v]); }; }
24
+ function step(op) {
25
+ if (f) throw new TypeError("Generator is already executing.");
26
+ while (_) try {
27
+ 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;
28
+ if (y = 0, t) op = [op[0] & 2, t.value];
29
+ switch (op[0]) {
30
+ case 0: case 1: t = op; break;
31
+ case 4: _.label++; return { value: op[1], done: false };
32
+ case 5: _.label++; y = op[1]; op = [0]; continue;
33
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
34
+ default:
35
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
36
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
37
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
38
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
39
+ if (t[2]) _.ops.pop();
40
+ _.trys.pop(); continue;
41
+ }
42
+ op = body.call(thisArg, _);
43
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
44
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
45
+ }
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.AdminPostCollectionsReq = void 0;
49
+ var class_validator_1 = require("class-validator");
50
+ var validator_1 = require("../../../../utils/validator");
51
+ /**
52
+ * @oas [post] /collections
53
+ * operationId: "PostCollections"
54
+ * summary: "Create a Product Collection"
55
+ * description: "Creates a Product Collection."
56
+ * x-authenticated: true
57
+ * requestBody:
58
+ * content:
59
+ * application/json:
60
+ * schema:
61
+ * required:
62
+ * - title
63
+ * properties:
64
+ * title:
65
+ * type: string
66
+ * description: The title to identify the Collection by.
67
+ * handle:
68
+ * type: string
69
+ * description: An optional handle to be used in slugs, if none is provided we will kebab-case the title.
70
+ * metadata:
71
+ * description: An optional set of key-value pairs to hold additional information.
72
+ * type: object
73
+ * tags:
74
+ * - Collection
75
+ * responses:
76
+ * "200":
77
+ * description: OK
78
+ * content:
79
+ * application/json:
80
+ * schema:
81
+ * properties:
82
+ * collection:
83
+ * $ref: "#/components/schemas/product_collection"
84
+ */
85
+ exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
86
+ var validated, productCollectionService, created, collection;
87
+ return __generator(this, function (_a) {
88
+ switch (_a.label) {
89
+ case 0: return [4 /*yield*/, (0, validator_1.validator)(AdminPostCollectionsReq, req.body)];
90
+ case 1:
91
+ validated = _a.sent();
92
+ productCollectionService = req.scope.resolve("productCollectionService");
93
+ return [4 /*yield*/, productCollectionService.create(validated)];
94
+ case 2:
95
+ created = _a.sent();
96
+ return [4 /*yield*/, productCollectionService.retrieve(created.id)];
97
+ case 3:
98
+ collection = _a.sent();
99
+ res.status(200).json({ collection: collection });
100
+ return [2 /*return*/];
101
+ }
102
+ });
103
+ }); });
104
+ var AdminPostCollectionsReq = /** @class */ (function () {
105
+ function AdminPostCollectionsReq() {
106
+ }
107
+ __decorate([
108
+ (0, class_validator_1.IsString)(),
109
+ (0, class_validator_1.IsNotEmpty)(),
110
+ __metadata("design:type", String)
111
+ ], AdminPostCollectionsReq.prototype, "title", void 0);
112
+ __decorate([
113
+ (0, class_validator_1.IsString)(),
114
+ (0, class_validator_1.IsOptional)(),
115
+ __metadata("design:type", String)
116
+ ], AdminPostCollectionsReq.prototype, "handle", void 0);
117
+ __decorate([
118
+ (0, class_validator_1.IsObject)(),
119
+ (0, class_validator_1.IsOptional)(),
120
+ __metadata("design:type", Object)
121
+ ], AdminPostCollectionsReq.prototype, "metadata", void 0);
122
+ return AdminPostCollectionsReq;
123
+ }());
124
+ exports.AdminPostCollectionsReq = AdminPostCollectionsReq;
125
+ //# sourceMappingURL=create-collection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-collection.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/product-tags/create-collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAA4E;AAE5E,yDAAuD;AACvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;oBACV,qBAAM,IAAA,qBAAS,EAAC,uBAAuB,EAAE,GAAG,CAAC,IAAI,CAAC,EAAA;;gBAA9D,SAAS,GAAG,SAAkD;gBAE9D,wBAAwB,GAA6B,GAAG,CAAC,KAAK,CAAC,OAAO,CAC1E,0BAA0B,CAC3B,CAAA;gBAEe,qBAAM,wBAAwB,CAAC,MAAM,CAAC,SAAS,CAAC,EAAA;;gBAA1D,OAAO,GAAG,SAAgD;gBAC7C,qBAAM,wBAAwB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,EAAA;;gBAAhE,UAAU,GAAG,SAAmD;gBAEtE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,UAAU,YAAA,EAAE,CAAC,CAAA;;;;KACrC,EAAA;AAED;IAAA;IAYA,CAAC;IATC;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;0DACA;IAIb;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;2DACE;IAIf;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;6DACI;IACnB,8BAAC;CAAA,AAZD,IAYC;AAZY,0DAAuB"}
@@ -0,0 +1,28 @@
1
+ declare const _default: (req: any, res: any) => Promise<void>;
2
+ /**
3
+ * @oas [delete] /collections/{id}
4
+ * operationId: "DeleteCollectionsCollection"
5
+ * summary: "Delete a Product Collection"
6
+ * description: "Deletes a Product Collection."
7
+ * x-authenticated: true
8
+ * parameters:
9
+ * - (path) id=* {string} The id of the Collection.
10
+ * tags:
11
+ * - Collection
12
+ * responses:
13
+ * "200":
14
+ * description: OK
15
+ * content:
16
+ * application/json:
17
+ * schema:
18
+ * properties:
19
+ * id:
20
+ * type: string
21
+ * description: The id of the deleted Collection
22
+ * object:
23
+ * type: string
24
+ * description: The type of the object that was deleted.
25
+ * deleted:
26
+ * type: boolean
27
+ */
28
+ export default _default;
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) 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 };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ /**
40
+ * @oas [delete] /collections/{id}
41
+ * operationId: "DeleteCollectionsCollection"
42
+ * summary: "Delete a Product Collection"
43
+ * description: "Deletes a Product Collection."
44
+ * x-authenticated: true
45
+ * parameters:
46
+ * - (path) id=* {string} The id of the Collection.
47
+ * tags:
48
+ * - Collection
49
+ * responses:
50
+ * "200":
51
+ * description: OK
52
+ * content:
53
+ * application/json:
54
+ * schema:
55
+ * properties:
56
+ * id:
57
+ * type: string
58
+ * description: The id of the deleted Collection
59
+ * object:
60
+ * type: string
61
+ * description: The type of the object that was deleted.
62
+ * deleted:
63
+ * type: boolean
64
+ */
65
+ exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
66
+ var id, productCollectionService;
67
+ return __generator(this, function (_a) {
68
+ switch (_a.label) {
69
+ case 0:
70
+ id = req.params.id;
71
+ productCollectionService = req.scope.resolve("productCollectionService");
72
+ return [4 /*yield*/, productCollectionService.delete(id)];
73
+ case 1:
74
+ _a.sent();
75
+ res.json({
76
+ id: id,
77
+ object: "product-collection",
78
+ deleted: true,
79
+ });
80
+ return [2 /*return*/];
81
+ }
82
+ });
83
+ }); });
84
+ //# sourceMappingURL=delete-collection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-collection.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/product-tags/delete-collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEnB,wBAAwB,GAA6B,GAAG,CAAC,KAAK,CAAC,OAAO,CAC1E,0BAA0B,CAC3B,CAAA;gBACD,qBAAM,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC,EAAA;;gBAAzC,SAAyC,CAAA;gBAEzC,GAAG,CAAC,IAAI,CAAC;oBACP,EAAE,IAAA;oBACF,MAAM,EAAE,oBAAoB;oBAC5B,OAAO,EAAE,IAAI;iBACd,CAAC,CAAA;;;;KACH,EAAA"}
@@ -0,0 +1,22 @@
1
+ declare const _default: (req: any, res: any) => Promise<void>;
2
+ /**
3
+ * @oas [get] /collections/{id}
4
+ * operationId: "GetCollectionsCollection"
5
+ * summary: "Retrieve a Product Collection"
6
+ * description: "Retrieves a Product Collection."
7
+ * x-authenticated: true
8
+ * parameters:
9
+ * - (path) id=* {string} The id of the Product Collection
10
+ * tags:
11
+ * - Collection
12
+ * responses:
13
+ * "200":
14
+ * description: OK
15
+ * content:
16
+ * application/json:
17
+ * schema:
18
+ * properties:
19
+ * collection:
20
+ * $ref: "#/components/schemas/product_collection"
21
+ */
22
+ export default _default;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) 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 };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ /**
40
+ * @oas [get] /collections/{id}
41
+ * operationId: "GetCollectionsCollection"
42
+ * summary: "Retrieve a Product Collection"
43
+ * description: "Retrieves a Product Collection."
44
+ * x-authenticated: true
45
+ * parameters:
46
+ * - (path) id=* {string} The id of the Product Collection
47
+ * tags:
48
+ * - Collection
49
+ * responses:
50
+ * "200":
51
+ * description: OK
52
+ * content:
53
+ * application/json:
54
+ * schema:
55
+ * properties:
56
+ * collection:
57
+ * $ref: "#/components/schemas/product_collection"
58
+ */
59
+ exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
60
+ var id, productCollectionService, collection;
61
+ return __generator(this, function (_a) {
62
+ switch (_a.label) {
63
+ case 0:
64
+ id = req.params.id;
65
+ productCollectionService = req.scope.resolve("productCollectionService");
66
+ return [4 /*yield*/, productCollectionService.retrieve(id)];
67
+ case 1:
68
+ collection = _a.sent();
69
+ res.status(200).json({ collection: collection });
70
+ return [2 /*return*/];
71
+ }
72
+ });
73
+ }); });
74
+ //# sourceMappingURL=get-collection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-collection.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/product-tags/get-collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEnB,wBAAwB,GAA6B,GAAG,CAAC,KAAK,CAAC,OAAO,CAC1E,0BAA0B,CAC3B,CAAA;gBAEkB,qBAAM,wBAAwB,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAA;;gBAAxD,UAAU,GAAG,SAA2C;gBAC9D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,UAAU,YAAA,EAAE,CAAC,CAAA;;;;KACrC,EAAA"}
@@ -0,0 +1,15 @@
1
+ import { ProductTag } from "../../../..";
2
+ import { PaginatedResponse } from "../../../../types/common";
3
+ import "reflect-metadata";
4
+ declare const _default: (app: any) => any;
5
+ export default _default;
6
+ export declare const allowedAdminProductTagsFields: string[];
7
+ export declare const defaultAdminProductTagsFields: string[];
8
+ export declare const defaultAdminProductTagsRelations: never[];
9
+ export declare type AdminProductTagsListRes = PaginatedResponse & {
10
+ product_tags: ProductTag[];
11
+ };
12
+ export declare type AdminProductTagsRes = {
13
+ product_tag: ProductTag;
14
+ };
15
+ export * from "./list-product-tags";
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ var __importDefault = (this && this.__importDefault) || function (mod) {
13
+ return (mod && mod.__esModule) ? mod : { "default": mod };
14
+ };
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.defaultAdminProductTagsRelations = exports.defaultAdminProductTagsFields = exports.allowedAdminProductTagsFields = void 0;
17
+ var express_1 = require("express");
18
+ var middlewares_1 = __importDefault(require("../../../middlewares"));
19
+ require("reflect-metadata");
20
+ var route = (0, express_1.Router)();
21
+ exports.default = (function (app) {
22
+ app.use("/product-tags", route);
23
+ route.get("/", middlewares_1.default.wrap(require("./list-product-tags").default));
24
+ return app;
25
+ });
26
+ exports.allowedAdminProductTagsFields = [
27
+ "id",
28
+ "value",
29
+ "created_at",
30
+ "updated_at",
31
+ ];
32
+ exports.defaultAdminProductTagsFields = [
33
+ "id",
34
+ "value",
35
+ "created_at",
36
+ "updated_at",
37
+ ];
38
+ exports.defaultAdminProductTagsRelations = [];
39
+ __exportStar(require("./list-product-tags"), exports);
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/product-tags/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mCAAgC;AAGhC,qEAA8C;AAC9C,4BAAyB;AAEzB,IAAM,KAAK,GAAG,IAAA,gBAAM,GAAE,CAAA;AAEtB,mBAAe,UAAC,GAAG;IACjB,GAAG,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,CAAC,CAAA;IAE/B,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,qBAAW,CAAC,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;IAExE,OAAO,GAAG,CAAA;AACZ,CAAC,EAAA;AAEY,QAAA,6BAA6B,GAAG;IAC3C,IAAI;IACJ,OAAO;IACP,YAAY;IACZ,YAAY;CACb,CAAA;AAEY,QAAA,6BAA6B,GAAG;IAC3C,IAAI;IACJ,OAAO;IACP,YAAY;IACZ,YAAY;CACb,CAAA;AACY,QAAA,gCAAgC,GAAG,EAAE,CAAA;AAUlD,sDAAmC"}
@@ -0,0 +1,40 @@
1
+ import { DateComparisonOperator } from "../../../../types/common";
2
+ declare const _default: (req: any, res: any) => Promise<void>;
3
+ /**
4
+ * @oas [get] /collections
5
+ * operationId: "GetCollections"
6
+ * summary: "List Product Collections"
7
+ * description: "Retrieve a list of Product Collection."
8
+ * x-authenticated: true
9
+ * parameters:
10
+ * - (query) limit {string} The number of collections to return.
11
+ * - (query) offset {string} The offset of collections to return.
12
+ * - (query) title {string} The title of collections to return.
13
+ * - (query) handle {string} The handle of collections to return.
14
+ * - (query) deleted_at {DateComparisonOperator} Date comparison for when resulting collections was deleted, i.e. less than, greater than etc.
15
+ * - (query) created_at {DateComparisonOperator} Date comparison for when resulting collections was created, i.e. less than, greater than etc.
16
+ * - (query) updated_at {DateComparisonOperator} Date comparison for when resulting collections was updated, i.e. less than, greater than etc.
17
+ * tags:
18
+ * - Collection
19
+ * responses:
20
+ * "200":
21
+ * description: OK
22
+ * content:
23
+ * application/json:
24
+ * schema:
25
+ * properties:
26
+ * collection:
27
+ * $ref: "#/components/schemas/product_collection"
28
+ */
29
+ export default _default;
30
+ export declare class AdminGetCollectionsPaginationParams {
31
+ limit: number;
32
+ offset: number;
33
+ }
34
+ export declare class AdminGetCollectionsParams extends AdminGetCollectionsPaginationParams {
35
+ title?: string;
36
+ handle?: string;
37
+ created_at?: DateComparisonOperator;
38
+ updated_at?: DateComparisonOperator;
39
+ deleted_at?: DateComparisonOperator;
40
+ }