@unchainedshop/api 1.1.7 → 1.1.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.
- package/lib/acl.d.ts +0 -1
- package/lib/api-index.d.ts +0 -1
- package/lib/api-index.js +3 -3
- package/lib/api-index.js.map +1 -1
- package/lib/context.d.ts +1 -2
- package/lib/context.js +2 -3
- package/lib/context.js.map +1 -1
- package/lib/createBulkImportServer.d.ts +1 -1
- package/lib/createBulkImportServer.js +2 -2
- package/lib/createBulkImportServer.js.map +1 -1
- package/lib/createGraphQLServer.d.ts +1 -1
- package/lib/createGraphQLServer.js +3 -4
- package/lib/createGraphQLServer.js.map +1 -1
- package/lib/loaders/index.d.ts +1 -1
- package/lib/loaders/index.js +2 -1
- package/lib/loaders/index.js.map +1 -1
- package/lib/locale-context.d.ts +1 -1
- package/lib/locale-context.js +2 -1
- package/lib/locale-context.js.map +1 -1
- package/lib/resolvers/mutations/accounts/addEmail.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/buildSecretTOTPAuthURL.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/changePassword.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/createUser.d.ts +1 -5
- package/lib/resolvers/mutations/accounts/disableTOTP.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/enableTOTP.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/enrollUser.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/forgotPassword.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/impersonate.d.ts +1 -6
- package/lib/resolvers/mutations/accounts/loginAsGuest.d.ts +1 -5
- package/lib/resolvers/mutations/accounts/loginWithPassword.d.ts +1 -5
- package/lib/resolvers/mutations/accounts/logout.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/logoutAllSessions.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/removeEmail.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/resetPassword.d.ts +1 -5
- package/lib/resolvers/mutations/accounts/setPassword.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/setUsername.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/verifyEmail.d.ts +1 -5
- package/lib/resolvers/mutations/assortments/addAssortmentFilter.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/addAssortmentLink.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/addAssortmentMedia.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/addAssortmentProduct.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/createAssortment.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/prepareAssortmentMediaUpload.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortment.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentFilter.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentLink.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentMedia.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/removeAssortmentProduct.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentFilters.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentLinks.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentMedia.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/reorderAssortmentProducts.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/setBaseAssortment.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortment.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentMediaTexts.d.ts +1 -1
- package/lib/resolvers/mutations/assortments/updateAssortmentTexts.d.ts +1 -1
- package/lib/resolvers/mutations/bookmarks/bookmark.d.ts +1 -1
- package/lib/resolvers/mutations/bookmarks/createBookmark.d.ts +1 -1
- package/lib/resolvers/mutations/bookmarks/removeBookmark.d.ts +1 -1
- package/lib/resolvers/mutations/countries/createCountry.d.ts +1 -1
- package/lib/resolvers/mutations/countries/removeCountry.d.ts +1 -1
- package/lib/resolvers/mutations/countries/updateCountry.d.ts +1 -1
- package/lib/resolvers/mutations/currencies/createCurrency.d.ts +1 -1
- package/lib/resolvers/mutations/currencies/removeCurrency.d.ts +1 -1
- package/lib/resolvers/mutations/currencies/updateCurrency.d.ts +1 -1
- package/lib/resolvers/mutations/delivery/createDeliveryProvider.d.ts +1 -1
- package/lib/resolvers/mutations/delivery/removeDeliveryProvider.d.ts +1 -1
- package/lib/resolvers/mutations/delivery/updateDeliveryProvider.d.ts +1 -1
- package/lib/resolvers/mutations/enrollments/activateEnrollment.d.ts +1 -1
- package/lib/resolvers/mutations/enrollments/createEnrollment.d.ts +1 -1
- package/lib/resolvers/mutations/enrollments/terminateEnrollment.d.ts +1 -1
- package/lib/resolvers/mutations/enrollments/updateEnrollment.d.ts +1 -1
- package/lib/resolvers/mutations/files/confirmMediaUpload.d.ts +1 -1
- package/lib/resolvers/mutations/filters/createFilter.d.ts +1 -1
- package/lib/resolvers/mutations/filters/createFilterOption.d.ts +1 -1
- package/lib/resolvers/mutations/filters/removeFilter.d.ts +1 -1
- package/lib/resolvers/mutations/filters/removeFilterOption.d.ts +1 -1
- package/lib/resolvers/mutations/filters/updateFilter.d.ts +1 -1
- package/lib/resolvers/mutations/filters/updateFilterTexts.d.ts +1 -1
- package/lib/resolvers/mutations/languages/createLanguage.d.ts +1 -1
- package/lib/resolvers/mutations/languages/removeLanguage.d.ts +1 -1
- package/lib/resolvers/mutations/languages/updateLanguage.d.ts +1 -1
- package/lib/resolvers/mutations/orders/addCartDiscount.d.ts +1 -1
- package/lib/resolvers/mutations/orders/addCartProduct.d.ts +1 -1
- package/lib/resolvers/mutations/orders/addCartQuotation.d.ts +1 -1
- package/lib/resolvers/mutations/orders/checkoutCart.d.ts +1 -1
- package/lib/resolvers/mutations/orders/confirmOrder.d.ts +1 -1
- package/lib/resolvers/mutations/orders/createCart.d.ts +1 -1
- package/lib/resolvers/mutations/orders/deliverOrder.d.ts +1 -1
- package/lib/resolvers/mutations/orders/emptyCart.d.ts +1 -1
- package/lib/resolvers/mutations/orders/payOrder.d.ts +1 -1
- package/lib/resolvers/mutations/orders/rejectOrder.d.ts +1 -1
- package/lib/resolvers/mutations/orders/removeCartDiscount.d.ts +1 -1
- package/lib/resolvers/mutations/orders/removeCartItem.d.ts +1 -1
- package/lib/resolvers/mutations/orders/removeOrder.d.ts +1 -1
- package/lib/resolvers/mutations/orders/setOrderDeliveryProvider.d.ts +1 -1
- package/lib/resolvers/mutations/orders/setOrderPaymentProvider.d.ts +1 -1
- package/lib/resolvers/mutations/orders/signPaymentProviderForCheckout.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateCart.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateCartItem.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateOrderDeliveryPickUp.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateOrderDeliveryShipping.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentCard.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentGeneric.d.ts +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentInvoice.d.ts +1 -1
- package/lib/resolvers/mutations/payment/createPaymentProvider.d.ts +1 -2
- package/lib/resolvers/mutations/payment/markPaymentCredentialsPreferred.d.ts +1 -1
- package/lib/resolvers/mutations/payment/registerPaymentCredentials.d.ts +1 -1
- package/lib/resolvers/mutations/payment/removePaymentCredentials.d.ts +1 -2
- package/lib/resolvers/mutations/payment/removePaymentProvider.d.ts +1 -2
- package/lib/resolvers/mutations/payment/signPaymentProviderForCredentialRegistration.d.ts +1 -1
- package/lib/resolvers/mutations/payment/updatePaymentProvider.d.ts +1 -2
- package/lib/resolvers/mutations/products/addProductAssignment.d.ts +1 -1
- package/lib/resolvers/mutations/products/addProductMedia.d.ts +1 -1
- package/lib/resolvers/mutations/products/addProductReviewVote.d.ts +1 -1
- package/lib/resolvers/mutations/products/createProduct.d.ts +1 -1
- package/lib/resolvers/mutations/products/createProductBundleItem.d.ts +1 -1
- package/lib/resolvers/mutations/products/createProductReview.d.ts +1 -1
- package/lib/resolvers/mutations/products/createProductVariation.d.ts +1 -1
- package/lib/resolvers/mutations/products/createProductVariationOption.d.ts +1 -1
- package/lib/resolvers/mutations/products/prepareProductMediaUpload.d.ts +1 -1
- package/lib/resolvers/mutations/products/publishProduct.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeBundleItem.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProduct.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProductAssignment.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProductMedia.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProductReview.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProductReviewVote.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProductVariation.d.ts +1 -1
- package/lib/resolvers/mutations/products/removeProductVariationOption.d.ts +1 -1
- package/lib/resolvers/mutations/products/reorderProductMedia.d.ts +1 -1
- package/lib/resolvers/mutations/products/unpublishProduct.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProduct.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductCommerce.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductMediaTexts.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductPlan.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductReview.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductSupply.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductTexts.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductVariationTexts.d.ts +1 -1
- package/lib/resolvers/mutations/products/updateProductWarehousing.d.ts +1 -1
- package/lib/resolvers/mutations/quotations/makeQuotationProposal.d.ts +1 -1
- package/lib/resolvers/mutations/quotations/rejectQuotation.d.ts +1 -1
- package/lib/resolvers/mutations/quotations/requestQuotation.d.ts +1 -1
- package/lib/resolvers/mutations/quotations/verifyQuotation.d.ts +1 -1
- package/lib/resolvers/mutations/users/heartbeat.d.ts +1 -1
- package/lib/resolvers/mutations/users/prepareUserAvatarUpload.d.ts +1 -1
- package/lib/resolvers/mutations/users/setRoles.d.ts +1 -1
- package/lib/resolvers/mutations/users/setUserTags.d.ts +1 -1
- package/lib/resolvers/mutations/users/updateUserAvatar.d.ts +1 -1
- package/lib/resolvers/mutations/users/updateUserProfile.d.ts +1 -1
- package/lib/resolvers/mutations/utils/getOrderCart.d.ts +1 -2
- package/lib/resolvers/mutations/warehousing/createWarehousingProvider.d.ts +1 -1
- package/lib/resolvers/mutations/warehousing/removeWarehousingProvider.d.ts +1 -1
- package/lib/resolvers/mutations/warehousing/updateWarehousingProvider.d.ts +1 -1
- package/lib/resolvers/mutations/worker/addWork.d.ts +1 -1
- package/lib/resolvers/mutations/worker/allocateWork.d.ts +1 -1
- package/lib/resolvers/mutations/worker/doWork.d.ts +1 -1
- package/lib/resolvers/mutations/worker/finishWork.d.ts +1 -1
- package/lib/resolvers/mutations/worker/removeWork.d.ts +1 -1
- package/lib/resolvers/queries/assortments/assortment.d.ts +1 -1
- package/lib/resolvers/queries/assortments/assortments.d.ts +1 -1
- package/lib/resolvers/queries/assortments/assortmentsCount.d.ts +1 -1
- package/lib/resolvers/queries/assortments/translatedAssortmentMediaTexts.d.ts +1 -1
- package/lib/resolvers/queries/assortments/translatedAssortmentTexts.d.ts +1 -1
- package/lib/resolvers/queries/countries/countries.d.ts +1 -1
- package/lib/resolvers/queries/countries/countriesCount.d.ts +1 -1
- package/lib/resolvers/queries/countries/country.d.ts +1 -1
- package/lib/resolvers/queries/currencies/currencies.d.ts +1 -1
- package/lib/resolvers/queries/currencies/currenciesCount.d.ts +1 -1
- package/lib/resolvers/queries/currencies/currency.d.ts +1 -1
- package/lib/resolvers/queries/delivery/deliveryProvider.d.ts +1 -1
- package/lib/resolvers/queries/delivery/deliveryProviders.d.ts +1 -1
- package/lib/resolvers/queries/delivery/deliveryProvidersCount.d.ts +1 -1
- package/lib/resolvers/queries/enrollments/enrollment.d.ts +1 -1
- package/lib/resolvers/queries/enrollments/enrollments.d.ts +1 -1
- package/lib/resolvers/queries/enrollments/enrollmentsCount.d.ts +1 -1
- package/lib/resolvers/queries/events/event.d.ts +1 -1
- package/lib/resolvers/queries/events/events.d.ts +1 -1
- package/lib/resolvers/queries/events/eventsCounts.d.ts +1 -1
- package/lib/resolvers/queries/filters/filter.d.ts +1 -1
- package/lib/resolvers/queries/filters/filters.d.ts +1 -1
- package/lib/resolvers/queries/filters/filtersCount.d.ts +1 -1
- package/lib/resolvers/queries/filters/searchAssortments.d.ts +1 -1
- package/lib/resolvers/queries/filters/searchProducts.d.ts +1 -1
- package/lib/resolvers/queries/filters/translatedFilterTexts.d.ts +1 -1
- package/lib/resolvers/queries/languages/language.d.ts +1 -1
- package/lib/resolvers/queries/languages/languages.d.ts +1 -1
- package/lib/resolvers/queries/languages/languagesCount.d.ts +1 -1
- package/lib/resolvers/queries/orders/order.d.ts +1 -1
- package/lib/resolvers/queries/orders/orders.d.ts +1 -1
- package/lib/resolvers/queries/orders/ordersCount.d.ts +1 -1
- package/lib/resolvers/queries/payment/paymentProvider.d.ts +1 -1
- package/lib/resolvers/queries/payment/paymentProviders.d.ts +1 -1
- package/lib/resolvers/queries/payment/paymentProvidersCount.d.ts +1 -1
- package/lib/resolvers/queries/products/product.d.ts +1 -1
- package/lib/resolvers/queries/products/productCatalogPrices.d.ts +1 -1
- package/lib/resolvers/queries/products/productReview.d.ts +1 -1
- package/lib/resolvers/queries/products/productReviews.d.ts +1 -1
- package/lib/resolvers/queries/products/productReviewsCount.d.ts +1 -1
- package/lib/resolvers/queries/products/products.d.ts +1 -1
- package/lib/resolvers/queries/products/productsCount.d.ts +1 -1
- package/lib/resolvers/queries/products/translatedProductMediaTexts.d.ts +1 -1
- package/lib/resolvers/queries/products/translatedProductTexts.d.ts +1 -1
- package/lib/resolvers/queries/products/translatedProductVariationTexts.d.ts +1 -1
- package/lib/resolvers/queries/quotations/quotation.d.ts +1 -1
- package/lib/resolvers/queries/quotations/quotations.d.ts +1 -1
- package/lib/resolvers/queries/quotations/quotationsCount.d.ts +1 -1
- package/lib/resolvers/queries/users/me.d.ts +1 -1
- package/lib/resolvers/queries/users/user.d.ts +1 -1
- package/lib/resolvers/queries/users/users.d.ts +1 -1
- package/lib/resolvers/queries/users/usersCount.d.ts +1 -1
- package/lib/resolvers/queries/warehousing/warehousingProvider.d.ts +1 -1
- package/lib/resolvers/queries/warehousing/warehousingProviders.d.ts +1 -1
- package/lib/resolvers/queries/warehousing/warehousingProvidersCount.d.ts +1 -1
- package/lib/resolvers/queries/worker/activeWorkTypes.d.ts +1 -1
- package/lib/resolvers/queries/worker/work.d.ts +1 -1
- package/lib/resolvers/queries/worker/workQueueCount.d.ts +1 -1
- package/lib/resolvers/type/login-method-response-types.d.ts +1 -19
- package/lib/resolvers/type/order/order-delivery-types.d.ts +1 -3
- package/lib/resolvers/type/order/order-payment-types.d.ts +1 -3
- package/lib/resolvers/type/user-types.d.ts +1 -1
- package/lib/user-context.d.ts +1 -1
- package/package.json +8 -8
- package/src/api-index.ts +9 -3
- package/src/context.ts +2 -3
- package/src/createBulkImportServer.ts +2 -2
- package/src/createGraphQLServer.ts +3 -4
- package/src/loaders/index.ts +3 -1
- package/src/locale-context.ts +3 -1
- package/src/resolvers/type/user-types.ts +1 -1
- package/tsconfig.build.json +13 -5
- package/lib/resolvers/queries/delivery/deliveryInterfaces.d.ts +0 -5
- package/lib/resolvers/queries/payment/paymentInterfaces.d.ts +0 -5
- package/lib/resolvers/queries/warehousing/warehousingInterfaces.d.ts +0 -5
- package/lib/resolvers/queries/worker/workQueue.d.ts +0 -14
- package/lib/resolvers/type/delivery-provider-types.d.ts +0 -27
- package/lib/resolvers/type/payment/payment-provider-types.d.ts +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/api",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"main": "lib/api-index.js",
|
|
5
5
|
"types": "lib/api-index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"graphql-scalars": "^1.x"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@unchainedshop/logger": "^1.1.
|
|
38
|
-
"@unchainedshop/utils": "^1.1.
|
|
37
|
+
"@unchainedshop/logger": "^1.1.9",
|
|
38
|
+
"@unchainedshop/utils": "^1.1.9",
|
|
39
39
|
"accounting": "0.4.1",
|
|
40
40
|
"dataloader": "^2.1.0",
|
|
41
41
|
"locale": "0.1.0",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/graphql-upload": "^8.0.11",
|
|
47
47
|
"@types/locale": "^0.1.1",
|
|
48
|
-
"@unchainedshop/core": "^1.1.
|
|
49
|
-
"@unchainedshop/events": "^1.1.
|
|
50
|
-
"@unchainedshop/roles": "^1.1.
|
|
51
|
-
"@unchainedshop/types": "^1.1.
|
|
48
|
+
"@unchainedshop/core": "^1.1.9",
|
|
49
|
+
"@unchainedshop/events": "^1.1.9",
|
|
50
|
+
"@unchainedshop/roles": "^1.1.9",
|
|
51
|
+
"@unchainedshop/types": "^1.1.9",
|
|
52
52
|
"apollo-server-express": "*",
|
|
53
53
|
"chai": "^4.3.6",
|
|
54
54
|
"cross-env": "^7.0.3",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"graphql-scalars": "^1.17.0",
|
|
57
57
|
"typescript": "^4.7.4"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "5395cd35169a1fd13bb83ff7d11cc8a162b27b09"
|
|
60
60
|
}
|
package/src/api-index.ts
CHANGED
|
@@ -14,7 +14,13 @@ export { createContextResolver, getCurrentContextResolver, setCurrentContextReso
|
|
|
14
14
|
const UNCHAINED_API_VERSION = '1.1.3'; // eslint-disable-line
|
|
15
15
|
|
|
16
16
|
export const startAPIServer = (options: UnchainedServerOptions) => {
|
|
17
|
-
const {
|
|
17
|
+
const {
|
|
18
|
+
unchainedAPI,
|
|
19
|
+
roles,
|
|
20
|
+
expressApp,
|
|
21
|
+
context: customContext,
|
|
22
|
+
...apolloServerOptions
|
|
23
|
+
} = options || {};
|
|
18
24
|
|
|
19
25
|
const contextResolver = createContextResolver(unchainedAPI, roles, UNCHAINED_API_VERSION);
|
|
20
26
|
|
|
@@ -26,8 +32,8 @@ export const startAPIServer = (options: UnchainedServerOptions) => {
|
|
|
26
32
|
: contextResolver,
|
|
27
33
|
);
|
|
28
34
|
|
|
29
|
-
const apolloGraphQLServer = createGraphQLServer(apolloServerOptions);
|
|
30
|
-
const bulkImportServer = createBulkImportServer();
|
|
35
|
+
const apolloGraphQLServer = createGraphQLServer(expressApp, apolloServerOptions);
|
|
36
|
+
const bulkImportServer = createBulkImportServer(expressApp);
|
|
31
37
|
|
|
32
38
|
return {
|
|
33
39
|
apolloGraphQLServer,
|
package/src/context.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { UnchainedAPI, UnchainedContextResolver } from '@unchainedshop/types/api';
|
|
2
|
-
import { WebApp } from 'meteor/webapp';
|
|
3
2
|
import { IncomingMessage } from 'http';
|
|
4
3
|
import instantiateLoaders from './loaders';
|
|
5
4
|
import { getLocaleContext } from './locale-context';
|
|
@@ -33,8 +32,8 @@ export const createContextResolver =
|
|
|
33
32
|
};
|
|
34
33
|
};
|
|
35
34
|
|
|
36
|
-
export const useMiddlewareWithCurrentContext = (path, middleware) => {
|
|
37
|
-
|
|
35
|
+
export const useMiddlewareWithCurrentContext = (expressApp, path, middleware) => {
|
|
36
|
+
expressApp.use(
|
|
38
37
|
path,
|
|
39
38
|
async (req: IncomingMessage & { unchainedContext?: UnchainedAPI }, res, ...rest) => {
|
|
40
39
|
req.unchainedContext = await context({ req, res });
|
|
@@ -90,6 +90,6 @@ const bulkImportMiddleware = async (req, res) => {
|
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
92
|
|
|
93
|
-
export default () => {
|
|
94
|
-
useMiddlewareWithCurrentContext(BULK_IMPORT_API_PATH, bulkImportMiddleware);
|
|
93
|
+
export default (expressApp) => {
|
|
94
|
+
useMiddlewareWithCurrentContext(expressApp, BULK_IMPORT_API_PATH, bulkImportMiddleware);
|
|
95
95
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ApolloServer, ApolloError } from 'apollo-server-express';
|
|
2
2
|
import { processRequest } from 'graphql-upload';
|
|
3
|
-
import { WebApp } from 'meteor/webapp';
|
|
4
3
|
import { log, LogLevel } from '@unchainedshop/logger';
|
|
5
4
|
import typeDefs from './schema';
|
|
6
5
|
import resolvers from './resolvers';
|
|
@@ -36,7 +35,7 @@ const logGraphQLServerError = (error) => {
|
|
|
36
35
|
} catch (e) {} // eslint-disable-line
|
|
37
36
|
};
|
|
38
37
|
|
|
39
|
-
export default (options) => {
|
|
38
|
+
export default (expressApp, options) => {
|
|
40
39
|
const {
|
|
41
40
|
corsOrigins = null, // no cookie handling
|
|
42
41
|
typeDefs: additionalTypeDefs = [],
|
|
@@ -103,7 +102,7 @@ export default (options) => {
|
|
|
103
102
|
},
|
|
104
103
|
});
|
|
105
104
|
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
expressApp.use(handleUploads({ maxFileSize: 10000000, maxFiles: 10 }));
|
|
106
|
+
expressApp.use(middleware);
|
|
108
107
|
return server;
|
|
109
108
|
};
|
package/src/loaders/index.ts
CHANGED
|
@@ -2,7 +2,9 @@ import { UnchainedAPI, UnchainedLoaders } from '@unchainedshop/types/api';
|
|
|
2
2
|
import DataLoader from 'dataloader';
|
|
3
3
|
import { IncomingMessage } from 'http';
|
|
4
4
|
import { systemLocale } from '@unchainedshop/utils';
|
|
5
|
-
import
|
|
5
|
+
import localePkg from 'locale';
|
|
6
|
+
|
|
7
|
+
const { Locale } = localePkg;
|
|
6
8
|
|
|
7
9
|
export default async (
|
|
8
10
|
req: IncomingMessage,
|
package/src/locale-context.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UnchainedAPI, UnchainedLocaleContext } from '@unchainedshop/types/api';
|
|
2
2
|
import { IncomingMessage } from 'http';
|
|
3
|
-
import
|
|
3
|
+
import localePkg from 'locale';
|
|
4
4
|
import 'abort-controller/polyfill';
|
|
5
5
|
import LRU from 'lru-cache';
|
|
6
6
|
import { log, LogLevel } from '@unchainedshop/logger';
|
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
systemLocale,
|
|
12
12
|
} from '@unchainedshop/utils';
|
|
13
13
|
|
|
14
|
+
const { Locales } = localePkg;
|
|
15
|
+
|
|
14
16
|
const { NODE_ENV } = process.env;
|
|
15
17
|
|
|
16
18
|
const ttl = NODE_ENV === 'production' ? 1000 * 60 : 0; // minute or second
|
|
@@ -9,7 +9,7 @@ import { Order } from '@unchainedshop/types/orders';
|
|
|
9
9
|
import { PaymentCredentials } from '@unchainedshop/types/payments';
|
|
10
10
|
import { Quotation } from '@unchainedshop/types/quotations';
|
|
11
11
|
import { Email, User as UserType, UserProfile } from '@unchainedshop/types/user';
|
|
12
|
-
import { Locale } from 'locale';
|
|
12
|
+
import type { Locale } from 'locale';
|
|
13
13
|
import { log, LogLevel } from '@unchainedshop/logger';
|
|
14
14
|
import { checkAction, checkTypeResolver } from '../../acl';
|
|
15
15
|
import { actions } from '../../roles';
|
package/tsconfig.build.json
CHANGED
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
"esModuleInterop": true,
|
|
7
7
|
"experimentalDecorators": true,
|
|
8
8
|
"forceConsistentCasingInFileNames": true,
|
|
9
|
-
"lib": [
|
|
9
|
+
"lib": [
|
|
10
|
+
"esnext"
|
|
11
|
+
],
|
|
10
12
|
"module": "esnext",
|
|
11
13
|
"moduleResolution": "node",
|
|
12
14
|
"noImplicitReturns": true,
|
|
@@ -16,11 +18,17 @@
|
|
|
16
18
|
"skipLibCheck": true,
|
|
17
19
|
"sourceMap": true,
|
|
18
20
|
"target": "esnext",
|
|
19
|
-
"types": [
|
|
21
|
+
"types": [
|
|
22
|
+
"node"
|
|
23
|
+
],
|
|
20
24
|
"baseUrl": ".", // This must be specified if "paths" is.
|
|
21
25
|
"paths": {
|
|
22
|
-
"
|
|
26
|
+
"@unchainedshop/*": [
|
|
27
|
+
"node_modules/@unchainedshop/types/index.d.ts"
|
|
28
|
+
]
|
|
23
29
|
}
|
|
24
30
|
},
|
|
25
|
-
"include": [
|
|
26
|
-
|
|
31
|
+
"include": [
|
|
32
|
+
"src"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Context, Root } from '@unchainedshop/types/api';
|
|
2
|
-
import { DeliveryProviderType } from '@unchainedshop/types/delivery';
|
|
3
|
-
export default function deliveryInterfaces(root: Root, { type }: {
|
|
4
|
-
type: DeliveryProviderType;
|
|
5
|
-
}, { modules, userId }: Context): import("@unchainedshop/types/delivery").DeliveryInterface[];
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { PaymentProviderType } from '@unchainedshop/types/payments';
|
|
2
|
-
import { Context, Root } from '@unchainedshop/types/api';
|
|
3
|
-
export default function paymentInterfaces(root: Root, { type }: {
|
|
4
|
-
type: PaymentProviderType;
|
|
5
|
-
}, { modules, userId }: Context): Promise<import("@unchainedshop/types/payments").PaymentInterface[]>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Context, Root } from '@unchainedshop/types/api';
|
|
2
|
-
import { WarehousingProviderType } from '@unchainedshop/types/warehousing';
|
|
3
|
-
export default function warehousingInterfaces(root: Root, params: {
|
|
4
|
-
type: WarehousingProviderType;
|
|
5
|
-
}, { modules, userId }: Context): Promise<import("@unchainedshop/types/warehousing").WarehousingInterface[]>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Root, Context, SortOption } from '@unchainedshop/types/api';
|
|
2
|
-
import { WorkStatus } from '@unchainedshop/types/worker';
|
|
3
|
-
export default function workers(root: Root, { limit, offset, status, types, created, queryString, sort, }: {
|
|
4
|
-
limit?: number;
|
|
5
|
-
offset?: number;
|
|
6
|
-
queryString?: string;
|
|
7
|
-
status?: Array<WorkStatus>;
|
|
8
|
-
types?: Array<string>;
|
|
9
|
-
created?: {
|
|
10
|
-
start: Date;
|
|
11
|
-
end: Date;
|
|
12
|
-
};
|
|
13
|
-
sort?: Array<SortOption>;
|
|
14
|
-
}, { modules, userId }: Context): Promise<import("@unchainedshop/types/worker").Work[]>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Context } from '@unchainedshop/types/api';
|
|
2
|
-
import { DeliveryError, DeliveryProvider as DeliveryProviderType } from '@unchainedshop/types/delivery';
|
|
3
|
-
declare type HelperType<P, T> = (provider: DeliveryProviderType, params: P, context: Context) => T;
|
|
4
|
-
export interface DeliveryProviderHelperTypes {
|
|
5
|
-
interface: HelperType<never, {
|
|
6
|
-
_id: string;
|
|
7
|
-
label: string;
|
|
8
|
-
version: string;
|
|
9
|
-
}>;
|
|
10
|
-
isActive: HelperType<void, Promise<boolean>>;
|
|
11
|
-
configurationError: HelperType<never, Promise<DeliveryError>>;
|
|
12
|
-
simulatedPrice: HelperType<{
|
|
13
|
-
currency?: string;
|
|
14
|
-
orderId: string;
|
|
15
|
-
useNetPrice?: boolean;
|
|
16
|
-
context: any;
|
|
17
|
-
}, Promise<{
|
|
18
|
-
_id: string;
|
|
19
|
-
amount: number;
|
|
20
|
-
currencyCode: string;
|
|
21
|
-
countryCode: string;
|
|
22
|
-
isTaxable: boolean;
|
|
23
|
-
isNetPrice: boolean;
|
|
24
|
-
}>>;
|
|
25
|
-
}
|
|
26
|
-
export declare const DeliveryProvider: DeliveryProviderHelperTypes;
|
|
27
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Context } from '@unchainedshop/types/api';
|
|
2
|
-
import { PaymentError, PaymentProvider as PaymentProviderType } from '@unchainedshop/types/payments';
|
|
3
|
-
export interface PaymentProviderHelperTypes {
|
|
4
|
-
interface: (provider: PaymentProviderType, _: never, context: Context) => {
|
|
5
|
-
_id: string;
|
|
6
|
-
label: string;
|
|
7
|
-
version: string;
|
|
8
|
-
};
|
|
9
|
-
isActive: (provider: PaymentProviderType, _: never, context: Context) => Promise<boolean>;
|
|
10
|
-
configurationError: (provider: PaymentProviderType, _: never, context: Context) => Promise<PaymentError>;
|
|
11
|
-
}
|
|
12
|
-
export declare const PaymentProvider: PaymentProviderHelperTypes;
|