@medusajs/medusa 1.7.14 → 1.7.15
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/dist/services/event-bus.js +27 -21
- package/dist/services/event-bus.js.map +1 -1
- package/dist/services/product-variant.js +1 -1
- package/dist/services/product-variant.js.map +1 -1
- package/package.json +1 -1
- package/dist/api/routes/admin/inventory-items/create-inventory-item.d.ts +0 -136
- package/dist/api/routes/admin/inventory-items/create-inventory-item.js +0 -315
- package/dist/api/routes/admin/inventory-items/create-inventory-item.js.map +0 -1
- package/dist/api/routes/admin/inventory-items/transaction/create-inventory-item.d.ts +0 -25
- package/dist/api/routes/admin/inventory-items/transaction/create-inventory-item.js +0 -200
- package/dist/api/routes/admin/inventory-items/transaction/create-inventory-item.js.map +0 -1
- package/dist/api/routes/admin/stock-locations/utils/join-sales-channels.d.ts +0 -4
- package/dist/api/routes/admin/stock-locations/utils/join-sales-channels.js +0 -81
- package/dist/api/routes/admin/stock-locations/utils/join-sales-channels.js.map +0 -1
- package/dist/api/routes/admin/variants/get-variant.d.ts +0 -59
- package/dist/api/routes/admin/variants/get-variant.js +0 -153
- package/dist/api/routes/admin/variants/get-variant.js.map +0 -1
- package/dist/loaders/helpers/plugins.d.ts +0 -15
- package/dist/loaders/helpers/plugins.js +0 -40
- package/dist/loaders/helpers/plugins.js.map +0 -1
- package/dist/migrations/1677234878504-product_category_rank.d.ts +0 -6
- package/dist/migrations/1677234878504-product_category_rank.js +0 -77
- package/dist/migrations/1677234878504-product_category_rank.js.map +0 -1
- package/dist/services/staged-job.d.ts +0 -22
- package/dist/services/staged-job.js +0 -189
- package/dist/services/staged-job.js.map +0 -1
- package/dist/utils/is-date.d.ts +0 -1
- package/dist/utils/is-date.js +0 -9
- package/dist/utils/is-date.js.map +0 -1
- package/dist/utils/product-category/index.d.ts +0 -4
- package/dist/utils/product-category/index.js +0 -18
- package/dist/utils/product-category/index.js.map +0 -1
- package/dist/utils/row-sql-results-to-entity-transformer.d.ts +0 -2
- package/dist/utils/row-sql-results-to-entity-transformer.js +0 -53
- package/dist/utils/row-sql-results-to-entity-transformer.js.map +0 -1
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { FindParams } from "../../../../types/common";
|
|
2
|
-
/**
|
|
3
|
-
* @oas [get] /admin/variants/{id}
|
|
4
|
-
* operationId: "GetVariantsVariant"
|
|
5
|
-
* summary: "Get a Product variant"
|
|
6
|
-
* description: "Retrieves a Product variant."
|
|
7
|
-
* x-authenticated: true
|
|
8
|
-
* parameters:
|
|
9
|
-
* - (path) id=* {string} The ID of the variant.
|
|
10
|
-
* - (query) expand {string} (Comma separated) Which fields should be expanded the order of the result.
|
|
11
|
-
* - (query) fields {string} (Comma separated) Which fields should be included the order of the result.
|
|
12
|
-
* x-codegen:
|
|
13
|
-
* method: retrieve
|
|
14
|
-
* queryParams: AdminGetVariantParams
|
|
15
|
-
* x-codeSamples:
|
|
16
|
-
* - lang: JavaScript
|
|
17
|
-
* label: JS Client
|
|
18
|
-
* source: |
|
|
19
|
-
* import Medusa from "@medusajs/medusa-js"
|
|
20
|
-
* const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
21
|
-
* // must be previously logged in or use api token
|
|
22
|
-
* medusa.admin.variants.retrieve(product_id)
|
|
23
|
-
* .then(({ product }) => {
|
|
24
|
-
* console.log(product.id);
|
|
25
|
-
* });
|
|
26
|
-
* - lang: Shell
|
|
27
|
-
* label: cURL
|
|
28
|
-
* source: |
|
|
29
|
-
* curl --location --request GET 'https://medusa-url.com/admin/variants/{id}' \
|
|
30
|
-
* --header 'Authorization: Bearer {api_token}'
|
|
31
|
-
* security:
|
|
32
|
-
* - api_token: []
|
|
33
|
-
* - cookie_auth: []
|
|
34
|
-
* tags:
|
|
35
|
-
* - Products
|
|
36
|
-
* responses:
|
|
37
|
-
* 200:
|
|
38
|
-
* description: OK
|
|
39
|
-
* content:
|
|
40
|
-
* application/json:
|
|
41
|
-
* schema:
|
|
42
|
-
* $ref: "#/components/schemas/AdminVariantsRes"
|
|
43
|
-
* "400":
|
|
44
|
-
* $ref: "#/components/responses/400_error"
|
|
45
|
-
* "401":
|
|
46
|
-
* $ref: "#/components/responses/unauthorized"
|
|
47
|
-
* "404":
|
|
48
|
-
* $ref: "#/components/responses/not_found_error"
|
|
49
|
-
* "409":
|
|
50
|
-
* $ref: "#/components/responses/invalid_state_error"
|
|
51
|
-
* "422":
|
|
52
|
-
* $ref: "#/components/responses/invalid_request_error"
|
|
53
|
-
* "500":
|
|
54
|
-
* $ref: "#/components/responses/500_error"
|
|
55
|
-
*/
|
|
56
|
-
declare const _default: (req: any, res: any) => Promise<void>;
|
|
57
|
-
export default _default;
|
|
58
|
-
export declare class AdminGetVariantParams extends FindParams {
|
|
59
|
-
}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
33
|
-
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;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
54
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
55
|
-
if (!m) return o;
|
|
56
|
-
var i = m.call(o), r, ar = [], e;
|
|
57
|
-
try {
|
|
58
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
59
|
-
}
|
|
60
|
-
catch (error) { e = { error: error }; }
|
|
61
|
-
finally {
|
|
62
|
-
try {
|
|
63
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
64
|
-
}
|
|
65
|
-
finally { if (e) throw e.error; }
|
|
66
|
-
}
|
|
67
|
-
return ar;
|
|
68
|
-
};
|
|
69
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
70
|
-
exports.AdminGetVariantParams = void 0;
|
|
71
|
-
var common_1 = require("../../../../types/common");
|
|
72
|
-
/**
|
|
73
|
-
* @oas [get] /admin/variants/{id}
|
|
74
|
-
* operationId: "GetVariantsVariant"
|
|
75
|
-
* summary: "Get a Product variant"
|
|
76
|
-
* description: "Retrieves a Product variant."
|
|
77
|
-
* x-authenticated: true
|
|
78
|
-
* parameters:
|
|
79
|
-
* - (path) id=* {string} The ID of the variant.
|
|
80
|
-
* - (query) expand {string} (Comma separated) Which fields should be expanded the order of the result.
|
|
81
|
-
* - (query) fields {string} (Comma separated) Which fields should be included the order of the result.
|
|
82
|
-
* x-codegen:
|
|
83
|
-
* method: retrieve
|
|
84
|
-
* queryParams: AdminGetVariantParams
|
|
85
|
-
* x-codeSamples:
|
|
86
|
-
* - lang: JavaScript
|
|
87
|
-
* label: JS Client
|
|
88
|
-
* source: |
|
|
89
|
-
* import Medusa from "@medusajs/medusa-js"
|
|
90
|
-
* const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
91
|
-
* // must be previously logged in or use api token
|
|
92
|
-
* medusa.admin.variants.retrieve(product_id)
|
|
93
|
-
* .then(({ product }) => {
|
|
94
|
-
* console.log(product.id);
|
|
95
|
-
* });
|
|
96
|
-
* - lang: Shell
|
|
97
|
-
* label: cURL
|
|
98
|
-
* source: |
|
|
99
|
-
* curl --location --request GET 'https://medusa-url.com/admin/variants/{id}' \
|
|
100
|
-
* --header 'Authorization: Bearer {api_token}'
|
|
101
|
-
* security:
|
|
102
|
-
* - api_token: []
|
|
103
|
-
* - cookie_auth: []
|
|
104
|
-
* tags:
|
|
105
|
-
* - Products
|
|
106
|
-
* responses:
|
|
107
|
-
* 200:
|
|
108
|
-
* description: OK
|
|
109
|
-
* content:
|
|
110
|
-
* application/json:
|
|
111
|
-
* schema:
|
|
112
|
-
* $ref: "#/components/schemas/AdminVariantsRes"
|
|
113
|
-
* "400":
|
|
114
|
-
* $ref: "#/components/responses/400_error"
|
|
115
|
-
* "401":
|
|
116
|
-
* $ref: "#/components/responses/unauthorized"
|
|
117
|
-
* "404":
|
|
118
|
-
* $ref: "#/components/responses/not_found_error"
|
|
119
|
-
* "409":
|
|
120
|
-
* $ref: "#/components/responses/invalid_state_error"
|
|
121
|
-
* "422":
|
|
122
|
-
* $ref: "#/components/responses/invalid_request_error"
|
|
123
|
-
* "500":
|
|
124
|
-
* $ref: "#/components/responses/500_error"
|
|
125
|
-
*/
|
|
126
|
-
exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
|
|
127
|
-
var id, productVariantService, pricingService, rawVariant, _a, variant;
|
|
128
|
-
return __generator(this, function (_b) {
|
|
129
|
-
switch (_b.label) {
|
|
130
|
-
case 0:
|
|
131
|
-
id = req.params.id;
|
|
132
|
-
productVariantService = req.scope.resolve("productVariantService");
|
|
133
|
-
pricingService = req.scope.resolve("pricingService");
|
|
134
|
-
return [4 /*yield*/, productVariantService.retrieve(id, req.retrieveConfig)];
|
|
135
|
-
case 1:
|
|
136
|
-
rawVariant = _b.sent();
|
|
137
|
-
return [4 /*yield*/, pricingService.setVariantPrices([rawVariant])];
|
|
138
|
-
case 2:
|
|
139
|
-
_a = __read.apply(void 0, [_b.sent(), 1]), variant = _a[0];
|
|
140
|
-
res.status(200).json({ variant: variant });
|
|
141
|
-
return [2 /*return*/];
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
}); });
|
|
145
|
-
var AdminGetVariantParams = /** @class */ (function (_super) {
|
|
146
|
-
__extends(AdminGetVariantParams, _super);
|
|
147
|
-
function AdminGetVariantParams() {
|
|
148
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
149
|
-
}
|
|
150
|
-
return AdminGetVariantParams;
|
|
151
|
-
}(common_1.FindParams));
|
|
152
|
-
exports.AdminGetVariantParams = AdminGetVariantParams;
|
|
153
|
-
//# sourceMappingURL=get-variant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-variant.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/variants/get-variant.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,mDAAqD;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEnB,qBAAqB,GAA0B,GAAG,CAAC,KAAK,CAAC,OAAO,CACpE,uBAAuB,CACxB,CAAA;gBACK,cAAc,GAAmB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;gBAEvD,qBAAM,qBAAqB,CAAC,QAAQ,CACrD,EAAE,EACF,GAAG,CAAC,cAAc,CACnB,EAAA;;gBAHK,UAAU,GAAG,SAGlB;gBAEiB,qBAAM,cAAc,CAAC,gBAAgB,CAAC,CAAC,UAAU,CAAC,CAAC,EAAA;;gBAA/D,KAAA,sBAAY,SAAmD,KAAA,EAA9D,OAAO,QAAA;gBAEd,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,SAAA,EAAE,CAAC,CAAA;;;;KAClC,EAAA;AAED;IAA2C,yCAAU;IAArD;;IAAuD,CAAC;IAAD,4BAAC;AAAD,CAAC,AAAxD,CAA2C,mBAAU,GAAG;AAA3C,sDAAqB"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ClassConstructor, MedusaContainer } from "../../types/global";
|
|
2
|
-
import { AbstractPaymentProcessor, AbstractPaymentService } from "../../interfaces";
|
|
3
|
-
import { LifetimeType } from "awilix";
|
|
4
|
-
declare type Context = {
|
|
5
|
-
container: MedusaContainer;
|
|
6
|
-
pluginDetails: Record<string, unknown>;
|
|
7
|
-
registrationName: string;
|
|
8
|
-
};
|
|
9
|
-
export declare function registerPaymentServiceFromClass(klass: ClassConstructor<AbstractPaymentService> & {
|
|
10
|
-
LIFE_TIME?: LifetimeType;
|
|
11
|
-
}, context: Context): void;
|
|
12
|
-
export declare function registerPaymentProcessorFromClass(klass: ClassConstructor<AbstractPaymentProcessor> & {
|
|
13
|
-
LIFE_TIME?: LifetimeType;
|
|
14
|
-
}, context: Context): void;
|
|
15
|
-
export {};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerPaymentProcessorFromClass = exports.registerPaymentServiceFromClass = void 0;
|
|
4
|
-
var interfaces_1 = require("../../interfaces");
|
|
5
|
-
var awilix_1 = require("awilix");
|
|
6
|
-
function registerPaymentServiceFromClass(klass, context) {
|
|
7
|
-
var _a;
|
|
8
|
-
if (!(0, interfaces_1.isPaymentService)(klass.prototype)) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
var container = context.container, pluginDetails = context.pluginDetails, registrationName = context.registrationName;
|
|
12
|
-
container.registerAdd("paymentProviders", (0, awilix_1.asFunction)(function (cradle) { return new klass(cradle, pluginDetails.options); }, {
|
|
13
|
-
lifetime: klass.LIFE_TIME || awilix_1.Lifetime.TRANSIENT,
|
|
14
|
-
}));
|
|
15
|
-
container.register((_a = {},
|
|
16
|
-
_a[registrationName] = (0, awilix_1.asFunction)(function (cradle) { return new klass(cradle, pluginDetails.options); }, {
|
|
17
|
-
lifetime: klass.LIFE_TIME || awilix_1.Lifetime.TRANSIENT,
|
|
18
|
-
}),
|
|
19
|
-
_a["pp_".concat(klass.identifier)] = (0, awilix_1.aliasTo)(registrationName),
|
|
20
|
-
_a));
|
|
21
|
-
}
|
|
22
|
-
exports.registerPaymentServiceFromClass = registerPaymentServiceFromClass;
|
|
23
|
-
function registerPaymentProcessorFromClass(klass, context) {
|
|
24
|
-
var _a;
|
|
25
|
-
if (!(0, interfaces_1.isPaymentProcessor)(klass.prototype)) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
var container = context.container, pluginDetails = context.pluginDetails, registrationName = context.registrationName;
|
|
29
|
-
container.registerAdd("paymentProviders", (0, awilix_1.asFunction)(function (cradle) { return new klass(cradle, pluginDetails.options); }, {
|
|
30
|
-
lifetime: klass.LIFE_TIME || awilix_1.Lifetime.TRANSIENT,
|
|
31
|
-
}));
|
|
32
|
-
container.register((_a = {},
|
|
33
|
-
_a[registrationName] = (0, awilix_1.asFunction)(function (cradle) { return new klass(cradle, pluginDetails.options); }, {
|
|
34
|
-
lifetime: klass.LIFE_TIME || awilix_1.Lifetime.TRANSIENT,
|
|
35
|
-
}),
|
|
36
|
-
_a["pp_".concat(klass.identifier)] = (0, awilix_1.aliasTo)(registrationName),
|
|
37
|
-
_a));
|
|
38
|
-
}
|
|
39
|
-
exports.registerPaymentProcessorFromClass = registerPaymentProcessorFromClass;
|
|
40
|
-
//# sourceMappingURL=plugins.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../src/loaders/helpers/plugins.ts"],"names":[],"mappings":";;;AACA,+CAKyB;AACzB,iCAAoE;AAQpE,SAAgB,+BAA+B,CAC7C,KAEC,EACD,OAAgB;;IAEhB,IAAI,CAAC,IAAA,6BAAgB,EAAC,KAAK,CAAC,SAAS,CAAC,EAAE;QACtC,OAAM;KACP;IAEO,IAAA,SAAS,GAAsC,OAAO,UAA7C,EAAE,aAAa,GAAuB,OAAO,cAA9B,EAAE,gBAAgB,GAAK,OAAO,iBAAZ,CAAY;IAE9D,SAAS,CAAC,WAAW,CACnB,kBAAkB,EAClB,IAAA,mBAAU,EAAC,UAAC,MAAM,IAAK,OAAA,IAAI,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,EAAxC,CAAwC,EAAE;QAC/D,QAAQ,EAAE,KAAK,CAAC,SAAS,IAAI,iBAAQ,CAAC,SAAS;KAChD,CAAC,CACH,CAAA;IAED,SAAS,CAAC,QAAQ;QAChB,GAAC,gBAAgB,IAAG,IAAA,mBAAU,EAC5B,UAAC,MAAM,IAAK,OAAA,IAAI,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,EAAxC,CAAwC,EACpD;YACE,QAAQ,EAAE,KAAK,CAAC,SAAS,IAAI,iBAAQ,CAAC,SAAS;SAChD,CACF;QACD,GAAC,aAAO,KAAkD,CAAC,UAAU,CAAE,IACrE,IAAA,gBAAO,EAAC,gBAAgB,CAAC;YAC3B,CAAA;AACJ,CAAC;AA7BD,0EA6BC;AAED,SAAgB,iCAAiC,CAC/C,KAEC,EACD,OAAgB;;IAEhB,IAAI,CAAC,IAAA,+BAAkB,EAAC,KAAK,CAAC,SAAS,CAAC,EAAE;QACxC,OAAM;KACP;IAEO,IAAA,SAAS,GAAsC,OAAO,UAA7C,EAAE,aAAa,GAAuB,OAAO,cAA9B,EAAE,gBAAgB,GAAK,OAAO,iBAAZ,CAAY;IAE9D,SAAS,CAAC,WAAW,CACnB,kBAAkB,EAClB,IAAA,mBAAU,EAAC,UAAC,MAAM,IAAK,OAAA,IAAI,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,EAAxC,CAAwC,EAAE;QAC/D,QAAQ,EAAE,KAAK,CAAC,SAAS,IAAI,iBAAQ,CAAC,SAAS;KAChD,CAAC,CACH,CAAA;IAED,SAAS,CAAC,QAAQ;QAChB,GAAC,gBAAgB,IAAG,IAAA,mBAAU,EAC5B,UAAC,MAAM,IAAK,OAAA,IAAI,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,EAAxC,CAAwC,EACpD;YACE,QAAQ,EAAE,KAAK,CAAC,SAAS,IAAI,iBAAQ,CAAC,SAAS;SAChD,CACF;QACD,GAAC,aAAO,KAAoD,CAAC,UAAU,CAAE,IACvE,IAAA,gBAAO,EAAC,gBAAgB,CAAC;YAC3B,CAAA;AACJ,CAAC;AA7BD,8EA6BC"}
|
|
@@ -1,77 +0,0 @@
|
|
|
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
|
-
exports.productCategoryRank1677234878504 = void 0;
|
|
40
|
-
var productCategoryRank1677234878504 = /** @class */ (function () {
|
|
41
|
-
function productCategoryRank1677234878504() {
|
|
42
|
-
this.name = "productCategoryRank1677234878504";
|
|
43
|
-
}
|
|
44
|
-
productCategoryRank1677234878504.prototype.up = function (queryRunner) {
|
|
45
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
46
|
-
return __generator(this, function (_a) {
|
|
47
|
-
switch (_a.label) {
|
|
48
|
-
case 0: return [4 /*yield*/, queryRunner.query("\n ALTER TABLE \"product_category\"\n ADD COLUMN \"rank\" integer DEFAULT '0' NOT NULL CHECK (\"rank\" >= 0);\n ")];
|
|
49
|
-
case 1:
|
|
50
|
-
_a.sent();
|
|
51
|
-
return [4 /*yield*/, queryRunner.query("\n CREATE UNIQUE INDEX \"UniqProductCategoryParentIdRank\"\n ON \"product_category\" (\"parent_category_id\", \"rank\");\n ")];
|
|
52
|
-
case 2:
|
|
53
|
-
_a.sent();
|
|
54
|
-
return [2 /*return*/];
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
productCategoryRank1677234878504.prototype.down = function (queryRunner) {
|
|
60
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
61
|
-
return __generator(this, function (_a) {
|
|
62
|
-
switch (_a.label) {
|
|
63
|
-
case 0: return [4 /*yield*/, queryRunner.query("\n DROP INDEX \"UniqProductCategoryParentIdRank\";\n ")];
|
|
64
|
-
case 1:
|
|
65
|
-
_a.sent();
|
|
66
|
-
return [4 /*yield*/, queryRunner.query("\n ALTER TABLE \"product_category\" DROP COLUMN \"rank\";\n ")];
|
|
67
|
-
case 2:
|
|
68
|
-
_a.sent();
|
|
69
|
-
return [2 /*return*/];
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
return productCategoryRank1677234878504;
|
|
75
|
-
}());
|
|
76
|
-
exports.productCategoryRank1677234878504 = productCategoryRank1677234878504;
|
|
77
|
-
//# sourceMappingURL=1677234878504-product_category_rank.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"1677234878504-product_category_rank.js","sourceRoot":"","sources":["../../src/migrations/1677234878504-product_category_rank.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;IAAA;QACE,SAAI,GAAG,kCAAkC,CAAA;IAsB3C,CAAC;IApBc,6CAAE,GAAf,UAAgB,WAAwB;;;;4BACtC,qBAAM,WAAW,CAAC,KAAK,CAAC,+HAGvB,CAAC,EAAA;;wBAHF,SAGE,CAAA;wBAEF,qBAAM,WAAW,CAAC,KAAK,CAAC,0IAGvB,CAAC,EAAA;;wBAHF,SAGE,CAAA;;;;;KACH;IAEY,+CAAI,GAAjB,UAAkB,WAAwB;;;;4BACxC,qBAAM,WAAW,CAAC,KAAK,CAAC,+DAEvB,CAAC,EAAA;;wBAFF,SAEE,CAAA;wBACF,qBAAM,WAAW,CAAC,KAAK,CAAC,sEAEvB,CAAC,EAAA;;wBAFF,SAEE,CAAA;;;;;KACH;IACH,uCAAC;AAAD,CAAC,AAvBD,IAuBC;AAvBY,4EAAgC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { EntityManager } from "typeorm";
|
|
2
|
-
import { EmitData, TransactionBaseService } from "../interfaces";
|
|
3
|
-
import { StagedJob } from "../models";
|
|
4
|
-
import { StagedJobRepository } from "../repositories/staged-job";
|
|
5
|
-
import { FindConfig } from "../types/common";
|
|
6
|
-
declare type StagedJobServiceProps = {
|
|
7
|
-
manager: EntityManager;
|
|
8
|
-
stagedJobRepository: typeof StagedJobRepository;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Provides layer to manipulate users.
|
|
12
|
-
*/
|
|
13
|
-
declare class StagedJobService extends TransactionBaseService {
|
|
14
|
-
protected stagedJobRepository_: typeof StagedJobRepository;
|
|
15
|
-
constructor({ stagedJobRepository }: StagedJobServiceProps);
|
|
16
|
-
create(data: Partial<StagedJob>): Promise<StagedJob>;
|
|
17
|
-
list(config: FindConfig<StagedJob>): Promise<StagedJob[]>;
|
|
18
|
-
remove(stagedJob: StagedJob): Promise<StagedJob | undefined>;
|
|
19
|
-
deleteBulk(stagedJobIds: string[]): Promise<void>;
|
|
20
|
-
insertBulk(stagedJobsInput: EmitData[]): Promise<import("typeorm").ObjectLiteral[]>;
|
|
21
|
-
}
|
|
22
|
-
export default StagedJobService;
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
33
|
-
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;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
54
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
55
|
-
if (!m) return o;
|
|
56
|
-
var i = m.call(o), r, ar = [], e;
|
|
57
|
-
try {
|
|
58
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
59
|
-
}
|
|
60
|
-
catch (error) { e = { error: error }; }
|
|
61
|
-
finally {
|
|
62
|
-
try {
|
|
63
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
64
|
-
}
|
|
65
|
-
finally { if (e) throw e.error; }
|
|
66
|
-
}
|
|
67
|
-
return ar;
|
|
68
|
-
};
|
|
69
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
70
|
-
var typeorm_1 = require("typeorm");
|
|
71
|
-
var interfaces_1 = require("../interfaces");
|
|
72
|
-
/**
|
|
73
|
-
* Provides layer to manipulate users.
|
|
74
|
-
*/
|
|
75
|
-
var StagedJobService = /** @class */ (function (_super) {
|
|
76
|
-
__extends(StagedJobService, _super);
|
|
77
|
-
function StagedJobService(_a) {
|
|
78
|
-
var stagedJobRepository = _a.stagedJobRepository;
|
|
79
|
-
var _this =
|
|
80
|
-
// eslint-disable-next-line prefer-rest-params
|
|
81
|
-
_super.call(this, arguments[0]) || this;
|
|
82
|
-
_this.stagedJobRepository_ = stagedJobRepository;
|
|
83
|
-
return _this;
|
|
84
|
-
}
|
|
85
|
-
StagedJobService.prototype.create = function (data) {
|
|
86
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
87
|
-
var _this = this;
|
|
88
|
-
return __generator(this, function (_a) {
|
|
89
|
-
return [2 /*return*/, this.atomicPhase_(function (manager) { return __awaiter(_this, void 0, void 0, function () {
|
|
90
|
-
var stagedJobRepo, stagedJob;
|
|
91
|
-
return __generator(this, function (_a) {
|
|
92
|
-
switch (_a.label) {
|
|
93
|
-
case 0:
|
|
94
|
-
stagedJobRepo = manager.withRepository(this.stagedJobRepository_);
|
|
95
|
-
stagedJob = stagedJobRepo.create(data);
|
|
96
|
-
return [4 /*yield*/, stagedJobRepo.save(stagedJob)];
|
|
97
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
}); })];
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
|
-
StagedJobService.prototype.list = function (config) {
|
|
105
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
106
|
-
var stagedJobRepo;
|
|
107
|
-
return __generator(this, function (_a) {
|
|
108
|
-
switch (_a.label) {
|
|
109
|
-
case 0:
|
|
110
|
-
stagedJobRepo = this.activeManager_.withRepository(this.stagedJobRepository_);
|
|
111
|
-
return [4 /*yield*/, stagedJobRepo.find(config)];
|
|
112
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
};
|
|
117
|
-
StagedJobService.prototype.remove = function (stagedJob) {
|
|
118
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
119
|
-
var _this = this;
|
|
120
|
-
return __generator(this, function (_a) {
|
|
121
|
-
return [2 /*return*/, this.atomicPhase_(function (manager) { return __awaiter(_this, void 0, void 0, function () {
|
|
122
|
-
var stagedJobRepo, _a, job;
|
|
123
|
-
return __generator(this, function (_b) {
|
|
124
|
-
switch (_b.label) {
|
|
125
|
-
case 0:
|
|
126
|
-
stagedJobRepo = manager.withRepository(this.stagedJobRepository_);
|
|
127
|
-
return [4 /*yield*/, stagedJobRepo.find({ where: { id: stagedJob.id } })];
|
|
128
|
-
case 1:
|
|
129
|
-
_a = __read.apply(void 0, [_b.sent(), 1]), job = _a[0];
|
|
130
|
-
if (!job) {
|
|
131
|
-
return [2 /*return*/];
|
|
132
|
-
}
|
|
133
|
-
return [4 /*yield*/, stagedJobRepo.remove(job)];
|
|
134
|
-
case 2: return [2 /*return*/, _b.sent()];
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
}); })];
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
};
|
|
141
|
-
StagedJobService.prototype.deleteBulk = function (stagedJobIds) {
|
|
142
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
143
|
-
var _this = this;
|
|
144
|
-
return __generator(this, function (_a) {
|
|
145
|
-
return [2 /*return*/, this.atomicPhase_(function (manager) { return __awaiter(_this, void 0, void 0, function () {
|
|
146
|
-
var stagedJobRepo;
|
|
147
|
-
return __generator(this, function (_a) {
|
|
148
|
-
switch (_a.label) {
|
|
149
|
-
case 0:
|
|
150
|
-
stagedJobRepo = manager.withRepository(this.stagedJobRepository_);
|
|
151
|
-
return [4 /*yield*/, stagedJobRepo.delete({ id: (0, typeorm_1.In)(stagedJobIds) })];
|
|
152
|
-
case 1:
|
|
153
|
-
_a.sent();
|
|
154
|
-
return [2 /*return*/];
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
}); })];
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
};
|
|
161
|
-
StagedJobService.prototype.insertBulk = function (stagedJobsInput) {
|
|
162
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
163
|
-
var _this = this;
|
|
164
|
-
return __generator(this, function (_a) {
|
|
165
|
-
return [2 /*return*/, this.atomicPhase_(function (manager) { return __awaiter(_this, void 0, void 0, function () {
|
|
166
|
-
var stagedJobRepo, stagedJobs;
|
|
167
|
-
return __generator(this, function (_a) {
|
|
168
|
-
switch (_a.label) {
|
|
169
|
-
case 0:
|
|
170
|
-
stagedJobRepo = manager.withRepository(this.stagedJobRepository_);
|
|
171
|
-
stagedJobs = stagedJobsInput.map(function (job) {
|
|
172
|
-
return stagedJobRepo.create({
|
|
173
|
-
event_name: job.eventName,
|
|
174
|
-
data: job.data,
|
|
175
|
-
options: job.options,
|
|
176
|
-
});
|
|
177
|
-
});
|
|
178
|
-
return [4 /*yield*/, stagedJobRepo.insertBulk(stagedJobs)];
|
|
179
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
}); })];
|
|
183
|
-
});
|
|
184
|
-
});
|
|
185
|
-
};
|
|
186
|
-
return StagedJobService;
|
|
187
|
-
}(interfaces_1.TransactionBaseService));
|
|
188
|
-
exports.default = StagedJobService;
|
|
189
|
-
//# sourceMappingURL=staged-job.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"staged-job.js","sourceRoot":"","sources":["../../src/services/staged-job.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAwD;AAExD,4CAAgE;AAUhE;;GAEG;AACH;IAA+B,oCAAsB;IAGnD,0BAAY,EAA8C;YAA5C,mBAAmB,yBAAA;QAAjC;QACE,8CAA8C;QAC9C,kBAAM,SAAS,CAAC,CAAC,CAAC,CAAC,SAGpB;QADC,KAAI,CAAC,oBAAoB,GAAG,mBAAmB,CAAA;;IACjD,CAAC;IAEK,iCAAM,GAAZ,UAAa,IAAwB;;;;gBACnC,sBAAO,IAAI,CAAC,YAAY,CAAC,UAAO,OAAO;;;;;oCAC/B,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA;oCAEjE,SAAS,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;oCACrC,qBAAM,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,EAAA;wCAA1C,sBAAO,SAAmC,EAAA;;;yBAC3C,CAAC,EAAA;;;KACH;IAEK,+BAAI,GAAV,UAAW,MAA6B;;;;;;wBAChC,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CACtD,IAAI,CAAC,oBAAoB,CAC1B,CAAA;wBAEM,qBAAM,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,EAAA;4BAAvC,sBAAO,SAAgC,EAAA;;;;KACxC;IAEK,iCAAM,GAAZ,UAAa,SAAoB;;;;gBAC/B,sBAAO,IAAI,CAAC,YAAY,CAAC,UAAO,OAAO;;;;;oCAC/B,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA;oCAEzD,qBAAM,aAAa,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,EAAA;;oCAAjE,KAAA,sBAAQ,SAAyD,KAAA,EAAhE,GAAG,QAAA;oCAEV,IAAI,CAAC,GAAG,EAAE;wCACR,sBAAM;qCACP;oCAEM,qBAAM,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,EAAA;wCAAtC,sBAAO,SAA+B,EAAA;;;yBACvC,CAAC,EAAA;;;KACH;IAEK,qCAAU,GAAhB,UAAiB,YAAsB;;;;gBACrC,sBAAO,IAAI,CAAC,YAAY,CAAC,UAAO,OAAO;;;;;oCAC/B,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA;oCAEvE,qBAAM,aAAa,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,IAAA,YAAE,EAAC,YAAY,CAAC,EAAE,CAAC,EAAA;;oCAApD,SAAoD,CAAA;;;;yBACrD,CAAC,EAAA;;;KACH;IAEK,qCAAU,GAAhB,UAAiB,eAA2B;;;;gBAC1C,sBAAO,IAAI,CAAC,YAAY,CAAC,UAAO,OAAO;;;;;oCAC/B,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA;oCAEjE,UAAU,GAAG,eAAe,CAAC,GAAG,CACpC,UAAC,GAAG;wCACF,OAAA,aAAa,CAAC,MAAM,CAAC;4CACnB,UAAU,EAAE,GAAG,CAAC,SAAS;4CACzB,IAAI,EAAE,GAAG,CAAC,IAAI;4CACd,OAAO,EAAE,GAAG,CAAC,OAAO;yCACK,CAAsC;oCAJjE,CAIiE,CACpE,CAAA;oCAEM,qBAAM,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,EAAA;wCAAjD,sBAAO,SAA0C,EAAA;;;yBAClD,CAAC,EAAA;;;KACH;IACH,uBAAC;AAAD,CAAC,AAjED,CAA+B,mCAAsB,GAiEpD;AAED,kBAAe,gBAAgB,CAAA"}
|
package/dist/utils/is-date.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isDate(value: any): value is Date;
|
package/dist/utils/is-date.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isDate = void 0;
|
|
4
|
-
function isDate(value) {
|
|
5
|
-
var date = new Date(value);
|
|
6
|
-
return !isNaN(date.valueOf());
|
|
7
|
-
}
|
|
8
|
-
exports.isDate = isDate;
|
|
9
|
-
//# sourceMappingURL=is-date.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-date.js","sourceRoot":"","sources":["../../src/utils/is-date.ts"],"names":[],"mappings":";;;AAAA,SAAgB,MAAM,CAAC,KAAU;IAC/B,IAAM,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAA;IAC5B,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAA;AAC/B,CAAC;AAHD,wBAGC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { FindOptionsWhere } from "typeorm";
|
|
2
|
-
import { ProductCategory } from "../../models";
|
|
3
|
-
export declare const categoryMatchesScope: (category: ProductCategory, query: FindOptionsWhere<ProductCategory>) => boolean;
|
|
4
|
-
export declare const fetchCategoryDescendantsIds: (productCategory: ProductCategory, query: FindOptionsWhere<ProductCategory>) => string[];
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchCategoryDescendantsIds = exports.categoryMatchesScope = void 0;
|
|
4
|
-
var categoryMatchesScope = function (category, query) {
|
|
5
|
-
return Object.keys(query !== null && query !== void 0 ? query : {}).every(function (key) { return category[key] === query[key]; });
|
|
6
|
-
};
|
|
7
|
-
exports.categoryMatchesScope = categoryMatchesScope;
|
|
8
|
-
var fetchCategoryDescendantsIds = function (productCategory, query) {
|
|
9
|
-
var result = [productCategory.id];
|
|
10
|
-
(productCategory.category_children || []).forEach(function (child) {
|
|
11
|
-
if ((0, exports.categoryMatchesScope)(child, query)) {
|
|
12
|
-
result = result.concat((0, exports.fetchCategoryDescendantsIds)(child, query));
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
return result;
|
|
16
|
-
};
|
|
17
|
-
exports.fetchCategoryDescendantsIds = fetchCategoryDescendantsIds;
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/product-category/index.ts"],"names":[],"mappings":";;;AAIO,IAAM,oBAAoB,GAAG,UAClC,QAAyB,EACzB,KAAwC;IAExC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC,CAAC,KAAK,CAAC,UAAA,GAAG,IAAI,OAAA,QAAQ,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,EAA5B,CAA4B,CAAC,CAAA;AAC5E,CAAC,CAAA;AALY,QAAA,oBAAoB,wBAKhC;AAEM,IAAM,2BAA2B,GAAG,UACzC,eAAgC,EAChC,KAAwC;IAExC,IAAI,MAAM,GAAG,CAAC,eAAe,CAAC,EAAE,CAAC,CAEhC;IAAA,CAAC,eAAe,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,UAAC,KAAK;QACvD,IAAI,IAAA,4BAAoB,EAAC,KAAK,EAAE,KAAK,CAAC,EAAE;YACtC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAA,mCAA2B,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;SAClE;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAbY,QAAA,2BAA2B,+BAavC"}
|