@unchainedshop/api 4.8.25 → 4.8.27

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 (51) hide show
  1. package/lib/errors.d.ts +1 -0
  2. package/lib/errors.js +1 -0
  3. package/lib/mcp/tools/assortment/schemas.d.ts +13 -13
  4. package/lib/mcp/tools/filter/schemas.d.ts +2 -2
  5. package/lib/mcp/tools/localization/schemas.d.ts +5 -5
  6. package/lib/mcp/tools/order/schemas.d.ts +7 -7
  7. package/lib/mcp/tools/product/schemas.d.ts +44 -44
  8. package/lib/mcp/tools/quotation/schemas.d.ts +2 -2
  9. package/lib/mcp/tools/system/handlers/allocateWork.js +2 -2
  10. package/lib/mcp/tools/system/schemas.d.ts +6 -6
  11. package/lib/mcp/tools/users/schemas.d.ts +10 -10
  12. package/lib/mcp/utils/sharedSchemas.d.ts +4 -4
  13. package/lib/middleware/createAuthMiddleware.js +2 -0
  14. package/lib/resolvers/mutations/accounts/logoutAllSessions.d.ts +3 -1
  15. package/lib/resolvers/mutations/accounts/logoutAllSessions.js +10 -4
  16. package/lib/resolvers/mutations/bulk/bulkAssignProductsToAssortment.d.ts +10 -0
  17. package/lib/resolvers/mutations/bulk/bulkAssignProductsToAssortment.js +18 -0
  18. package/lib/resolvers/mutations/bulk/bulkOperation.d.ts +12 -0
  19. package/lib/resolvers/mutations/bulk/bulkOperation.js +14 -0
  20. package/lib/resolvers/mutations/bulk/bulkRemoveAssortments.d.ts +9 -0
  21. package/lib/resolvers/mutations/bulk/bulkRemoveAssortments.js +7 -0
  22. package/lib/resolvers/mutations/bulk/bulkRemoveFilters.d.ts +9 -0
  23. package/lib/resolvers/mutations/bulk/bulkRemoveFilters.js +9 -0
  24. package/lib/resolvers/mutations/bulk/bulkRemoveProducts.d.ts +9 -0
  25. package/lib/resolvers/mutations/bulk/bulkRemoveProducts.js +9 -0
  26. package/lib/resolvers/mutations/bulk/bulkRemoveUsers.d.ts +9 -0
  27. package/lib/resolvers/mutations/bulk/bulkRemoveUsers.js +7 -0
  28. package/lib/resolvers/mutations/bulk/bulkSetAssortmentActive.d.ts +10 -0
  29. package/lib/resolvers/mutations/bulk/bulkSetAssortmentActive.js +9 -0
  30. package/lib/resolvers/mutations/bulk/bulkSetFilterActive.d.ts +10 -0
  31. package/lib/resolvers/mutations/bulk/bulkSetFilterActive.js +10 -0
  32. package/lib/resolvers/mutations/bulk/bulkSetProductStatus.d.ts +10 -0
  33. package/lib/resolvers/mutations/bulk/bulkSetProductStatus.js +17 -0
  34. package/lib/resolvers/mutations/bulk/bulkSetUserRoles.d.ts +10 -0
  35. package/lib/resolvers/mutations/bulk/bulkSetUserRoles.js +14 -0
  36. package/lib/resolvers/mutations/bulk/bulkUpdateAssortmentTags.d.ts +11 -0
  37. package/lib/resolvers/mutations/bulk/bulkUpdateAssortmentTags.js +10 -0
  38. package/lib/resolvers/mutations/bulk/bulkUpdateProductTags.d.ts +11 -0
  39. package/lib/resolvers/mutations/bulk/bulkUpdateProductTags.js +7 -0
  40. package/lib/resolvers/mutations/bulk/bulkUpdateUserTags.d.ts +11 -0
  41. package/lib/resolvers/mutations/bulk/bulkUpdateUserTags.js +7 -0
  42. package/lib/resolvers/mutations/users/removeUser.js +9 -2
  43. package/lib/resolvers/mutations/users/setRoles.js +9 -2
  44. package/lib/resolvers/mutations/worker/allocateWork.d.ts +1 -1
  45. package/lib/resolvers/mutations/worker/allocateWork.js +4 -3
  46. package/lib/resolvers/queries/search/globalSearch.d.ts +36 -0
  47. package/lib/resolvers/queries/search/globalSearch.js +200 -0
  48. package/lib/resolvers/type/global-search-result-types.d.ts +3 -0
  49. package/lib/resolvers/type/global-search-result-types.js +15 -0
  50. package/lib/schema/types/common.js +7 -0
  51. package/package.json +24 -24
package/lib/errors.d.ts CHANGED
@@ -19,6 +19,7 @@ export declare const CurrencyNotFoundError: any;
19
19
  export declare const DeliverProviderNotFoundError: any;
20
20
  export declare const LanguageNotFoundError: any;
21
21
  export declare const UserNotFoundError: any;
22
+ export declare const LastAdminError: any;
22
23
  export declare const UserWebAuthnCredentialsNotFoundError: any;
23
24
  export declare const WebAuthnDisabledError: any;
24
25
  export declare const UserWeb3AddressNotFoundError: any;
package/lib/errors.js CHANGED
@@ -29,6 +29,7 @@ export const CurrencyNotFoundError = createError('CurrencyNotFoundError', 'Curre
29
29
  export const DeliverProviderNotFoundError = createError('DeliverProviderNotFoundError', 'Delivery provider not found');
30
30
  export const LanguageNotFoundError = createError('LanguageNotFoundError', 'Language not found');
31
31
  export const UserNotFoundError = createError('UserNotFoundError', 'User not found');
32
+ export const LastAdminError = createError('LastAdminError', 'At least one active administrator is required. Assign another administrator before removing this account or revoking its admin role.');
32
33
  export const UserWebAuthnCredentialsNotFoundError = createError('UserWebAuthnCredentialsNotFoundError', 'User WebAuth Credentials not found');
33
34
  export const WebAuthnDisabledError = createError('WebAuthnDisabledError', 'WebAuthn disabled');
34
35
  export const UserWeb3AddressNotFoundError = createError('UserWeb3AddressNotFoundError', 'Web3 Account not found for User');
@@ -16,7 +16,7 @@ export declare const AssortmentSchema: z.ZodMiniObject<{
16
16
  isRoot: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
17
17
  isActive: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
18
18
  tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
19
- sequence: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
19
+ sequence: z.ZodMiniOptional<z.ZodMiniInt>;
20
20
  meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
21
21
  }, z.core.$strip>;
22
22
  export declare const actionValidators: {
@@ -25,7 +25,7 @@ export declare const actionValidators: {
25
25
  isRoot: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
26
26
  isActive: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
27
27
  tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
28
- sequence: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
28
+ sequence: z.ZodMiniOptional<z.ZodMiniInt>;
29
29
  meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
30
30
  }, z.core.$strip>;
31
31
  texts: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
@@ -42,7 +42,7 @@ export declare const actionValidators: {
42
42
  isRoot: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
43
43
  isActive: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
44
44
  tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
45
- sequence: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
45
+ sequence: z.ZodMiniOptional<z.ZodMiniInt>;
46
46
  meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
47
47
  }, z.core.$strip>;
48
48
  }, z.core.$strip>;
@@ -65,8 +65,8 @@ export declare const actionValidators: {
65
65
  [x: string]: string;
66
66
  }>;
67
67
  }, z.core.$strip>>>;
68
- limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
69
- offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
68
+ limit: z.ZodMiniOptional<z.ZodMiniInt>;
69
+ offset: z.ZodMiniOptional<z.ZodMiniInt>;
70
70
  }, z.core.$strip>;
71
71
  readonly COUNT: z.ZodMiniObject<{
72
72
  tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
@@ -93,12 +93,12 @@ export declare const actionValidators: {
93
93
  readonly REORDER_MEDIA: z.ZodMiniObject<{
94
94
  sortKeys: z.ZodMiniArray<z.ZodMiniObject<{
95
95
  assortmentMediaId: z.ZodMiniString<string>;
96
- sortKey: z.ZodMiniNumberFormat;
96
+ sortKey: z.ZodMiniInt;
97
97
  }, z.core.$strip>>;
98
98
  }, z.core.$strip>;
99
99
  readonly GET_MEDIA: z.ZodMiniObject<{
100
- limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
101
- offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
100
+ limit: z.ZodMiniOptional<z.ZodMiniInt>;
101
+ offset: z.ZodMiniOptional<z.ZodMiniInt>;
102
102
  assortmentId: z.ZodMiniString<string>;
103
103
  tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
104
104
  }, z.core.$strip>;
@@ -124,7 +124,7 @@ export declare const actionValidators: {
124
124
  readonly REORDER_PRODUCTS: z.ZodMiniObject<{
125
125
  sortKeys: z.ZodMiniArray<z.ZodMiniObject<{
126
126
  assortmentProductId: z.ZodMiniString<string>;
127
- sortKey: z.ZodMiniNumberFormat;
127
+ sortKey: z.ZodMiniInt;
128
128
  }, z.core.$strip>>;
129
129
  }, z.core.$strip>;
130
130
  readonly ADD_FILTER: z.ZodMiniObject<{
@@ -141,7 +141,7 @@ export declare const actionValidators: {
141
141
  readonly REORDER_FILTERS: z.ZodMiniObject<{
142
142
  sortKeys: z.ZodMiniArray<z.ZodMiniObject<{
143
143
  assortmentFilterId: z.ZodMiniString<string>;
144
- sortKey: z.ZodMiniNumberFormat;
144
+ sortKey: z.ZodMiniInt;
145
145
  }, z.core.$strip>>;
146
146
  }, z.core.$strip>;
147
147
  readonly ADD_LINK: z.ZodMiniObject<{
@@ -158,7 +158,7 @@ export declare const actionValidators: {
158
158
  readonly REORDER_LINKS: z.ZodMiniObject<{
159
159
  sortKeys: z.ZodMiniArray<z.ZodMiniObject<{
160
160
  assortmentLinkId: z.ZodMiniString<string>;
161
- sortKey: z.ZodMiniNumberFormat;
161
+ sortKey: z.ZodMiniInt;
162
162
  }, z.core.$strip>>;
163
163
  }, z.core.$strip>;
164
164
  readonly GET_CHILDREN: z.ZodMiniObject<{
@@ -168,8 +168,8 @@ export declare const actionValidators: {
168
168
  readonly SEARCH_PRODUCTS: z.ZodMiniObject<{
169
169
  queryString: z.ZodMiniOptional<z.ZodMiniString<string>>;
170
170
  includeInactive: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
171
- limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
172
- offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
171
+ limit: z.ZodMiniOptional<z.ZodMiniInt>;
172
+ offset: z.ZodMiniOptional<z.ZodMiniInt>;
173
173
  assortmentId: z.ZodMiniString<string>;
174
174
  }, z.core.$strip>;
175
175
  readonly GET_TEXTS: z.ZodMiniObject<{
@@ -75,8 +75,8 @@ export declare const actionValidators: {
75
75
  [x: string]: string;
76
76
  }>;
77
77
  }, z.core.$strip>>>;
78
- limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
79
- offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
78
+ limit: z.ZodMiniOptional<z.ZodMiniInt>;
79
+ offset: z.ZodMiniOptional<z.ZodMiniInt>;
80
80
  }, z.core.$strip>;
81
81
  readonly COUNT: z.ZodMiniObject<{
82
82
  queryString: z.ZodMiniOptional<z.ZodMiniString<string>>;
@@ -11,7 +11,7 @@ export declare const LocalizationEntitySchema: z.ZodMiniObject<{
11
11
  isActive: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
12
12
  defaultCurrencyCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
13
13
  contractAddress: z.ZodMiniOptional<z.ZodMiniString<string>>;
14
- decimals: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
14
+ decimals: z.ZodMiniOptional<z.ZodMiniInt>;
15
15
  }, z.core.$strip>;
16
16
  export declare const actionValidators: {
17
17
  readonly CREATE: z.ZodMiniObject<{
@@ -24,7 +24,7 @@ export declare const actionValidators: {
24
24
  isActive: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
25
25
  defaultCurrencyCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
26
26
  contractAddress: z.ZodMiniOptional<z.ZodMiniString<string>>;
27
- decimals: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
27
+ decimals: z.ZodMiniOptional<z.ZodMiniInt>;
28
28
  isoCode: z.ZodMiniString<string>;
29
29
  }, z.core.$strip>;
30
30
  }, z.core.$strip>;
@@ -40,7 +40,7 @@ export declare const actionValidators: {
40
40
  isActive: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
41
41
  defaultCurrencyCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
42
42
  contractAddress: z.ZodMiniOptional<z.ZodMiniString<string>>;
43
- decimals: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
43
+ decimals: z.ZodMiniOptional<z.ZodMiniInt>;
44
44
  }, z.core.$strip>;
45
45
  }, z.core.$strip>;
46
46
  readonly REMOVE: z.ZodMiniObject<{
@@ -68,8 +68,8 @@ export declare const actionValidators: {
68
68
  [x: string]: string;
69
69
  }>;
70
70
  }, z.core.$strip>>>;
71
- limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
72
- offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
71
+ limit: z.ZodMiniOptional<z.ZodMiniInt>;
72
+ offset: z.ZodMiniOptional<z.ZodMiniInt>;
73
73
  localizationType: z.ZodMiniEnum<{
74
74
  COUNTRY: "COUNTRY";
75
75
  CURRENCY: "CURRENCY";
@@ -65,11 +65,11 @@ export declare const actionValidators: {
65
65
  [x: string]: string;
66
66
  }>;
67
67
  }, z.core.$strip>>>;
68
- limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
69
- offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
68
+ limit: z.ZodMiniOptional<z.ZodMiniInt>;
69
+ offset: z.ZodMiniOptional<z.ZodMiniInt>;
70
70
  }, z.core.$strip>;
71
71
  readonly SALES_SUMMARY: z.ZodMiniObject<{
72
- days: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
72
+ days: z.ZodMiniOptional<z.ZodMiniInt>;
73
73
  paymentProviderIds: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
74
74
  deliveryProviderIds: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
75
75
  status: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniEnum<{
@@ -99,14 +99,14 @@ export declare const actionValidators: {
99
99
  customerStatus: z.ZodMiniOptional<z.ZodMiniString<string>>;
100
100
  from: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
101
101
  to: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
102
- limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
103
- offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
102
+ limit: z.ZodMiniOptional<z.ZodMiniInt>;
103
+ offset: z.ZodMiniOptional<z.ZodMiniInt>;
104
104
  }, z.core.$strip>;
105
105
  readonly TOP_PRODUCTS: z.ZodMiniObject<{
106
106
  from: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
107
107
  to: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
108
- limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
109
- offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
108
+ limit: z.ZodMiniOptional<z.ZodMiniInt>;
109
+ offset: z.ZodMiniOptional<z.ZodMiniInt>;
110
110
  }, z.core.$strip>;
111
111
  readonly GET_CART: z.ZodMiniObject<{
112
112
  userId: z.ZodMiniString<string>;
@@ -25,7 +25,7 @@ export declare const UpdateProductPlanInputSchema: z.ZodMiniObject<{
25
25
  MONTHS: "MONTHS";
26
26
  YEARS: "YEARS";
27
27
  }>;
28
- billingIntervalCount: z.ZodMiniNumberFormat;
28
+ billingIntervalCount: z.ZodMiniInt;
29
29
  trialInterval: z.ZodMiniOptional<z.ZodMiniEnum<{
30
30
  HOURS: "HOURS";
31
31
  DAYS: "DAYS";
@@ -33,7 +33,7 @@ export declare const UpdateProductPlanInputSchema: z.ZodMiniObject<{
33
33
  MONTHS: "MONTHS";
34
34
  YEARS: "YEARS";
35
35
  }>>;
36
- trialIntervalCount: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
36
+ trialIntervalCount: z.ZodMiniOptional<z.ZodMiniInt>;
37
37
  }, z.core.$strip>;
38
38
  export declare const ProductTextInputSchema: z.ZodMiniObject<{
39
39
  locale: z.ZodMiniString<string>;
@@ -64,7 +64,7 @@ export declare const ProductSchema: z.ZodMiniObject<{
64
64
  [x: string]: string;
65
65
  }>>;
66
66
  tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
67
- sequence: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
67
+ sequence: z.ZodMiniOptional<z.ZodMiniInt>;
68
68
  meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
69
69
  plan: z.ZodMiniOptional<z.ZodMiniObject<{
70
70
  usageCalculationType: z.ZodMiniEnum<{
@@ -78,7 +78,7 @@ export declare const ProductSchema: z.ZodMiniObject<{
78
78
  MONTHS: "MONTHS";
79
79
  YEARS: "YEARS";
80
80
  }>;
81
- billingIntervalCount: z.ZodMiniNumberFormat;
81
+ billingIntervalCount: z.ZodMiniInt;
82
82
  trialInterval: z.ZodMiniOptional<z.ZodMiniEnum<{
83
83
  HOURS: "HOURS";
84
84
  DAYS: "DAYS";
@@ -86,29 +86,29 @@ export declare const ProductSchema: z.ZodMiniObject<{
86
86
  MONTHS: "MONTHS";
87
87
  YEARS: "YEARS";
88
88
  }>>;
89
- trialIntervalCount: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
89
+ trialIntervalCount: z.ZodMiniOptional<z.ZodMiniInt>;
90
90
  }, z.core.$strip>>;
91
91
  warehousing: z.ZodMiniOptional<z.ZodMiniObject<{
92
92
  sku: z.ZodMiniOptional<z.ZodMiniString<string>>;
93
93
  baseUnit: z.ZodMiniOptional<z.ZodMiniString<string>>;
94
94
  }, z.core.$strip>>;
95
95
  supply: z.ZodMiniOptional<z.ZodMiniObject<{
96
- weightInGram: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
97
- heightInMillimeters: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
98
- lengthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
99
- widthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
96
+ weightInGram: z.ZodMiniOptional<z.ZodMiniInt>;
97
+ heightInMillimeters: z.ZodMiniOptional<z.ZodMiniInt>;
98
+ lengthInMillimeters: z.ZodMiniOptional<z.ZodMiniInt>;
99
+ widthInMillimeters: z.ZodMiniOptional<z.ZodMiniInt>;
100
100
  }, z.core.$strip>>;
101
101
  tokenization: z.ZodMiniOptional<z.ZodMiniObject<{
102
102
  contractAddress: z.ZodMiniString<string>;
103
103
  contractStandard: z.ZodMiniString<string>;
104
104
  tokenId: z.ZodMiniString<string>;
105
- supply: z.ZodMiniNumberFormat;
105
+ supply: z.ZodMiniInt;
106
106
  ercMetadataProperties: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
107
107
  }, z.core.$strip>>;
108
108
  commerce: z.ZodMiniOptional<z.ZodMiniObject<{
109
109
  pricing: z.ZodMiniArray<z.ZodMiniObject<{
110
- amount: z.ZodMiniNumberFormat;
111
- maxQuantity: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
110
+ amount: z.ZodMiniInt;
111
+ maxQuantity: z.ZodMiniOptional<z.ZodMiniInt>;
112
112
  isTaxable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
113
113
  isNetPrice: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
114
114
  currencyCode: z.ZodMiniString<string>;
@@ -120,7 +120,7 @@ export declare const actionValidators: {
120
120
  readonly CREATE: z.ZodMiniObject<{
121
121
  product: z.ZodMiniObject<{
122
122
  tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
123
- sequence: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
123
+ sequence: z.ZodMiniOptional<z.ZodMiniInt>;
124
124
  meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
125
125
  plan: z.ZodMiniOptional<z.ZodMiniObject<{
126
126
  usageCalculationType: z.ZodMiniEnum<{
@@ -134,7 +134,7 @@ export declare const actionValidators: {
134
134
  MONTHS: "MONTHS";
135
135
  YEARS: "YEARS";
136
136
  }>;
137
- billingIntervalCount: z.ZodMiniNumberFormat;
137
+ billingIntervalCount: z.ZodMiniInt;
138
138
  trialInterval: z.ZodMiniOptional<z.ZodMiniEnum<{
139
139
  HOURS: "HOURS";
140
140
  DAYS: "DAYS";
@@ -142,29 +142,29 @@ export declare const actionValidators: {
142
142
  MONTHS: "MONTHS";
143
143
  YEARS: "YEARS";
144
144
  }>>;
145
- trialIntervalCount: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
145
+ trialIntervalCount: z.ZodMiniOptional<z.ZodMiniInt>;
146
146
  }, z.core.$strip>>;
147
147
  warehousing: z.ZodMiniOptional<z.ZodMiniObject<{
148
148
  sku: z.ZodMiniOptional<z.ZodMiniString<string>>;
149
149
  baseUnit: z.ZodMiniOptional<z.ZodMiniString<string>>;
150
150
  }, z.core.$strip>>;
151
151
  supply: z.ZodMiniOptional<z.ZodMiniObject<{
152
- weightInGram: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
153
- heightInMillimeters: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
154
- lengthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
155
- widthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
152
+ weightInGram: z.ZodMiniOptional<z.ZodMiniInt>;
153
+ heightInMillimeters: z.ZodMiniOptional<z.ZodMiniInt>;
154
+ lengthInMillimeters: z.ZodMiniOptional<z.ZodMiniInt>;
155
+ widthInMillimeters: z.ZodMiniOptional<z.ZodMiniInt>;
156
156
  }, z.core.$strip>>;
157
157
  tokenization: z.ZodMiniOptional<z.ZodMiniObject<{
158
158
  contractAddress: z.ZodMiniString<string>;
159
159
  contractStandard: z.ZodMiniString<string>;
160
160
  tokenId: z.ZodMiniString<string>;
161
- supply: z.ZodMiniNumberFormat;
161
+ supply: z.ZodMiniInt;
162
162
  ercMetadataProperties: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
163
163
  }, z.core.$strip>>;
164
164
  commerce: z.ZodMiniOptional<z.ZodMiniObject<{
165
165
  pricing: z.ZodMiniArray<z.ZodMiniObject<{
166
- amount: z.ZodMiniNumberFormat;
167
- maxQuantity: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
166
+ amount: z.ZodMiniInt;
167
+ maxQuantity: z.ZodMiniOptional<z.ZodMiniInt>;
168
168
  isTaxable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
169
169
  isNetPrice: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
170
170
  currencyCode: z.ZodMiniString<string>;
@@ -193,7 +193,7 @@ export declare const actionValidators: {
193
193
  [x: string]: string;
194
194
  }>>;
195
195
  tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
196
- sequence: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
196
+ sequence: z.ZodMiniOptional<z.ZodMiniInt>;
197
197
  meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
198
198
  plan: z.ZodMiniOptional<z.ZodMiniObject<{
199
199
  usageCalculationType: z.ZodMiniEnum<{
@@ -207,7 +207,7 @@ export declare const actionValidators: {
207
207
  MONTHS: "MONTHS";
208
208
  YEARS: "YEARS";
209
209
  }>;
210
- billingIntervalCount: z.ZodMiniNumberFormat;
210
+ billingIntervalCount: z.ZodMiniInt;
211
211
  trialInterval: z.ZodMiniOptional<z.ZodMiniEnum<{
212
212
  HOURS: "HOURS";
213
213
  DAYS: "DAYS";
@@ -215,29 +215,29 @@ export declare const actionValidators: {
215
215
  MONTHS: "MONTHS";
216
216
  YEARS: "YEARS";
217
217
  }>>;
218
- trialIntervalCount: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
218
+ trialIntervalCount: z.ZodMiniOptional<z.ZodMiniInt>;
219
219
  }, z.core.$strip>>;
220
220
  warehousing: z.ZodMiniOptional<z.ZodMiniObject<{
221
221
  sku: z.ZodMiniOptional<z.ZodMiniString<string>>;
222
222
  baseUnit: z.ZodMiniOptional<z.ZodMiniString<string>>;
223
223
  }, z.core.$strip>>;
224
224
  supply: z.ZodMiniOptional<z.ZodMiniObject<{
225
- weightInGram: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
226
- heightInMillimeters: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
227
- lengthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
228
- widthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
225
+ weightInGram: z.ZodMiniOptional<z.ZodMiniInt>;
226
+ heightInMillimeters: z.ZodMiniOptional<z.ZodMiniInt>;
227
+ lengthInMillimeters: z.ZodMiniOptional<z.ZodMiniInt>;
228
+ widthInMillimeters: z.ZodMiniOptional<z.ZodMiniInt>;
229
229
  }, z.core.$strip>>;
230
230
  tokenization: z.ZodMiniOptional<z.ZodMiniObject<{
231
231
  contractAddress: z.ZodMiniString<string>;
232
232
  contractStandard: z.ZodMiniString<string>;
233
233
  tokenId: z.ZodMiniString<string>;
234
- supply: z.ZodMiniNumberFormat;
234
+ supply: z.ZodMiniInt;
235
235
  ercMetadataProperties: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
236
236
  }, z.core.$strip>>;
237
237
  commerce: z.ZodMiniOptional<z.ZodMiniObject<{
238
238
  pricing: z.ZodMiniArray<z.ZodMiniObject<{
239
- amount: z.ZodMiniNumberFormat;
240
- maxQuantity: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
239
+ amount: z.ZodMiniInt;
240
+ maxQuantity: z.ZodMiniOptional<z.ZodMiniInt>;
241
241
  isTaxable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
242
242
  isNetPrice: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
243
243
  currencyCode: z.ZodMiniString<string>;
@@ -266,8 +266,8 @@ export declare const actionValidators: {
266
266
  [x: string]: string;
267
267
  }>;
268
268
  }, z.core.$strip>>>;
269
- limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
270
- offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
269
+ limit: z.ZodMiniOptional<z.ZodMiniInt>;
270
+ offset: z.ZodMiniOptional<z.ZodMiniInt>;
271
271
  }, z.core.$strip>;
272
272
  readonly COUNT: z.ZodMiniObject<{
273
273
  tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
@@ -294,12 +294,12 @@ export declare const actionValidators: {
294
294
  readonly REORDER_MEDIA: z.ZodMiniObject<{
295
295
  sortKeys: z.ZodMiniArray<z.ZodMiniObject<{
296
296
  productMediaId: z.ZodMiniString<string>;
297
- sortKey: z.ZodMiniNumberFormat;
297
+ sortKey: z.ZodMiniInt;
298
298
  }, z.core.$strip>>;
299
299
  }, z.core.$strip>;
300
300
  readonly GET_MEDIA: z.ZodMiniObject<{
301
- limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
302
- offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
301
+ limit: z.ZodMiniOptional<z.ZodMiniInt>;
302
+ offset: z.ZodMiniOptional<z.ZodMiniInt>;
303
303
  productId: z.ZodMiniString<string>;
304
304
  tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
305
305
  }, z.core.$strip>;
@@ -380,18 +380,18 @@ export declare const actionValidators: {
380
380
  readonly ADD_BUNDLE_ITEM: z.ZodMiniObject<{
381
381
  bundleId: z.ZodMiniString<string>;
382
382
  bundleProductId: z.ZodMiniString<string>;
383
- quantity: z.ZodMiniDefault<z.ZodMiniNumberFormat>;
383
+ quantity: z.ZodMiniDefault<z.ZodMiniInt>;
384
384
  }, z.core.$strip>;
385
385
  readonly REMOVE_BUNDLE_ITEM: z.ZodMiniObject<{
386
386
  bundleId: z.ZodMiniString<string>;
387
- index: z.ZodMiniNumberFormat;
387
+ index: z.ZodMiniInt;
388
388
  }, z.core.$strip>;
389
389
  readonly GET_BUNDLE_ITEMS: z.ZodMiniObject<{
390
390
  bundleId: z.ZodMiniString<string>;
391
391
  }, z.core.$strip>;
392
392
  readonly GET_CATALOG_PRICE: z.ZodMiniObject<{
393
393
  productId: z.ZodMiniString<string>;
394
- quantity: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
394
+ quantity: z.ZodMiniOptional<z.ZodMiniInt>;
395
395
  currencyCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
396
396
  }, z.core.$strip>;
397
397
  readonly SIMULATE_PRICE: z.ZodMiniObject<{
@@ -400,7 +400,7 @@ export declare const actionValidators: {
400
400
  key: z.ZodMiniString<string>;
401
401
  value: z.ZodMiniString<string>;
402
402
  }, z.core.$strip>>>;
403
- quantity: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
403
+ quantity: z.ZodMiniOptional<z.ZodMiniInt>;
404
404
  currencyCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
405
405
  useNetPrice: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
406
406
  }, z.core.$strip>;
@@ -410,7 +410,7 @@ export declare const actionValidators: {
410
410
  key: z.ZodMiniString<string>;
411
411
  value: z.ZodMiniString<string>;
412
412
  }, z.core.$strip>>>;
413
- quantity: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
413
+ quantity: z.ZodMiniOptional<z.ZodMiniInt>;
414
414
  currencyCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
415
415
  useNetPrice: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
416
416
  }, z.core.$strip>;
@@ -433,8 +433,8 @@ export declare const actionValidators: {
433
433
  [x: string]: string;
434
434
  }>;
435
435
  }, z.core.$strip>>>;
436
- limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
437
- offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
436
+ limit: z.ZodMiniOptional<z.ZodMiniInt>;
437
+ offset: z.ZodMiniOptional<z.ZodMiniInt>;
438
438
  productId: z.ZodMiniString<string>;
439
439
  }, z.core.$strip>;
440
440
  readonly COUNT_REVIEWS: z.ZodMiniObject<{
@@ -31,8 +31,8 @@ export declare const actionValidators: {
31
31
  [x: string]: string;
32
32
  }>;
33
33
  }, z.core.$strip>>>;
34
- limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
35
- offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
34
+ limit: z.ZodMiniOptional<z.ZodMiniInt>;
35
+ offset: z.ZodMiniOptional<z.ZodMiniInt>;
36
36
  }, z.core.$strip>;
37
37
  readonly GET: z.ZodMiniObject<{
38
38
  quotationId: z.ZodMiniString<string>;
@@ -1,8 +1,8 @@
1
1
  import { buildObfuscatedFieldsFilter } from '@unchainedshop/utils';
2
+ import { WorkerDirector } from '@unchainedshop/core';
2
3
  const allocateWork = async (context, options) => {
3
- const { modules } = context;
4
4
  const removePrivateFieldsFromWork = buildObfuscatedFieldsFilter(context.options.worker?.blacklistedVariables);
5
- const work = await modules.worker.allocateWork({
5
+ const work = await WorkerDirector.allocateWork(context, {
6
6
  types: options.types || [],
7
7
  worker: options.worker || '',
8
8
  });
@@ -5,11 +5,11 @@ export declare const actionValidators: {
5
5
  readonly SHOP_INFO: z.ZodMiniObject<{}, z.core.$strip>;
6
6
  readonly WORKER_ADD: z.ZodMiniObject<{
7
7
  type: z.ZodMiniString<string>;
8
- priority: z.ZodMiniDefault<z.ZodMiniNumberFormat>;
8
+ priority: z.ZodMiniDefault<z.ZodMiniInt>;
9
9
  input: z.ZodMiniOptional<z.ZodMiniAny>;
10
10
  originalWorkId: z.ZodMiniOptional<z.ZodMiniString<string>>;
11
11
  scheduled: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
12
- retries: z.ZodMiniDefault<z.ZodMiniNumberFormat>;
12
+ retries: z.ZodMiniDefault<z.ZodMiniInt>;
13
13
  worker: z.ZodMiniOptional<z.ZodMiniString<string>>;
14
14
  }, z.core.$strip>;
15
15
  readonly WORKER_ACTIVE_WORK_TYPES: z.ZodMiniObject<{}, z.core.$strip>;
@@ -40,8 +40,8 @@ export declare const actionValidators: {
40
40
  [x: string]: string;
41
41
  }>;
42
42
  }, z.core.$strip>>>;
43
- limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
44
- offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
43
+ limit: z.ZodMiniOptional<z.ZodMiniInt>;
44
+ offset: z.ZodMiniOptional<z.ZodMiniInt>;
45
45
  }, z.core.$strip>;
46
46
  readonly WORKER_COUNT: z.ZodMiniObject<{
47
47
  created: z.ZodMiniOptional<z.ZodMiniObject<{
@@ -91,8 +91,8 @@ export declare const actionValidators: {
91
91
  [x: string]: string;
92
92
  }>;
93
93
  }, z.core.$strip>>>;
94
- limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
95
- offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
94
+ limit: z.ZodMiniOptional<z.ZodMiniInt>;
95
+ offset: z.ZodMiniOptional<z.ZodMiniInt>;
96
96
  }, z.core.$strip>;
97
97
  readonly EVENT_COUNT: z.ZodMiniObject<{
98
98
  types: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
@@ -30,8 +30,8 @@ export declare const actionValidators: {
30
30
  [x: string]: string;
31
31
  }>;
32
32
  }, z.core.$strip>>>;
33
- limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
34
- offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
33
+ limit: z.ZodMiniOptional<z.ZodMiniInt>;
34
+ offset: z.ZodMiniOptional<z.ZodMiniInt>;
35
35
  }, z.core.$strip>;
36
36
  readonly COUNT: z.ZodMiniObject<{
37
37
  includeGuests: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
@@ -144,8 +144,8 @@ export declare const actionValidators: {
144
144
  [x: string]: string;
145
145
  }>;
146
146
  }, z.core.$strip>>>;
147
- limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
148
- offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
147
+ limit: z.ZodMiniOptional<z.ZodMiniInt>;
148
+ offset: z.ZodMiniOptional<z.ZodMiniInt>;
149
149
  userId: z.ZodMiniString<string>;
150
150
  }, z.core.$strip>;
151
151
  readonly GET_ENROLLMENTS: z.ZodMiniObject<{
@@ -158,8 +158,8 @@ export declare const actionValidators: {
158
158
  [x: string]: string;
159
159
  }>;
160
160
  }, z.core.$strip>>>;
161
- limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
162
- offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
161
+ limit: z.ZodMiniOptional<z.ZodMiniInt>;
162
+ offset: z.ZodMiniOptional<z.ZodMiniInt>;
163
163
  userId: z.ZodMiniString<string>;
164
164
  }, z.core.$strip>;
165
165
  readonly GET_QUOTATIONS: z.ZodMiniObject<{
@@ -171,8 +171,8 @@ export declare const actionValidators: {
171
171
  [x: string]: string;
172
172
  }>;
173
173
  }, z.core.$strip>>>;
174
- limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
175
- offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
174
+ limit: z.ZodMiniOptional<z.ZodMiniInt>;
175
+ offset: z.ZodMiniOptional<z.ZodMiniInt>;
176
176
  userId: z.ZodMiniString<string>;
177
177
  }, z.core.$strip>;
178
178
  readonly GET_BOOKMARKS: z.ZodMiniObject<{
@@ -192,8 +192,8 @@ export declare const actionValidators: {
192
192
  [x: string]: string;
193
193
  }>;
194
194
  }, z.core.$strip>>>;
195
- limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
196
- offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
195
+ limit: z.ZodMiniOptional<z.ZodMiniInt>;
196
+ offset: z.ZodMiniOptional<z.ZodMiniInt>;
197
197
  userId: z.ZodMiniString<string>;
198
198
  }, z.core.$strip>;
199
199
  readonly GET_REVIEWS_COUNT: z.ZodMiniObject<{
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod/v4-mini';
2
2
  import type { StandardSchemaWithJSON } from '@modelcontextprotocol/server';
3
3
  export declare const PaginationSchema: {
4
- limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
5
- offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
4
+ limit: z.ZodMiniOptional<z.ZodMiniInt>;
5
+ offset: z.ZodMiniOptional<z.ZodMiniInt>;
6
6
  };
7
7
  export declare const SortingSchema: {
8
8
  sort: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
@@ -51,8 +51,8 @@ export declare function createManagementSchema<T extends readonly string[]>(acti
51
51
  [x: string]: string;
52
52
  }>;
53
53
  }, z.core.$strip>>>;
54
- limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
55
- offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
54
+ limit: z.ZodMiniOptional<z.ZodMiniInt>;
55
+ offset: z.ZodMiniOptional<z.ZodMiniInt>;
56
56
  action: z.ZodMiniEnum<{
57
57
  [x: string]: any;
58
58
  }>;
@@ -61,7 +61,9 @@ export async function createAuthContext(params, authConfig) {
61
61
  const tokenObject = {
62
62
  _id: crypto.randomUUID(),
63
63
  userId: user._id,
64
+ userName: user.username || user.emails?.[0]?.address,
64
65
  tokenExpires: expires,
66
+ remoteAddress: params.remoteAddress,
65
67
  };
66
68
  await emit(API_EVENTS.API_LOGIN_TOKEN_CREATED, tokenObject);
67
69
  user._inLoginMethodResponse = true;
@@ -1,4 +1,6 @@
1
1
  import type { Context } from '../../../context.ts';
2
- export default function logoutAllSessions(root: never, _: never, context: Context): Promise<{
2
+ export default function logoutAllSessions(root: never, params: {
3
+ userId?: string;
4
+ }, context: Context): Promise<{
3
5
  success: boolean;
4
6
  }>;
@@ -1,11 +1,17 @@
1
1
  import { log } from '@unchainedshop/logger';
2
- export default async function logoutAllSessions(root, _, context) {
2
+ import { UserNotFoundError } from "../../../errors.js";
3
+ export default async function logoutAllSessions(root, params, context) {
3
4
  const { userId, modules } = context;
4
- log('mutation logoutAllSessions', { userId });
5
- const result = await modules.users.incrementTokenVersion(userId);
5
+ const normalizedUserId = params.userId || userId;
6
+ log(`mutation logoutAllSessions ${normalizedUserId}`, { userId });
7
+ if (!(await modules.users.userExists({ userId: normalizedUserId })))
8
+ throw new UserNotFoundError({ userId: normalizedUserId });
9
+ const result = await modules.users.incrementTokenVersion(normalizedUserId);
6
10
  if (!result) {
7
11
  throw new Error('Failed to logout all sessions', { cause: 'LOGOUT_FAILED' });
8
12
  }
9
- await context.logout();
13
+ if (normalizedUserId === userId) {
14
+ await context.logout();
15
+ }
10
16
  return { success: true };
11
17
  }
@@ -0,0 +1,10 @@
1
+ import type { Context } from '../../../context.ts';
2
+ export default function bulkAssignProductsToAssortment(root: never, { productIds, assortmentId }: {
3
+ productIds: string[];
4
+ assortmentId: string;
5
+ }, { modules, services, userId }: Context): Promise<{
6
+ successIds: string[];
7
+ successCount: number;
8
+ failedIds: string[];
9
+ failedCount: number;
10
+ }>;