@aiminaabeejs/link-modules 0.0.1
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/definitions/index.d.ts +4 -0
- package/dist/definitions/index.d.ts.map +1 -0
- package/dist/definitions/index.js +20 -0
- package/dist/definitions/index.js.map +1 -0
- package/dist/definitions/order-cart.d.ts +3 -0
- package/dist/definitions/order-cart.d.ts.map +1 -0
- package/dist/definitions/order-cart.js +71 -0
- package/dist/definitions/order-cart.js.map +1 -0
- package/dist/definitions/product-sales-channel.d.ts +3 -0
- package/dist/definitions/product-sales-channel.d.ts.map +1 -0
- package/dist/definitions/product-sales-channel.js +76 -0
- package/dist/definitions/product-sales-channel.js.map +1 -0
- package/dist/definitions/product-variant-price-set.d.ts +3 -0
- package/dist/definitions/product-variant-price-set.d.ts.map +1 -0
- package/dist/definitions/product-variant-price-set.js +80 -0
- package/dist/definitions/product-variant-price-set.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/initialize/index.d.ts +16 -0
- package/dist/initialize/index.d.ts.map +1 -0
- package/dist/initialize/index.js +159 -0
- package/dist/initialize/index.js.map +1 -0
- package/dist/initialize/module-definition.d.ts +3 -0
- package/dist/initialize/module-definition.d.ts.map +1 -0
- package/dist/initialize/module-definition.js +18 -0
- package/dist/initialize/module-definition.js.map +1 -0
- package/dist/loaders/connection.d.ts +4 -0
- package/dist/loaders/connection.d.ts.map +1 -0
- package/dist/loaders/connection.js +19 -0
- package/dist/loaders/connection.js.map +1 -0
- package/dist/loaders/container.d.ts +3 -0
- package/dist/loaders/container.d.ts.map +1 -0
- package/dist/loaders/container.js +32 -0
- package/dist/loaders/container.js.map +1 -0
- package/dist/loaders/index.d.ts +7 -0
- package/dist/loaders/index.d.ts.map +1 -0
- package/dist/loaders/index.js +14 -0
- package/dist/loaders/index.js.map +1 -0
- package/dist/migration/index.d.ts +104 -0
- package/dist/migration/index.d.ts.map +1 -0
- package/dist/migration/index.js +371 -0
- package/dist/migration/index.js.map +1 -0
- package/dist/repositories/index.d.ts +3 -0
- package/dist/repositories/index.d.ts.map +1 -0
- package/dist/repositories/index.js +8 -0
- package/dist/repositories/index.js.map +1 -0
- package/dist/repositories/link.d.ts +35 -0
- package/dist/repositories/link.d.ts.map +1 -0
- package/dist/repositories/link.js +33 -0
- package/dist/repositories/link.js.map +1 -0
- package/dist/services/dynamic-service-class.d.ts +8 -0
- package/dist/services/dynamic-service-class.d.ts.map +1 -0
- package/dist/services/dynamic-service-class.js +32 -0
- package/dist/services/dynamic-service-class.js.map +1 -0
- package/dist/services/index.d.ts +4 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +26 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/link-module-service.d.ts +42 -0
- package/dist/services/link-module-service.d.ts.map +1 -0
- package/dist/services/link-module-service.js +286 -0
- package/dist/services/link-module-service.js.map +1 -0
- package/dist/services/link.d.ts +18 -0
- package/dist/services/link.d.ts.map +1 -0
- package/dist/services/link.js +139 -0
- package/dist/services/link.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/generate-entity.d.ts +4 -0
- package/dist/utils/generate-entity.d.ts.map +1 -0
- package/dist/utils/generate-entity.js +98 -0
- package/dist/utils/generate-entity.js.map +1 -0
- package/dist/utils/generate-schema.d.ts +5 -0
- package/dist/utils/generate-schema.d.ts.map +1 -0
- package/dist/utils/generate-schema.js +156 -0
- package/dist/utils/generate-schema.js.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +19 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/definitions/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,6BAA6B,CAAA;AAC3C,cAAc,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./order-cart"), exports);
|
|
18
|
+
__exportStar(require("./product-variant-price-set"), exports);
|
|
19
|
+
__exportStar(require("./product-sales-channel"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/definitions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,8DAA2C;AAC3C,0DAAuC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order-cart.d.ts","sourceRoot":"","sources":["../../src/definitions/order-cart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAGlE,eAAO,MAAM,SAAS,EAAE,kBAiEvB,CAAA"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrderCart = void 0;
|
|
4
|
+
const utils_1 = require("@aiminaabeejs/framework/utils");
|
|
5
|
+
exports.OrderCart = {
|
|
6
|
+
serviceName: utils_1.LINKS.OrderCart,
|
|
7
|
+
isLink: true,
|
|
8
|
+
databaseConfig: {
|
|
9
|
+
tableName: "order_cart",
|
|
10
|
+
idPrefix: "ordercart",
|
|
11
|
+
},
|
|
12
|
+
alias: [
|
|
13
|
+
{
|
|
14
|
+
name: ["order_cart", "order_carts"],
|
|
15
|
+
entity: "LinkOrderCart",
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
primaryKeys: ["id", "order_id", "cart_id"],
|
|
19
|
+
relationships: [
|
|
20
|
+
{
|
|
21
|
+
serviceName: utils_1.Modules.ORDER,
|
|
22
|
+
entity: "Order",
|
|
23
|
+
primaryKey: "id",
|
|
24
|
+
foreignKey: "order_id",
|
|
25
|
+
alias: "order",
|
|
26
|
+
args: {
|
|
27
|
+
methodSuffix: "Orders",
|
|
28
|
+
},
|
|
29
|
+
hasMany: true,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
serviceName: utils_1.Modules.CART,
|
|
33
|
+
entity: "Cart",
|
|
34
|
+
primaryKey: "id",
|
|
35
|
+
foreignKey: "cart_id",
|
|
36
|
+
alias: "cart",
|
|
37
|
+
args: {
|
|
38
|
+
methodSuffix: "Carts",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
extends: [
|
|
43
|
+
{
|
|
44
|
+
serviceName: utils_1.Modules.ORDER,
|
|
45
|
+
entity: "Order",
|
|
46
|
+
fieldAlias: {
|
|
47
|
+
cart: "cart_link.cart",
|
|
48
|
+
},
|
|
49
|
+
relationship: {
|
|
50
|
+
serviceName: utils_1.LINKS.OrderCart,
|
|
51
|
+
primaryKey: "order_id",
|
|
52
|
+
foreignKey: "id",
|
|
53
|
+
alias: "cart_link",
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
serviceName: utils_1.Modules.CART,
|
|
58
|
+
entity: "Cart",
|
|
59
|
+
fieldAlias: {
|
|
60
|
+
order: "order_link.order",
|
|
61
|
+
},
|
|
62
|
+
relationship: {
|
|
63
|
+
serviceName: utils_1.LINKS.OrderCart,
|
|
64
|
+
primaryKey: "cart_id",
|
|
65
|
+
foreignKey: "id",
|
|
66
|
+
alias: "order_link",
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=order-cart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order-cart.js","sourceRoot":"","sources":["../../src/definitions/order-cart.ts"],"names":[],"mappings":";;;AACA,yDAA8D;AAEjD,QAAA,SAAS,GAAuB;IAC3C,WAAW,EAAE,aAAK,CAAC,SAAS;IAC5B,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE;QACd,SAAS,EAAE,YAAY;QACvB,QAAQ,EAAE,WAAW;KACtB;IACD,KAAK,EAAE;QACL;YACE,IAAI,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC;YACnC,MAAM,EAAE,eAAe;SACxB;KACF;IACD,WAAW,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC;IAC1C,aAAa,EAAE;QACb;YACE,WAAW,EAAE,eAAO,CAAC,KAAK;YAC1B,MAAM,EAAE,OAAO;YACf,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,UAAU;YACtB,KAAK,EAAE,OAAO;YACd,IAAI,EAAE;gBACJ,YAAY,EAAE,QAAQ;aACvB;YACD,OAAO,EAAE,IAAI;SACd;QACD;YACE,WAAW,EAAE,eAAO,CAAC,IAAI;YACzB,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,SAAS;YACrB,KAAK,EAAE,MAAM;YACb,IAAI,EAAE;gBACJ,YAAY,EAAE,OAAO;aACtB;SACF;KACF;IACD,OAAO,EAAE;QACP;YACE,WAAW,EAAE,eAAO,CAAC,KAAK;YAC1B,MAAM,EAAE,OAAO;YACf,UAAU,EAAE;gBACV,IAAI,EAAE,gBAAgB;aACvB;YACD,YAAY,EAAE;gBACZ,WAAW,EAAE,aAAK,CAAC,SAAS;gBAC5B,UAAU,EAAE,UAAU;gBACtB,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,WAAW;aACnB;SACF;QACD;YACE,WAAW,EAAE,eAAO,CAAC,IAAI;YACzB,MAAM,EAAE,MAAM;YACd,UAAU,EAAE;gBACV,KAAK,EAAE,kBAAkB;aAC1B;YACD,YAAY,EAAE;gBACZ,WAAW,EAAE,aAAK,CAAC,SAAS;gBAC5B,UAAU,EAAE,SAAS;gBACrB,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,YAAY;aACpB;SACF;KACF;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-sales-channel.d.ts","sourceRoot":"","sources":["../../src/definitions/product-sales-channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAGlE,eAAO,MAAM,mBAAmB,EAAE,kBAsEjC,CAAA"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductSalesChannel = void 0;
|
|
4
|
+
const utils_1 = require("@aiminaabeejs/framework/utils");
|
|
5
|
+
exports.ProductSalesChannel = {
|
|
6
|
+
serviceName: utils_1.LINKS.ProductSalesChannel,
|
|
7
|
+
isLink: true,
|
|
8
|
+
databaseConfig: {
|
|
9
|
+
tableName: "product_sales_channel",
|
|
10
|
+
idPrefix: "prodsc",
|
|
11
|
+
},
|
|
12
|
+
alias: [
|
|
13
|
+
{
|
|
14
|
+
name: "product_sales_channel",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "product_sales_channels",
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
primaryKeys: ["id", "product_id", "sales_channel_id"],
|
|
21
|
+
relationships: [
|
|
22
|
+
{
|
|
23
|
+
serviceName: utils_1.Modules.PRODUCT,
|
|
24
|
+
entity: "Product",
|
|
25
|
+
primaryKey: "id",
|
|
26
|
+
foreignKey: "product_id",
|
|
27
|
+
alias: "product",
|
|
28
|
+
args: {
|
|
29
|
+
methodSuffix: "Products",
|
|
30
|
+
},
|
|
31
|
+
hasMany: true,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
serviceName: utils_1.Modules.SALES_CHANNEL,
|
|
35
|
+
entity: "SalesChannel",
|
|
36
|
+
primaryKey: "id",
|
|
37
|
+
foreignKey: "sales_channel_id",
|
|
38
|
+
alias: "sales_channel",
|
|
39
|
+
args: {
|
|
40
|
+
methodSuffix: "SalesChannels",
|
|
41
|
+
},
|
|
42
|
+
hasMany: true,
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
extends: [
|
|
46
|
+
{
|
|
47
|
+
serviceName: utils_1.Modules.PRODUCT,
|
|
48
|
+
entity: "Product",
|
|
49
|
+
fieldAlias: {
|
|
50
|
+
sales_channels: {
|
|
51
|
+
path: "sales_channels_link.sales_channel",
|
|
52
|
+
isList: true,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
relationship: {
|
|
56
|
+
serviceName: utils_1.LINKS.ProductSalesChannel,
|
|
57
|
+
primaryKey: "product_id",
|
|
58
|
+
foreignKey: "id",
|
|
59
|
+
alias: "sales_channels_link",
|
|
60
|
+
isList: true,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
serviceName: utils_1.Modules.SALES_CHANNEL,
|
|
65
|
+
entity: "SalesChannel",
|
|
66
|
+
relationship: {
|
|
67
|
+
serviceName: utils_1.LINKS.ProductSalesChannel,
|
|
68
|
+
primaryKey: "sales_channel_id",
|
|
69
|
+
foreignKey: "id",
|
|
70
|
+
alias: "products_link",
|
|
71
|
+
isList: true,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=product-sales-channel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-sales-channel.js","sourceRoot":"","sources":["../../src/definitions/product-sales-channel.ts"],"names":[],"mappings":";;;AACA,yDAA8D;AAEjD,QAAA,mBAAmB,GAAuB;IACrD,WAAW,EAAE,aAAK,CAAC,mBAAmB;IACtC,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE;QACd,SAAS,EAAE,uBAAuB;QAClC,QAAQ,EAAE,QAAQ;KACnB;IACD,KAAK,EAAE;QACL;YACE,IAAI,EAAE,uBAAuB;SAC9B;QACD;YACE,IAAI,EAAE,wBAAwB;SAC/B;KACF;IACD,WAAW,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,kBAAkB,CAAC;IACrD,aAAa,EAAE;QACb;YACE,WAAW,EAAE,eAAO,CAAC,OAAO;YAC5B,MAAM,EAAE,SAAS;YACjB,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,YAAY;YACxB,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE;gBACJ,YAAY,EAAE,UAAU;aACzB;YACD,OAAO,EAAE,IAAI;SACd;QACD;YACE,WAAW,EAAE,eAAO,CAAC,aAAa;YAClC,MAAM,EAAE,cAAc;YACtB,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,kBAAkB;YAC9B,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE;gBACJ,YAAY,EAAE,eAAe;aAC9B;YACD,OAAO,EAAE,IAAI;SACd;KACF;IACD,OAAO,EAAE;QACP;YACE,WAAW,EAAE,eAAO,CAAC,OAAO;YAC5B,MAAM,EAAE,SAAS;YACjB,UAAU,EAAE;gBACV,cAAc,EAAE;oBACd,IAAI,EAAE,mCAAmC;oBACzC,MAAM,EAAE,IAAI;iBACb;aACF;YACD,YAAY,EAAE;gBACZ,WAAW,EAAE,aAAK,CAAC,mBAAmB;gBACtC,UAAU,EAAE,YAAY;gBACxB,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,qBAAqB;gBAC5B,MAAM,EAAE,IAAI;aACb;SACF;QACD;YACE,WAAW,EAAE,eAAO,CAAC,aAAa;YAClC,MAAM,EAAE,cAAc;YACtB,YAAY,EAAE;gBACZ,WAAW,EAAE,aAAK,CAAC,mBAAmB;gBACtC,UAAU,EAAE,kBAAkB;gBAC9B,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,eAAe;gBACtB,MAAM,EAAE,IAAI;aACb;SACF;KACF;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-variant-price-set.d.ts","sourceRoot":"","sources":["../../src/definitions/product-variant-price-set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAGlE,eAAO,MAAM,sBAAsB,EAAE,kBA0EpC,CAAA"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductVariantPriceSet = void 0;
|
|
4
|
+
const utils_1 = require("@aiminaabeejs/framework/utils");
|
|
5
|
+
exports.ProductVariantPriceSet = {
|
|
6
|
+
serviceName: utils_1.LINKS.ProductVariantPriceSet,
|
|
7
|
+
isLink: true,
|
|
8
|
+
databaseConfig: {
|
|
9
|
+
tableName: "product_variant_price_set",
|
|
10
|
+
idPrefix: "pvps",
|
|
11
|
+
},
|
|
12
|
+
alias: [
|
|
13
|
+
{
|
|
14
|
+
name: ["product_variant_price_set", "product_variant_price_sets"],
|
|
15
|
+
entity: "LinkProductVariantPriceSet",
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
primaryKeys: ["id", "variant_id", "price_set_id"],
|
|
19
|
+
relationships: [
|
|
20
|
+
{
|
|
21
|
+
serviceName: utils_1.Modules.PRODUCT,
|
|
22
|
+
entity: "ProductVariant",
|
|
23
|
+
primaryKey: "id",
|
|
24
|
+
foreignKey: "variant_id",
|
|
25
|
+
alias: "variant",
|
|
26
|
+
args: {
|
|
27
|
+
methodSuffix: "ProductVariants",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
serviceName: utils_1.Modules.PRICING,
|
|
32
|
+
entity: "PriceSet",
|
|
33
|
+
primaryKey: "id",
|
|
34
|
+
foreignKey: "price_set_id",
|
|
35
|
+
alias: "price_set",
|
|
36
|
+
args: {
|
|
37
|
+
methodSuffix: "PriceSets",
|
|
38
|
+
},
|
|
39
|
+
deleteCascade: true,
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
extends: [
|
|
43
|
+
{
|
|
44
|
+
serviceName: utils_1.Modules.PRODUCT,
|
|
45
|
+
entity: "ProductVariant",
|
|
46
|
+
fieldAlias: {
|
|
47
|
+
price_set: "price_set_link.price_set",
|
|
48
|
+
prices: {
|
|
49
|
+
path: "price_set_link.price_set.prices",
|
|
50
|
+
isList: true,
|
|
51
|
+
forwardArgumentsOnPath: ["price_set_link.price_set"],
|
|
52
|
+
},
|
|
53
|
+
calculated_price: {
|
|
54
|
+
path: "price_set_link.price_set.calculated_price",
|
|
55
|
+
forwardArgumentsOnPath: ["price_set_link.price_set"],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
relationship: {
|
|
59
|
+
serviceName: utils_1.LINKS.ProductVariantPriceSet,
|
|
60
|
+
primaryKey: "variant_id",
|
|
61
|
+
foreignKey: "id",
|
|
62
|
+
alias: "price_set_link",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
serviceName: utils_1.Modules.PRICING,
|
|
67
|
+
entity: "PriceSet",
|
|
68
|
+
relationship: {
|
|
69
|
+
serviceName: utils_1.LINKS.ProductVariantPriceSet,
|
|
70
|
+
primaryKey: "price_set_id",
|
|
71
|
+
foreignKey: "id",
|
|
72
|
+
alias: "variant_link",
|
|
73
|
+
},
|
|
74
|
+
fieldAlias: {
|
|
75
|
+
variant: "variant_link.variant",
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=product-variant-price-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-variant-price-set.js","sourceRoot":"","sources":["../../src/definitions/product-variant-price-set.ts"],"names":[],"mappings":";;;AACA,yDAA8D;AAEjD,QAAA,sBAAsB,GAAuB;IACxD,WAAW,EAAE,aAAK,CAAC,sBAAsB;IACzC,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE;QACd,SAAS,EAAE,2BAA2B;QACtC,QAAQ,EAAE,MAAM;KACjB;IACD,KAAK,EAAE;QACL;YACE,IAAI,EAAE,CAAC,2BAA2B,EAAE,4BAA4B,CAAC;YACjE,MAAM,EAAE,4BAA4B;SACrC;KACF;IACD,WAAW,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,cAAc,CAAC;IACjD,aAAa,EAAE;QACb;YACE,WAAW,EAAE,eAAO,CAAC,OAAO;YAC5B,MAAM,EAAE,gBAAgB;YACxB,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,YAAY;YACxB,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE;gBACJ,YAAY,EAAE,iBAAiB;aAChC;SACF;QACD;YACE,WAAW,EAAE,eAAO,CAAC,OAAO;YAC5B,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,cAAc;YAC1B,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE;gBACJ,YAAY,EAAE,WAAW;aAC1B;YACD,aAAa,EAAE,IAAI;SACpB;KACF;IACD,OAAO,EAAE;QACP;YACE,WAAW,EAAE,eAAO,CAAC,OAAO;YAC5B,MAAM,EAAE,gBAAgB;YACxB,UAAU,EAAE;gBACV,SAAS,EAAE,0BAA0B;gBACrC,MAAM,EAAE;oBACN,IAAI,EAAE,iCAAiC;oBACvC,MAAM,EAAE,IAAI;oBACZ,sBAAsB,EAAE,CAAC,0BAA0B,CAAC;iBACrD;gBACD,gBAAgB,EAAE;oBAChB,IAAI,EAAE,2CAA2C;oBACjD,sBAAsB,EAAE,CAAC,0BAA0B,CAAC;iBACrD;aACF;YACD,YAAY,EAAE;gBACZ,WAAW,EAAE,aAAK,CAAC,sBAAsB;gBACzC,UAAU,EAAE,YAAY;gBACxB,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,gBAAgB;aACxB;SACF;QACD;YACE,WAAW,EAAE,eAAO,CAAC,OAAO;YAC5B,MAAM,EAAE,UAAU;YAClB,YAAY,EAAE;gBACZ,WAAW,EAAE,aAAK,CAAC,sBAAsB;gBACzC,UAAU,EAAE,cAAc;gBAC1B,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,cAAc;aACtB;YACD,UAAU,EAAE;gBACV,OAAO,EAAE,sBAAsB;aAChC;SACF;KACF;CACF,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./initialize"), exports);
|
|
18
|
+
__exportStar(require("./loaders"), exports);
|
|
19
|
+
__exportStar(require("./migration"), exports);
|
|
20
|
+
__exportStar(require("./services"), exports);
|
|
21
|
+
__exportStar(require("./types"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,4CAAyB;AACzB,8CAA2B;AAC3B,6CAA0B;AAC1B,0CAAuB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ExternalModuleDeclaration, ILinkModule, InternalModuleDeclaration, ModuleJoinerConfig, ModuleServiceInitializeCustomDataLayerOptions, ModuleServiceInitializeOptions } from "@aiminaabeejs/framework/types";
|
|
2
|
+
import { MigrationsExecutionPlanner } from "../migration";
|
|
3
|
+
import { InitializeModuleInjectableDependencies } from "../types";
|
|
4
|
+
export declare const initialize: (options?: ModuleServiceInitializeOptions | ModuleServiceInitializeCustomDataLayerOptions | ExternalModuleDeclaration | InternalModuleDeclaration, pluginLinksDefinitions?: ModuleJoinerConfig[], injectedDependencies?: InitializeModuleInjectableDependencies) => Promise<{
|
|
5
|
+
[link: string]: ILinkModule;
|
|
6
|
+
}>;
|
|
7
|
+
/**
|
|
8
|
+
* Prepare an execution plan and run the migrations accordingly.
|
|
9
|
+
* It includes creating, updating, deleting the tables according to the execution plan.
|
|
10
|
+
* If any unsafe sql is identified then we will notify the user to act manually.
|
|
11
|
+
*
|
|
12
|
+
* @param options
|
|
13
|
+
* @param pluginLinksDefinition
|
|
14
|
+
*/
|
|
15
|
+
export declare function getMigrationPlanner(options: ModuleServiceInitializeOptions, pluginLinksDefinition?: ModuleJoinerConfig[]): MigrationsExecutionPlanner;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/initialize/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,yBAAyB,EACzB,WAAW,EACX,yBAAyB,EAGzB,kBAAkB,EAClB,6CAA6C,EAC7C,8BAA8B,EAC/B,MAAM,+BAA+B,CAAA;AAWtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,sCAAsC,EAAE,MAAM,UAAU,CAAA;AAIjE,eAAO,MAAM,UAAU,aAEjB,8BAA8B,GAC9B,6CAA6C,GAC7C,yBAAyB,GACzB,yBAAyB,2BACJ,kBAAkB,EAAE,yBACtB,sCAAsC,KAC5D,OAAO,CAAC;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAA;CAAE,CAwIzC,CAAA;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,8BAA8B,EACvC,qBAAqB,CAAC,EAAE,kBAAkB,EAAE,8BA+C7C"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.initialize = void 0;
|
|
37
|
+
exports.getMigrationPlanner = getMigrationPlanner;
|
|
38
|
+
const modules_sdk_1 = require("@aiminaabeejs/framework/modules-sdk");
|
|
39
|
+
const utils_1 = require("@aiminaabeejs/framework/utils");
|
|
40
|
+
const linkDefinitions = __importStar(require("../definitions"));
|
|
41
|
+
const migration_1 = require("../migration");
|
|
42
|
+
const utils_2 = require("../utils");
|
|
43
|
+
const module_definition_1 = require("./module-definition");
|
|
44
|
+
const initialize = async (options, pluginLinksDefinitions, injectedDependencies) => {
|
|
45
|
+
const allLinks = {};
|
|
46
|
+
const modulesLoadedKeys = modules_sdk_1.AiminaabeeModule.getLoadedModules().map((mod) => Object.keys(mod)[0]);
|
|
47
|
+
const allLinksToLoad = Object.values(linkDefinitions).concat(pluginLinksDefinitions ?? []);
|
|
48
|
+
for (const linkDefinition of allLinksToLoad) {
|
|
49
|
+
const definition = JSON.parse(JSON.stringify(linkDefinition));
|
|
50
|
+
const [primary, foreign] = definition.relationships ?? [];
|
|
51
|
+
if (definition.relationships?.length !== 2 && !definition.isReadOnlyLink) {
|
|
52
|
+
throw new Error(`Link module ${definition.serviceName} can only link 2 modules.`);
|
|
53
|
+
}
|
|
54
|
+
else if (foreign?.foreignKey?.split(",").length > 1 &&
|
|
55
|
+
!definition.isReadOnlyLink) {
|
|
56
|
+
throw new Error(`Foreign key cannot be a composed key.`);
|
|
57
|
+
}
|
|
58
|
+
if (Array.isArray(definition.extraDataFields)) {
|
|
59
|
+
const extraDataFields = definition.extraDataFields;
|
|
60
|
+
const definedDbFields = Object.keys(definition.databaseConfig?.extraFields || {});
|
|
61
|
+
const difference = (0, utils_1.arrayDifference)(extraDataFields, definedDbFields);
|
|
62
|
+
if (difference.length) {
|
|
63
|
+
throw new Error(`extraDataFields (fieldNames: ${difference.join(",")}) need to be configured under databaseConfig (serviceName: ${definition.serviceName}).`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const serviceKey = !definition.isReadOnlyLink
|
|
67
|
+
? definition.serviceName ??
|
|
68
|
+
(0, utils_1.composeLinkName)(primary.serviceName, primary.foreignKey, foreign.serviceName, foreign.foreignKey)
|
|
69
|
+
: (0, utils_1.simpleHash)(JSON.stringify(definition.extends));
|
|
70
|
+
if (modulesLoadedKeys.includes(serviceKey)) {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
else if (serviceKey in allLinks) {
|
|
74
|
+
throw new Error(`Link module ${serviceKey} already defined.`);
|
|
75
|
+
}
|
|
76
|
+
if (definition.isReadOnlyLink) {
|
|
77
|
+
const extended = [];
|
|
78
|
+
for (const extension of definition.extends ?? []) {
|
|
79
|
+
if (modulesLoadedKeys.includes(extension.serviceName) &&
|
|
80
|
+
modulesLoadedKeys.includes(extension.relationship.serviceName)) {
|
|
81
|
+
extended.push(extension);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
definition.extends = extended;
|
|
85
|
+
if (extended.length === 0) {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
else if (!modulesLoadedKeys.includes(primary.serviceName) ||
|
|
90
|
+
!modulesLoadedKeys.includes(foreign.serviceName)) {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
const logger = injectedDependencies?.[utils_1.ContainerRegistrationKeys.LOGGER] ?? console;
|
|
94
|
+
definition.schema = (0, utils_2.generateGraphQLSchema)(definition, primary, foreign, {
|
|
95
|
+
logger,
|
|
96
|
+
});
|
|
97
|
+
if (!Array.isArray(definition.alias)) {
|
|
98
|
+
definition.alias = definition.alias ? [definition.alias] : [];
|
|
99
|
+
}
|
|
100
|
+
for (const alias of definition.alias) {
|
|
101
|
+
alias.args ??= {};
|
|
102
|
+
alias.entity = (0, utils_1.toPascalCase)("Link_" +
|
|
103
|
+
(definition.databaseConfig?.tableName ??
|
|
104
|
+
(0, utils_1.composeTableName)(primary.serviceName, primary.foreignKey, foreign.serviceName, foreign.foreignKey)));
|
|
105
|
+
}
|
|
106
|
+
const moduleDefinition = (0, module_definition_1.getLinkModuleDefinition)(definition, primary, foreign);
|
|
107
|
+
const linkModuleDefinition = {
|
|
108
|
+
key: serviceKey,
|
|
109
|
+
label: serviceKey,
|
|
110
|
+
dependencies: [utils_1.Modules.EVENT_BUS],
|
|
111
|
+
defaultModuleDeclaration: {
|
|
112
|
+
scope: modules_sdk_1.MODULE_SCOPE.INTERNAL,
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
const loaded = await modules_sdk_1.AiminaabeeModule.bootstrapLink({
|
|
116
|
+
definition: linkModuleDefinition,
|
|
117
|
+
declaration: options,
|
|
118
|
+
moduleExports: moduleDefinition,
|
|
119
|
+
injectedDependencies,
|
|
120
|
+
});
|
|
121
|
+
allLinks[serviceKey] = Object.values(loaded)[0];
|
|
122
|
+
}
|
|
123
|
+
return allLinks;
|
|
124
|
+
};
|
|
125
|
+
exports.initialize = initialize;
|
|
126
|
+
/**
|
|
127
|
+
* Prepare an execution plan and run the migrations accordingly.
|
|
128
|
+
* It includes creating, updating, deleting the tables according to the execution plan.
|
|
129
|
+
* If any unsafe sql is identified then we will notify the user to act manually.
|
|
130
|
+
*
|
|
131
|
+
* @param options
|
|
132
|
+
* @param pluginLinksDefinition
|
|
133
|
+
*/
|
|
134
|
+
function getMigrationPlanner(options, pluginLinksDefinition) {
|
|
135
|
+
const modulesLoadedKeys = modules_sdk_1.AiminaabeeModule.getLoadedModules().map((mod) => Object.keys(mod)[0]);
|
|
136
|
+
const allLinksToLoad = Object.values(linkDefinitions).concat(pluginLinksDefinition ?? []);
|
|
137
|
+
const allLinks = new Set();
|
|
138
|
+
for (const definition of allLinksToLoad) {
|
|
139
|
+
if (definition.isReadOnlyLink) {
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
if (definition.relationships?.length !== 2) {
|
|
143
|
+
throw new Error(`Link module ${definition.serviceName} must have 2 relationships.`);
|
|
144
|
+
}
|
|
145
|
+
const [primary, foreign] = definition.relationships ?? [];
|
|
146
|
+
const serviceKey = definition.serviceName ??
|
|
147
|
+
(0, utils_1.composeLinkName)(primary.serviceName, primary.foreignKey, foreign.serviceName, foreign.foreignKey);
|
|
148
|
+
if (allLinks.has(serviceKey)) {
|
|
149
|
+
throw new Error(`Link module ${serviceKey} already exists.`);
|
|
150
|
+
}
|
|
151
|
+
allLinks.add(serviceKey);
|
|
152
|
+
if (!modulesLoadedKeys.includes(primary.serviceName) ||
|
|
153
|
+
!modulesLoadedKeys.includes(foreign.serviceName)) {
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return new migration_1.MigrationsExecutionPlanner(allLinksToLoad, options);
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/initialize/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoLA,kDAiDC;AArOD,qEAAoF;AAWpF,yDAQsC;AACtC,gEAAiD;AACjD,4CAAyD;AAEzD,oCAAgD;AAChD,2DAA6D;AAEtD,MAAM,UAAU,GAAG,KAAK,EAC7B,OAI6B,EAC7B,sBAA6C,EAC7C,oBAA6D,EACnB,EAAE;IAC5C,MAAM,QAAQ,GAAG,EAAE,CAAA;IACnB,MAAM,iBAAiB,GAAG,8BAAgB,CAAC,gBAAgB,EAAE,CAAC,GAAG,CAC/D,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAC7B,CAAA;IAED,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,MAAM,CAC1D,sBAAsB,IAAI,EAAE,CAC7B,CAAA;IAED,KAAK,MAAM,cAAc,IAAI,cAAc,EAAE,CAAC;QAC5C,MAAM,UAAU,GAAuB,IAAI,CAAC,KAAK,CAC/C,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAC/B,CAAA;QAED,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,UAAU,CAAC,aAAa,IAAI,EAAE,CAAA;QAEzD,IAAI,UAAU,CAAC,aAAa,EAAE,MAAM,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;YACzE,MAAM,IAAI,KAAK,CACb,eAAe,UAAU,CAAC,WAAW,2BAA2B,CACjE,CA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U,IAAI,cAAc,EAAE,CAAC;QACxC,IAAI,UAAU,CAAC,cAAc,EAAE,CAAC;YAC9B,SAAQ;QACV,CAAC;QAED,IAAI,UAAU,CAAC,aAAa,EAAE,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3C,MAAM,IAAI,KAAK,CACb,eAAe,UAAU,CAAC,WAAW,6BAA6B,CACnE,CAAA;QACH,CAAC;QAED,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,UAAU,CAAC,aAAa,IAAI,EAAE,CAAA;QACzD,MAAM,UAAU,GACd,UAAU,CAAC,WAAW;YACtB,IAAA,uBAAe,EACb,OAAO,CAAC,WAAW,EACnB,OAAO,CAAC,UAAU,EAClB,OAAO,CAAC,WAAW,EACnB,OAAO,CAAC,UAAU,CACnB,CAAA;QAEH,IAAI,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,eAAe,UAAU,kBAAkB,CAAC,CAAA;QAC9D,CAAC;QAED,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;QAExB,IACE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC;YAChD,CAAC,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,EAChD,CAAC;YACD,SAAQ;QACV,CAAC;IACH,CAAC;IAED,OAAO,IAAI,sCAA0B,CAAC,cAAc,EAAE,OAAO,CAAC,CAAA;AAChE,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { JoinerRelationship, ModuleExports, ModuleJoinerConfig } from "@aiminaabeejs/framework/types";
|
|
2
|
+
export declare function getLinkModuleDefinition(joinerConfig: ModuleJoinerConfig, primary: JoinerRelationship, foreign: JoinerRelationship): ModuleExports;
|
|
3
|
+
//# sourceMappingURL=module-definition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-definition.d.ts","sourceRoot":"","sources":["../../src/initialize/module-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EACnB,MAAM,+BAA+B,CAAA;AAMtC,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,kBAAkB,EAChC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,kBAAkB,GAC1B,aAAa,CAWf"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLinkModuleDefinition = getLinkModuleDefinition;
|
|
4
|
+
const services_1 = require("../services");
|
|
5
|
+
const loaders_1 = require("../loaders");
|
|
6
|
+
function getLinkModuleDefinition(joinerConfig, primary, foreign) {
|
|
7
|
+
return {
|
|
8
|
+
service: joinerConfig.isReadOnlyLink
|
|
9
|
+
? (0, services_1.getReadOnlyModuleService)(joinerConfig)
|
|
10
|
+
: (0, services_1.getModuleService)(joinerConfig),
|
|
11
|
+
loaders: (0, loaders_1.getLoaders)({
|
|
12
|
+
joinerConfig,
|
|
13
|
+
primary,
|
|
14
|
+
foreign,
|
|
15
|
+
}),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=module-definition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-definition.js","sourceRoot":"","sources":["../../src/initialize/module-definition.ts"],"names":[],"mappings":";;AAUE,0DAeC;AAlBH,0CAAwE;AACxE,wCAAuC;AAErC,SAAgB,uBAAuB,CACrC,YAAgC,EAChC,OAA2B,EAC3B,OAA2B;IAE3B,OAAO;QACL,OAAO,EAAE,YAAY,CAAC,cAAc;YAClC,CAAC,CAAC,IAAA,mCAAwB,EAAC,YAAY,CAAC;YACxC,CAAC,CAAC,IAAA,2BAAgB,EAAC,YAAY,CAAC;QAClC,OAAO,EAAE,IAAA,oBAAU,EAAC;YAClB,YAAY;YACZ,OAAO;YACP,OAAO;SACR,CAAC;KACH,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InternalModuleDeclaration, LoaderOptions, ModuleServiceInitializeCustomDataLayerOptions, ModuleServiceInitializeOptions } from "@aiminaabeejs/framework/types";
|
|
2
|
+
import { EntitySchema } from "@mikro-orm/core";
|
|
3
|
+
export declare function connectionLoader(entity: EntitySchema): ({ options, container, logger, }: LoaderOptions<ModuleServiceInitializeOptions | ModuleServiceInitializeCustomDataLayerOptions>, moduleDeclaration?: InternalModuleDeclaration) => Promise<void>;
|
|
4
|
+
//# sourceMappingURL=connection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/loaders/connection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,aAAa,EACb,6CAA6C,EAC7C,8BAA8B,EAC/B,MAAM,+BAA+B,CAAA;AAGtC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,qCAM9C,aAAa,CACZ,8BAA8B,GAC9B,6CAA6C,CAChD,sBACmB,yBAAyB,KAC5C,OAAO,CAAC,IAAI,CAAC,CAajB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.connectionLoader = connectionLoader;
|
|
4
|
+
const utils_1 = require("@aiminaabeejs/framework/utils");
|
|
5
|
+
function connectionLoader(entity) {
|
|
6
|
+
return async ({ options, container, logger, }, moduleDeclaration) => {
|
|
7
|
+
const pathToMigrations = __dirname + "/../migrations";
|
|
8
|
+
await utils_1.ModulesSdkUtils.mikroOrmConnectionLoader({
|
|
9
|
+
moduleName: "link_module",
|
|
10
|
+
entities: [entity],
|
|
11
|
+
container,
|
|
12
|
+
options,
|
|
13
|
+
moduleDeclaration,
|
|
14
|
+
logger,
|
|
15
|
+
pathToMigrations,
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/loaders/connection.ts"],"names":[],"mappings":";;AAUA,4CAwBC;AA5BD,yDAA+D;AAI/D,SAAgB,gBAAgB,CAAC,MAAoB;IACnD,OAAO,KAAK,EACV,EACE,OAAO,EACP,SAAS,EACT,MAAM,GAIP,EACD,iBAA6C,EAC9B,EAAE;QACjB,MAAM,gBAAgB,GAAG,SAAS,GAAG,gBAAgB,CAAA;QAErD,MAAM,uBAAe,CAAC,wBAAwB,CAAC;YAC7C,UAAU,EAAE,aAAa;YACzB,QAAQ,EAAE,CAAC,MAAM,CAAC;YAClB,SAAS;YACT,OAAO;YACP,iBAAiB;YACjB,MAAM;YACN,gBAAgB;SACjB,CAAC,CAAA;IACJ,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { InternalModuleDeclaration, LoaderOptions, ModuleJoinerConfig, ModulesSdkTypes } from "@aiminaabeejs/framework/types";
|
|
2
|
+
export declare function containerLoader(entity: any, joinerConfig: ModuleJoinerConfig): ({ options, container, }: LoaderOptions<ModulesSdkTypes.ModuleServiceInitializeOptions | ModulesSdkTypes.ModuleServiceInitializeCustomDataLayerOptions>, moduleDeclaration?: InternalModuleDeclaration) => Promise<void>;
|
|
3
|
+
//# sourceMappingURL=container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/loaders/container.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,yBAAyB,EACzB,aAAa,EACb,kBAAkB,EAClB,eAAe,EAChB,MAAM,+BAA+B,CAAA;AAQtC,wBAAgB,eAAe,CAAC,MAAM,KAAA,EAAE,YAAY,EAAE,kBAAkB,6BAKjE,aAAa,CACZ,eAAe,CAAC,8BAA8B,GAC9C,eAAe,CAAC,6CAA6C,CAChE,sBACmB,yBAAyB,KAC5C,OAAO,CAAC,IAAI,CAAC,CAyCjB"}
|