@unchainedshop/api 4.8.12 → 5.0.0-alpha.2

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 (111) hide show
  1. package/lib/acl.d.ts +2 -2
  2. package/lib/acl.js +36 -8
  3. package/lib/api-index.d.ts +3 -1
  4. package/lib/chat/generateImageHandler.js +6 -5
  5. package/lib/context.d.ts +3 -1
  6. package/lib/context.js +9 -4
  7. package/lib/events.d.ts +2 -0
  8. package/lib/events.js +2 -0
  9. package/lib/express/createMCPMiddleware.js +1 -1
  10. package/lib/express/index.d.ts +6 -9
  11. package/lib/express/index.js +53 -126
  12. package/lib/fastify/index.d.ts +6 -9
  13. package/lib/fastify/index.js +52 -118
  14. package/lib/fastify/mcpHandler.js +1 -1
  15. package/lib/loaders/buildTextMap.js +6 -3
  16. package/lib/loaders/index.d.ts +0 -25
  17. package/lib/loaders/index.js +0 -10
  18. package/lib/locale-context.d.ts +4 -2
  19. package/lib/locale-context.js +2 -6
  20. package/lib/mcp/tools/assortment/assortmentManagement.d.ts +2 -2
  21. package/lib/mcp/tools/assortment/assortmentManagement.js +2 -2
  22. package/lib/mcp/tools/assortment/schemas.d.ts +322 -141
  23. package/lib/mcp/tools/assortment/schemas.js +179 -96
  24. package/lib/mcp/tools/filter/filterManagement.d.ts +2 -2
  25. package/lib/mcp/tools/filter/filterManagement.js +2 -2
  26. package/lib/mcp/tools/filter/schemas.d.ts +184 -75
  27. package/lib/mcp/tools/filter/schemas.js +87 -51
  28. package/lib/mcp/tools/localization/getLocalizationsConfig.d.ts +1 -1
  29. package/lib/mcp/tools/localization/localizationManagement.d.ts +2 -2
  30. package/lib/mcp/tools/localization/localizationManagement.js +2 -2
  31. package/lib/mcp/tools/localization/schemas.d.ts +144 -47
  32. package/lib/mcp/tools/localization/schemas.js +51 -36
  33. package/lib/mcp/tools/order/handlers/getTopCustomers.d.ts +2 -0
  34. package/lib/mcp/tools/order/orderManagement.d.ts +2 -2
  35. package/lib/mcp/tools/order/orderManagement.js +2 -2
  36. package/lib/mcp/tools/order/schemas.d.ts +184 -75
  37. package/lib/mcp/tools/order/schemas.js +113 -51
  38. package/lib/mcp/tools/product/productManagement.d.ts +2 -2
  39. package/lib/mcp/tools/product/productManagement.js +2 -2
  40. package/lib/mcp/tools/product/schemas.d.ts +642 -317
  41. package/lib/mcp/tools/product/schemas.js +287 -191
  42. package/lib/mcp/tools/provider/providerManagement.d.ts +2 -2
  43. package/lib/mcp/tools/provider/providerManagement.js +2 -2
  44. package/lib/mcp/tools/provider/schemas.d.ts +142 -47
  45. package/lib/mcp/tools/provider/schemas.js +67 -32
  46. package/lib/mcp/tools/quotation/handlers/getQuotation.d.ts +2 -0
  47. package/lib/mcp/tools/quotation/handlers/listQuotations.d.ts +2 -0
  48. package/lib/mcp/tools/quotation/handlers/makeQuotationProposal.d.ts +2 -0
  49. package/lib/mcp/tools/quotation/handlers/rejectQuotation.d.ts +2 -0
  50. package/lib/mcp/tools/quotation/handlers/verifyQuotation.d.ts +2 -0
  51. package/lib/mcp/tools/quotation/quotationManagement.d.ts +2 -2
  52. package/lib/mcp/tools/quotation/quotationManagement.js +2 -2
  53. package/lib/mcp/tools/quotation/schemas.d.ts +111 -40
  54. package/lib/mcp/tools/quotation/schemas.js +54 -29
  55. package/lib/mcp/tools/system/handlers/countEvents.d.ts +8 -1
  56. package/lib/mcp/tools/system/handlers/countWork.d.ts +10 -1
  57. package/lib/mcp/tools/system/handlers/countWork.js +1 -0
  58. package/lib/mcp/tools/system/handlers/index.d.ts +4 -4
  59. package/lib/mcp/tools/system/handlers/listEvents.d.ts +12 -1
  60. package/lib/mcp/tools/system/handlers/listWork.d.ts +14 -1
  61. package/lib/mcp/tools/system/handlers/listWork.js +1 -0
  62. package/lib/mcp/tools/system/schemas.d.ts +179 -84
  63. package/lib/mcp/tools/system/schemas.js +188 -67
  64. package/lib/mcp/tools/system/systemManagement.d.ts +1 -1
  65. package/lib/mcp/tools/system/systemManagement.js +1 -1
  66. package/lib/mcp/tools/users/handlers/addUserEmail.d.ts +2 -0
  67. package/lib/mcp/tools/users/handlers/createUser.d.ts +2 -0
  68. package/lib/mcp/tools/users/handlers/enrollUser.d.ts +2 -0
  69. package/lib/mcp/tools/users/handlers/getCurrentUser.d.ts +2 -0
  70. package/lib/mcp/tools/users/handlers/getUser.d.ts +2 -0
  71. package/lib/mcp/tools/users/handlers/listUsers.d.ts +2 -0
  72. package/lib/mcp/tools/users/handlers/setUserTags.d.ts +2 -0
  73. package/lib/mcp/tools/users/handlers/setUserUsername.d.ts +2 -0
  74. package/lib/mcp/tools/users/handlers/updateUser.d.ts +2 -0
  75. package/lib/mcp/tools/users/schemas.d.ts +296 -163
  76. package/lib/mcp/tools/users/schemas.js +152 -71
  77. package/lib/mcp/tools/users/usersManagement.d.ts +2 -2
  78. package/lib/mcp/tools/users/usersManagement.js +2 -2
  79. package/lib/mcp/utils/getNormalizedQuotationDetails.d.ts +2 -0
  80. package/lib/mcp/utils/getNormalizedUserDetails.d.ts +2 -0
  81. package/lib/mcp/utils/normalizeMediaUrl.js +1 -1
  82. package/lib/mcp/utils/sanitizeLocalizationEntityData.d.ts +1 -1
  83. package/lib/mcp/utils/sharedSchemas.d.ts +28 -39
  84. package/lib/mcp/utils/sharedSchemas.js +28 -47
  85. package/lib/mcp/utils/validateIsoCode.d.ts +1 -1
  86. package/lib/middleware/createAuthMiddleware.js +1 -3
  87. package/lib/resolvers/mutations/accounts/changePassword.js +1 -2
  88. package/lib/resolvers/mutations/index.d.ts +150 -155
  89. package/lib/resolvers/mutations/index.js +2 -12
  90. package/lib/resolvers/mutations/orders/updateCart.js +7 -1
  91. package/lib/resolvers/mutations/users/setRoles.d.ts +1 -1
  92. package/lib/resolvers/mutations/users/setRoles.js +6 -4
  93. package/lib/resolvers/queries/events/registeredEventTypes.d.ts +1 -1
  94. package/lib/resolvers/queries/events/registeredEventTypes.js +1 -1
  95. package/lib/resolvers/queries/index.d.ts +71 -71
  96. package/lib/resolvers/queries/index.js +1 -1
  97. package/lib/resolvers/type/index.d.ts +5 -6
  98. package/lib/resolvers/type/order/order-delivery-pickup-types.d.ts +0 -1
  99. package/lib/resolvers/type/order/order-delivery-pickup-types.js +0 -7
  100. package/lib/resolvers/type/order/order-types.d.ts +5 -5
  101. package/lib/resolvers/type/order/order-types.js +27 -12
  102. package/lib/resolvers/type/shop-types.js +1 -1
  103. package/lib/resolvers/type/user-types.js +3 -3
  104. package/lib/roles/index.d.ts +4 -11
  105. package/lib/roles/index.js +16 -11
  106. package/lib/roles/loggedIn.js +2 -1
  107. package/lib/schema/mutation.js +6 -44
  108. package/lib/schema/query.js +5 -5
  109. package/lib/schema/types/index.js +2 -2
  110. package/lib/schema/types/order/delivery.js +0 -2
  111. package/package.json +14 -24
@@ -1,158 +1,153 @@
1
1
  declare const _default: {
2
- logout: (root: any, params: any, context: any, info: any) => Promise<any>;
3
- loginAsGuest: (root: any, params: any, context: any, info: any) => Promise<any>;
4
- impersonate: (root: any, params: any, context: any, info: any) => Promise<any>;
5
- stopImpersonation: (root: any, params: any, context: any, info: any) => Promise<any>;
6
- createWebAuthnCredentialCreationOptions: (root: any, params: any, context: any, info: any) => Promise<any>;
7
- createWebAuthnCredentialRequestOptions: (root: any, params: any, context: any, info: any) => Promise<any>;
8
- addPushSubscription: (root: any, params: any, context: any, info: any) => Promise<any>;
9
- removePushSubscription: (root: any, params: any, context: any, info: any) => Promise<any>;
10
- addWebAuthnCredentials: (root: any, params: any, context: any, info: any) => Promise<any>;
11
- removeWebAuthnCredentials: (root: any, params: any, context: any, info: any) => Promise<any>;
12
- addWeb3Address: (root: any, params: any, context: any, info: any) => Promise<any>;
13
- removeWeb3Address: (root: any, params: any, context: any, info: any) => Promise<any>;
14
- verifyWeb3Address: (root: any, params: any, context: any, info: any) => Promise<any>;
15
- verifyEmail: (root: any, params: any, context: any, info: any) => Promise<any>;
16
- loginWithPassword: (root: any, params: any, context: any, info: any) => Promise<any>;
17
- loginWithWebAuthn: (root: any, params: any, context: any, info: any) => Promise<any>;
18
- pageView: (root: any, params: any, context: any, info: any) => Promise<any>;
19
- createUser: (root: any, params: any, context: any, info: any) => Promise<any>;
20
- forgotPassword: (root: any, params: any, context: any, info: any) => Promise<any>;
21
- resetPassword: (root: any, params: any, context: any, info: any) => Promise<any>;
22
- sendVerificationEmail: (root: any, params: any, context: any, info: any) => Promise<any>;
23
- sendEnrollmentEmail: (root: any, params: any, context: any, info: any) => Promise<any>;
24
- changePassword: (root: any, params: any, context: any, info: any) => Promise<any>;
25
- heartbeat: (root: any, params: any, context: any, info: any) => Promise<any>;
26
- addEmail: (root: any, params: any, context: any, info: any) => Promise<any>;
27
- removeEmail: (root: any, params: any, context: any, info: any) => Promise<any>;
28
- updateUserProfile: (root: any, params: any, context: any, info: any) => Promise<any>;
29
- removeUser: (root: any, params: any, context: any, info: any) => Promise<any>;
30
- setPassword: (root: any, params: any, context: any, info: any) => Promise<any>;
31
- prepareUserAvatarUpload: (root: any, params: any, context: any, info: any) => Promise<any>;
32
- setUserTags: (root: any, params: any, context: any, info: any) => Promise<any>;
33
- setUsername: (root: any, params: any, context: any, info: any) => Promise<any>;
34
- setRoles: (root: any, params: any, context: any, info: any) => Promise<any>;
35
- enrollUser: (root: any, params: any, context: any, info: any) => Promise<any>;
36
- registerPaymentCredentials: (root: any, params: any, context: any, info: any) => Promise<any>;
37
- markPaymentCredentialsPreferred: (root: any, params: any, context: any, info: any) => Promise<any>;
38
- removePaymentCredentials: (root: any, params: any, context: any, info: any) => Promise<any>;
39
- createLanguage: (root: any, params: any, context: any, info: any) => Promise<any>;
40
- updateLanguage: (root: any, params: any, context: any, info: any) => Promise<any>;
41
- removeLanguage: (root: any, params: any, context: any, info: any) => Promise<any>;
42
- createCountry: (root: any, params: any, context: any, info: any) => Promise<any>;
43
- updateCountry: (root: any, params: any, context: any, info: any) => Promise<any>;
44
- removeCountry: (root: any, params: any, context: any, info: any) => Promise<any>;
45
- createProduct: (root: any, params: any, context: any, info: any) => Promise<any>;
46
- publishProduct: (root: any, params: any, context: any, info: any) => Promise<any>;
47
- unpublishProduct: (root: any, params: any, context: any, info: any) => Promise<any>;
48
- removeProduct: (root: any, params: any, context: any, info: any) => Promise<any>;
49
- updateProduct: (root: any, params: any, context: any, info: any) => Promise<any>;
50
- updateProductTexts: (root: any, params: any, context: any, info: any) => Promise<any>;
51
- updateProductMediaTexts: (root: any, params: any, context: any, info: any) => Promise<any>;
52
- confirmMediaUpload: (root: any, params: any, context: any, info: any) => Promise<any>;
53
- prepareProductMediaUpload: (root: any, params: any, context: any, info: any) => Promise<any>;
54
- reorderProductMedia: (root: any, params: any, context: any, info: any) => Promise<any>;
55
- removeProductMedia: (root: any, params: any, context: any, info: any) => Promise<any>;
56
- updateProductCommerce: (root: any, params: any, context: any, info: any) => Promise<any>;
57
- updateProductWarehousing: (root: any, params: any, context: any, info: any) => Promise<any>;
58
- updateProductSupply: (root: any, params: any, context: any, info: any) => Promise<any>;
59
- updateProductPlan: (root: any, params: any, context: any, info: any) => Promise<any>;
60
- updateProductTokenization: (root: any, params: any, context: any, info: any) => Promise<any>;
61
- removeProductVariation: (root: any, params: any, context: any, info: any) => Promise<any>;
62
- updateProductVariationTexts: (root: any, params: any, context: any, info: any) => Promise<any>;
63
- removeProductVariationOption: (root: any, params: any, context: any, info: any) => Promise<any>;
64
- createProductVariation: (root: any, params: any, context: any, info: any) => Promise<any>;
65
- createProductBundleItem: (root: any, params: any, context: any, info: any) => Promise<any>;
66
- removeBundleItem: (root: any, params: any, context: any, info: any) => Promise<any>;
67
- createProductVariationOption: (root: any, params: any, context: any, info: any) => Promise<any>;
68
- addProductAssignment: (root: any, params: any, context: any, info: any) => Promise<any>;
69
- removeProductAssignment: (root: any, params: any, context: any, info: any) => Promise<any>;
70
- createCurrency: (root: any, params: any, context: any, info: any) => Promise<any>;
71
- updateCurrency: (root: any, params: any, context: any, info: any) => Promise<any>;
72
- removeCurrency: (root: any, params: any, context: any, info: any) => Promise<any>;
73
- createCart: (root: any, params: any, context: any, info: any) => Promise<any>;
74
- addCartProduct: (root: any, params: any, context: any, info: any) => Promise<any>;
75
- addMultipleCartProducts: (root: any, params: any, context: any, info: any) => Promise<any>;
76
- addCartDiscount: (root: any, params: any, context: any, info: any) => Promise<any>;
77
- addCartQuotation: (root: any, params: any, context: any, info: any) => Promise<any>;
78
- updateCart: (root: any, params: any, context: any, info: any) => Promise<any>;
79
- emptyCart: (root: any, params: any, context: any, info: any) => Promise<any>;
80
- checkoutCart: (root: any, params: any, context: any, info: any) => Promise<any>;
81
- updateCartItem: (root: any, params: any, context: any, info: any) => Promise<any>;
82
- removeCartItem: (root: any, params: any, context: any, info: any) => Promise<any>;
83
- removeCartDiscount: (root: any, params: any, context: any, info: any) => Promise<any>;
84
- updateCartDeliveryPickUp: (root: any, params: any, context: any, info: any) => Promise<any>;
85
- updateCartDeliveryShipping: (root: any, params: any, context: any, info: any) => Promise<any>;
86
- updateCartPaymentGeneric: (root: any, params: any, context: any, info: any) => Promise<any>;
87
- updateCartPaymentInvoice: (root: any, params: any, context: any, info: any) => Promise<any>;
88
- setOrderPaymentProvider: (root: any, params: any, context: any, info: any) => Promise<any>;
89
- setOrderDeliveryProvider: (root: any, params: any, context: any, info: any) => Promise<any>;
90
- updateOrderDeliveryShipping: (root: any, params: any, context: any, info: any) => Promise<any>;
91
- updateOrderDeliveryPickUp: (root: any, params: any, context: any, info: any) => Promise<any>;
92
- updateOrderPaymentGeneric: (root: any, params: any, context: any, info: any) => Promise<any>;
93
- updateOrderPaymentInvoice: (root: any, params: any, context: any, info: any) => Promise<any>;
94
- removeOrder: (root: any, params: any, context: any, info: any) => Promise<any>;
95
- confirmOrder: (root: any, params: any, context: any, info: any) => Promise<any>;
96
- rejectOrder: (root: any, params: any, context: any, info: any) => Promise<any>;
97
- payOrder: (root: any, params: any, context: any, info: any) => Promise<any>;
98
- deliverOrder: (root: any, params: any, context: any, info: any) => Promise<any>;
99
- createEnrollment: (root: any, params: any, context: any, info: any) => Promise<any>;
100
- terminateEnrollment: (root: any, params: any, context: any, info: any) => Promise<any>;
101
- activateEnrollment: (root: any, params: any, context: any, info: any) => Promise<any>;
102
- updateEnrollment: (root: any, params: any, context: any, info: any) => Promise<any>;
103
- createPaymentProvider: (root: any, params: any, context: any, info: any) => Promise<any>;
104
- updatePaymentProvider: (root: any, params: any, context: any, info: any) => Promise<any>;
105
- removePaymentProvider: (root: any, params: any, context: any, info: any) => Promise<any>;
106
- createDeliveryProvider: (root: any, params: any, context: any, info: any) => Promise<any>;
107
- updateDeliveryProvider: (root: any, params: any, context: any, info: any) => Promise<any>;
108
- removeDeliveryProvider: (root: any, params: any, context: any, info: any) => Promise<any>;
109
- createWarehousingProvider: (root: any, params: any, context: any, info: any) => Promise<any>;
110
- updateWarehousingProvider: (root: any, params: any, context: any, info: any) => Promise<any>;
111
- removeWarehousingProvider: (root: any, params: any, context: any, info: any) => Promise<any>;
112
- exportToken: (root: any, params: any, context: any, info: any) => Promise<any>;
113
- invalidateToken: (root: any, params: any, context: any, info: any) => Promise<any>;
114
- createFilter: (root: any, params: any, context: any, info: any) => Promise<any>;
115
- updateFilter: (root: any, params: any, context: any, info: any) => Promise<any>;
116
- removeFilter: (root: any, params: any, context: any, info: any) => Promise<any>;
117
- updateFilterTexts: (root: any, params: any, context: any, info: any) => Promise<any>;
118
- removeFilterOption: (root: any, params: any, context: any, info: any) => Promise<any>;
119
- createFilterOption: (root: any, params: any, context: any, info: any) => Promise<any>;
120
- createAssortment: (root: any, params: any, context: any, info: any) => Promise<any>;
121
- prepareAssortmentMediaUpload: (root: any, params: any, context: any, info: any) => Promise<any>;
122
- updateAssortment: (root: any, params: any, context: any, info: any) => Promise<any>;
123
- removeAssortment: (root: any, params: any, context: any, info: any) => Promise<any>;
124
- reorderAssortmentMedia: (root: any, params: any, context: any, info: any) => Promise<any>;
125
- removeAssortmentMedia: (root: any, params: any, context: any, info: any) => Promise<any>;
126
- updateAssortmentMediaTexts: (root: any, params: any, context: any, info: any) => Promise<any>;
127
- updateAssortmentTexts: (root: any, params: any, context: any, info: any) => Promise<any>;
128
- addAssortmentProduct: (root: any, params: any, context: any, info: any) => Promise<any>;
129
- removeAssortmentProduct: (root: any, params: any, context: any, info: any) => Promise<any>;
130
- reorderAssortmentProducts: (root: any, params: any, context: any, info: any) => Promise<any>;
131
- addAssortmentLink: (root: any, params: any, context: any, info: any) => Promise<any>;
132
- removeAssortmentLink: (root: any, params: any, context: any, info: any) => Promise<any>;
133
- reorderAssortmentLinks: (root: any, params: any, context: any, info: any) => Promise<any>;
134
- addAssortmentFilter: (root: any, params: any, context: any, info: any) => Promise<any>;
135
- removeAssortmentFilter: (root: any, params: any, context: any, info: any) => Promise<any>;
136
- reorderAssortmentFilters: (root: any, params: any, context: any, info: any) => Promise<any>;
137
- createProductReview: (root: any, params: any, context: any, info: any) => Promise<any>;
138
- updateProductReview: (root: any, params: any, context: any, info: any) => Promise<any>;
139
- removeProductReview: (root: any, params: any, context: any, info: any) => Promise<any>;
140
- addProductReviewVote: (root: any, params: any, context: any, info: any) => Promise<any>;
141
- removeProductReviewVote: (root: any, params: any, context: any, info: any) => Promise<any>;
142
- requestQuotation: (root: any, params: any, context: any, info: any) => Promise<any>;
143
- rejectQuotation: (root: any, params: any, context: any, info: any) => Promise<any>;
144
- verifyQuotation: (root: any, params: any, context: any, info: any) => Promise<any>;
145
- makeQuotationProposal: (root: any, params: any, context: any, info: any) => Promise<any>;
146
- bookmark: (root: any, params: any, context: any, info: any) => Promise<any>;
147
- createBookmark: (root: any, params: any, context: any, info: any) => Promise<any>;
148
- removeBookmark: (root: any, params: any, context: any, info: any) => Promise<any>;
149
- addWork: (root: any, params: any, context: any, info: any) => Promise<any>;
150
- allocateWork: (root: any, params: any, context: any, info: any) => Promise<any>;
151
- finishWork: (root: any, params: any, context: any, info: any) => Promise<any>;
152
- removeWork: (root: any, params: any, context: any, info: any) => Promise<any>;
153
- processNextWork: (root: any, params: any, context: any, info: any) => Promise<any>;
154
- signPaymentProviderForCredentialRegistration: (root: any, params: any, context: any, info: any) => Promise<any>;
155
- signPaymentProviderForCheckout: (root: any, params: any, context: any, info: any) => Promise<any>;
156
- removeUserProductReviews: (root: any, params: any, context: any, info: any) => Promise<any>;
2
+ logout: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
3
+ logoutAllSessions: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
4
+ loginAsGuest: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
5
+ impersonate: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
6
+ stopImpersonation: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
7
+ createWebAuthnCredentialCreationOptions: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
8
+ createWebAuthnCredentialRequestOptions: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
9
+ addPushSubscription: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
10
+ removePushSubscription: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
11
+ addWebAuthnCredentials: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
12
+ removeWebAuthnCredentials: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
13
+ addWeb3Address: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
14
+ removeWeb3Address: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
15
+ verifyWeb3Address: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
16
+ verifyEmail: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
17
+ loginWithPassword: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
18
+ loginWithWebAuthn: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
19
+ pageView: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
20
+ createUser: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
21
+ forgotPassword: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
22
+ resetPassword: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
23
+ sendVerificationEmail: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
24
+ sendEnrollmentEmail: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
25
+ changePassword: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
26
+ heartbeat: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
27
+ addEmail: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
28
+ removeEmail: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
29
+ updateUserProfile: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
30
+ removeUser: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
31
+ setPassword: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
32
+ prepareUserAvatarUpload: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
33
+ setUserTags: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
34
+ setUsername: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
35
+ setRoles: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
36
+ enrollUser: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
37
+ registerPaymentCredentials: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
38
+ markPaymentCredentialsPreferred: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
39
+ removePaymentCredentials: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
40
+ createLanguage: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
41
+ updateLanguage: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
42
+ removeLanguage: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
43
+ createCountry: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
44
+ updateCountry: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
45
+ removeCountry: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
46
+ createProduct: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
47
+ publishProduct: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
48
+ unpublishProduct: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
49
+ removeProduct: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
50
+ updateProduct: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
51
+ updateProductTexts: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
52
+ updateProductMediaTexts: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
53
+ confirmMediaUpload: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
54
+ prepareProductMediaUpload: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
55
+ reorderProductMedia: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
56
+ removeProductMedia: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
57
+ updateProductCommerce: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
58
+ updateProductWarehousing: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
59
+ updateProductSupply: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
60
+ updateProductPlan: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
61
+ updateProductTokenization: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
62
+ removeProductVariation: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
63
+ updateProductVariationTexts: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
64
+ removeProductVariationOption: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
65
+ createProductVariation: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
66
+ createProductBundleItem: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
67
+ removeBundleItem: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
68
+ createProductVariationOption: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
69
+ addProductAssignment: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
70
+ removeProductAssignment: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
71
+ createCurrency: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
72
+ updateCurrency: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
73
+ removeCurrency: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
74
+ createCart: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
75
+ addCartProduct: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
76
+ addMultipleCartProducts: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
77
+ addCartDiscount: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
78
+ addCartQuotation: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
79
+ updateCart: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
80
+ emptyCart: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
81
+ checkoutCart: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
82
+ updateCartItem: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
83
+ removeCartItem: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
84
+ removeCartDiscount: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
85
+ updateCartDeliveryPickUp: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
86
+ updateCartDeliveryShipping: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
87
+ updateCartPaymentGeneric: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
88
+ updateCartPaymentInvoice: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
89
+ removeOrder: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
90
+ confirmOrder: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
91
+ rejectOrder: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
92
+ payOrder: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
93
+ deliverOrder: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
94
+ createEnrollment: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
95
+ terminateEnrollment: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
96
+ activateEnrollment: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
97
+ updateEnrollment: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
98
+ createPaymentProvider: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
99
+ updatePaymentProvider: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
100
+ removePaymentProvider: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
101
+ createDeliveryProvider: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
102
+ updateDeliveryProvider: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
103
+ removeDeliveryProvider: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
104
+ createWarehousingProvider: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
105
+ updateWarehousingProvider: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
106
+ removeWarehousingProvider: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
107
+ exportToken: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
108
+ invalidateToken: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
109
+ createFilter: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
110
+ updateFilter: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
111
+ removeFilter: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
112
+ updateFilterTexts: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
113
+ removeFilterOption: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
114
+ createFilterOption: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
115
+ createAssortment: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
116
+ prepareAssortmentMediaUpload: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
117
+ updateAssortment: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
118
+ removeAssortment: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
119
+ reorderAssortmentMedia: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
120
+ removeAssortmentMedia: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
121
+ updateAssortmentMediaTexts: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
122
+ updateAssortmentTexts: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
123
+ addAssortmentProduct: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
124
+ removeAssortmentProduct: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
125
+ reorderAssortmentProducts: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
126
+ addAssortmentLink: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
127
+ removeAssortmentLink: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
128
+ reorderAssortmentLinks: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
129
+ addAssortmentFilter: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
130
+ removeAssortmentFilter: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
131
+ reorderAssortmentFilters: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
132
+ createProductReview: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
133
+ updateProductReview: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
134
+ removeProductReview: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
135
+ addProductReviewVote: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
136
+ removeProductReviewVote: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
137
+ requestQuotation: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
138
+ rejectQuotation: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
139
+ verifyQuotation: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
140
+ makeQuotationProposal: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
141
+ bookmark: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
142
+ createBookmark: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
143
+ removeBookmark: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
144
+ addWork: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
145
+ allocateWork: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
146
+ finishWork: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
147
+ removeWork: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
148
+ processNextWork: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
149
+ signPaymentProviderForCredentialRegistration: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
150
+ signPaymentProviderForCheckout: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
151
+ removeUserProductReviews: (root: any, params: any, context: any, ...other: any[]) => Promise<any>;
157
152
  };
158
153
  export default _default;
@@ -4,6 +4,7 @@ import loginWithPassword from "./accounts/loginWithPassword.js";
4
4
  import loginWithWebAuthn from "./accounts/loginWithWebAuthn.js";
5
5
  import loginAsGuest from "./accounts/loginAsGuest.js";
6
6
  import logout from "./accounts/logout.js";
7
+ import logoutAllSessions from "./accounts/logoutAllSessions.js";
7
8
  import impersonate from "./accounts/impersonate.js";
8
9
  import stopImpersonation from "./accounts/stopImpersonation.js";
9
10
  import changePassword from "./accounts/changePassword.js";
@@ -69,8 +70,6 @@ import updateCartItem from "./orders/updateCartItem.js";
69
70
  import removeCartItem from "./orders/removeCartItem.js";
70
71
  import removeCartDiscount from "./orders/removeCartDiscount.js";
71
72
  import removeOrder from "./orders/removeOrder.js";
72
- import setOrderPaymentProvider from "./orders/setOrderPaymentProvider.js";
73
- import setOrderDeliveryProvider from "./orders/setOrderDeliveryProvider.js";
74
73
  import confirmOrder from "./orders/confirmOrder.js";
75
74
  import payOrder from "./orders/payOrder.js";
76
75
  import deliverOrder from "./orders/deliverOrder.js";
@@ -134,10 +133,6 @@ import updateEnrollment from "./enrollments/updateEnrollment.js";
134
133
  import registerPaymentCredentials from "./payment/registerPaymentCredentials.js";
135
134
  import markPaymentCredentialsPreferred from "./payment/markPaymentCredentialsPreferred.js";
136
135
  import removePaymentCredentials from "./payment/removePaymentCredentials.js";
137
- import updateOrderDeliveryShipping from "./orders/updateOrderDeliveryShipping.js";
138
- import updateOrderDeliveryPickUp from "./orders/updateOrderDeliveryPickUp.js";
139
- import updateOrderPaymentGeneric from "./orders/updateOrderPaymentGeneric.js";
140
- import updateOrderPaymentInvoice from "./orders/updateOrderPaymentInvoice.js";
141
136
  import signPaymentProviderForCredentialRegistration from "./payment/signPaymentProviderForCredentialRegistration.js";
142
137
  import signPaymentProviderForCheckout from "./orders/signPaymentProviderForCheckout.js";
143
138
  import pageView from "./pageView.js";
@@ -157,6 +152,7 @@ import updateCartPaymentGeneric from "./orders/updateCartPaymentGeneric.js";
157
152
  import updateCartPaymentInvoice from "./orders/updateCartPaymentInvoice.js";
158
153
  export default {
159
154
  logout: acl(actions.logout)(logout),
155
+ logoutAllSessions: acl(actions.logoutAllSessions)(logoutAllSessions),
160
156
  loginAsGuest: acl(actions.loginAsGuest)(loginAsGuest),
161
157
  impersonate: acl(actions.impersonate)(impersonate),
162
158
  stopImpersonation: acl(actions.stopImpersonation)(stopImpersonation),
@@ -242,12 +238,6 @@ export default {
242
238
  updateCartDeliveryShipping: acl(actions.updateCart)(updateCartDeliveryShipping),
243
239
  updateCartPaymentGeneric: acl(actions.updateCart)(updateCartPaymentGeneric),
244
240
  updateCartPaymentInvoice: acl(actions.updateCart)(updateCartPaymentInvoice),
245
- setOrderPaymentProvider: acl(actions.updateOrder)(setOrderPaymentProvider),
246
- setOrderDeliveryProvider: acl(actions.updateOrder)(setOrderDeliveryProvider),
247
- updateOrderDeliveryShipping: acl(actions.updateOrderDelivery)(updateOrderDeliveryShipping),
248
- updateOrderDeliveryPickUp: acl(actions.updateOrderDelivery)(updateOrderDeliveryPickUp),
249
- updateOrderPaymentGeneric: acl(actions.updateOrderPayment)(updateOrderPaymentGeneric),
250
- updateOrderPaymentInvoice: acl(actions.updateOrderPayment)(updateOrderPaymentInvoice),
251
241
  removeOrder: acl(actions.updateOrder)(removeOrder),
252
242
  confirmOrder: acl(actions.markOrderConfirmed)(confirmOrder),
253
243
  rejectOrder: acl(actions.markOrderRejected)(rejectOrder),
@@ -1,9 +1,15 @@
1
1
  import { log } from '@unchainedshop/logger';
2
- import { OrderNotFoundError, OrderWrongStatusError } from "../../../errors.js";
2
+ import { InvalidIdError, OrderNotFoundError, OrderWrongStatusError } from "../../../errors.js";
3
3
  export default async function updateCart(root, params, context) {
4
4
  const { orderId, billingAddress, contact, paymentProviderId, deliveryProviderId, meta } = params;
5
5
  const { modules, services, userId, user } = context;
6
6
  log('mutation updateCart', { userId });
7
+ if (orderId === '')
8
+ throw new InvalidIdError({ orderId });
9
+ if (paymentProviderId === '')
10
+ throw new InvalidIdError({ paymentProviderId });
11
+ if (deliveryProviderId === '')
12
+ throw new InvalidIdError({ deliveryProviderId });
7
13
  const order = await services.orders.findOrInitCart({
8
14
  orderId,
9
15
  user: user,
@@ -2,4 +2,4 @@ import type { Context } from '../../../context.ts';
2
2
  export default function setRoles(root: never, params: {
3
3
  roles: string[];
4
4
  userId: string;
5
- }, { modules, userId }: Context): Promise<import("mongodb").WithId<import("@unchainedshop/core-users").User> | null>;
5
+ }, context: Context): Promise<import("mongodb").WithId<import("@unchainedshop/core-users").User> | null>;
@@ -1,15 +1,17 @@
1
1
  import { log } from '@unchainedshop/logger';
2
- import { Roles } from '@unchainedshop/roles';
3
2
  import { InvalidIdError, UserNotFoundError } from "../../../errors.js";
4
- export default async function setRoles(root, params, { modules, userId }) {
3
+ import { getPublicRoles } from "../../../roles/index.js";
4
+ export default async function setRoles(root, params, context) {
5
+ const { modules, userId } = context;
5
6
  const foreignUserId = params.userId;
6
7
  log(`mutation setRoles ${foreignUserId}`, { userId });
7
8
  if (!foreignUserId)
8
9
  throw new InvalidIdError({ foreignUserId });
9
10
  if (!(await modules.users.userExists({ userId: foreignUserId })))
10
11
  throw new UserNotFoundError({ userId: foreignUserId });
11
- const invalidRoles = params.roles.filter((role) => !Roles.roles[role]);
12
- if (invalidRoles.length > 0) {
12
+ const publicRoles = getPublicRoles(context.roles);
13
+ const invalidRoles = params.roles.filter((r) => !publicRoles.includes(r));
14
+ if (invalidRoles.length) {
13
15
  throw new Error(`Invalid role names: ${invalidRoles.join(', ')}`);
14
16
  }
15
17
  return modules.users.updateRoles(foreignUserId, params.roles);
@@ -1 +1 @@
1
- export default function registeredEventTypes(): string[];
1
+ export default function registeredEventTypes(): Promise<string[]>;
@@ -1,4 +1,4 @@
1
1
  import { getRegisteredEvents } from '@unchainedshop/events';
2
- export default function registeredEventTypes() {
2
+ export default async function registeredEventTypes() {
3
3
  return getRegisteredEvents();
4
4
  }