@unchainedshop/core-products 5.0.0-alpha.7 → 5.0.0-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -63,9 +63,9 @@ export interface ProductCommerce {
63
63
  pricing: ProductPrice[];
64
64
  }
65
65
  export interface ProductTokenization {
66
- contractAddress: string;
66
+ contractAddress?: string;
67
67
  contractStandard: ProductContractStandard;
68
- tokenId: string;
68
+ tokenId?: string;
69
69
  supply: number;
70
70
  ercMetadataProperties?: Record<string, any>;
71
71
  }
@@ -1,6 +1,6 @@
1
1
  import { mongodb, type ModuleInput } from '@unchainedshop/mongodb';
2
2
  import { type SortOption, type Price } from '@unchainedshop/utils';
3
- import { type Product, type ProductAssignment, type ProductBundleItem, type ProductConfiguration, ProductStatus } from '../db/ProductsCollection.ts';
3
+ import { type Product, type ProductAssignment, type ProductBundleItem, type ProductConfiguration, ProductStatus, ProductType } from '../db/ProductsCollection.ts';
4
4
  import { type ProductsSettingsOptions } from '../products-settings.ts';
5
5
  export interface ProductQuery {
6
6
  queryString?: string;
@@ -11,6 +11,7 @@ export interface ProductQuery {
11
11
  slugs?: string[];
12
12
  tags?: string[];
13
13
  skus?: string[];
14
+ type?: ProductType;
14
15
  bundleItemProductIds?: string[];
15
16
  proxyAssignmentProductIds?: string[];
16
17
  }
@@ -22,7 +23,7 @@ export interface ProductDiscount {
22
23
  discountKey: string;
23
24
  context?: any;
24
25
  }
25
- export declare const buildFindSelector: ({ slugs, tags, includeDrafts, includeDeleted, productIds, productSelector, queryString, skus, bundleItemProductIds, proxyAssignmentProductIds, }: ProductQuery) => mongodb.Filter<Product>;
26
+ export declare const buildFindSelector: ({ slugs, tags, includeDrafts, includeDeleted, productIds, productSelector, queryString, skus, type, bundleItemProductIds, proxyAssignmentProductIds, }: ProductQuery) => mongodb.Filter<Product>;
26
27
  export declare const configureProductsModule: (moduleInput: ModuleInput<ProductsSettingsOptions>) => Promise<{
27
28
  findProduct: (params: {
28
29
  productId: string;
@@ -25,11 +25,14 @@ const InternalProductStatus = {
25
25
  DRAFT: null,
26
26
  };
27
27
  const isDraftStatus = (status) => status === ProductStatus.DRAFT || status === InternalProductStatus.DRAFT;
28
- export const buildFindSelector = ({ slugs, tags, includeDrafts = false, includeDeleted = false, productIds, productSelector, queryString, skus, bundleItemProductIds, proxyAssignmentProductIds, }) => {
28
+ export const buildFindSelector = ({ slugs, tags, includeDrafts = false, includeDeleted = false, productIds, productSelector, queryString, skus, type, bundleItemProductIds, proxyAssignmentProductIds, }) => {
29
29
  const selector = productSelector ? { ...productSelector } : {};
30
30
  if (productIds && !selector._id) {
31
31
  selector._id = { $in: productIds };
32
32
  }
33
+ if (type && !selector.type) {
34
+ selector.type = type;
35
+ }
33
36
  if (slugs && !selector.slugs) {
34
37
  selector.slugs = { $in: slugs };
35
38
  }
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "@unchainedshop/core-products",
3
3
  "description": "Product catalog management module for the Unchained Engine",
4
- "version": "5.0.0-alpha.7",
4
+ "version": "5.0.0-alpha.9",
5
+ "files": [
6
+ "lib"
7
+ ],
5
8
  "main": "lib/products-index.js",
6
9
  "types": "lib/products-index.d.ts",
7
10
  "type": "module",
@@ -35,10 +38,10 @@
35
38
  },
36
39
  "homepage": "https://github.com/unchainedshop/unchained#readme",
37
40
  "dependencies": {
38
- "@unchainedshop/events": "^5.0.0-alpha.7",
39
- "@unchainedshop/logger": "^5.0.0-alpha.7",
40
- "@unchainedshop/mongodb": "^5.0.0-alpha.7",
41
- "@unchainedshop/utils": "^5.0.0-alpha.7"
41
+ "@unchainedshop/events": "^5.0.0-alpha.9",
42
+ "@unchainedshop/logger": "^5.0.0-alpha.9",
43
+ "@unchainedshop/mongodb": "^5.0.0-alpha.9",
44
+ "@unchainedshop/utils": "^5.0.0-alpha.9"
42
45
  },
43
46
  "devDependencies": {
44
47
  "@types/node": "^26.2.0",