@unchainedshop/api 2.13.0 → 3.0.0-alpha2
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/api-index.d.ts +13 -4
- package/lib/api-index.d.ts.map +1 -1
- package/lib/api-index.js +4 -5
- package/lib/api-index.js.map +1 -1
- package/lib/context.d.ts +14 -1
- package/lib/context.d.ts.map +1 -1
- package/lib/context.js +10 -9
- package/lib/context.js.map +1 -1
- package/lib/createGraphQLServer.d.ts +1 -2
- package/lib/createGraphQLServer.d.ts.map +1 -1
- package/lib/createGraphQLServer.js +22 -31
- package/lib/createGraphQLServer.js.map +1 -1
- package/lib/errors.d.ts +3 -6
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +6 -9
- package/lib/errors.js.map +1 -1
- package/lib/events.d.ts +5 -0
- package/lib/events.d.ts.map +1 -0
- package/lib/events.js +8 -0
- package/lib/events.js.map +1 -0
- package/lib/express/createBulkImportMiddleware.d.ts +6 -1
- package/lib/express/createBulkImportMiddleware.d.ts.map +1 -1
- package/lib/express/createBulkImportMiddleware.js +1 -3
- package/lib/express/createBulkImportMiddleware.js.map +1 -1
- package/lib/express/createERCMetadataMiddleware.d.ts +4 -1
- package/lib/express/createERCMetadataMiddleware.d.ts.map +1 -1
- package/lib/express/createERCMetadataMiddleware.js +1 -3
- package/lib/express/createERCMetadataMiddleware.js.map +1 -1
- package/lib/express/index.d.ts +7 -6
- package/lib/express/index.d.ts.map +1 -1
- package/lib/express/index.js +98 -13
- package/lib/express/index.js.map +1 -1
- package/lib/express/passport/access-token-strategy.d.ts +10 -0
- package/lib/express/passport/access-token-strategy.d.ts.map +1 -0
- package/lib/express/passport/access-token-strategy.js +33 -0
- package/lib/express/passport/access-token-strategy.js.map +1 -0
- package/lib/express/passport/setup.d.ts +4 -0
- package/lib/express/passport/setup.d.ts.map +1 -0
- package/lib/express/passport/setup.js +30 -0
- package/lib/express/passport/setup.js.map +1 -0
- package/lib/loaders/index.d.ts +1 -2
- package/lib/loaders/index.d.ts.map +1 -1
- package/lib/loaders/index.js +2 -2
- package/lib/loaders/index.js.map +1 -1
- package/lib/locale-context.d.ts +6 -4
- package/lib/locale-context.d.ts.map +1 -1
- package/lib/locale-context.js +4 -6
- package/lib/locale-context.js.map +1 -1
- package/lib/resolvers/index.d.ts.map +1 -1
- package/lib/resolvers/index.js +0 -2
- package/lib/resolvers/index.js.map +1 -1
- package/lib/resolvers/mutations/accounts/addEmail.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/addEmail.js +10 -2
- package/lib/resolvers/mutations/accounts/addEmail.js.map +1 -1
- package/lib/resolvers/mutations/accounts/addWebAuthnCredentials.js +1 -1
- package/lib/resolvers/mutations/accounts/addWebAuthnCredentials.js.map +1 -1
- package/lib/resolvers/mutations/accounts/changePassword.d.ts +2 -2
- package/lib/resolvers/mutations/accounts/changePassword.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/changePassword.js +13 -7
- package/lib/resolvers/mutations/accounts/changePassword.js.map +1 -1
- package/lib/resolvers/mutations/accounts/createUser.d.ts +2 -3
- package/lib/resolvers/mutations/accounts/createUser.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/createUser.js +21 -26
- package/lib/resolvers/mutations/accounts/createUser.js.map +1 -1
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialCreationOptions.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialCreationOptions.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialCreationOptions.js +2 -2
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialCreationOptions.js.map +1 -1
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialRequestOptions.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialRequestOptions.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialRequestOptions.js +3 -3
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialRequestOptions.js.map +1 -1
- package/lib/resolvers/mutations/accounts/enrollUser.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/enrollUser.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/enrollUser.js +13 -16
- package/lib/resolvers/mutations/accounts/enrollUser.js.map +1 -1
- package/lib/resolvers/mutations/accounts/forgotPassword.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/forgotPassword.js +11 -8
- package/lib/resolvers/mutations/accounts/forgotPassword.js.map +1 -1
- package/lib/resolvers/mutations/accounts/loginAsGuest.d.ts +1 -2
- package/lib/resolvers/mutations/accounts/loginAsGuest.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/loginAsGuest.js +18 -3
- package/lib/resolvers/mutations/accounts/loginAsGuest.js.map +1 -1
- package/lib/resolvers/mutations/accounts/loginWithPassword.d.ts +2 -4
- package/lib/resolvers/mutations/accounts/loginWithPassword.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/loginWithPassword.js +23 -26
- package/lib/resolvers/mutations/accounts/loginWithPassword.js.map +1 -1
- package/lib/resolvers/mutations/accounts/loginWithWebAuthn.d.ts +1 -2
- package/lib/resolvers/mutations/accounts/loginWithWebAuthn.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/loginWithWebAuthn.js +13 -14
- package/lib/resolvers/mutations/accounts/loginWithWebAuthn.js.map +1 -1
- package/lib/resolvers/mutations/accounts/logout.d.ts +1 -3
- package/lib/resolvers/mutations/accounts/logout.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/logout.js +5 -18
- package/lib/resolvers/mutations/accounts/logout.js.map +1 -1
- package/lib/resolvers/mutations/accounts/removeEmail.js +1 -1
- package/lib/resolvers/mutations/accounts/removeEmail.js.map +1 -1
- package/lib/resolvers/mutations/accounts/resetPassword.d.ts +2 -3
- package/lib/resolvers/mutations/accounts/resetPassword.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/resetPassword.js +48 -43
- package/lib/resolvers/mutations/accounts/resetPassword.js.map +1 -1
- package/lib/resolvers/mutations/accounts/sendEnrollmentEmail.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/sendEnrollmentEmail.js +5 -1
- package/lib/resolvers/mutations/accounts/sendEnrollmentEmail.js.map +1 -1
- package/lib/resolvers/mutations/accounts/sendVerificationEmail.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/sendVerificationEmail.js +15 -4
- package/lib/resolvers/mutations/accounts/sendVerificationEmail.js.map +1 -1
- package/lib/resolvers/mutations/accounts/setPassword.d.ts +1 -1
- package/lib/resolvers/mutations/accounts/setPassword.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/setPassword.js +11 -3
- package/lib/resolvers/mutations/accounts/setPassword.js.map +1 -1
- package/lib/resolvers/mutations/accounts/setUsername.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/setUsername.js +10 -2
- package/lib/resolvers/mutations/accounts/setUsername.js.map +1 -1
- package/lib/resolvers/mutations/accounts/verifyEmail.d.ts +1 -2
- package/lib/resolvers/mutations/accounts/verifyEmail.d.ts.map +1 -1
- package/lib/resolvers/mutations/accounts/verifyEmail.js +14 -6
- package/lib/resolvers/mutations/accounts/verifyEmail.js.map +1 -1
- package/lib/resolvers/mutations/assortments/createAssortment.d.ts +5 -7
- package/lib/resolvers/mutations/assortments/createAssortment.d.ts.map +1 -1
- package/lib/resolvers/mutations/assortments/createAssortment.js +7 -5
- package/lib/resolvers/mutations/assortments/createAssortment.js.map +1 -1
- package/lib/resolvers/mutations/filters/createFilter.d.ts +4 -5
- package/lib/resolvers/mutations/filters/createFilter.d.ts.map +1 -1
- package/lib/resolvers/mutations/filters/createFilter.js +7 -2
- package/lib/resolvers/mutations/filters/createFilter.js.map +1 -1
- package/lib/resolvers/mutations/filters/createFilterOption.d.ts +3 -4
- package/lib/resolvers/mutations/filters/createFilterOption.d.ts.map +1 -1
- package/lib/resolvers/mutations/filters/createFilterOption.js +5 -2
- package/lib/resolvers/mutations/filters/createFilterOption.js.map +1 -1
- package/lib/resolvers/mutations/index.d.ts +0 -12
- package/lib/resolvers/mutations/index.d.ts.map +1 -1
- package/lib/resolvers/mutations/index.js +0 -24
- package/lib/resolvers/mutations/index.js.map +1 -1
- package/lib/resolvers/mutations/orders/addCartDiscount.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/addCartDiscount.js +3 -1
- package/lib/resolvers/mutations/orders/addCartDiscount.js.map +1 -1
- package/lib/resolvers/mutations/orders/addCartProduct.js +1 -0
- package/lib/resolvers/mutations/orders/addCartProduct.js.map +1 -1
- package/lib/resolvers/mutations/orders/addCartQuotation.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/addCartQuotation.js +3 -1
- package/lib/resolvers/mutations/orders/addCartQuotation.js.map +1 -1
- package/lib/resolvers/mutations/orders/addMultipleCartProducts.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/addMultipleCartProducts.js +3 -1
- package/lib/resolvers/mutations/orders/addMultipleCartProducts.js.map +1 -1
- package/lib/resolvers/mutations/orders/confirmOrder.d.ts +0 -1
- package/lib/resolvers/mutations/orders/confirmOrder.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/confirmOrder.js.map +1 -1
- package/lib/resolvers/mutations/orders/emptyCart.js +2 -2
- package/lib/resolvers/mutations/orders/emptyCart.js.map +1 -1
- package/lib/resolvers/mutations/orders/rejectOrder.d.ts +0 -1
- package/lib/resolvers/mutations/orders/rejectOrder.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/rejectOrder.js.map +1 -1
- package/lib/resolvers/mutations/orders/removeCartDiscount.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/removeCartDiscount.js +3 -1
- package/lib/resolvers/mutations/orders/removeCartDiscount.js.map +1 -1
- package/lib/resolvers/mutations/orders/removeCartItem.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/removeCartItem.js +3 -1
- package/lib/resolvers/mutations/orders/removeCartItem.js.map +1 -1
- package/lib/resolvers/mutations/orders/setOrderDeliveryProvider.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/setOrderDeliveryProvider.js +2 -2
- package/lib/resolvers/mutations/orders/setOrderDeliveryProvider.js.map +1 -1
- package/lib/resolvers/mutations/orders/setOrderPaymentProvider.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/setOrderPaymentProvider.js +2 -1
- package/lib/resolvers/mutations/orders/setOrderPaymentProvider.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateCart.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateCart.js +5 -4
- package/lib/resolvers/mutations/orders/updateCart.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateCartItem.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateCartItem.js +3 -1
- package/lib/resolvers/mutations/orders/updateCartItem.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderDeliveryPickUp.js +6 -2
- package/lib/resolvers/mutations/orders/updateOrderDeliveryPickUp.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderDeliveryShipping.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderDeliveryShipping.js +8 -1
- package/lib/resolvers/mutations/orders/updateOrderDeliveryShipping.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentCard.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentCard.js +3 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentCard.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentGeneric.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentGeneric.js +3 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentGeneric.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentInvoice.d.ts.map +1 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentInvoice.js +3 -1
- package/lib/resolvers/mutations/orders/updateOrderPaymentInvoice.js.map +1 -1
- package/lib/resolvers/mutations/products/createProduct.d.ts +5 -6
- package/lib/resolvers/mutations/products/createProduct.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/createProduct.js +6 -5
- package/lib/resolvers/mutations/products/createProduct.js.map +1 -1
- package/lib/resolvers/mutations/products/createProductVariation.d.ts +3 -3
- package/lib/resolvers/mutations/products/createProductVariation.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/createProductVariation.js +7 -4
- package/lib/resolvers/mutations/products/createProductVariation.js.map +1 -1
- package/lib/resolvers/mutations/products/createProductVariationOption.d.ts +4 -5
- package/lib/resolvers/mutations/products/createProductVariationOption.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/createProductVariationOption.js +8 -5
- package/lib/resolvers/mutations/products/createProductVariationOption.js.map +1 -1
- package/lib/resolvers/mutations/warehousing/exportToken.d.ts.map +1 -1
- package/lib/resolvers/mutations/warehousing/exportToken.js +20 -20
- package/lib/resolvers/mutations/warehousing/exportToken.js.map +1 -1
- package/lib/resolvers/queries/events/events.js +1 -1
- package/lib/resolvers/queries/events/events.js.map +1 -1
- package/lib/resolvers/queries/index.d.ts +0 -2
- package/lib/resolvers/queries/index.d.ts.map +1 -1
- package/lib/resolvers/queries/index.js +0 -2
- package/lib/resolvers/queries/index.js.map +1 -1
- package/lib/resolvers/queries/shopInfo.d.ts +0 -2
- package/lib/resolvers/queries/shopInfo.d.ts.map +1 -1
- package/lib/resolvers/queries/shopInfo.js +0 -3
- package/lib/resolvers/queries/shopInfo.js.map +1 -1
- package/lib/resolvers/queries/users/validateResetPasswordToken.js +1 -1
- package/lib/resolvers/queries/users/validateResetPasswordToken.js.map +1 -1
- package/lib/resolvers/queries/users/validateVerifyEmailToken.js +1 -1
- package/lib/resolvers/queries/users/validateVerifyEmailToken.js.map +1 -1
- package/lib/resolvers/type/assortment/assortment-types.d.ts.map +1 -1
- package/lib/resolvers/type/assortment/assortment-types.js +1 -0
- package/lib/resolvers/type/assortment/assortment-types.js.map +1 -1
- package/lib/resolvers/type/event-types.d.ts +1 -1
- package/lib/resolvers/type/event-types.d.ts.map +1 -1
- package/lib/resolvers/type/index.d.ts +4 -36
- package/lib/resolvers/type/index.d.ts.map +1 -1
- package/lib/resolvers/type/index.js +2 -6
- package/lib/resolvers/type/index.js.map +1 -1
- package/lib/resolvers/type/login-method-response-types.d.ts +3 -27
- package/lib/resolvers/type/login-method-response-types.d.ts.map +1 -1
- package/lib/resolvers/type/login-method-response-types.js +1 -6
- package/lib/resolvers/type/login-method-response-types.js.map +1 -1
- package/lib/resolvers/type/product/product-bundle-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-configurable-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-plan-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-simple-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-tokenized-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-types.js +1 -0
- package/lib/resolvers/type/product/product-types.js.map +1 -1
- package/lib/resolvers/type/user-types.d.ts +1 -3
- package/lib/resolvers/type/user-types.d.ts.map +1 -1
- package/lib/resolvers/type/user-types.js +0 -14
- package/lib/resolvers/type/user-types.js.map +1 -1
- package/lib/resolvers/type/webauthn-credentials-types.js +1 -1
- package/lib/resolvers/type/webauthn-credentials-types.js.map +1 -1
- package/lib/roles/all.d.ts.map +1 -1
- package/lib/roles/all.js +1 -7
- package/lib/roles/all.js.map +1 -1
- package/lib/roles/index.d.ts.map +1 -1
- package/lib/roles/index.js +0 -6
- package/lib/roles/index.js.map +1 -1
- package/lib/roles/loggedIn.d.ts.map +1 -1
- package/lib/roles/loggedIn.js +0 -4
- package/lib/roles/loggedIn.js.map +1 -1
- package/lib/schema/directives.d.ts.map +1 -1
- package/lib/schema/directives.js +1 -5
- package/lib/schema/directives.js.map +1 -1
- package/lib/schema/inputTypes.d.ts.map +1 -1
- package/lib/schema/inputTypes.js +11 -25
- package/lib/schema/inputTypes.js.map +1 -1
- package/lib/schema/mutation.d.ts.map +1 -1
- package/lib/schema/mutation.js +26 -85
- package/lib/schema/mutation.js.map +1 -1
- package/lib/schema/query.d.ts.map +1 -1
- package/lib/schema/query.js +0 -4
- package/lib/schema/query.js.map +1 -1
- package/lib/schema/scalars.d.ts.map +1 -1
- package/lib/schema/scalars.js +0 -1
- package/lib/schema/scalars.js.map +1 -1
- package/lib/schema/types/product/product.js +1 -1
- package/lib/schema/types/product/tokenized-product.js +1 -1
- package/lib/schema/types/shop.d.ts.map +1 -1
- package/lib/schema/types/shop.js +0 -1
- package/lib/schema/types/shop.js.map +1 -1
- package/lib/schema/types/user.d.ts.map +1 -1
- package/lib/schema/types/user.js +2 -21
- package/lib/schema/types/user.js.map +1 -1
- package/package.json +18 -12
- package/src/api-index.ts +19 -14
- package/src/context.ts +23 -10
- package/src/createGraphQLServer.ts +25 -36
- package/src/errors.ts +15 -21
- package/src/events.ts +8 -0
- package/src/express/createBulkImportMiddleware.ts +8 -4
- package/src/express/createERCMetadataMiddleware.ts +6 -4
- package/src/express/index.ts +127 -21
- package/src/express/passport/access-token-strategy.ts +39 -0
- package/src/express/passport/setup.ts +44 -0
- package/src/loaders/index.ts +2 -8
- package/src/locale-context.ts +13 -9
- package/src/resolvers/index.ts +0 -2
- package/src/resolvers/mutations/accounts/addEmail.ts +7 -2
- package/src/resolvers/mutations/accounts/addWebAuthnCredentials.ts +1 -1
- package/src/resolvers/mutations/accounts/changePassword.ts +18 -8
- package/src/resolvers/mutations/accounts/createUser.ts +30 -37
- package/src/resolvers/mutations/accounts/createWebAuthnCredentialCreationOptions.ts +3 -3
- package/src/resolvers/mutations/accounts/createWebAuthnCredentialRequestOptions.ts +4 -4
- package/src/resolvers/mutations/accounts/enrollUser.ts +18 -17
- package/src/resolvers/mutations/accounts/forgotPassword.ts +11 -7
- package/src/resolvers/mutations/accounts/loginAsGuest.ts +23 -4
- package/src/resolvers/mutations/accounts/loginWithPassword.ts +33 -36
- package/src/resolvers/mutations/accounts/loginWithWebAuthn.ts +22 -15
- package/src/resolvers/mutations/accounts/logout.ts +5 -21
- package/src/resolvers/mutations/accounts/removeEmail.ts +1 -1
- package/src/resolvers/mutations/accounts/resetPassword.ts +50 -53
- package/src/resolvers/mutations/accounts/sendEnrollmentEmail.ts +5 -1
- package/src/resolvers/mutations/accounts/sendVerificationEmail.ts +13 -4
- package/src/resolvers/mutations/accounts/setPassword.ts +9 -4
- package/src/resolvers/mutations/accounts/setUsername.ts +8 -2
- package/src/resolvers/mutations/accounts/verifyEmail.ts +15 -6
- package/src/resolvers/mutations/assortments/createAssortment.ts +16 -7
- package/src/resolvers/mutations/filters/createFilter.ts +8 -3
- package/src/resolvers/mutations/filters/createFilterOption.ts +9 -7
- package/src/resolvers/mutations/index.ts +0 -24
- package/src/resolvers/mutations/orders/addCartDiscount.ts +3 -1
- package/src/resolvers/mutations/orders/addCartProduct.ts +1 -1
- package/src/resolvers/mutations/orders/addCartQuotation.ts +3 -1
- package/src/resolvers/mutations/orders/addMultipleCartProducts.ts +23 -19
- package/src/resolvers/mutations/orders/confirmOrder.ts +0 -1
- package/src/resolvers/mutations/orders/emptyCart.ts +2 -2
- package/src/resolvers/mutations/orders/rejectOrder.ts +0 -2
- package/src/resolvers/mutations/orders/removeCartDiscount.ts +3 -1
- package/src/resolvers/mutations/orders/removeCartItem.ts +3 -1
- package/src/resolvers/mutations/orders/setOrderDeliveryProvider.ts +2 -3
- package/src/resolvers/mutations/orders/setOrderPaymentProvider.ts +2 -1
- package/src/resolvers/mutations/orders/updateCart.ts +5 -4
- package/src/resolvers/mutations/orders/updateCartItem.ts +3 -1
- package/src/resolvers/mutations/orders/updateOrderDeliveryPickUp.ts +7 -7
- package/src/resolvers/mutations/orders/updateOrderDeliveryShipping.ts +8 -1
- package/src/resolvers/mutations/orders/updateOrderPaymentCard.ts +3 -1
- package/src/resolvers/mutations/orders/updateOrderPaymentGeneric.ts +3 -1
- package/src/resolvers/mutations/orders/updateOrderPaymentInvoice.ts +3 -1
- package/src/resolvers/mutations/products/createProduct.ts +9 -7
- package/src/resolvers/mutations/products/createProductVariation.ts +11 -6
- package/src/resolvers/mutations/products/createProductVariationOption.ts +13 -6
- package/src/resolvers/mutations/warehousing/exportToken.ts +19 -20
- package/src/resolvers/queries/events/events.ts +1 -1
- package/src/resolvers/queries/index.ts +0 -2
- package/src/resolvers/queries/shopInfo.ts +0 -5
- package/src/resolvers/queries/users/validateResetPasswordToken.ts +1 -1
- package/src/resolvers/queries/users/validateVerifyEmailToken.ts +1 -1
- package/src/resolvers/type/assortment/assortment-types.ts +1 -0
- package/src/resolvers/type/event-types.ts +1 -1
- package/src/resolvers/type/index.ts +2 -6
- package/src/resolvers/type/login-method-response-types.ts +1 -12
- package/src/resolvers/type/product/product-types.ts +1 -0
- package/src/resolvers/type/user-types.ts +1 -17
- package/src/resolvers/type/webauthn-credentials-types.ts +1 -1
- package/src/roles/all.ts +1 -7
- package/src/roles/index.ts +0 -6
- package/src/roles/loggedIn.ts +0 -4
- package/src/schema/directives.ts +1 -5
- package/src/schema/inputTypes.ts +11 -25
- package/src/schema/mutation.ts +26 -85
- package/src/schema/query.ts +0 -4
- package/src/schema/scalars.ts +0 -1
- package/src/schema/types/product/product.ts +1 -1
- package/src/schema/types/product/tokenized-product.ts +1 -1
- package/src/schema/types/shop.ts +0 -1
- package/src/schema/types/user.ts +2 -21
- package/lib/express/createApolloMiddleware.d.ts +0 -4
- package/lib/express/createApolloMiddleware.d.ts.map +0 -1
- package/lib/express/createApolloMiddleware.js +0 -36
- package/lib/express/createApolloMiddleware.js.map +0 -1
- package/lib/express/createSingleSignOnMiddleware.d.ts +0 -5
- package/lib/express/createSingleSignOnMiddleware.d.ts.map +0 -1
- package/lib/express/createSingleSignOnMiddleware.js +0 -73
- package/lib/express/createSingleSignOnMiddleware.js.map +0 -1
- package/lib/hashPassword.d.ts +0 -2
- package/lib/hashPassword.d.ts.map +0 -1
- package/lib/hashPassword.js +0 -5
- package/lib/hashPassword.js.map +0 -1
- package/lib/resolvers/mutations/accounts/buildSecretTOTPAuthURL.d.ts +0 -3
- package/lib/resolvers/mutations/accounts/buildSecretTOTPAuthURL.d.ts.map +0 -1
- package/lib/resolvers/mutations/accounts/buildSecretTOTPAuthURL.js +0 -6
- package/lib/resolvers/mutations/accounts/buildSecretTOTPAuthURL.js.map +0 -1
- package/lib/resolvers/mutations/accounts/disableTOTP.d.ts +0 -6
- package/lib/resolvers/mutations/accounts/disableTOTP.d.ts.map +0 -1
- package/lib/resolvers/mutations/accounts/disableTOTP.js +0 -27
- package/lib/resolvers/mutations/accounts/disableTOTP.js.map +0 -1
- package/lib/resolvers/mutations/accounts/enableTOTP.d.ts +0 -6
- package/lib/resolvers/mutations/accounts/enableTOTP.d.ts.map +0 -1
- package/lib/resolvers/mutations/accounts/enableTOTP.js +0 -20
- package/lib/resolvers/mutations/accounts/enableTOTP.js.map +0 -1
- package/lib/resolvers/mutations/accounts/impersonate.d.ts +0 -10
- package/lib/resolvers/mutations/accounts/impersonate.d.ts.map +0 -1
- package/lib/resolvers/mutations/accounts/impersonate.js +0 -15
- package/lib/resolvers/mutations/accounts/impersonate.js.map +0 -1
- package/lib/resolvers/mutations/accounts/linkOAuthAccount.d.ts +0 -7
- package/lib/resolvers/mutations/accounts/linkOAuthAccount.d.ts.map +0 -1
- package/lib/resolvers/mutations/accounts/linkOAuthAccount.js +0 -30
- package/lib/resolvers/mutations/accounts/linkOAuthAccount.js.map +0 -1
- package/lib/resolvers/mutations/accounts/loginWithOAuth.d.ts +0 -8
- package/lib/resolvers/mutations/accounts/loginWithOAuth.d.ts.map +0 -1
- package/lib/resolvers/mutations/accounts/loginWithOAuth.js +0 -25
- package/lib/resolvers/mutations/accounts/loginWithOAuth.js.map +0 -1
- package/lib/resolvers/mutations/accounts/logoutAllSessions.d.ts +0 -5
- package/lib/resolvers/mutations/accounts/logoutAllSessions.d.ts.map +0 -1
- package/lib/resolvers/mutations/accounts/logoutAllSessions.js +0 -20
- package/lib/resolvers/mutations/accounts/logoutAllSessions.js.map +0 -1
- package/lib/resolvers/mutations/accounts/stopImpersonation.d.ts +0 -7
- package/lib/resolvers/mutations/accounts/stopImpersonation.d.ts.map +0 -1
- package/lib/resolvers/mutations/accounts/stopImpersonation.js +0 -21
- package/lib/resolvers/mutations/accounts/stopImpersonation.js.map +0 -1
- package/lib/resolvers/mutations/accounts/unlinkOAuthAccount.d.ts +0 -6
- package/lib/resolvers/mutations/accounts/unlinkOAuthAccount.d.ts.map +0 -1
- package/lib/resolvers/mutations/accounts/unlinkOAuthAccount.js +0 -13
- package/lib/resolvers/mutations/accounts/unlinkOAuthAccount.js.map +0 -1
- package/lib/resolvers/mutations/assortments/addAssortmentMedia.d.ts +0 -6
- package/lib/resolvers/mutations/assortments/addAssortmentMedia.d.ts.map +0 -1
- package/lib/resolvers/mutations/assortments/addAssortmentMedia.js +0 -18
- package/lib/resolvers/mutations/assortments/addAssortmentMedia.js.map +0 -1
- package/lib/resolvers/mutations/products/addProductMedia.d.ts +0 -6
- package/lib/resolvers/mutations/products/addProductMedia.d.ts.map +0 -1
- package/lib/resolvers/mutations/products/addProductMedia.js +0 -18
- package/lib/resolvers/mutations/products/addProductMedia.js.map +0 -1
- package/lib/resolvers/mutations/users/updateUserAvatar.d.ts +0 -6
- package/lib/resolvers/mutations/users/updateUserAvatar.d.ts.map +0 -1
- package/lib/resolvers/mutations/users/updateUserAvatar.js +0 -22
- package/lib/resolvers/mutations/users/updateUserAvatar.js.map +0 -1
- package/lib/resolvers/queries/users/impersonator.d.ts +0 -3
- package/lib/resolvers/queries/users/impersonator.d.ts.map +0 -1
- package/lib/resolvers/queries/users/impersonator.js +0 -12
- package/lib/resolvers/queries/users/impersonator.js.map +0 -1
- package/lib/resolvers/type/oauth-account.d.ts +0 -6
- package/lib/resolvers/type/oauth-account.d.ts.map +0 -1
- package/lib/resolvers/type/oauth-account.js +0 -7
- package/lib/resolvers/type/oauth-account.js.map +0 -1
- package/lib/resolvers/type/oauth-provider.d.ts +0 -6
- package/lib/resolvers/type/oauth-provider.d.ts.map +0 -1
- package/lib/resolvers/type/oauth-provider.js +0 -6
- package/lib/resolvers/type/oauth-provider.js.map +0 -1
- package/lib/user-context.d.ts +0 -7
- package/lib/user-context.d.ts.map +0 -1
- package/lib/user-context.js +0 -64
- package/lib/user-context.js.map +0 -1
- package/src/express/createApolloMiddleware.ts +0 -40
- package/src/express/createSingleSignOnMiddleware.ts +0 -92
- package/src/hashPassword.ts +0 -5
- package/src/resolvers/mutations/accounts/buildSecretTOTPAuthURL.ts +0 -8
- package/src/resolvers/mutations/accounts/disableTOTP.ts +0 -36
- package/src/resolvers/mutations/accounts/enableTOTP.ts +0 -23
- package/src/resolvers/mutations/accounts/impersonate.ts +0 -21
- package/src/resolvers/mutations/accounts/linkOAuthAccount.ts +0 -51
- package/src/resolvers/mutations/accounts/loginWithOAuth.ts +0 -38
- package/src/resolvers/mutations/accounts/logoutAllSessions.ts +0 -27
- package/src/resolvers/mutations/accounts/stopImpersonation.ts +0 -31
- package/src/resolvers/mutations/accounts/unlinkOAuthAccount.ts +0 -24
- package/src/resolvers/mutations/assortments/addAssortmentMedia.ts +0 -26
- package/src/resolvers/mutations/products/addProductMedia.ts +0 -24
- package/src/resolvers/mutations/users/updateUserAvatar.ts +0 -39
- package/src/resolvers/queries/users/impersonator.ts +0 -19
- package/src/resolvers/type/oauth-account.ts +0 -8
- package/src/resolvers/type/oauth-provider.ts +0 -5
- package/src/user-context.ts +0 -87
package/lib/api-index.d.ts
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { ApolloServer } from '@apollo/server';
|
|
1
|
+
import { AdminUiConfig } from '@unchainedshop/types/api.js';
|
|
3
2
|
import { createContextResolver, setCurrentContextResolver, getCurrentContextResolver } from './context.js';
|
|
3
|
+
import { YogaServerOptions } from 'graphql-yoga';
|
|
4
|
+
import { UnchainedCore } from '@unchainedshop/types/core.js';
|
|
4
5
|
export * from './context.js';
|
|
5
6
|
export * as acl from './acl.js';
|
|
6
7
|
export * as errors from './errors.js';
|
|
7
8
|
export * as express from './express/index.js';
|
|
8
|
-
export { hashPassword } from './hashPassword.js';
|
|
9
9
|
export * as roles from './roles/index.js';
|
|
10
10
|
export { createContextResolver, getCurrentContextResolver, setCurrentContextResolver };
|
|
11
11
|
export declare const loadJSON: (filename: any) => any;
|
|
12
|
-
export
|
|
12
|
+
export type GraphQLServerOptions = YogaServerOptions<any, any>;
|
|
13
|
+
export type UnchainedServerOptions = GraphQLServerOptions & {
|
|
14
|
+
unchainedAPI: UnchainedCore;
|
|
15
|
+
roles?: any;
|
|
16
|
+
context?: any;
|
|
17
|
+
events: Array<string>;
|
|
18
|
+
workTypes: Array<string>;
|
|
19
|
+
adminUiConfig?: AdminUiConfig;
|
|
20
|
+
};
|
|
21
|
+
export declare const startAPIServer: (options: UnchainedServerOptions) => Promise<import("graphql-yoga").YogaServerInstance<{}, {}>>;
|
|
13
22
|
//# sourceMappingURL=api-index.d.ts.map
|
package/lib/api-index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-index.d.ts","sourceRoot":"","sources":["../src/api-index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"api-index.d.ts","sourceRoot":"","sources":["../src/api-index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,cAAc,cAAc,CAAC;AAC7B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,CAAC;AAEvF,eAAO,MAAM,QAAQ,wBAapB,CAAC;AAKF,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAE/D,MAAM,MAAM,sBAAsB,GAAG,oBAAoB,GAAG;IAC1D,YAAY,EAAE,aAAa,CAAC;IAC5B,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACzB,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,cAAc,YAAmB,sBAAsB,+DAmBnE,CAAC"}
|
package/lib/api-index.js
CHANGED
|
@@ -6,7 +6,6 @@ export * from './context.js';
|
|
|
6
6
|
export * as acl from './acl.js';
|
|
7
7
|
export * as errors from './errors.js';
|
|
8
8
|
export * as express from './express/index.js';
|
|
9
|
-
export { hashPassword } from './hashPassword.js';
|
|
10
9
|
export * as roles from './roles/index.js';
|
|
11
10
|
export { createContextResolver, getCurrentContextResolver, setCurrentContextResolver };
|
|
12
11
|
export const loadJSON = (filename) => {
|
|
@@ -27,13 +26,13 @@ export const loadJSON = (filename) => {
|
|
|
27
26
|
const packageJson = loadJSON('../package.json');
|
|
28
27
|
const { UNCHAINED_API_VERSION = packageJson?.version || '2.x' } = process.env;
|
|
29
28
|
export const startAPIServer = async (options) => {
|
|
30
|
-
const { unchainedAPI, roles, context: customContext, adminUiConfig, ...
|
|
29
|
+
const { unchainedAPI, roles, context: customContext, adminUiConfig, ...serverOptions } = options || {};
|
|
31
30
|
const contextResolver = createContextResolver(unchainedAPI, roles, UNCHAINED_API_VERSION, adminUiConfig);
|
|
32
31
|
setCurrentContextResolver(customContext
|
|
33
|
-
? (
|
|
34
|
-
return customContext(
|
|
32
|
+
? (props) => {
|
|
33
|
+
return customContext(props, contextResolver);
|
|
35
34
|
}
|
|
36
35
|
: contextResolver);
|
|
37
|
-
return createGraphQLServer(
|
|
36
|
+
return createGraphQLServer(serverOptions);
|
|
38
37
|
};
|
|
39
38
|
//# sourceMappingURL=api-index.js.map
|
package/lib/api-index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-index.js","sourceRoot":"","sources":["../src/api-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"api-index.js","sourceRoot":"","sources":["../src/api-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,mBAAmB,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AAItB,cAAc,cAAc,CAAC;AAC7B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,CAAC;AAEvF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,QAAQ,EAAE,EAAE;IACnC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,OAAO,UAAU,KAAK,WAAW,IAAI,UAAU,CAAC;QAC7D,IAAI,CAAC,IAAI;YACP,OAAO;gBACL,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB;aACzC,CAAC;QACJ,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC;QAChE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;QAChE,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AACF,MAAM,WAAW,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAEhD,MAAM,EAAE,qBAAqB,GAAG,WAAW,EAAE,OAAO,IAAI,KAAK,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;AAa9E,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EAAE,OAA+B,EAAE,EAAE;IACtE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,GAAG,aAAa,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAEvG,MAAM,eAAe,GAAG,qBAAqB,CAC3C,YAAY,EACZ,KAAK,EACL,qBAAqB,EACrB,aAAa,CACd,CAAC;IAEF,yBAAyB,CACvB,aAAa;QACX,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;YACR,OAAO,aAAa,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;QAC/C,CAAC;QACH,CAAC,CAAC,eAAe,CACpB,CAAC;IAEF,OAAO,mBAAmB,CAAC,aAAa,CAAC,CAAC;AAC5C,CAAC,CAAC"}
|
package/lib/context.d.ts
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AdminUiConfig, Context, UnchainedHTTPServerContext } from '@unchainedshop/types/api.js';
|
|
2
2
|
import { UnchainedCore } from '@unchainedshop/types/core.js';
|
|
3
3
|
export declare const getCurrentContextResolver: () => UnchainedContextResolver;
|
|
4
4
|
export declare const setCurrentContextResolver: (newContext: UnchainedContextResolver) => void;
|
|
5
|
+
export type UnchainedContextResolver = (params: UnchainedHTTPServerContext & {
|
|
6
|
+
cookies?: Record<string, string>;
|
|
7
|
+
remoteAddress?: string;
|
|
8
|
+
remotePort?: number;
|
|
9
|
+
user?: any;
|
|
10
|
+
userId?: string;
|
|
11
|
+
login: (user: any) => Promise<{
|
|
12
|
+
_id: string;
|
|
13
|
+
user: any;
|
|
14
|
+
tokenExpires: Date;
|
|
15
|
+
}>;
|
|
16
|
+
logout: () => Promise<boolean>;
|
|
17
|
+
}) => Promise<Context>;
|
|
5
18
|
export declare const createContextResolver: (unchainedAPI: UnchainedCore, roles: any, version: string, adminUiConfig?: AdminUiConfig) => UnchainedContextResolver;
|
|
6
19
|
//# sourceMappingURL=context.d.ts.map
|
package/lib/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAM7D,eAAO,MAAM,yBAAyB,QAAO,wBAAmC,CAAC;AAEjF,eAAO,MAAM,yBAAyB,eAAgB,wBAAwB,SAE7E,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,CACrC,MAAM,EAAE,0BAA0B,GAAG;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,GAAG,CAAC;QAAC,YAAY,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;IAC9E,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CAChC,KACE,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB,eAAO,MAAM,qBAAqB,iBAEhB,aAAa,SACpB,GAAG,WACD,MAAM,kBACC,aAAa,KAC5B,wBAoBF,CAAC"}
|
package/lib/context.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import instantiateLoaders from './loaders/index.js';
|
|
2
2
|
import { getLocaleContext } from './locale-context.js';
|
|
3
|
-
import { getUserContext } from './user-context.js';
|
|
4
3
|
let context;
|
|
5
4
|
export const getCurrentContextResolver = () => context;
|
|
6
5
|
export const setCurrentContextResolver = (newContext) => {
|
|
7
6
|
context = newContext;
|
|
8
7
|
};
|
|
9
|
-
export const createContextResolver = (unchainedAPI, roles, version, adminUiConfig) => async ({
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const localeContext = await getLocaleContext(
|
|
8
|
+
export const createContextResolver = (unchainedAPI, roles, version, adminUiConfig) => async ({ getHeader, setHeader, cookies, remoteAddress, remotePort, user, userId, login, logout }) => {
|
|
9
|
+
const abstractHttpServerContext = { remoteAddress, remotePort, getHeader, setHeader, cookies };
|
|
10
|
+
const loaders = await instantiateLoaders(unchainedAPI);
|
|
11
|
+
const localeContext = await getLocaleContext(abstractHttpServerContext, unchainedAPI);
|
|
13
12
|
return {
|
|
14
|
-
req,
|
|
15
|
-
res,
|
|
16
|
-
...apolloContext,
|
|
17
13
|
...unchainedAPI,
|
|
18
|
-
...userContext,
|
|
19
14
|
...localeContext,
|
|
15
|
+
user,
|
|
16
|
+
userId,
|
|
17
|
+
login,
|
|
18
|
+
logout,
|
|
20
19
|
loaders,
|
|
21
20
|
roles,
|
|
22
21
|
version,
|
|
23
22
|
adminUiConfig,
|
|
23
|
+
setHeader,
|
|
24
|
+
getHeader,
|
|
24
25
|
};
|
|
25
26
|
};
|
|
26
27
|
//# sourceMappingURL=context.js.map
|
package/lib/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAEA,OAAO,kBAAkB,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAEA,OAAO,kBAAkB,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,IAAI,OAAO,CAAC;AAEZ,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAA6B,EAAE,CAAC,OAAO,CAAC;AAEjF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,UAAoC,EAAE,EAAE;IAChF,OAAO,GAAG,UAAU,CAAC;AACvB,CAAC,CAAC;AAcF,MAAM,CAAC,MAAM,qBAAqB,GAChC,CACE,YAA2B,EAC3B,KAAU,EACV,OAAe,EACf,aAA6B,EACH,EAAE,CAC9B,KAAK,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;IAClG,MAAM,yBAAyB,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;IAC/F,MAAM,OAAO,GAAG,MAAM,kBAAkB,CAAC,YAAY,CAAC,CAAC;IACvD,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAC,yBAAyB,EAAE,YAAY,CAAC,CAAC;IAEtF,OAAO;QACL,GAAG,YAAY;QACf,GAAG,aAAa;QAChB,IAAI;QACJ,MAAM;QACN,KAAK;QACL,MAAM;QACN,OAAO;QACP,KAAK;QACL,OAAO;QACP,aAAa;QACb,SAAS;QACT,SAAS;KACV,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
declare const _default: (options: any) => Promise<ApolloServer<import("@apollo/server").BaseContext>>;
|
|
1
|
+
declare const _default: (options: any) => Promise<import("graphql-yoga").YogaServerInstance<{}, {}>>;
|
|
3
2
|
export default _default;
|
|
4
3
|
//# sourceMappingURL=createGraphQLServer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGraphQLServer.d.ts","sourceRoot":"","sources":["../src/createGraphQLServer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createGraphQLServer.d.ts","sourceRoot":"","sources":["../src/createGraphQLServer.ts"],"names":[],"mappings":";AAQA,wBAkCE"}
|
|
@@ -1,39 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { log, LogLevel } from '@unchainedshop/logger';
|
|
1
|
+
import { createLogger } from '@unchainedshop/logger';
|
|
3
2
|
import { buildDefaultTypeDefs } from './schema/index.js';
|
|
4
3
|
import resolvers from './resolvers/index.js';
|
|
5
4
|
import { actions } from './roles/index.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const { message, extensions: { stacktrace, ...parameters }, ...rest } = error;
|
|
9
|
-
const nativeError = new Error(message);
|
|
10
|
-
nativeError.stack = stacktrace.join('\n');
|
|
11
|
-
nativeError.name = parameters.code;
|
|
12
|
-
log(nativeError, {
|
|
13
|
-
level: LogLevel.Error,
|
|
14
|
-
...parameters,
|
|
15
|
-
...rest,
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
catch (e) { } // eslint-disable-line
|
|
19
|
-
};
|
|
5
|
+
import { createYoga, createSchema } from 'graphql-yoga';
|
|
6
|
+
const logger = createLogger('unchained:api');
|
|
20
7
|
export default async (options) => {
|
|
21
|
-
const { typeDefs: additionalTypeDefs = [], resolvers: additionalResolvers = [], events = [], workTypes = [], ...
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
8
|
+
const { typeDefs: additionalTypeDefs = [], resolvers: additionalResolvers = [], events = [], workTypes = [], schema: customSchema, ...graphQLServerOptions } = options || {};
|
|
9
|
+
const schema = customSchema ||
|
|
10
|
+
createSchema({
|
|
11
|
+
typeDefs: [
|
|
12
|
+
...buildDefaultTypeDefs({
|
|
13
|
+
actions: Object.keys(actions),
|
|
14
|
+
events,
|
|
15
|
+
workTypes,
|
|
16
|
+
}),
|
|
17
|
+
...additionalTypeDefs,
|
|
18
|
+
],
|
|
19
|
+
resolvers: [resolvers, ...additionalResolvers],
|
|
20
|
+
});
|
|
21
|
+
const server = createYoga({
|
|
22
|
+
schema,
|
|
23
|
+
logging: logger,
|
|
24
|
+
context: async (ctx) => {
|
|
25
|
+
return ctx.req?.unchainedContext;
|
|
35
26
|
},
|
|
36
|
-
...
|
|
27
|
+
...graphQLServerOptions,
|
|
37
28
|
});
|
|
38
29
|
return server;
|
|
39
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGraphQLServer.js","sourceRoot":"","sources":["../src/createGraphQLServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"createGraphQLServer.js","sourceRoot":"","sources":["../src/createGraphQLServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAExD,MAAM,MAAM,GAAG,YAAY,CAAC,eAAe,CAAC,CAAC;AAE7C,eAAe,KAAK,EAAE,OAAO,EAAE,EAAE;IAC/B,MAAM,EACJ,QAAQ,EAAE,kBAAkB,GAAG,EAAE,EACjC,SAAS,EAAE,mBAAmB,GAAG,EAAE,EACnC,MAAM,GAAG,EAAE,EACX,SAAS,GAAG,EAAE,EACd,MAAM,EAAE,YAAY,EACpB,GAAG,oBAAoB,EACxB,GAAG,OAAO,IAAI,EAAE,CAAC;IAElB,MAAM,MAAM,GACV,YAAY;QACZ,YAAY,CAAC;YACX,QAAQ,EAAE;gBACR,GAAG,oBAAoB,CAAC;oBACtB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;oBAC7B,MAAM;oBACN,SAAS;iBACV,CAAC;gBACF,GAAG,kBAAkB;aACtB;YACD,SAAS,EAAE,CAAC,SAAS,EAAE,GAAG,mBAAmB,CAAC;SAC/C,CAAC,CAAC;IAEL,MAAM,MAAM,GAAG,UAAU,CAAC;QACxB,MAAM;QACN,OAAO,EAAE,MAAM;QACf,OAAO,EAAE,KAAK,EAAE,GAAQ,EAAE,EAAE;YAC1B,OAAQ,GAAG,CAAC,GAAW,EAAE,gBAAgB,CAAC;QAC5C,CAAC;QACD,GAAG,oBAAoB;KACxB,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/lib/errors.d.ts
CHANGED
|
@@ -59,14 +59,12 @@ export declare const CyclicAssortmentLinkNotSupportedError: any;
|
|
|
59
59
|
export declare const EmailAlreadyExistsError: any;
|
|
60
60
|
export declare const UsernameAlreadyExistsError: any;
|
|
61
61
|
export declare const UsernameOrEmailRequiredError: any;
|
|
62
|
-
export declare const
|
|
63
|
-
export declare const
|
|
64
|
-
export declare const TwoFactorAlreadySetError: any;
|
|
65
|
-
export declare const TwoFactorNotSetError: any;
|
|
62
|
+
export declare const PasswordInvalidError: any;
|
|
63
|
+
export declare const PasswordOrWebAuthnPublicKeyRequiredError: any;
|
|
66
64
|
export declare const InvalidCredentialsError: any;
|
|
67
65
|
export declare const InvalidResetTokenError: any;
|
|
66
|
+
export declare const InvalidEmailVerificationTokenError: any;
|
|
68
67
|
export declare const NoEmailSetError: any;
|
|
69
|
-
export declare const ResetPasswordLinkExpiredError: any;
|
|
70
68
|
export declare const ResetPasswordLinkUnknownAddressError: any;
|
|
71
69
|
export declare const AuthenticationFailedError: any;
|
|
72
70
|
export declare const UserDeactivatedError: any;
|
|
@@ -75,7 +73,6 @@ export declare const ProductLinkedToActiveVariationError: any;
|
|
|
75
73
|
export declare const ProductLinkedToActiveBundleError: any;
|
|
76
74
|
export declare const ProductLinkedToEnrollmentError: any;
|
|
77
75
|
export declare const ProductLinkedToQuotationError: any;
|
|
78
|
-
export declare const ImpersonatingAdminUserError: any;
|
|
79
76
|
export declare const FileNotFoundError: any;
|
|
80
77
|
export declare const FileUploadExpiredError: any;
|
|
81
78
|
//# sourceMappingURL=errors.d.ts.map
|
package/lib/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,SAAU,MAAM,WAAW,MAAM,KAAG,GAUzD,CAAC;AAEJ,eAAO,MAAM,qBAAqB,KAAkE,CAAC;AACrG,eAAO,MAAM,iBAAiB,KAAqD,CAAC;AACpF,eAAO,MAAM,oBAAoB,KAA2D,CAAC;AAE7F,eAAO,MAAM,6BAA6B,KAGzC,CAAC;AAEF,eAAO,MAAM,yBAAyB,KAGrC,CAAC;AAEF,eAAO,MAAM,0BAA0B,KAGtC,CAAC;AACF,eAAO,MAAM,uBAAuB,KAGnC,CAAC;AAEF,eAAO,MAAM,qBAAqB,KAGjC,CAAC;AAEF,eAAO,MAAM,uBAAuB,KAAiE,CAAC;AAEtG,eAAO,MAAM,6BAA6B,KAGz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,mCAAmC,KAG/C,CAAC;AAEF,eAAO,MAAM,gCAAgC,KAG5C,CAAC;AAEF,eAAO,MAAM,8BAA8B,KAG1C,CAAC;AAEF,eAAO,MAAM,6BAA6B,KAGzC,CAAC;AAEF,eAAO,MAAM,iBAAiB,KAAqD,CAAC;AAEpF,eAAO,MAAM,sBAAsB,KAA8D,CAAC"}
|
package/lib/errors.js
CHANGED
|
@@ -66,17 +66,15 @@ export const ProviderConfigurationInvalid = createError('ProviderConfigurationIn
|
|
|
66
66
|
export const TokenWrongStatusError = createError('TokenWrongStatusError', 'The current status of the token does not allow this operation');
|
|
67
67
|
export const TokenNotFoundError = createError('TokenNotFoundError', 'Token not found');
|
|
68
68
|
export const CyclicAssortmentLinkNotSupportedError = createError('CyclicAssortmentLinkNotSupported', 'Cyclic assortment link detected, make sure child assortment is not assigned as a parent on the assortment graph');
|
|
69
|
-
export const EmailAlreadyExistsError = createError('EmailAlreadyExists', 'Email already
|
|
70
|
-
export const UsernameAlreadyExistsError = createError('UsernameAlreadyExists', 'Username already
|
|
69
|
+
export const EmailAlreadyExistsError = createError('EmailAlreadyExists', 'Email already exists or is invalid');
|
|
70
|
+
export const UsernameAlreadyExistsError = createError('UsernameAlreadyExists', 'Username already exists or is invalid');
|
|
71
71
|
export const UsernameOrEmailRequiredError = createError('UsernameOrEmailRequired', 'No username or email is provided.');
|
|
72
|
-
export const
|
|
73
|
-
export const
|
|
74
|
-
export const TwoFactorAlreadySetError = createError('TwoFactorAlreadySet', '2FA already set for user');
|
|
75
|
-
export const TwoFactorNotSetError = createError('TwoFactorNotSet', '2FA not set for user');
|
|
72
|
+
export const PasswordInvalidError = createError('PasswordInvalidError', 'The provided password is invalid, maybe too insecure');
|
|
73
|
+
export const PasswordOrWebAuthnPublicKeyRequiredError = createError('PasswordOrWebAuthnPublicKeyRequired', 'A password or a WebAuthn public key is required');
|
|
76
74
|
export const InvalidCredentialsError = createError('InvalidCredentials', 'Invalid credentials provided');
|
|
77
|
-
export const InvalidResetTokenError = createError('InvalidResetTokenError', 'Token
|
|
75
|
+
export const InvalidResetTokenError = createError('InvalidResetTokenError', 'Token invalid or expired');
|
|
76
|
+
export const InvalidEmailVerificationTokenError = createError('InvalidEmailVerificationTokenError', 'Token invalid or expired');
|
|
78
77
|
export const NoEmailSetError = createError('NoEmailSet', 'User has no email set');
|
|
79
|
-
export const ResetPasswordLinkExpiredError = createError('ResetPasswordLinkExpired', 'Token does not exist or is expired');
|
|
80
78
|
export const ResetPasswordLinkUnknownAddressError = createError('ResetPasswordLinkUnknownAddress', 'Valid token but no email address found for the entry');
|
|
81
79
|
export const AuthenticationFailedError = createError('AuthenticationFailed', 'Failed to authenticate the user');
|
|
82
80
|
export const UserDeactivatedError = createError('UserDeactivatedError', 'User is deactivated, so not allowed to login');
|
|
@@ -85,7 +83,6 @@ export const ProductLinkedToActiveVariationError = createError('ProductLinkedToA
|
|
|
85
83
|
export const ProductLinkedToActiveBundleError = createError('ProductLinkedToActiveBundle', 'Product is part of a active/draft bundle item, remove it from any active/draft bundle item before deleting');
|
|
86
84
|
export const ProductLinkedToEnrollmentError = createError('ProductLinkedToEnrollment', 'Product is part of a active/paused subscriptions item, remove it from any active/paused subscriptions item before deleting');
|
|
87
85
|
export const ProductLinkedToQuotationError = createError('ProductLinkedToQuotation', 'Product is part of a requested/proposed quotations item, remove it from any requested/proposed quotations item before deleting');
|
|
88
|
-
export const ImpersonatingAdminUserError = createError('ImpersonatingAdminUserError', 'Can not impersonate a admin user account');
|
|
89
86
|
export const FileNotFoundError = createError('FileNotFoundError', 'File not found');
|
|
90
87
|
export const FileUploadExpiredError = createError('FileUploadExpired', 'File upload has expired');
|
|
91
88
|
//# sourceMappingURL=errors.js.map
|
package/lib/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAA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ourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAEA,oBAAY,UAAU;IACpB,uBAAuB,4BAA4B;IACnD,UAAU,eAAe;CAC1B"}
|
package/lib/events.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { registerEvents } from '@unchainedshop/events';
|
|
2
|
+
export var API_EVENTS;
|
|
3
|
+
(function (API_EVENTS) {
|
|
4
|
+
API_EVENTS["API_LOGIN_TOKEN_CREATED"] = "API_LOGIN_TOKEN_CREATED";
|
|
5
|
+
API_EVENTS["API_LOGOUT"] = "API_LOGOUT";
|
|
6
|
+
})(API_EVENTS || (API_EVENTS = {}));
|
|
7
|
+
registerEvents(Object.keys(API_EVENTS));
|
|
8
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,iEAAmD,CAAA;IACnD,uCAAyB,CAAA;AAC3B,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC"}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { IncomingMessage } from 'http';
|
|
2
|
+
import { Context } from '@unchainedshop/types/api.js';
|
|
3
|
+
export default function bulkImportMiddleware(req: IncomingMessage & {
|
|
4
|
+
query?: any;
|
|
5
|
+
unchainedContext: Context;
|
|
6
|
+
}, res: any): Promise<void>;
|
|
2
7
|
//# sourceMappingURL=createBulkImportMiddleware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createBulkImportMiddleware.d.ts","sourceRoot":"","sources":["../../src/express/createBulkImportMiddleware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createBulkImportMiddleware.d.ts","sourceRoot":"","sources":["../../src/express/createBulkImportMiddleware.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAgBtD,wBAA8B,oBAAoB,CAChD,GAAG,EAAE,eAAe,GAAG;IAAE,KAAK,CAAC,EAAE,GAAG,CAAC;IAAC,gBAAgB,EAAE,OAAO,CAAA;CAAE,EACjE,GAAG,KAAA,iBA+CJ"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createLogger } from '@unchainedshop/logger';
|
|
2
2
|
import { checkAction } from '../acl.js';
|
|
3
3
|
import { actions } from '../roles/index.js';
|
|
4
|
-
import { getCurrentContextResolver } from '../context.js';
|
|
5
4
|
const logger = createLogger('unchained:bulk-import');
|
|
6
5
|
const errorHandler = (res) => (e) => {
|
|
7
6
|
logger.error(e.message);
|
|
@@ -15,12 +14,11 @@ const methodWrongHandler = (res) => () => {
|
|
|
15
14
|
};
|
|
16
15
|
export default async function bulkImportMiddleware(req, res) {
|
|
17
16
|
try {
|
|
17
|
+
const context = req.unchainedContext;
|
|
18
18
|
if (req.method !== 'POST') {
|
|
19
19
|
methodWrongHandler(res)();
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
|
-
const contextResolver = getCurrentContextResolver();
|
|
23
|
-
const context = await contextResolver({ req, res });
|
|
24
22
|
await checkAction(context, actions.bulkImport);
|
|
25
23
|
const input = {
|
|
26
24
|
createShouldUpsertIfIDExists: !!req.query?.createShouldUpsertIfIDExists,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createBulkImportMiddleware.js","sourceRoot":"","sources":["../../src/express/createBulkImportMiddleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EA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nB,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAChC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { IncomingMessage } from 'http';
|
|
2
|
-
|
|
2
|
+
import { Context } from '@unchainedshop/types/api.js';
|
|
3
|
+
export default function ercMetadataMiddleware(req: IncomingMessage & {
|
|
4
|
+
unchainedContext: Context;
|
|
5
|
+
}, res: any): Promise<void>;
|
|
3
6
|
//# sourceMappingURL=createERCMetadataMiddleware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createERCMetadataMiddleware.d.ts","sourceRoot":"","sources":["../../src/express/createERCMetadataMiddleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"createERCMetadataMiddleware.d.ts","sourceRoot":"","sources":["../../src/express/createERCMetadataMiddleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAKvC,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAkBtD,wBAA8B,qBAAqB,CACjD,GAAG,EAAE,eAAe,GAAG;IAAE,gBAAgB,EAAE,OAAO,CAAA;CAAE,EACpD,GAAG,KAAA,iBAgDJ"}
|
|
@@ -2,7 +2,6 @@ import path from 'path';
|
|
|
2
2
|
import { createLogger } from '@unchainedshop/logger';
|
|
3
3
|
import { systemLocale } from '@unchainedshop/utils';
|
|
4
4
|
import localePkg from 'locale';
|
|
5
|
-
import { getCurrentContextResolver } from '../context.js';
|
|
6
5
|
const { Locale } = localePkg;
|
|
7
6
|
const logger = createLogger('unchained:erc-metadata');
|
|
8
7
|
const errorHandler = (res) => (e) => {
|
|
@@ -21,8 +20,7 @@ export default async function ercMetadataMiddleware(req, res) {
|
|
|
21
20
|
methodWrongHandler(res)();
|
|
22
21
|
return;
|
|
23
22
|
}
|
|
24
|
-
const
|
|
25
|
-
const context = await contextResolver({ req, res });
|
|
23
|
+
const context = req.unchainedContext;
|
|
26
24
|
const url = new URL(req.url, process.env.ROOT_URL);
|
|
27
25
|
const parsedPath = path.parse(url.pathname);
|
|
28
26
|
if (parsedPath.ext !== '.json')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createERCMetadataMiddleware.js","sourceRoot":"","sources":["../../src/express/createERCMetadataMiddleware.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,SAAS,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"createERCMetadataMiddleware.js","sourceRoot":"","sources":["../../src/express/createERCMetadataMiddleware.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,SAAS,MAAM,QAAQ,CAAC;AAG/B,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;AAE7B,MAAM,MAAM,GAAG,YAAY,CAAC,wBAAwB,CAAC,CAAC;AAEtD,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;IAClC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACxB,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACnB,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,I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WAAW,CAAC;YACzD,SAAS;SACV,CAAC,CAAC;QAEH,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC;YAC3D,YAAY;YACZ,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe;SACxD,CAAC,CAAC;QAEH,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,aAAa,CACjE,YAAY,EACZ;YACE,KAAK;YACL,OAAO;YACP,MAAM,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC;YAC1B,aAAa,EAAE,IAAI,IAAI,EAAE;SAC1B,EACD,OAAO,CACR,CAAC;QAEF,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QACzC,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE;YACjB,gBAAgB,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC;YACzC,cAAc,EAAE,YAAY;SAC7B,CAAC,CAAC;QACH,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
|
package/lib/express/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ApolloServer } from '@apollo/server';
|
|
2
1
|
import type e from 'express';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { YogaServer } from 'graphql-yoga';
|
|
3
|
+
import { mongodb } from '@unchainedshop/mongodb';
|
|
4
|
+
import { UnchainedCore } from '@unchainedshop/types/core.js';
|
|
5
|
+
export declare const connect: (expressApp: e.Express, { yogaServer, db, unchainedAPI, }: {
|
|
6
|
+
yogaServer: YogaServer<any, any>;
|
|
7
|
+
db: mongodb.Db;
|
|
8
|
+
unchainedAPI: UnchainedCore;
|
|
8
9
|
}) => void;
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/express/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/express/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAO7B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AA0G7D,eAAO,MAAM,OAAO,eACN,CAAC,CAAC,OAAO,qCAKlB;IAAE,UAAU,EAAE,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAAC,EAAE,EAAE,OAAO,CAAC,EAAE,CAAC;IAAC,YAAY,EAAE,aAAa,CAAA;CAAE,SA+BrF,CAAC"}
|