@unchainedshop/api 1.2.40 → 2.0.0-beta2
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 +1 -0
- package/lib/api-index.js +3 -0
- package/lib/api-index.js.map +1 -1
- package/lib/context.js +3 -3
- package/lib/context.js.map +1 -1
- package/lib/createBulkImportServer.js +1 -1
- package/lib/createBulkImportServer.js.map +1 -1
- package/lib/createERCMetadataServer.d.ts +2 -0
- package/lib/createERCMetadataServer.js +53 -0
- package/lib/createERCMetadataServer.js.map +1 -0
- package/lib/errors.d.ts +4 -0
- package/lib/errors.js +4 -0
- package/lib/errors.js.map +1 -1
- package/lib/loaders/index.d.ts +2 -2
- package/lib/loaders/index.js +1 -1
- package/lib/loaders/index.js.map +1 -1
- package/lib/locale-context.d.ts +2 -2
- package/lib/locale-context.js +1 -1
- package/lib/locale-context.js.map +1 -1
- package/lib/resolvers/index.js +2 -0
- package/lib/resolvers/index.js.map +1 -1
- package/lib/resolvers/mutations/accounts/addWeb3Address.d.ts +4 -0
- package/lib/resolvers/mutations/accounts/addWeb3Address.js +21 -0
- package/lib/resolvers/mutations/accounts/addWeb3Address.js.map +1 -0
- package/lib/resolvers/mutations/accounts/addWebAuthnCredentials.d.ts +4 -0
- package/lib/resolvers/mutations/accounts/addWebAuthnCredentials.js +14 -0
- package/lib/resolvers/mutations/accounts/addWebAuthnCredentials.js.map +1 -0
- package/lib/resolvers/mutations/accounts/createUser.js +18 -6
- package/lib/resolvers/mutations/accounts/createUser.js.map +1 -1
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialCreationOptions.d.ts +5 -0
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialCreationOptions.js +9 -0
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialCreationOptions.js.map +1 -0
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialRequestOptions.d.ts +5 -0
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialRequestOptions.js +16 -0
- package/lib/resolvers/mutations/accounts/createWebAuthnCredentialRequestOptions.js.map +1 -0
- package/lib/resolvers/mutations/accounts/loginWithWebAuthn.d.ts +8 -0
- package/lib/resolvers/mutations/accounts/loginWithWebAuthn.js +7 -0
- package/lib/resolvers/mutations/accounts/loginWithWebAuthn.js.map +1 -0
- package/lib/resolvers/mutations/accounts/logout.js +6 -2
- package/lib/resolvers/mutations/accounts/logout.js.map +1 -1
- package/lib/resolvers/mutations/accounts/logoutAllSessions.js +6 -2
- package/lib/resolvers/mutations/accounts/logoutAllSessions.js.map +1 -1
- package/lib/resolvers/mutations/accounts/removeWeb3Address.d.ts +4 -0
- package/lib/resolvers/mutations/accounts/removeWeb3Address.js +18 -0
- package/lib/resolvers/mutations/accounts/removeWeb3Address.js.map +1 -0
- package/lib/resolvers/mutations/accounts/removeWebAuthnCredentials.d.ts +4 -0
- package/lib/resolvers/mutations/accounts/removeWebAuthnCredentials.js +18 -0
- package/lib/resolvers/mutations/accounts/removeWebAuthnCredentials.js.map +1 -0
- package/lib/resolvers/mutations/accounts/verifyWeb3Address.d.ts +5 -0
- package/lib/resolvers/mutations/accounts/verifyWeb3Address.js +40 -0
- package/lib/resolvers/mutations/accounts/verifyWeb3Address.js.map +1 -0
- package/lib/resolvers/mutations/index.d.ts +174 -157
- package/lib/resolvers/mutations/index.js +20 -0
- package/lib/resolvers/mutations/index.js.map +1 -1
- package/lib/resolvers/mutations/orders/signPaymentProviderForCheckout.js +7 -1
- package/lib/resolvers/mutations/orders/signPaymentProviderForCheckout.js.map +1 -1
- package/lib/resolvers/mutations/pageView.d.ts +2 -2
- package/lib/resolvers/mutations/pageView.js.map +1 -1
- package/lib/resolvers/mutations/products/updateProductTokenization.d.ts +6 -0
- package/lib/resolvers/mutations/products/updateProductTokenization.js +19 -0
- package/lib/resolvers/mutations/products/updateProductTokenization.js.map +1 -0
- package/lib/resolvers/mutations/warehousing/exportToken.d.ts +6 -0
- package/lib/resolvers/mutations/warehousing/exportToken.js +21 -0
- package/lib/resolvers/mutations/warehousing/exportToken.js.map +1 -0
- package/lib/resolvers/queries/index.d.ts +67 -66
- package/lib/resolvers/queries/index.js +2 -0
- package/lib/resolvers/queries/index.js.map +1 -1
- package/lib/resolvers/queries/warehousing/token.d.ts +4 -0
- package/lib/resolvers/queries/warehousing/token.js +11 -0
- package/lib/resolvers/queries/warehousing/token.js.map +1 -0
- package/lib/resolvers/scalars/LowerCaseString.d.ts +3 -0
- package/lib/resolvers/scalars/LowerCaseString.js +17 -0
- package/lib/resolvers/scalars/LowerCaseString.js.map +1 -0
- package/lib/resolvers/scalars/index.d.ts +4 -0
- package/lib/resolvers/scalars/index.js +5 -0
- package/lib/resolvers/scalars/index.js.map +1 -0
- package/lib/resolvers/type/assortment/assortment-filter-types.d.ts +1 -1
- package/lib/resolvers/type/assortment/assortment-link-types.d.ts +1 -1
- package/lib/resolvers/type/assortment/assortment-product-types.d.ts +1 -1
- package/lib/resolvers/type/currency-types.d.ts +3 -0
- package/lib/resolvers/type/currency-types.js +6 -0
- package/lib/resolvers/type/currency-types.js.map +1 -0
- package/lib/resolvers/type/index.d.ts +246 -130
- package/lib/resolvers/type/index.js +8 -0
- package/lib/resolvers/type/index.js.map +1 -1
- package/lib/resolvers/type/login-method-response-types.d.ts +4 -0
- package/lib/resolvers/type/login-method-response-types.js +4 -0
- package/lib/resolvers/type/login-method-response-types.js.map +1 -1
- package/lib/resolvers/type/order/order-delivery-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-delivery-shipping-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-discountable-types.d.ts +6 -0
- package/lib/resolvers/type/order/order-discountable-types.js +1 -1
- package/lib/resolvers/type/order/order-discountable-types.js.map +1 -1
- package/lib/resolvers/type/order/order-global-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-item-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-item-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-payment-card-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-payment-discount-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-payment-generic-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-payment-invoice-types.d.ts +1 -1
- package/lib/resolvers/type/order/order-types.d.ts +2 -6
- package/lib/resolvers/type/order/order-types.js +0 -1
- package/lib/resolvers/type/order/order-types.js.map +1 -1
- package/lib/resolvers/type/product/product-tokenized-types.d.ts +2 -0
- package/lib/resolvers/type/product/product-tokenized-types.js +28 -0
- package/lib/resolvers/type/product/product-tokenized-types.js.map +1 -0
- package/lib/resolvers/type/quotation-types.d.ts +0 -4
- package/lib/resolvers/type/quotation-types.js +0 -10
- package/lib/resolvers/type/quotation-types.js.map +1 -1
- package/lib/resolvers/type/shop-types.d.ts +1 -1
- package/lib/resolvers/type/token-types.d.ts +17 -0
- package/lib/resolvers/type/token-types.js +30 -0
- package/lib/resolvers/type/token-types.js.map +1 -0
- package/lib/resolvers/type/user-types.d.ts +5 -1
- package/lib/resolvers/type/user-types.js +12 -0
- package/lib/resolvers/type/user-types.js.map +1 -1
- package/lib/resolvers/type/webauthn-credentials-types.d.ts +10 -0
- package/lib/resolvers/type/webauthn-credentials-types.js +13 -0
- package/lib/resolvers/type/webauthn-credentials-types.js.map +1 -0
- package/lib/roles/admin.js +3 -0
- package/lib/roles/admin.js.map +1 -1
- package/lib/roles/all.js +3 -0
- package/lib/roles/all.js.map +1 -1
- package/lib/roles/index.d.ts +1 -1
- package/lib/roles/index.js +3 -0
- package/lib/roles/index.js.map +1 -1
- package/lib/roles/loggedIn.js +9 -0
- package/lib/roles/loggedIn.js.map +1 -1
- package/lib/schema/inputTypes.js +6 -4
- package/lib/schema/inputTypes.js.map +1 -1
- package/lib/schema/mutation.js +57 -4
- package/lib/schema/mutation.js.map +1 -1
- package/lib/schema/query.js +9 -4
- package/lib/schema/query.js.map +1 -1
- package/lib/schema/scalars.js +1 -0
- package/lib/schema/scalars.js.map +1 -1
- package/lib/schema/types/assortment.js +6 -6
- package/lib/schema/types/currency.js +1 -0
- package/lib/schema/types/currency.js.map +1 -1
- package/lib/schema/types/order/order.js +0 -33
- package/lib/schema/types/order/order.js.map +1 -1
- package/lib/schema/types/payment.js +1 -1
- package/lib/schema/types/product/bundle-product.js +2 -2
- package/lib/schema/types/product/configurable-product.js +2 -2
- package/lib/schema/types/product/index.js +9 -1
- package/lib/schema/types/product/index.js.map +1 -1
- package/lib/schema/types/product/plan-product.js +2 -2
- package/lib/schema/types/product/product.js +4 -4
- package/lib/schema/types/product/simple-product.js +2 -2
- package/lib/schema/types/product/tokenized-product.d.ts +2 -0
- package/lib/schema/types/product/tokenized-product.js +57 -0
- package/lib/schema/types/product/tokenized-product.js.map +1 -0
- package/lib/schema/types/quotation.js +0 -1
- package/lib/schema/types/quotation.js.map +1 -1
- package/lib/schema/types/user.js +39 -1
- package/lib/schema/types/user.js.map +1 -1
- package/lib/schema/types/warehousing.js +23 -1
- package/lib/schema/types/warehousing.js.map +1 -1
- package/lib/user-context.d.ts +2 -2
- package/lib/user-context.js +20 -9
- package/lib/user-context.js.map +1 -1
- package/package.json +11 -9
- package/src/api-index.ts +4 -0
- package/src/context.ts +3 -3
- package/src/createBulkImportServer.ts +1 -1
- package/src/createERCMetadataServer.ts +71 -0
- package/src/errors.ts +20 -0
- package/src/loaders/index.ts +2 -1
- package/src/locale-context.ts +2 -1
- package/src/resolvers/index.ts +2 -0
- package/src/resolvers/mutations/accounts/addWeb3Address.ts +33 -0
- package/src/resolvers/mutations/accounts/addWebAuthnCredentials.ts +29 -0
- package/src/resolvers/mutations/accounts/createUser.ts +28 -6
- package/src/resolvers/mutations/accounts/createWebAuthnCredentialCreationOptions.ts +20 -0
- package/src/resolvers/mutations/accounts/createWebAuthnCredentialRequestOptions.ts +28 -0
- package/src/resolvers/mutations/accounts/loginWithWebAuthn.ts +16 -0
- package/src/resolvers/mutations/accounts/logout.ts +5 -2
- package/src/resolvers/mutations/accounts/logoutAllSessions.ts +5 -2
- package/src/resolvers/mutations/accounts/removeWeb3Address.ts +32 -0
- package/src/resolvers/mutations/accounts/removeWebAuthnCredentials.ts +30 -0
- package/src/resolvers/mutations/accounts/verifyWeb3Address.ts +60 -0
- package/src/resolvers/mutations/{index.js → index.ts} +20 -0
- package/src/resolvers/mutations/orders/signPaymentProviderForCheckout.ts +8 -1
- package/src/resolvers/mutations/{pageView.js → pageView.ts} +0 -0
- package/src/resolvers/mutations/products/updateProductTokenization.ts +28 -0
- package/src/resolvers/mutations/warehousing/exportToken.ts +33 -0
- package/src/resolvers/queries/{index.js → index.ts} +2 -0
- package/src/resolvers/queries/warehousing/token.ts +17 -0
- package/src/resolvers/scalars/LowerCaseString.ts +19 -0
- package/src/resolvers/scalars/index.ts +5 -0
- package/src/resolvers/type/assortment/assortment-filter-types.ts +1 -1
- package/src/resolvers/type/assortment/assortment-link-types.ts +1 -1
- package/src/resolvers/type/assortment/assortment-product-types.ts +1 -1
- package/src/resolvers/type/currency-types.ts +5 -0
- package/src/resolvers/type/{index.js → index.ts} +8 -0
- package/src/resolvers/type/login-method-response-types.ts +4 -0
- package/src/resolvers/type/order/order-delivery-discount-types.ts +1 -1
- package/src/resolvers/type/order/order-delivery-shipping-types.ts +1 -1
- package/src/resolvers/type/order/order-discount-types.ts +1 -1
- package/src/resolvers/type/order/order-discountable-types.ts +1 -1
- package/src/resolvers/type/order/order-global-discount-types.ts +1 -1
- package/src/resolvers/type/order/order-item-discount-types.ts +1 -1
- package/src/resolvers/type/order/order-item-types.ts +1 -1
- package/src/resolvers/type/order/order-payment-card-types.ts +1 -1
- package/src/resolvers/type/order/order-payment-discount-types.ts +1 -1
- package/src/resolvers/type/order/order-payment-generic-types.ts +1 -1
- package/src/resolvers/type/order/order-payment-invoice-types.ts +1 -1
- package/src/resolvers/type/order/order-types.ts +2 -10
- package/src/resolvers/type/product/product-tokenized-types.ts +34 -0
- package/src/resolvers/type/quotation-types.ts +0 -17
- package/src/resolvers/type/shop-types.ts +1 -1
- package/src/resolvers/type/token-types.ts +43 -0
- package/src/resolvers/type/user-types.ts +26 -1
- package/src/resolvers/type/webauthn-credentials-types.ts +27 -0
- package/src/roles/admin.ts +3 -0
- package/src/roles/all.ts +3 -0
- package/src/roles/index.ts +4 -1
- package/src/roles/loggedIn.ts +13 -0
- package/src/schema/inputTypes.js +6 -4
- package/src/schema/mutation.js +57 -4
- package/src/schema/query.js +9 -4
- package/src/schema/scalars.js +1 -0
- package/src/schema/types/assortment.js +6 -6
- package/src/schema/types/currency.js +1 -0
- package/src/schema/types/order/order.js +0 -33
- package/src/schema/types/payment.js +1 -1
- package/src/schema/types/product/bundle-product.js +2 -2
- package/src/schema/types/product/configurable-product.js +2 -2
- package/src/schema/types/product/index.js +9 -1
- package/src/schema/types/product/plan-product.js +2 -2
- package/src/schema/types/product/product.js +4 -4
- package/src/schema/types/product/simple-product.js +2 -2
- package/src/schema/types/product/tokenized-product.js +56 -0
- package/src/schema/types/quotation.js +0 -1
- package/src/schema/types/user.js +39 -1
- package/src/schema/types/warehousing.js +23 -1
- package/src/user-context.ts +23 -9
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Context } from '@unchainedshop/types/api';
|
|
2
|
+
import { WebAuthnCredentials as WebAuthnCredentialsTypes } from '@unchainedshop/types/user';
|
|
3
|
+
|
|
4
|
+
type HelperType<P, T> = (
|
|
5
|
+
credentials: WebAuthnCredentialsTypes,
|
|
6
|
+
params: P,
|
|
7
|
+
context: Context,
|
|
8
|
+
) => Promise<T>;
|
|
9
|
+
|
|
10
|
+
export interface WebAuthnCredentialsHelperTypes {
|
|
11
|
+
_id: HelperType<any, string>;
|
|
12
|
+
created: HelperType<any, Date>;
|
|
13
|
+
mdsMetadata: HelperType<any, any>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const WebAuthnCredentials: WebAuthnCredentialsHelperTypes = {
|
|
17
|
+
async _id(obj) {
|
|
18
|
+
return obj.id;
|
|
19
|
+
},
|
|
20
|
+
async created(obj) {
|
|
21
|
+
return obj.created || new Date(0);
|
|
22
|
+
},
|
|
23
|
+
async mdsMetadata(obj, _, { modules }) {
|
|
24
|
+
const metadata = await modules.accounts.webAuthn.findMDSMetadataForAAGUID(obj.aaguid);
|
|
25
|
+
return metadata;
|
|
26
|
+
},
|
|
27
|
+
};
|
package/src/roles/admin.ts
CHANGED
|
@@ -23,6 +23,8 @@ export const admin = (role, actions) => {
|
|
|
23
23
|
role.allow(actions.managePaymentProviders, () => true);
|
|
24
24
|
role.allow(actions.manageDeliveryProviders, () => true);
|
|
25
25
|
role.allow(actions.manageWarehousingProviders, () => true);
|
|
26
|
+
role.allow(actions.updateToken, () => true);
|
|
27
|
+
role.allow(actions.viewToken, () => true);
|
|
26
28
|
role.allow(actions.manageUsers, () => true);
|
|
27
29
|
role.allow(actions.updateUser, () => true);
|
|
28
30
|
role.allow(actions.updateUsername, () => true);
|
|
@@ -47,6 +49,7 @@ export const admin = (role, actions) => {
|
|
|
47
49
|
role.allow(actions.viewUserPublicInfos, () => true);
|
|
48
50
|
role.allow(actions.viewUserPrivateInfos, () => true);
|
|
49
51
|
role.allow(actions.viewUserEnrollments, () => true);
|
|
52
|
+
role.allow(actions.viewUserTokens, () => true);
|
|
50
53
|
role.allow(actions.reviewProduct, () => true);
|
|
51
54
|
role.allow(actions.updateProductReview, () => true);
|
|
52
55
|
role.allow(actions.manageProductReviews, () => true);
|
package/src/roles/all.ts
CHANGED
|
@@ -31,6 +31,8 @@ export const all = (role, actions) => {
|
|
|
31
31
|
role.allow(actions.managePaymentProviders, () => false);
|
|
32
32
|
role.allow(actions.manageDeliveryProviders, () => false);
|
|
33
33
|
role.allow(actions.manageWarehousingProviders, () => false);
|
|
34
|
+
role.allow(actions.updateToken, () => false);
|
|
35
|
+
role.allow(actions.viewToken, () => false);
|
|
34
36
|
role.allow(actions.manageAssortments, () => false);
|
|
35
37
|
role.allow(actions.manageFilters, () => false);
|
|
36
38
|
role.allow(actions.manageUsers, () => false);
|
|
@@ -49,6 +51,7 @@ export const all = (role, actions) => {
|
|
|
49
51
|
role.allow(actions.viewLogs, isInLoginMutationResponse);
|
|
50
52
|
role.allow(actions.viewUserRoles, isInLoginMutationResponse);
|
|
51
53
|
role.allow(actions.viewUserOrders, isInLoginMutationResponse);
|
|
54
|
+
role.allow(actions.viewUserTokens, isInLoginMutationResponse);
|
|
52
55
|
role.allow(actions.viewUserQuotations, isInLoginMutationResponse);
|
|
53
56
|
role.allow(actions.viewUserPrivateInfos, isInLoginMutationResponse);
|
|
54
57
|
role.allow(actions.viewUserEnrollments, isInLoginMutationResponse);
|
package/src/roles/index.ts
CHANGED
|
@@ -12,7 +12,7 @@ const roles = {
|
|
|
12
12
|
|
|
13
13
|
const allRoles = roles;
|
|
14
14
|
|
|
15
|
-
const actions = [
|
|
15
|
+
const actions: Record<string, string> = [
|
|
16
16
|
'viewEvent',
|
|
17
17
|
'viewEvents',
|
|
18
18
|
'viewUserRoles',
|
|
@@ -21,6 +21,7 @@ const actions = [
|
|
|
21
21
|
'viewUserPublicInfos',
|
|
22
22
|
'viewUserPrivateInfos',
|
|
23
23
|
'viewUserEnrollments',
|
|
24
|
+
'viewUserTokens',
|
|
24
25
|
'viewLogs',
|
|
25
26
|
'viewUser',
|
|
26
27
|
'viewUsers',
|
|
@@ -57,6 +58,8 @@ const actions = [
|
|
|
57
58
|
'managePaymentProviders',
|
|
58
59
|
'manageDeliveryProviders',
|
|
59
60
|
'manageWarehousingProviders',
|
|
61
|
+
'updateToken',
|
|
62
|
+
'viewToken',
|
|
60
63
|
'manageAssortments',
|
|
61
64
|
'manageFilters',
|
|
62
65
|
'createCart',
|
package/src/roles/loggedIn.ts
CHANGED
|
@@ -190,6 +190,16 @@ export const loggedIn = (role: any, actions: Record<string, string>) => {
|
|
|
190
190
|
return credentials.userId === userId;
|
|
191
191
|
};
|
|
192
192
|
|
|
193
|
+
const isOwnedToken = async (
|
|
194
|
+
obj: any,
|
|
195
|
+
{ tokenId }: { tokenId: string },
|
|
196
|
+
{ modules, userId }: Context,
|
|
197
|
+
) => {
|
|
198
|
+
const token = await modules.warehousing.findToken({ tokenId });
|
|
199
|
+
if (!token) return true;
|
|
200
|
+
return token.userId === userId;
|
|
201
|
+
};
|
|
202
|
+
|
|
193
203
|
role.allow(actions.viewEvent, false);
|
|
194
204
|
role.allow(actions.viewEvents, false);
|
|
195
205
|
role.allow(actions.viewUser, isMyself);
|
|
@@ -198,6 +208,7 @@ export const loggedIn = (role: any, actions: Record<string, string>) => {
|
|
|
198
208
|
role.allow(actions.viewUserQuotations, isMyself);
|
|
199
209
|
role.allow(actions.viewUserEnrollments, isMyself);
|
|
200
210
|
role.allow(actions.viewUserPrivateInfos, isMyself);
|
|
211
|
+
role.allow(actions.viewUserTokens, isMyself);
|
|
201
212
|
role.allow(actions.updateUser, isMyself);
|
|
202
213
|
role.allow(actions.authTwoFactor, isMyself);
|
|
203
214
|
role.allow(actions.manageTwoFactor, isMyself);
|
|
@@ -223,4 +234,6 @@ export const loggedIn = (role: any, actions: Record<string, string>) => {
|
|
|
223
234
|
role.allow(actions.voteProductReview, () => true);
|
|
224
235
|
role.allow(actions.registerPaymentCredentials, () => true);
|
|
225
236
|
role.allow(actions.managePaymentCredentials, isOwnedPaymentCredential);
|
|
237
|
+
role.allow(actions.updateToken, isOwnedToken);
|
|
238
|
+
role.allow(actions.viewToken, isOwnedToken);
|
|
226
239
|
};
|
package/src/schema/inputTypes.js
CHANGED
|
@@ -65,17 +65,19 @@ export default [
|
|
|
65
65
|
input CreateCurrencyInput {
|
|
66
66
|
isoCode: String!
|
|
67
67
|
contractAddress: String
|
|
68
|
+
decimals: Int
|
|
68
69
|
}
|
|
69
70
|
input UpdateCurrencyInput {
|
|
70
71
|
isoCode: String!
|
|
71
72
|
isActive: Boolean
|
|
72
73
|
contractAddress: String
|
|
74
|
+
decimals: Int
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
input CreateProductInput {
|
|
76
78
|
title: String!
|
|
77
79
|
type: String!
|
|
78
|
-
tags: [
|
|
80
|
+
tags: [LowerCaseString!]
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
input CreateProductVariationInput {
|
|
@@ -95,7 +97,7 @@ export default [
|
|
|
95
97
|
}
|
|
96
98
|
|
|
97
99
|
input UpdateProductInput {
|
|
98
|
-
tags: [
|
|
100
|
+
tags: [LowerCaseString!]
|
|
99
101
|
sequence: Int
|
|
100
102
|
meta: JSON
|
|
101
103
|
}
|
|
@@ -174,13 +176,13 @@ export default [
|
|
|
174
176
|
|
|
175
177
|
input CreateAssortmentInput {
|
|
176
178
|
isRoot: Boolean
|
|
177
|
-
tags: [
|
|
179
|
+
tags: [LowerCaseString!]
|
|
178
180
|
title: String!
|
|
179
181
|
}
|
|
180
182
|
|
|
181
183
|
input UpdateAssortmentInput {
|
|
182
184
|
isRoot: Boolean
|
|
183
|
-
tags: [
|
|
185
|
+
tags: [LowerCaseString!]
|
|
184
186
|
isActive: Boolean
|
|
185
187
|
sequence: Int
|
|
186
188
|
}
|
package/src/schema/mutation.js
CHANGED
|
@@ -13,6 +13,18 @@ export default [
|
|
|
13
13
|
totpCode: String
|
|
14
14
|
): LoginMethodResponse
|
|
15
15
|
|
|
16
|
+
"""
|
|
17
|
+
Log the user in with a WebAuthn device
|
|
18
|
+
"""
|
|
19
|
+
loginWithWebAuthn(webAuthnPublicKeyCredentials: JSON!): LoginMethodResponse
|
|
20
|
+
|
|
21
|
+
"""
|
|
22
|
+
Web3
|
|
23
|
+
"""
|
|
24
|
+
addWeb3Address(address: String!): User
|
|
25
|
+
verifyWeb3Address(address: String!, hash: String!): User
|
|
26
|
+
removeWeb3Address(address: String!): User
|
|
27
|
+
|
|
16
28
|
"""
|
|
17
29
|
Create a new user.
|
|
18
30
|
"""
|
|
@@ -20,6 +32,10 @@ export default [
|
|
|
20
32
|
username: String
|
|
21
33
|
email: String
|
|
22
34
|
password: HashedPasswordInput
|
|
35
|
+
@deprecated(
|
|
36
|
+
reason: "Use plainPassword, there is not a lot of added security by hashing on the client"
|
|
37
|
+
)
|
|
38
|
+
webAuthnPublicKeyCredentials: JSON
|
|
23
39
|
plainPassword: String
|
|
24
40
|
profile: UserProfileInput
|
|
25
41
|
): LoginMethodResponse
|
|
@@ -95,6 +111,26 @@ export default [
|
|
|
95
111
|
"""
|
|
96
112
|
disableTOTP(code: String!, userId: ID): User
|
|
97
113
|
|
|
114
|
+
"""
|
|
115
|
+
Create WebAuthn PublicKeyCredentialCreationOptions to use for Registering a new WebAuthn Device
|
|
116
|
+
"""
|
|
117
|
+
createWebAuthnCredentialCreationOptions(username: String!, extensionOptions: JSON): JSON!
|
|
118
|
+
|
|
119
|
+
"""
|
|
120
|
+
Register WebAuthn Credentials for current user
|
|
121
|
+
"""
|
|
122
|
+
addWebAuthnCredentials(credentials: JSON!): User!
|
|
123
|
+
|
|
124
|
+
"""
|
|
125
|
+
Remove WebAuthn Credentials for current user
|
|
126
|
+
"""
|
|
127
|
+
removeWebAuthnCredentials(credentialsId: ID!): User!
|
|
128
|
+
|
|
129
|
+
"""
|
|
130
|
+
Create WebAuthn PublicKeyCredentialRequestrOptions to use for WebAuthn Login Flow
|
|
131
|
+
"""
|
|
132
|
+
createWebAuthnCredentialRequestOptions(username: String, extensionOptions: JSON): JSON!
|
|
133
|
+
|
|
98
134
|
"""
|
|
99
135
|
Creates an alternative cart. If you use this feature, you should use explicit orderId's when using the
|
|
100
136
|
cart mutations. Else it will work like a stack and the checkout will use the very first cart of the user.
|
|
@@ -302,7 +338,7 @@ export default [
|
|
|
302
338
|
"""
|
|
303
339
|
Set tags of user
|
|
304
340
|
"""
|
|
305
|
-
setUserTags(tags: [
|
|
341
|
+
setUserTags(tags: [LowerCaseString]!, userId: ID!): User
|
|
306
342
|
|
|
307
343
|
"""
|
|
308
344
|
Update Profile of any user or logged in user if userId is not provided
|
|
@@ -379,6 +415,14 @@ export default [
|
|
|
379
415
|
"""
|
|
380
416
|
updateProductPlan(productId: ID!, plan: UpdateProductPlanInput!): Product
|
|
381
417
|
|
|
418
|
+
"""
|
|
419
|
+
Modify tokenization part of a product
|
|
420
|
+
"""
|
|
421
|
+
updateProductTokenization(
|
|
422
|
+
productId: ID!
|
|
423
|
+
tokenization: UpdateProductTokenizationInput!
|
|
424
|
+
): TokenizedProduct
|
|
425
|
+
|
|
382
426
|
"""
|
|
383
427
|
Modify warehousing part of a product
|
|
384
428
|
"""
|
|
@@ -607,7 +651,11 @@ export default [
|
|
|
607
651
|
"""
|
|
608
652
|
Add a new product to an assortment
|
|
609
653
|
"""
|
|
610
|
-
addAssortmentProduct(
|
|
654
|
+
addAssortmentProduct(
|
|
655
|
+
assortmentId: ID!
|
|
656
|
+
productId: ID!
|
|
657
|
+
tags: [LowerCaseString!]
|
|
658
|
+
): AssortmentProduct!
|
|
611
659
|
|
|
612
660
|
"""
|
|
613
661
|
Remove a product from an assortment
|
|
@@ -625,7 +673,7 @@ export default [
|
|
|
625
673
|
addAssortmentLink(
|
|
626
674
|
parentAssortmentId: ID!
|
|
627
675
|
childAssortmentId: ID!
|
|
628
|
-
tags: [
|
|
676
|
+
tags: [LowerCaseString!]
|
|
629
677
|
): AssortmentLink!
|
|
630
678
|
|
|
631
679
|
"""
|
|
@@ -641,7 +689,7 @@ export default [
|
|
|
641
689
|
"""
|
|
642
690
|
Add a new filter to an assortment
|
|
643
691
|
"""
|
|
644
|
-
addAssortmentFilter(assortmentId: ID!, filterId: ID!, tags: [
|
|
692
|
+
addAssortmentFilter(assortmentId: ID!, filterId: ID!, tags: [LowerCaseString!]): AssortmentFilter!
|
|
645
693
|
|
|
646
694
|
"""
|
|
647
695
|
Remove a product from an assortment
|
|
@@ -846,6 +894,11 @@ export default [
|
|
|
846
894
|
prepareAssortmentMediaUpload(mediaName: String!, assortmentId: ID!): MediaUploadTicket!
|
|
847
895
|
prepareUserAvatarUpload(mediaName: String!, userId: ID): MediaUploadTicket!
|
|
848
896
|
confirmMediaUpload(mediaUploadTicketId: ID!, size: Int!, type: String!): Media!
|
|
897
|
+
|
|
898
|
+
"""
|
|
899
|
+
Tokenize
|
|
900
|
+
"""
|
|
901
|
+
exportToken(tokenId: ID!, quantity: Int! = 1, recipientWalletAddress: String!): Token!
|
|
849
902
|
}
|
|
850
903
|
`,
|
|
851
904
|
];
|
package/src/schema/query.js
CHANGED
|
@@ -31,7 +31,7 @@ export default [
|
|
|
31
31
|
If a slug is provided
|
|
32
32
|
"""
|
|
33
33
|
productsCount(
|
|
34
|
-
tags: [
|
|
34
|
+
tags: [LowerCaseString!]
|
|
35
35
|
slugs: [String!]
|
|
36
36
|
includeDrafts: Boolean = false
|
|
37
37
|
queryString: String
|
|
@@ -43,7 +43,7 @@ export default [
|
|
|
43
43
|
"""
|
|
44
44
|
products(
|
|
45
45
|
queryString: String
|
|
46
|
-
tags: [
|
|
46
|
+
tags: [LowerCaseString!]
|
|
47
47
|
slugs: [String!]
|
|
48
48
|
limit: Int = 10
|
|
49
49
|
offset: Int = 0
|
|
@@ -182,6 +182,11 @@ export default [
|
|
|
182
182
|
"""
|
|
183
183
|
warehousingInterfaces(type: WarehousingProviderType!): [WarehousingInterface!]!
|
|
184
184
|
|
|
185
|
+
"""
|
|
186
|
+
Get token
|
|
187
|
+
"""
|
|
188
|
+
token(tokenId: ID!): Token
|
|
189
|
+
|
|
185
190
|
"""
|
|
186
191
|
Returns total number of payment providers, optionally filtered by type
|
|
187
192
|
"""
|
|
@@ -233,7 +238,7 @@ export default [
|
|
|
233
238
|
"""
|
|
234
239
|
assortments(
|
|
235
240
|
queryString: String
|
|
236
|
-
tags: [
|
|
241
|
+
tags: [LowerCaseString!]
|
|
237
242
|
slugs: [String!]
|
|
238
243
|
limit: Int = 10
|
|
239
244
|
offset: Int = 0
|
|
@@ -246,7 +251,7 @@ export default [
|
|
|
246
251
|
Returns total number of assortments that match a given criteria or all if no criteria is given
|
|
247
252
|
"""
|
|
248
253
|
assortmentsCount(
|
|
249
|
-
tags: [
|
|
254
|
+
tags: [LowerCaseString!]
|
|
250
255
|
slugs: [String!]
|
|
251
256
|
includeInactive: Boolean = false
|
|
252
257
|
includeLeaves: Boolean = false
|
package/src/schema/scalars.js
CHANGED
|
@@ -9,7 +9,7 @@ export default [
|
|
|
9
9
|
|
|
10
10
|
type AssortmentMedia {
|
|
11
11
|
_id: ID!
|
|
12
|
-
tags: [
|
|
12
|
+
tags: [LowerCaseString!]
|
|
13
13
|
file: Media!
|
|
14
14
|
sortKey: Int!
|
|
15
15
|
texts(forceLocale: String): AssortmentMediaTexts
|
|
@@ -26,8 +26,8 @@ export default [
|
|
|
26
26
|
isBase: Boolean
|
|
27
27
|
isRoot: Boolean
|
|
28
28
|
sequence: Int!
|
|
29
|
-
tags: [
|
|
30
|
-
media(limit: Int = 10, offset: Int = 0, tags: [
|
|
29
|
+
tags: [LowerCaseString!]
|
|
30
|
+
media(limit: Int = 10, offset: Int = 0, tags: [LowerCaseString!]): [AssortmentMedia!]!
|
|
31
31
|
texts(forceLocale: String): AssortmentTexts
|
|
32
32
|
productAssignments: [AssortmentProduct!]
|
|
33
33
|
filterAssignments: [AssortmentFilter!]
|
|
@@ -66,7 +66,7 @@ export default [
|
|
|
66
66
|
type AssortmentProduct {
|
|
67
67
|
_id: ID!
|
|
68
68
|
sortKey: Int!
|
|
69
|
-
tags: [
|
|
69
|
+
tags: [LowerCaseString!]
|
|
70
70
|
assortment: Assortment!
|
|
71
71
|
product: Product!
|
|
72
72
|
}
|
|
@@ -74,7 +74,7 @@ export default [
|
|
|
74
74
|
type AssortmentFilter {
|
|
75
75
|
_id: ID!
|
|
76
76
|
sortKey: Int!
|
|
77
|
-
tags: [
|
|
77
|
+
tags: [LowerCaseString!]
|
|
78
78
|
assortment: Assortment!
|
|
79
79
|
filter: Filter!
|
|
80
80
|
}
|
|
@@ -82,7 +82,7 @@ export default [
|
|
|
82
82
|
type AssortmentLink {
|
|
83
83
|
_id: ID!
|
|
84
84
|
sortKey: Int!
|
|
85
|
-
tags: [
|
|
85
|
+
tags: [LowerCaseString!]
|
|
86
86
|
parent: Assortment!
|
|
87
87
|
child: Assortment!
|
|
88
88
|
}
|
|
@@ -54,38 +54,6 @@ export default [
|
|
|
54
54
|
DISCOUNTS
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
enum OrderDocumentType {
|
|
58
|
-
"""
|
|
59
|
-
Order Confirmation
|
|
60
|
-
"""
|
|
61
|
-
ORDER_CONFIRMATION
|
|
62
|
-
|
|
63
|
-
"""
|
|
64
|
-
Order Rejection
|
|
65
|
-
"""
|
|
66
|
-
ORDER_REJECTION
|
|
67
|
-
|
|
68
|
-
"""
|
|
69
|
-
Delivery Note
|
|
70
|
-
"""
|
|
71
|
-
DELIVERY_NOTE
|
|
72
|
-
|
|
73
|
-
"""
|
|
74
|
-
Invoice
|
|
75
|
-
"""
|
|
76
|
-
INVOICE
|
|
77
|
-
|
|
78
|
-
"""
|
|
79
|
-
Receipt
|
|
80
|
-
"""
|
|
81
|
-
RECEIPT
|
|
82
|
-
|
|
83
|
-
"""
|
|
84
|
-
Other
|
|
85
|
-
"""
|
|
86
|
-
OTHER
|
|
87
|
-
}
|
|
88
|
-
|
|
89
57
|
"""
|
|
90
58
|
Just an order
|
|
91
59
|
"""
|
|
@@ -100,7 +68,6 @@ export default [
|
|
|
100
68
|
currency: Currency
|
|
101
69
|
delivery: OrderDelivery
|
|
102
70
|
discounts: [OrderDiscount!]
|
|
103
|
-
documents(type: OrderDocumentType = CONFIRMATION): [Media!]!
|
|
104
71
|
enrollment: Enrollment
|
|
105
72
|
fullfilled: DateTime
|
|
106
73
|
items: [OrderItem!]
|
|
@@ -7,11 +7,11 @@ export default [
|
|
|
7
7
|
_id: ID!
|
|
8
8
|
sequence: Int!
|
|
9
9
|
status: ProductStatus!
|
|
10
|
-
tags: [
|
|
10
|
+
tags: [LowerCaseString!]
|
|
11
11
|
created: DateTime
|
|
12
12
|
updated: DateTime
|
|
13
13
|
published: DateTime
|
|
14
|
-
media(limit: Int = 10, offset: Int = 0, tags: [
|
|
14
|
+
media(limit: Int = 10, offset: Int = 0, tags: [LowerCaseString!]): [ProductMedia!]!
|
|
15
15
|
texts(forceLocale: String): ProductTexts
|
|
16
16
|
bundleItems: [ProductBundleItem!]
|
|
17
17
|
reviews(
|
|
@@ -66,11 +66,11 @@ export default [
|
|
|
66
66
|
_id: ID!
|
|
67
67
|
sequence: Int!
|
|
68
68
|
status: ProductStatus!
|
|
69
|
-
tags: [
|
|
69
|
+
tags: [LowerCaseString!]
|
|
70
70
|
created: DateTime
|
|
71
71
|
updated: DateTime
|
|
72
72
|
published: DateTime
|
|
73
|
-
media(limit: Int = 10, offset: Int = 0, tags: [
|
|
73
|
+
media(limit: Int = 10, offset: Int = 0, tags: [LowerCaseString!]): [ProductMedia!]!
|
|
74
74
|
texts(forceLocale: String): ProductTexts
|
|
75
75
|
assortmentPaths: [ProductAssortmentPath!]!
|
|
76
76
|
siblings(
|
|
@@ -3,5 +3,13 @@ import simpleProduct from './simple-product';
|
|
|
3
3
|
import product from './product';
|
|
4
4
|
import bundleProduct from './bundle-product';
|
|
5
5
|
import planProduct from './plan-product';
|
|
6
|
+
import tokenizedProduct from './tokenized-product';
|
|
6
7
|
|
|
7
|
-
export default [
|
|
8
|
+
export default [
|
|
9
|
+
...product,
|
|
10
|
+
...configurableProduct,
|
|
11
|
+
...simpleProduct,
|
|
12
|
+
...bundleProduct,
|
|
13
|
+
...planProduct,
|
|
14
|
+
...tokenizedProduct,
|
|
15
|
+
];
|
|
@@ -36,11 +36,11 @@ export default [
|
|
|
36
36
|
_id: ID!
|
|
37
37
|
sequence: Int!
|
|
38
38
|
status: ProductStatus!
|
|
39
|
-
tags: [
|
|
39
|
+
tags: [LowerCaseString!]
|
|
40
40
|
created: DateTime
|
|
41
41
|
updated: DateTime
|
|
42
42
|
published: DateTime
|
|
43
|
-
media(limit: Int = 10, offset: Int = 0, tags: [
|
|
43
|
+
media(limit: Int = 10, offset: Int = 0, tags: [LowerCaseString!]): [ProductMedia!]!
|
|
44
44
|
texts(forceLocale: String): ProductTexts
|
|
45
45
|
catalogPrice(quantity: Int = 1, currency: String): Price
|
|
46
46
|
leveledCatalogPrices(currency: String): [PriceLevel!]!
|
|
@@ -32,7 +32,7 @@ export default [
|
|
|
32
32
|
|
|
33
33
|
type ProductMedia {
|
|
34
34
|
_id: ID!
|
|
35
|
-
tags: [
|
|
35
|
+
tags: [LowerCaseString!]
|
|
36
36
|
file: Media!
|
|
37
37
|
sortKey: Int!
|
|
38
38
|
texts(forceLocale: String): ProductMediaTexts
|
|
@@ -57,12 +57,12 @@ export default [
|
|
|
57
57
|
_id: ID!
|
|
58
58
|
sequence: Int!
|
|
59
59
|
status: ProductStatus!
|
|
60
|
-
tags: [
|
|
60
|
+
tags: [LowerCaseString!]
|
|
61
61
|
created: DateTime
|
|
62
62
|
updated: DateTime
|
|
63
63
|
published: DateTime
|
|
64
|
-
texts: ProductTexts
|
|
65
|
-
media(limit: Int = 10, offset: Int = 0, tags: [
|
|
64
|
+
texts(forceLocale: String): ProductTexts
|
|
65
|
+
media(limit: Int = 10, offset: Int = 0, tags: [LowerCaseString!]): [ProductMedia!]!
|
|
66
66
|
reviews(
|
|
67
67
|
limit: Int = 10
|
|
68
68
|
offset: Int = 0
|
|
@@ -7,11 +7,11 @@ export default [
|
|
|
7
7
|
_id: ID!
|
|
8
8
|
sequence: Int!
|
|
9
9
|
status: ProductStatus!
|
|
10
|
-
tags: [
|
|
10
|
+
tags: [LowerCaseString!]
|
|
11
11
|
created: DateTime
|
|
12
12
|
updated: DateTime
|
|
13
13
|
published: DateTime
|
|
14
|
-
media(limit: Int = 10, offset: Int = 0, tags: [
|
|
14
|
+
media(limit: Int = 10, offset: Int = 0, tags: [LowerCaseString!]): [ProductMedia!]!
|
|
15
15
|
texts(forceLocale: String): ProductTexts
|
|
16
16
|
catalogPrice(quantity: Int = 1, currency: String): Price
|
|
17
17
|
leveledCatalogPrices(currency: String): [PriceLevel!]!
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
/* GraphQL */ `
|
|
3
|
+
input UpdateProductTokenizationInput {
|
|
4
|
+
contractAddress: String!
|
|
5
|
+
contractStandard: SmartContractStandard!
|
|
6
|
+
tokenId: String!
|
|
7
|
+
supply: Int!
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
enum SmartContractStandard {
|
|
11
|
+
ERC1155
|
|
12
|
+
ERC721
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
type ContractConfiguration {
|
|
16
|
+
tokenId: String!
|
|
17
|
+
supply: Int!
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
"""
|
|
21
|
+
Tokenized Product (Blockchain materialized Product)
|
|
22
|
+
"""
|
|
23
|
+
type TokenizedProduct implements Product {
|
|
24
|
+
_id: ID!
|
|
25
|
+
sequence: Int!
|
|
26
|
+
status: ProductStatus!
|
|
27
|
+
tags: [LowerCaseString!]
|
|
28
|
+
created: DateTime
|
|
29
|
+
updated: DateTime
|
|
30
|
+
published: DateTime
|
|
31
|
+
media(limit: Int = 10, offset: Int = 0, tags: [LowerCaseString!]): [ProductMedia!]!
|
|
32
|
+
texts(forceLocale: String): ProductTexts
|
|
33
|
+
catalogPrice(quantity: Int = 1, currency: String): Price
|
|
34
|
+
leveledCatalogPrices(currency: String): [PriceLevel!]!
|
|
35
|
+
simulatedPrice(currency: String, useNetPrice: Boolean = false, quantity: Int = 1): Price
|
|
36
|
+
simulatedDiscounts(quantity: Int = 1): [ProductDiscount!]
|
|
37
|
+
assortmentPaths(forceLocale: String): [ProductAssortmentPath!]!
|
|
38
|
+
siblings(
|
|
39
|
+
assortmentId: ID
|
|
40
|
+
limit: Int = 10
|
|
41
|
+
offset: Int = 0
|
|
42
|
+
includeInactive: Boolean = false
|
|
43
|
+
): [Product!]!
|
|
44
|
+
reviews(
|
|
45
|
+
limit: Int = 10
|
|
46
|
+
offset: Int = 0
|
|
47
|
+
sort: [SortOptionInput!]
|
|
48
|
+
queryString: String
|
|
49
|
+
): [ProductReview!]!
|
|
50
|
+
contractAddress: String
|
|
51
|
+
contractStandard: SmartContractStandard
|
|
52
|
+
contractConfiguration: ContractConfiguration
|
|
53
|
+
ercMetadata(forceLocale: String): JSON
|
|
54
|
+
}
|
|
55
|
+
`,
|
|
56
|
+
];
|