@aiminaabeejs/link-modules 0.0.15 → 0.0.17

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 (31) hide show
  1. package/dist/definitions/index.d.ts +7 -0
  2. package/dist/definitions/index.d.ts.map +1 -1
  3. package/dist/definitions/index.js +8 -0
  4. package/dist/definitions/index.js.map +1 -1
  5. package/dist/definitions/store-category.d.ts.map +1 -1
  6. package/dist/definitions/store-category.js +0 -3
  7. package/dist/definitions/store-category.js.map +1 -1
  8. package/dist/definitions/store-product.d.ts +83 -0
  9. package/dist/definitions/store-product.d.ts.map +1 -1
  10. package/dist/definitions/store-product.js +94 -7
  11. package/dist/definitions/store-product.js.map +1 -1
  12. package/dist/definitions/store-region.js +9 -9
  13. package/dist/definitions/store-region.js.map +1 -1
  14. package/dist/definitions/store-sales-channel.d.ts +10 -0
  15. package/dist/definitions/store-sales-channel.d.ts.map +1 -1
  16. package/dist/definitions/store-sales-channel.js +19 -7
  17. package/dist/definitions/store-sales-channel.js.map +1 -1
  18. package/dist/definitions/store-user.d.ts +88 -0
  19. package/dist/definitions/store-user.d.ts.map +1 -0
  20. package/dist/definitions/store-user.js +171 -0
  21. package/dist/definitions/store-user.js.map +1 -0
  22. package/dist/tsconfig.tsbuildinfo +1 -1
  23. package/package.json +1 -1
  24. package/dist/definitions/product-collection.d.ts +0 -3
  25. package/dist/definitions/product-collection.d.ts.map +0 -1
  26. package/dist/definitions/product-collection.js +0 -82
  27. package/dist/definitions/product-collection.js.map +0 -1
  28. package/dist/definitions/store-collection.d.ts +0 -3
  29. package/dist/definitions/store-collection.d.ts.map +0 -1
  30. package/dist/definitions/store-collection.js +0 -82
  31. package/dist/definitions/store-collection.js.map +0 -1
@@ -16,6 +16,13 @@ export * from "./sales-channel-location";
16
16
  export * from "./shipping-option-price-set";
17
17
  export * from "./product-shipping-profile";
18
18
  export * from "./customer-account-holder";
19
+ export * from "./store-api-key";
19
20
  export * from "./store-category";
21
+ export * from "./store-customer";
22
+ export * from "./store-product";
23
+ export * from "./store-region";
24
+ export * from "./store-sales-channel";
25
+ export * from "./store-shipping-profile";
26
+ export * from "./store-user";
20
27
  export * from "./readonly";
21
28
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/definitions/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,cAAc,kBAAkB,CAAA;AAChC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,cAAc,CAAA;AAC5B,cAAc,qBAAqB,CAAA;AACnC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,mBAAmB,CAAA;AACjC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,kCAAkC,CAAA;AAChD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,qCAAqC,CAAA;AACnD,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,2BAA2B,CAAA;AACzC,cAAc,kBAAkB,CAAA;AAGhC,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/definitions/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,cAAc,kBAAkB,CAAA;AAChC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,cAAc,CAAA;AAC5B,cAAc,qBAAqB,CAAA;AACnC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,mBAAmB,CAAA;AACjC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,kCAAkC,CAAA;AAChD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,qCAAqC,CAAA;AACnD,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,2BAA2B,CAAA;AACzC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAEhC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,cAAc,CAAA;AAG5B,cAAc,YAAY,CAAA"}
@@ -32,7 +32,15 @@ __exportStar(require("./sales-channel-location"), exports);
32
32
  __exportStar(require("./shipping-option-price-set"), exports);
33
33
  __exportStar(require("./product-shipping-profile"), exports);
34
34
  __exportStar(require("./customer-account-holder"), exports);
35
+ __exportStar(require("./store-api-key"), exports);
35
36
  __exportStar(require("./store-category"), exports);
37
+ __exportStar(require("./store-customer"), exports);
38
+ // export * from "./store-inventory-level"
39
+ __exportStar(require("./store-product"), exports);
40
+ __exportStar(require("./store-region"), exports);
41
+ __exportStar(require("./store-sales-channel"), exports);
42
+ __exportStar(require("./store-shipping-profile"), exports);
43
+ __exportStar(require("./store-user"), exports);
36
44
  //read only links
37
45
  __exportStar(require("./readonly"), exports);
38
46
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/definitions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAAyC;AACzC,mDAAgC;AAChC,kEAA+C;AAC/C,6DAA0C;AAC1C,+CAA4B;AAC5B,sDAAmC;AACnC,6DAA0C;AAC1C,oDAAiC;AACjC,6DAA0C;AAC1C,0DAAuC;AACvC,mEAAgD;AAChD,8DAA2C;AAC3C,sEAAmD;AACnD,4DAAyC;AACzC,2DAAwC;AACxC,8DAA2C;AAC3C,6DAA0C;AAC1C,4DAAyC;AACzC,mDAAgC;AAEhC,iBAAiB;AACjB,6CAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/definitions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAAyC;AACzC,mDAAgC;AAChC,kEAA+C;AAC/C,6DAA0C;AAC1C,+CAA4B;AAC5B,sDAAmC;AACnC,6DAA0C;AAC1C,oDAAiC;AACjC,6DAA0C;AAC1C,0DAAuC;AACvC,mEAAgD;AAChD,8DAA2C;AAC3C,sEAAmD;AACnD,4DAAyC;AACzC,2DAAwC;AACxC,8DAA2C;AAC3C,6DAA0C;AAC1C,4DAAyC;AACzC,kDAA+B;AAC/B,mDAAgC;AAChC,mDAAgC;AAChC,0CAA0C;AAC1C,kDAA+B;AAC/B,iDAA8B;AAC9B,wDAAqC;AACrC,2DAAwC;AACxC,+CAA4B;AAE5B,iBAAiB;AACjB,6CAA0B"}
@@ -1 +1 @@
1
- {"version":3,"file":"store-category.d.ts","sourceRoot":"","sources":["../../src/definitions/store-category.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAGlE,eAAO,MAAM,aAAa,EAAE,kBA8E3B,CAAA"}
1
+ {"version":3,"file":"store-category.d.ts","sourceRoot":"","sources":["../../src/definitions/store-category.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAGlE,eAAO,MAAM,aAAa,EAAE,kBA2E3B,CAAA"}
@@ -36,9 +36,6 @@ exports.StoreCategory = {
36
36
  primaryKey: "id",
37
37
  foreignKey: "product_category_id",
38
38
  alias: "category",
39
- args: {
40
- methodSuffix: "Categories",
41
- },
42
39
  hasMany: true,
43
40
  },
44
41
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"store-category.js","sourceRoot":"","sources":["../../src/definitions/store-category.ts"],"names":[],"mappings":";;;AACA,yDAA8D;AAEjD,QAAA,aAAa,GAAuB;IAC/C,WAAW,EAAE,aAAK,CAAC,aAAa;IAChC,MAAM,EAAE,IAAI;I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MAAM,EAAE,KAAK,EAAE,yDAAyD;iBACzE;aACF;YACD,YAAY,EAAE;gBACZ,WAAW,EAAE,aAAK,CAAC,aAAa;gBAChC,UAAU,EAAE,qBAAqB;gBACjC,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,YAAY,EAAE,qCAAqC;gBAC1D,MAAM,EAAE,KAAK,EAAE,2BAA2B;aAC3C;SACF;KACF;CACF,CAAA"}
1
+ {"version":3,"file":"store-category.js","sourceRoot":"","sources":["../../src/definitions/store-category.ts"],"names":[],"mappings":";;;AACA,yDAA8D;AAEjD,QAAA,aAAa,GAAuB;IAC/C,WAAW,EAAE,aAAK,CAAC,aAAa;IAChC,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE;QACd,SAAS,EAAE,gBAAgB;QAC3B,QAAQ,EAAE,OAAO;KAClB;IACD,KAAK,EAAE;QACL;YACE,IAAI,EAAE,gBAAgB;SACvB;QACD;YACE,IAAI,EAAE,kBAAkB;SACzB;KACF;IACD,WAAW,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,qBAAqB,CAAC;IACtD,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,OAAO;YAC5B,MAAM,EAAE,iBAAiB;YACzB,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,qBAAqB;YACjC,KAAK,EAAE,UAAU;YACjB,OAAO,EAAE,IAAI;SACd;KACF;IACD,OAAO,EAAE;QACP,yCAAyC;QACzC;YACE,WAAW,EAAE,eAAO,CAAC,KAAK;YAC1B,MAAM,EAAE,OAAO;YACf,UAAU,EAAE;gBACV,UAAU,EAAE;oBACV,IAAI,EAAE,0BAA0B;oBAChC,MAAM,EAAE,IAAI,EAAE,8BAA8B;iBAC7C;aACF;YACD,YAAY,EAAE;gBACZ,WAAW,EAAE,aAAK,CAAC,aAAa;gBAChC,UAAU,EAAE,UAAU;gBACtB,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,iBAAiB;gBACxB,MAAM,EAAE,IAAI,EAAE,8BAA8B;aAC7C;SACF;QACD,qDAAqD;QACrD;YACE,WAAW,EAAE,eAAO,CAAC,OAAO;YAC5B,MAAM,EAAE,iBAAiB;YACzB,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,kBAAkB;oBACxB,MAAM,EAAE,KAAK,EAAE,yDAAyD;iBACzE;aACF;YACD,YAAY,EAAE;gBACZ,WAAW,EAAE,aAAK,CAAC,aAAa;gBAChC,UAAU,EAAE,qBAAqB;gBACjC,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,YAAY,EAAE,qCAAqC;gBAC1D,MAAM,EAAE,KAAK,EAAE,2BAA2B;aAC3C;SACF;KACF;CACF,CAAA"}
@@ -1,3 +1,86 @@
1
1
  import { ModuleJoinerConfig } from "@aiminaabeejs/framework/types";
2
+ /**
3
+ * StoreProduct Link Module
4
+ *
5
+ * Defines a ONE-TO-MANY relationship between Store and Product:
6
+ * - One Store can have many Products (Store → Products: isList: true)
7
+ * - One Product belongs to one Store (Product → Store: isList: false)
8
+ *
9
+ * This allows products to be associated with a single store while enabling
10
+ * stores to manage multiple products.
11
+ */
2
12
  export declare const StoreProduct: ModuleJoinerConfig;
13
+ /**
14
+ * HOW TO QUERY: Getting all products for a specific store
15
+ *
16
+ * Option 1: Query Store and expand products (Recommended - uses virtual field)
17
+ * This leverages the "products" virtual field created by the extends configuration above
18
+ *
19
+ * @example
20
+ * const queryObject = remoteQueryObjectFromString({
21
+ * entryPoint: "store",
22
+ * variables: {
23
+ * filters: { id: storeId }, // Filter by store ID
24
+ * },
25
+ * fields: [
26
+ * "id",
27
+ * "products.id",
28
+ * "products.title",
29
+ * "products.handle",
30
+ * "products.description",
31
+ * // ... any other product fields you need
32
+ * ],
33
+ * })
34
+ *
35
+ * const { rows: stores, metadata } = await remoteQuery(queryObject)
36
+ * const products = stores[0]?.products || [] // products is an array of all products belonging to that store
37
+ *
38
+ *
39
+ * Option 2: Query via store_product link module directly
40
+ * Query the link table and expand the product relationship
41
+ *
42
+ * @example
43
+ * const queryObject = remoteQueryObjectFromString({
44
+ * entryPoint: "store_product", // Query the link module
45
+ * variables: {
46
+ * filters: {
47
+ * store_id: storeId, // Filter link table by store_id
48
+ * },
49
+ * ...paginationConfig, // skip, take if needed
50
+ * },
51
+ * fields: [
52
+ * "id",
53
+ * "product.id",
54
+ * "product.title",
55
+ * "product.handle",
56
+ * "product.description",
57
+ * // ... any other product fields
58
+ * ],
59
+ * })
60
+ *
61
+ * const { rows: storeProducts, metadata } = await remoteQuery(queryObject)
62
+ * const products = storeProducts.map(sp => sp.product) // Extract products from link results
63
+ *
64
+ *
65
+ * HOW TO QUERY: Getting the store for a specific product
66
+ *
67
+ * @example
68
+ * const queryObject = remoteQueryObjectFromString({
69
+ * entryPoint: "product",
70
+ * variables: {
71
+ * filters: { id: productId }, // Filter by product ID
72
+ * },
73
+ * fields: [
74
+ * "id",
75
+ * "title",
76
+ * "store.id", // Expand store relationship (singular, not "stores")
77
+ * "store.name",
78
+ * "store.code",
79
+ * // ... any other store fields
80
+ * ],
81
+ * })
82
+ *
83
+ * const { rows: products } = await remoteQuery(queryObject)
84
+ * const store = products[0]?.store // store is a single object (not an array) since isList: false
85
+ */
3
86
  //# sourceMappingURL=store-product.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"store-product.d.ts","sourceRoot":"","sources":["../../src/definitions/store-product.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAGlE,eAAO,MAAM,YAAY,EAAE,kBA4E1B,CAAA"}
1
+ {"version":3,"file":"store-product.d.ts","sourceRoot":"","sources":["../../src/definitions/store-product.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAGlE;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,EAAE,kBAgF1B,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG"}
@@ -2,6 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StoreProduct = void 0;
4
4
  const utils_1 = require("@aiminaabeejs/framework/utils");
5
+ /**
6
+ * StoreProduct Link Module
7
+ *
8
+ * Defines a ONE-TO-MANY relationship between Store and Product:
9
+ * - One Store can have many Products (Store → Products: isList: true)
10
+ * - One Product belongs to one Store (Product → Store: isList: false)
11
+ *
12
+ * This allows products to be associated with a single store while enabling
13
+ * stores to manage multiple products.
14
+ */
5
15
  exports.StoreProduct = {
6
16
  serviceName: utils_1.LINKS.StoreProduct,
7
17
  isLink: true,
@@ -43,13 +53,15 @@ exports.StoreProduct = {
43
53
  },
44
54
  ],
45
55
  extends: [
56
+ // ONE-TO-MANY: Store has many Products
57
+ // isList: true indicates this is the "many" side of the relationship
46
58
  {
47
59
  serviceName: utils_1.Modules.STORE,
48
60
  entity: "Store",
49
61
  fieldAlias: {
50
62
  products: {
51
63
  path: "products_link.product",
52
- isList: true,
64
+ isList: true, // ONE Store → MANY Products
53
65
  },
54
66
  },
55
67
  relationship: {
@@ -57,26 +69,101 @@ exports.StoreProduct = {
57
69
  primaryKey: "store_id",
58
70
  foreignKey: "id",
59
71
  alias: "products_link",
60
- isList: true,
72
+ isList: true, // ONE Store → MANY Products
61
73
  },
62
74
  },
75
+ // ONE-TO-MANY: Product belongs to one Store
76
+ // isList: false indicates this is the "one" side of the relationship
63
77
  {
64
78
  serviceName: utils_1.Modules.PRODUCT,
65
79
  entity: "Product",
66
80
  fieldAlias: {
67
- stores: {
68
- path: "stores_link.store",
69
- isList: true,
81
+ store: {
82
+ path: "store_link.store",
83
+ isList: false, // ONE Product → ONE Store (singular field name "store")
70
84
  },
71
85
  },
72
86
  relationship: {
73
87
  serviceName: utils_1.LINKS.StoreProduct,
74
88
  primaryKey: "product_id",
75
89
  foreignKey: "id",
76
- alias: "stores_link",
77
- isList: true,
90
+ alias: "store_link", // Singular alias (not "stores_link")
91
+ isList: false, // ONE Product → ONE Store
78
92
  },
79
93
  },
80
94
  ],
81
95
  };
96
+ /**
97
+ * HOW TO QUERY: Getting all products for a specific store
98
+ *
99
+ * Option 1: Query Store and expand products (Recommended - uses virtual field)
100
+ * This leverages the "products" virtual field created by the extends configuration above
101
+ *
102
+ * @example
103
+ * const queryObject = remoteQueryObjectFromString({
104
+ * entryPoint: "store",
105
+ * variables: {
106
+ * filters: { id: storeId }, // Filter by store ID
107
+ * },
108
+ * fields: [
109
+ * "id",
110
+ * "products.id",
111
+ * "products.title",
112
+ * "products.handle",
113
+ * "products.description",
114
+ * // ... any other product fields you need
115
+ * ],
116
+ * })
117
+ *
118
+ * const { rows: stores, metadata } = await remoteQuery(queryObject)
119
+ * const products = stores[0]?.products || [] // products is an array of all products belonging to that store
120
+ *
121
+ *
122
+ * Option 2: Query via store_product link module directly
123
+ * Query the link table and expand the product relationship
124
+ *
125
+ * @example
126
+ * const queryObject = remoteQueryObjectFromString({
127
+ * entryPoint: "store_product", // Query the link module
128
+ * variables: {
129
+ * filters: {
130
+ * store_id: storeId, // Filter link table by store_id
131
+ * },
132
+ * ...paginationConfig, // skip, take if needed
133
+ * },
134
+ * fields: [
135
+ * "id",
136
+ * "product.id",
137
+ * "product.title",
138
+ * "product.handle",
139
+ * "product.description",
140
+ * // ... any other product fields
141
+ * ],
142
+ * })
143
+ *
144
+ * const { rows: storeProducts, metadata } = await remoteQuery(queryObject)
145
+ * const products = storeProducts.map(sp => sp.product) // Extract products from link results
146
+ *
147
+ *
148
+ * HOW TO QUERY: Getting the store for a specific product
149
+ *
150
+ * @example
151
+ * const queryObject = remoteQueryObjectFromString({
152
+ * entryPoint: "product",
153
+ * variables: {
154
+ * filters: { id: productId }, // Filter by product ID
155
+ * },
156
+ * fields: [
157
+ * "id",
158
+ * "title",
159
+ * "store.id", // Expand store relationship (singular, not "stores")
160
+ * "store.name",
161
+ * "store.code",
162
+ * // ... any other store fields
163
+ * ],
164
+ * })
165
+ *
166
+ * const { rows: products } = await remoteQuery(queryObject)
167
+ * const store = products[0]?.store // store is a single object (not an array) since isList: false
168
+ */
82
169
  //# sourceMappingURL=store-product.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"store-product.js","sourceRoot":"","sources":["../../src/definitions/store-product.ts"],"names":[],"mappings":";;;AACA,yDAA8D;AAEjD,QAAA,YAAY,GAAuB;IAC9C,WAAW,EAAE,aAAK,CAAC,YAAY;IAC/B,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE;QACd,SAAS,EAAE,eAAe;QAC1B,QAAQ,EAAE,SAAS;KACpB;IACD,KAAK,EAAE;QACL;YACE,IAAI,EAAE,eAAe;SACtB;QACD;YACE,IAAI,EAAE,gBAAgB;SACvB;KACF;IACD,WAAW,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,YAAY,CAAC;IAC7C,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,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;KACF;IACD,OAAO,EAAE;QACP;YACE,WAAW,EAAE,eAAO,CAAC,KAAK;YAC1B,MAAM,EAAE,OAAO;YACf,UAAU,EAAE;gBACV,QAAQ,EAAE;oBACR,IAAI,EAAE,uBAAuB;oBAC7B,MAAM,EAAE,IAAI;iBACb;aACF;YACD,YAAY,EAAE;gBACZ,WAAW,EAAE,aAAK,CAAC,YAAY;gBAC/B,UAAU,EAAE,UAAU;gBACtB,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,eAAe;gBACtB,MAAM,EAAE,IAAI;aACb;SACF;QACD;YACE,WAAW,EAAE,eAAO,CAAC,OAAO;YAC5B,MAAM,EAAE,SAAS;YACjB,UAAU,EAAE;gBACV,MAAM,EAAE;oBACN,IAAI,EAAE,mBAAmB;oBACzB,MAAM,EAAE,IAAI;iBACb;aACF;YACD,YAAY,EAAE;gBACZ,WAAW,EAAE,aAAK,CAAC,YAAY;gBAC/B,UAAU,EAAE,YAAY;gBACxB,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,aAAa;gBACpB,MAAM,EAAE,IAAI;aACb;SACF;KACF;CACF,CAAA"}
1
+ {"version":3,"file":"store-product.js","sourceRoot":"","sources":["../../src/definitions/store-product.ts"],"names":[],"mappings":";;;AACA,yDAA8D;AAE9D;;;;;;;;;GASG;AACU,QAAA,YAAY,GAAuB;IAC9C,WAAW,EAAE,aAAK,CAAC,YAAY;IAC/B,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE;QACd,SAAS,EAAE,eAAe;QAC1B,QAAQ,EAAE,SAAS;KACpB;IACD,KAAK,EAAE;QACL;YACE,IAAI,EAAE,eAAe;SACtB;QACD;YACE,IAAI,EAAE,gBAAgB;SACvB;KACF;IACD,WAAW,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,YAAY,CAAC;IAC7C,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;Y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-43,14 +43,14 @@ exports.StoreRegion = {
43
43
  },
44
44
  ],
45
45
  extends: [
46
- // This creates the "regions" relationship on Store
46
+ // ONE-TO-MANY: Store has many Regions
47
47
  {
48
- serviceName: utils_1.Modules.STORE, // Fixed: Use Modules.STORE
48
+ serviceName: utils_1.Modules.STORE,
49
49
  entity: "Store",
50
50
  fieldAlias: {
51
51
  regions: {
52
52
  path: "regions_link.region",
53
- isList: true,
53
+ isList: true, // ONE Store → MANY Regions
54
54
  },
55
55
  },
56
56
  relationship: {
@@ -61,22 +61,22 @@ exports.StoreRegion = {
61
61
  isList: true,
62
62
  },
63
63
  },
64
- // THIS is what creates the "stores" relationship on Region
64
+ // ONE-TO-MANY: Region belongs to exactly one Store
65
65
  {
66
66
  serviceName: utils_1.Modules.REGION,
67
67
  entity: "Region",
68
68
  fieldAlias: {
69
- stores: {
70
- path: "stores_link.store",
71
- isList: true,
69
+ store: {
70
+ path: "store_link.store",
71
+ isList: false, // ONE Region → ONE Store (singular field name "store")
72
72
  },
73
73
  },
74
74
  relationship: {
75
75
  serviceName: utils_1.LINKS.StoreRegion,
76
76
  primaryKey: "region_id",
77
77
  foreignKey: "id",
78
- alias: "stores_link",
79
- isList: true,
78
+ alias: "store_link", // Singular alias (not "stores_link")
79
+ isList: false, // ONE Region → ONE Store
80
80
  },
81
81
  },
82
82
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"store-region.js","sourceRoot":"","sources":["../../src/definitions/store-region.ts"],"names":[],"mappings":";;;AACA,yDAA8D;AAEjD,QAAA,WAAW,GAAuB;IAC7C,WAAW,EAAE,aAAK,CAAC,WAAW;IAC9B,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE;QACd,SAAS,EAAE,cAAc;QACzB,QAAQ,EAAE,OAAO;KAClB;IACD,KAAK,EAAE;QACL;YACE,IAAI,EAAE,cAAc;SACrB;QACD;YACE,IAAI,EAAE,eAAe;SACtB;KACF;IACD,WAAW,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE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file":"store-region.js","sourceRoot":"","sources":["../../src/definitions/store-region.ts"],"names":[],"mappings":";;;AACA,yDAA8D;AAEjD,QAAA,WAAW,GAAuB;IAC7C,WAAW,EAAE,aAAK,CAAC,WAAW;IAC9B,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE;QACd,SAAS,EAAE,cAAc;QACzB,QAAQ,EAAE,OAAO;KAClB;IACD,KAAK,EAAE;QACL;YACE,IAAI,EAAE,cAAc;SACrB;QACD;YACE,IAAI,EAAE,eAAe;SACtB;KACF;IACD,WAAW,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,WAAW,CAAC;IAC5C,aAAa,EAAE;QACb;YACE,WAAW,EAAE,eAAO,CAAC,KAAK,EAAE,8CAA8C;YAC1E,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,MAAM;YAC3B,MAAM,EAAE,QAAQ;YAChB,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,WAAW;YACvB,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE;gBACJ,YAAY,EAAE,SAAS;aACxB;YACD,OAAO,EAAE,IAAI;SACd;KACF;IACD,OAAO,EAAE;QACP,sCAAsC;QACtC;YACE,WAAW,EAAE,eAAO,CAAC,KAAK;YAC1B,MAAM,EAAE,OAAO;YACf,UAAU,EAAE;gBACV,OAAO,EAAE;oBACP,IAAI,EAAE,qBAAqB;oBAC3B,MAAM,EAAE,IAAI,EAAE,2BAA2B;iBAC1C;aACF;YACD,YAAY,EAAE;gBACZ,WAAW,EAAE,aAAK,CAAC,WAAW;gBAC9B,UAAU,EAAE,UAAU;gBACtB,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,cAAc;gBACrB,MAAM,EAAE,IAAI;aACb;SACF;QACD,mDAAmD;QACnD;YACE,WAAW,EAAE,eAAO,CAAC,MAAM;YAC3B,MAAM,EAAE,QAAQ;YAChB,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,kBAAkB;oBACxB,MAAM,EAAE,KAAK,EAAE,uDAAuD;iBACvE;aACF;YACD,YAAY,EAAE;gBACZ,WAAW,EAAE,aAAK,CAAC,WAAW;gBAC9B,UAAU,EAAE,WAAW;gBACvB,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,YAAY,EAAE,qCAAqC;gBAC1D,MAAM,EAAE,KAAK,EAAE,yBAAyB;aACzC;SACF;KACF;CACF,CAAA"}
@@ -1,3 +1,13 @@
1
1
  import { ModuleJoinerConfig } from "@aiminaabeejs/framework/types";
2
+ /**
3
+ * StoreSalesChannel Link Module
4
+ *
5
+ * Defines a ONE-TO-MANY relationship between Store and SalesChannel:
6
+ * - One Store can have many SalesChannels (Store → SalesChannels: isList: true)
7
+ * - One SalesChannel belongs to exactly one Store (SalesChannel → Store: isList: false)
8
+ *
9
+ * This enforces that each store has its own unique set of sales channels.
10
+ * Sales channels are NOT shared across stores - each sales channel belongs to exactly one store.
11
+ */
2
12
  export declare const StoreSalesChannel: ModuleJoinerConfig;
3
13
  //# sourceMappingURL=store-sales-channel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"store-sales-channel.d.ts","sourceRoot":"","sources":["../../src/definitions/store-sales-channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAGlE,eAAO,MAAM,iBAAiB,EAAE,kBA4E/B,CAAA"}
1
+ {"version":3,"file":"store-sales-channel.d.ts","sourceRoot":"","sources":["../../src/definitions/store-sales-channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAGlE;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,EAAE,kBA8E/B,CAAA"}
@@ -2,6 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StoreSalesChannel = void 0;
4
4
  const utils_1 = require("@aiminaabeejs/framework/utils");
5
+ /**
6
+ * StoreSalesChannel Link Module
7
+ *
8
+ * Defines a ONE-TO-MANY relationship between Store and SalesChannel:
9
+ * - One Store can have many SalesChannels (Store → SalesChannels: isList: true)
10
+ * - One SalesChannel belongs to exactly one Store (SalesChannel → Store: isList: false)
11
+ *
12
+ * This enforces that each store has its own unique set of sales channels.
13
+ * Sales channels are NOT shared across stores - each sales channel belongs to exactly one store.
14
+ */
5
15
  exports.StoreSalesChannel = {
6
16
  serviceName: utils_1.LINKS.StoreSalesChannel,
7
17
  isLink: true,
@@ -43,13 +53,14 @@ exports.StoreSalesChannel = {
43
53
  },
44
54
  ],
45
55
  extends: [
56
+ // ONE-TO-MANY: Store has many SalesChannels
46
57
  {
47
58
  serviceName: utils_1.Modules.STORE,
48
59
  entity: "Store",
49
60
  fieldAlias: {
50
61
  sales_channels: {
51
62
  path: "sales_channels_link.sales_channel",
52
- isList: true,
63
+ isList: true, // ONE Store → MANY SalesChannels
53
64
  },
54
65
  },
55
66
  relationship: {
@@ -57,24 +68,25 @@ exports.StoreSalesChannel = {
57
68
  primaryKey: "store_id",
58
69
  foreignKey: "id",
59
70
  alias: "sales_channels_link",
60
- isList: true,
71
+ isList: true, // ONE Store → MANY SalesChannels
61
72
  },
62
73
  },
74
+ // ONE-TO-MANY: SalesChannel belongs to exactly one Store
63
75
  {
64
76
  serviceName: utils_1.Modules.SALES_CHANNEL,
65
77
  entity: "SalesChannel",
66
78
  fieldAlias: {
67
- stores: {
68
- path: "stores_link.store",
69
- isList: true,
79
+ store: {
80
+ path: "store_link.store",
81
+ isList: false, // ✅ FIXED: ONE SalesChannel → ONE Store (singular field name "store")
70
82
  },
71
83
  },
72
84
  relationship: {
73
85
  serviceName: utils_1.LINKS.StoreSalesChannel,
74
86
  primaryKey: "sales_channel_id",
75
87
  foreignKey: "id",
76
- alias: "stores_link",
77
- isList: true,
88
+ alias: "store_link", // ✅ FIXED: Singular alias (not "stores_link")
89
+ isList: false, // ✅ FIXED: ONE SalesChannel → ONE Store
78
90
  },
79
91
  },
80
92
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"store-sales-channel.js","sourceRoot":"","sources":["../../src/definitions/store-sales-channel.ts"],"names":[],"mappings":";;;AACA,yDAA8D;AAEjD,QAAA,iBAAiB,GAAuB;IACnD,WAAW,EAAE,aAAK,CAAC,iBAAiB;IACpC,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE;QACd,SAAS,EAAE,qBAAqB;QAChC,QAAQ,EAAE,OAAO;KAClB;IACD,KAAK,EAAE;QACL;YACE,IAAI,EAAE,qBAAqB;SAC5B;QACD;YACE,IAAI,EAAE,sBAAsB;SAC7B;KACF;IACD,WAAW,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,kBAAkB,CAAC;IACnD,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,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,KAAK;YAC1B,MAAM,EAAE,OAAO;YACf,UAAU,EAAE;gBACV,cAAc,EAAE;oBACd,IAAI,EAAE,mCAAmC;oBACzC,MAAM,EAAE,IAAI;iBACb;aACF;YACD,YAAY,EAAE;gBACZ,WAAW,EAAE,aAAK,CAAC,iBAAiB;gBACpC,UAAU,EAAE,UAAU;gBACtB,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,UAAU,EAAE;gBACV,MAAM,EAAE;oBACN,IAAI,EAAE,mBAAmB;oBACzB,MAAM,EAAE,IAAI;iBACb;aACF;YACD,YAAY,EAAE;gBACZ,WAAW,EAAE,aAAK,CAAC,iBAAiB;gBACpC,UAAU,EAAE,kBAAkB;gBAC9B,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,aAAa;gBACpB,MAAM,EAAE,IAAI;aACb;SACF;KACF;CACF,CAAA"}
1
+ {"version":3,"file":"store-sales-channel.js","sourceRoot":"","sources":["../../src/definitions/store-sales-channel.ts"],"names":[],"mappings":";;;AACA,yDAA8D;AAE9D;;;;;;;;;GASG;AACU,QAAA,iBAAiB,GAAuB;IACnD,WAAW,EAAE,aAAK,CAAC,iBAAiB;IACpC,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE;QACd,SAAS,EAAE,qBAAqB;QAChC,QAAQ,EAAE,OAAO;KAClB;IACD,KAAK,EAAE;QACL;YACE,IAAI,EAAE,qBAAqB;SAC5B;QACD;YACE,IAAI,EAAE,sBAAsB;SAC7B;KACF;IACD,WAAW,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,kBAAkB,CAAC;IACnD,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,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,4CAA4C;QAC5C;YACE,WAAW,EAAE,eAAO,CAAC,KAAK;YAC1B,MAAM,EAAE,OAAO;YACf,UAAU,EAAE;gBACV,cAAc,EAAE;oBACd,IAAI,EAAE,mCAAmC;oBACzC,MAAM,EAAE,IAAI,EAAE,iCAAiC;iBAChD;aACF;YACD,YAAY,EAAE;gBACZ,WAAW,EAAE,aAAK,CAAC,iBAAiB;gBACpC,UAAU,EAAE,UAAU;gBACtB,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,qBAAqB;gBAC5B,MAAM,EAAE,IAAI,EAAE,iCAAiC;aAChD;SACF;QACD,yDAAyD;QACzD;YACE,WAAW,EAAE,eAAO,CAAC,aAAa;YAClC,MAAM,EAAE,cAAc;YACtB,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,kBAAkB;oBACxB,MAAM,EAAE,KAAK,EAAE,sEAAsE;iBACtF;aACF;YACD,YAAY,EAAE;gBACZ,WAAW,EAAE,aAAK,CAAC,iBAAiB;gBACpC,UAAU,EAAE,kBAAkB;gBAC9B,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,YAAY,EAAE,8CAA8C;gBACnE,MAAM,EAAE,KAAK,EAAE,wCAAwC;aACxD;SACF;KACF;CACF,CAAA"}
@@ -0,0 +1,88 @@
1
+ import { ModuleJoinerConfig } from "@aiminaabeejs/framework/types";
2
+ /**
3
+ * StoreUser Link Module
4
+ *
5
+ * Defines a ONE-TO-MANY relationship between Store and User:
6
+ * - One Store can have many Users (Store → Users: isList: true)
7
+ * - One User belongs to exactly one Store (User → Store: isList: false)
8
+ *
9
+ * This enforces that each store has its own unique set of users.
10
+ * Users are NOT shared across stores - each user belongs to exactly one store.
11
+ */
12
+ export declare const StoreUser: ModuleJoinerConfig;
13
+ /**
14
+ * HOW TO QUERY: Getting all users for a specific store
15
+ *
16
+ * Option 1: Query Store and expand users (Recommended - uses virtual field)
17
+ * This leverages the "users" virtual field created by the extends configuration above
18
+ *
19
+ * @example
20
+ * const queryObject = remoteQueryObjectFromString({
21
+ * entryPoint: "store",
22
+ * variables: {
23
+ * filters: { id: storeId }, // Filter by store ID
24
+ * },
25
+ * fields: [
26
+ * "id",
27
+ * "users.id",
28
+ * "users.email",
29
+ * "users.first_name",
30
+ * "users.last_name",
31
+ * "users.avatar_url",
32
+ * // ... any other user fields you need
33
+ * ],
34
+ * })
35
+ *
36
+ * const { rows: stores, metadata } = await remoteQuery(queryObject)
37
+ * const users = stores[0]?.users || [] // users is an array of all users belonging to that store
38
+ *
39
+ *
40
+ * Option 2: Query via store_user link module directly
41
+ * Query the link table and expand the user relationship
42
+ *
43
+ * @example
44
+ * const queryObject = remoteQueryObjectFromString({
45
+ * entryPoint: "store_user", // Query the link module
46
+ * variables: {
47
+ * filters: {
48
+ * store_id: storeId, // Filter link table by store_id
49
+ * },
50
+ * ...paginationConfig, // skip, take if needed
51
+ * },
52
+ * fields: [
53
+ * "id",
54
+ * "user.id",
55
+ * "user.email",
56
+ * "user.first_name",
57
+ * "user.last_name",
58
+ * "user.avatar_url",
59
+ * // ... any other user fields
60
+ * ],
61
+ * })
62
+ *
63
+ * const { rows: storeUsers, metadata } = await remoteQuery(queryObject)
64
+ * const users = storeUsers.map(su => su.user) // Extract users from link results
65
+ *
66
+ *
67
+ * HOW TO QUERY: Getting the store for a specific user
68
+ *
69
+ * @example
70
+ * const queryObject = remoteQueryObjectFromString({
71
+ * entryPoint: "user",
72
+ * variables: {
73
+ * filters: { id: userId }, // Filter by user ID
74
+ * },
75
+ * fields: [
76
+ * "id",
77
+ * "email",
78
+ * "store.id", // Expand store relationship (singular, not "stores")
79
+ * "store.name",
80
+ * "store.handle",
81
+ * // ... any other store fields
82
+ * ],
83
+ * })
84
+ *
85
+ * const { rows: users } = await remoteQuery(queryObject)
86
+ * const store = users[0]?.store // store is a single object (not an array) since isList: false
87
+ */
88
+ //# sourceMappingURL=store-user.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store-user.d.ts","sourceRoot":"","sources":["../../src/definitions/store-user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAGlE;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,EAAE,kBAgFvB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG"}
@@ -0,0 +1,171 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StoreUser = void 0;
4
+ const utils_1 = require("@aiminaabeejs/framework/utils");
5
+ /**
6
+ * StoreUser Link Module
7
+ *
8
+ * Defines a ONE-TO-MANY relationship between Store and User:
9
+ * - One Store can have many Users (Store → Users: isList: true)
10
+ * - One User belongs to exactly one Store (User → Store: isList: false)
11
+ *
12
+ * This enforces that each store has its own unique set of users.
13
+ * Users are NOT shared across stores - each user belongs to exactly one store.
14
+ */
15
+ exports.StoreUser = {
16
+ serviceName: utils_1.LINKS.StoreUser,
17
+ isLink: true,
18
+ databaseConfig: {
19
+ tableName: "store_user",
20
+ idPrefix: "strusr",
21
+ },
22
+ alias: [
23
+ {
24
+ name: "store_user",
25
+ },
26
+ {
27
+ name: "store_users",
28
+ },
29
+ ],
30
+ primaryKeys: ["id", "store_id", "user_id"],
31
+ relationships: [
32
+ {
33
+ serviceName: utils_1.Modules.STORE,
34
+ entity: "Store",
35
+ primaryKey: "id",
36
+ foreignKey: "store_id",
37
+ alias: "store",
38
+ args: {
39
+ methodSuffix: "Stores",
40
+ },
41
+ hasMany: true,
42
+ },
43
+ {
44
+ serviceName: utils_1.Modules.USER,
45
+ entity: "User",
46
+ primaryKey: "id",
47
+ foreignKey: "user_id",
48
+ alias: "user",
49
+ args: {
50
+ methodSuffix: "Users",
51
+ },
52
+ hasMany: true,
53
+ },
54
+ ],
55
+ extends: [
56
+ // ONE-TO-MANY: Store has many Users
57
+ // isList: true indicates this is the "many" side of the relationship
58
+ {
59
+ serviceName: utils_1.Modules.STORE,
60
+ entity: "Store",
61
+ fieldAlias: {
62
+ users: {
63
+ path: "users_link.user",
64
+ isList: true, // ONE Store → MANY Users
65
+ },
66
+ },
67
+ relationship: {
68
+ serviceName: utils_1.LINKS.StoreUser,
69
+ primaryKey: "store_id",
70
+ foreignKey: "id",
71
+ alias: "users_link",
72
+ isList: true, // ONE Store → MANY Users
73
+ },
74
+ },
75
+ // ONE-TO-MANY: User belongs to exactly one Store
76
+ // isList: false indicates this is the "one" side of the relationship
77
+ {
78
+ serviceName: utils_1.Modules.USER,
79
+ entity: "User",
80
+ fieldAlias: {
81
+ store: {
82
+ path: "store_link.store",
83
+ isList: false, // ONE User → ONE Store (singular field name "store")
84
+ },
85
+ },
86
+ relationship: {
87
+ serviceName: utils_1.LINKS.StoreUser,
88
+ primaryKey: "user_id",
89
+ foreignKey: "id",
90
+ alias: "store_link", // Singular alias (not "stores_link")
91
+ isList: false, // ONE User → ONE Store
92
+ },
93
+ },
94
+ ],
95
+ };
96
+ /**
97
+ * HOW TO QUERY: Getting all users for a specific store
98
+ *
99
+ * Option 1: Query Store and expand users (Recommended - uses virtual field)
100
+ * This leverages the "users" virtual field created by the extends configuration above
101
+ *
102
+ * @example
103
+ * const queryObject = remoteQueryObjectFromString({
104
+ * entryPoint: "store",
105
+ * variables: {
106
+ * filters: { id: storeId }, // Filter by store ID
107
+ * },
108
+ * fields: [
109
+ * "id",
110
+ * "users.id",
111
+ * "users.email",
112
+ * "users.first_name",
113
+ * "users.last_name",
114
+ * "users.avatar_url",
115
+ * // ... any other user fields you need
116
+ * ],
117
+ * })
118
+ *
119
+ * const { rows: stores, metadata } = await remoteQuery(queryObject)
120
+ * const users = stores[0]?.users || [] // users is an array of all users belonging to that store
121
+ *
122
+ *
123
+ * Option 2: Query via store_user link module directly
124
+ * Query the link table and expand the user relationship
125
+ *
126
+ * @example
127
+ * const queryObject = remoteQueryObjectFromString({
128
+ * entryPoint: "store_user", // Query the link module
129
+ * variables: {
130
+ * filters: {
131
+ * store_id: storeId, // Filter link table by store_id
132
+ * },
133
+ * ...paginationConfig, // skip, take if needed
134
+ * },
135
+ * fields: [
136
+ * "id",
137
+ * "user.id",
138
+ * "user.email",
139
+ * "user.first_name",
140
+ * "user.last_name",
141
+ * "user.avatar_url",
142
+ * // ... any other user fields
143
+ * ],
144
+ * })
145
+ *
146
+ * const { rows: storeUsers, metadata } = await remoteQuery(queryObject)
147
+ * const users = storeUsers.map(su => su.user) // Extract users from link results
148
+ *
149
+ *
150
+ * HOW TO QUERY: Getting the store for a specific user
151
+ *
152
+ * @example
153
+ * const queryObject = remoteQueryObjectFromString({
154
+ * entryPoint: "user",
155
+ * variables: {
156
+ * filters: { id: userId }, // Filter by user ID
157
+ * },
158
+ * fields: [
159
+ * "id",
160
+ * "email",
161
+ * "store.id", // Expand store relationship (singular, not "stores")
162
+ * "store.name",
163
+ * "store.handle",
164
+ * // ... any other store fields
165
+ * ],
166
+ * })
167
+ *
168
+ * const { rows: users } = await remoteQuery(queryObject)
169
+ * const store = users[0]?.store // store is a single object (not an array) since isList: false
170
+ */
171
+ //# sourceMappingURL=store-user.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store-user.js","sourceRoot":"","sources":["../../src/definitions/store-user.ts"],"names":[],"mappings":";;;AACA,yDAA8D;AAE9D;;;;;;;;;GASG;AACU,QAAA,SAAS,GAAuB;IAC3C,WAAW,EAAE,aAAK,CAAC,SAAS;IAC5B,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE;QACd,SAAS,EAAE,YAAY;QACvB,QAAQ,EAAE,QAAQ;KACnB;IACD,KAAK,EAAE;QACL;YACE,IAAI,EAAE,YAAY;SACnB;Q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AS;gBACrB,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,YAAY,EAAE,qCAAqC;gBAC1D,MAAM,EAAE,KAAK,EAAE,uBAAuB;aACvC;SACF;KACF;CACF,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG"}
@@ -1 +1 @@
1
- {"root":["../src/index.ts","../src/definitions/cart-payment-collection.ts","../src/definitions/cart-promotion.ts","../src/definitions/customer-account-holder.ts","../src/definitions/fulfillment-provider-location.ts","../src/definitions/fulfillment-set-location.ts","../src/definitions/index.ts","../src/definitions/order-cart.ts","../src/definitions/order-fulfillment.ts","../src/definitions/order-payment-collection.ts","../src/definitions/order-promotion.ts","../src/definitions/order-return-fulfillment.ts","../src/definitions/product-collection.ts","../src/definitions/product-sales-channel.ts","../src/definitions/product-shipping-profile.ts","../src/definitions/product-variant-inventory-item.ts","../src/definitions/product-variant-price-set.ts","../src/definitions/publishable-api-key-sales-channel.ts","../src/definitions/region-payment-provider.ts","../src/definitions/sales-channel-location.ts","../src/definitions/shipping-option-price-set.ts","../src/definitions/store-api-key.ts","../src/definitions/store-category.ts","../src/definitions/store-collection.ts","../src/definitions/store-customer.ts","../src/definitions/store-inventory-level.ts","../src/definitions/store-product.ts","../src/definitions/store-region.ts","../src/definitions/store-sales-channel.ts","../src/definitions/store-shipping-profile.ts","../src/definitions/readonly/index.ts","../src/definitions/readonly/store-currency.ts","../src/initialize/index.ts","../src/initialize/module-definition.ts","../src/loaders/connection.ts","../src/loaders/container.ts","../src/loaders/index.ts","../src/migration/index.ts","../src/repositories/index.ts","../src/repositories/link.ts","../src/services/dynamic-service-class.ts","../src/services/index.ts","../src/services/link-module-service.ts","../src/services/link.ts","../src/types/index.ts","../src/utils/generate-entity.ts","../src/utils/generate-schema.ts","../src/utils/index.ts"],"version":"5.7.3"}
1
+ {"root":["../src/index.ts","../src/definitions/cart-payment-collection.ts","../src/definitions/cart-promotion.ts","../src/definitions/customer-account-holder.ts","../src/definitions/fulfillment-provider-location.ts","../src/definitions/fulfillment-set-location.ts","../src/definitions/index.ts","../src/definitions/order-cart.ts","../src/definitions/order-fulfillment.ts","../src/definitions/order-payment-collection.ts","../src/definitions/order-promotion.ts","../src/definitions/order-return-fulfillment.ts","../src/definitions/product-sales-channel.ts","../src/definitions/product-shipping-profile.ts","../src/definitions/product-variant-inventory-item.ts","../src/definitions/product-variant-price-set.ts","../src/definitions/publishable-api-key-sales-channel.ts","../src/definitions/region-payment-provider.ts","../src/definitions/sales-channel-location.ts","../src/definitions/shipping-option-price-set.ts","../src/definitions/store-api-key.ts","../src/definitions/store-category.ts","../src/definitions/store-customer.ts","../src/definitions/store-inventory-level.ts","../src/definitions/store-product.ts","../src/definitions/store-region.ts","../src/definitions/store-sales-channel.ts","../src/definitions/store-shipping-profile.ts","../src/definitions/store-user.ts","../src/definitions/readonly/index.ts","../src/definitions/readonly/store-currency.ts","../src/initialize/index.ts","../src/initialize/module-definition.ts","../src/loaders/connection.ts","../src/loaders/container.ts","../src/loaders/index.ts","../src/migration/index.ts","../src/repositories/index.ts","../src/repositories/link.ts","../src/services/dynamic-service-class.ts","../src/services/index.ts","../src/services/link-module-service.ts","../src/services/link.ts","../src/types/index.ts","../src/utils/generate-entity.ts","../src/utils/generate-schema.ts","../src/utils/index.ts"],"version":"5.7.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiminaabeejs/link-modules",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "Aiminaabeejs Default Link Modules Package and Definitions",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,3 +0,0 @@
1
- import { ModuleJoinerConfig } from "@aiminaabeejs/framework/types";
2
- export declare const ProductCollection: ModuleJoinerConfig;
3
- //# sourceMappingURL=product-collection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"product-collection.d.ts","sourceRoot":"","sources":["../../src/definitions/product-collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAGlE,eAAO,MAAM,iBAAiB,EAAE,kBA4E/B,CAAA"}
@@ -1,82 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProductCollection = void 0;
4
- const utils_1 = require("@aiminaabeejs/framework/utils");
5
- exports.ProductCollection = {
6
- serviceName: utils_1.LINKS.ProductCollection,
7
- isLink: true,
8
- databaseConfig: {
9
- tableName: "product_collection",
10
- idPrefix: "prcol",
11
- },
12
- alias: [
13
- {
14
- name: "product_collection",
15
- },
16
- {
17
- name: "product_collections",
18
- },
19
- ],
20
- primaryKeys: ["id", "product_id", "collection_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.COLLECTION,
35
- entity: "Collection",
36
- primaryKey: "id",
37
- foreignKey: "collection_id",
38
- alias: "collection",
39
- args: {
40
- methodSuffix: "Collections",
41
- },
42
- hasMany: true,
43
- },
44
- ],
45
- extends: [
46
- {
47
- serviceName: utils_1.Modules.PRODUCT,
48
- entity: "Product",
49
- fieldAlias: {
50
- collections: {
51
- path: "collections_link.collection",
52
- isList: true,
53
- },
54
- },
55
- relationship: {
56
- serviceName: utils_1.LINKS.ProductCollection,
57
- primaryKey: "product_id",
58
- foreignKey: "id",
59
- alias: "collections_link",
60
- isList: true,
61
- },
62
- },
63
- {
64
- serviceName: utils_1.Modules.COLLECTION,
65
- entity: "Collection",
66
- fieldAlias: {
67
- products: {
68
- path: "products_link.product",
69
- isList: true,
70
- },
71
- },
72
- relationship: {
73
- serviceName: utils_1.LINKS.ProductCollection,
74
- primaryKey: "collection_id",
75
- foreignKey: "id",
76
- alias: "products_link",
77
- isList: true,
78
- },
79
- },
80
- ],
81
- };
82
- //# sourceMappingURL=product-collection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"product-collection.js","sourceRoot":"","sources":["../../src/definitions/product-collection.ts"],"names":[],"mappings":";;;AACA,yDAA8D;AAEjD,QAAA,iBAAiB,GAAuB;IACnD,WAAW,EAAE,aAAK,CAAC,iBAAiB;IACpC,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE;QACd,SAAS,EAAE,oBAAoB;QAC/B,QAAQ,EAAE,OAAO;KAClB;IACD,KAAK,EAAE;QACL;YACE,IAAI,EAAE,oBAAoB;SAC3B;QACD;YACE,IAAI,EAAE,qBAAqB;SAC5B;KACF;IACD,WAAW,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,eAAe,CAAC;IAClD,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,UAAU;YAC/B,MAAM,EAAE,YAAY;YACpB,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,eAAe;YAC3B,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE;gBACJ,YAAY,EAAE,aAAa;aAC5B;YACD,OAAO,EAAE,IAAI;SACd;KACF;IACD,OAAO,EAAE;QACP;YACE,WAAW,EAAE,eAAO,CAAC,OAAO;YAC5B,MAAM,EAAE,SAAS;YACjB,UAAU,EAAE;gBACV,WAAW,EAAE;oBACX,IAAI,EAAE,6BAA6B;oBACnC,MAAM,EAAE,IAAI;iBACb;aACF;YACD,YAAY,EAAE;gBACZ,WAAW,EAAE,aAAK,CAAC,iBAAiB;gBACpC,UAAU,EAAE,YAAY;gBACxB,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,kBAAkB;gBACzB,MAAM,EAAE,IAAI;aACb;SACF;QACD;YACE,WAAW,EAAE,eAAO,CAAC,UAAU;YAC/B,MAAM,EAAE,YAAY;YACpB,UAAU,EAAE;gBACV,QAAQ,EAAE;oBACR,IAAI,EAAE,uBAAuB;oBAC7B,MAAM,EAAE,IAAI;iBACb;aACF;YACD,YAAY,EAAE;gBACZ,WAAW,EAAE,aAAK,CAAC,iBAAiB;gBACpC,UAAU,EAAE,eAAe;gBAC3B,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,eAAe;gBACtB,MAAM,EAAE,IAAI;aACb;SACF;KACF;CACF,CAAA"}
@@ -1,3 +0,0 @@
1
- import { ModuleJoinerConfig } from "@aiminaabeejs/framework/types";
2
- export declare const StoreCollection: ModuleJoinerConfig;
3
- //# sourceMappingURL=store-collection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store-collection.d.ts","sourceRoot":"","sources":["../../src/definitions/store-collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAGlE,eAAO,MAAM,eAAe,EAAE,kBA4E7B,CAAA"}
@@ -1,82 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StoreCollection = void 0;
4
- const utils_1 = require("@aiminaabeejs/framework/utils");
5
- exports.StoreCollection = {
6
- serviceName: utils_1.LINKS.StoreCollection,
7
- isLink: true,
8
- databaseConfig: {
9
- tableName: "store_collection",
10
- idPrefix: "stcol",
11
- },
12
- alias: [
13
- {
14
- name: "store_collection",
15
- },
16
- {
17
- name: "store_collections",
18
- },
19
- ],
20
- primaryKeys: ["id", "store_id", "collection_id"],
21
- relationships: [
22
- {
23
- serviceName: utils_1.Modules.STORE,
24
- entity: "Store",
25
- primaryKey: "id",
26
- foreignKey: "store_id",
27
- alias: "store",
28
- args: {
29
- methodSuffix: "Stores",
30
- },
31
- hasMany: true,
32
- },
33
- {
34
- serviceName: utils_1.Modules.COLLECTION,
35
- entity: "Collection",
36
- primaryKey: "id",
37
- foreignKey: "collection_id",
38
- alias: "collection",
39
- args: {
40
- methodSuffix: "Collections",
41
- },
42
- hasMany: true,
43
- },
44
- ],
45
- extends: [
46
- {
47
- serviceName: utils_1.Modules.STORE,
48
- entity: "Store",
49
- fieldAlias: {
50
- collections: {
51
- path: "collections_link.collection",
52
- isList: true,
53
- },
54
- },
55
- relationship: {
56
- serviceName: utils_1.LINKS.StoreCollection,
57
- primaryKey: "store_id",
58
- foreignKey: "id",
59
- alias: "collections_link",
60
- isList: true,
61
- },
62
- },
63
- {
64
- serviceName: utils_1.Modules.COLLECTION,
65
- entity: "Collection",
66
- fieldAlias: {
67
- stores: {
68
- path: "stores_link.store",
69
- isList: true,
70
- },
71
- },
72
- relationship: {
73
- serviceName: utils_1.LINKS.StoreCollection,
74
- primaryKey: "collection_id",
75
- foreignKey: "id",
76
- alias: "stores_link",
77
- isList: true,
78
- },
79
- },
80
- ],
81
- };
82
- //# sourceMappingURL=store-collection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store-collection.js","sourceRoot":"","sources":["../../src/definitions/store-collection.ts"],"names":[],"mappings":";;;AACA,yDAA8D;AAEjD,QAAA,eAAe,GAAuB;IACjD,WAAW,EAAE,aAAK,CAAC,eAAe;IAClC,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE;QACd,SAAS,EAAE,kBAAkB;QAC7B,QAAQ,EAAE,OAAO;KAClB;IACD,KAAK,EAAE;QACL;YACE,IAAI,EAAE,kBAAkB;SACzB;QACD;YACE,IAAI,EAAE,mBAAmB;SAC1B;KACF;IACD,WAAW,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,CAAC;IAChD,aAAa,EAAE;QACb;YACE,WAAW,EAAE,eAAO,CAAC,KAAK;YAC1B,MAAM,EAAE,OAAO;YACf,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,UAAU;YACtB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