@unchainedshop/api 1.2.40 → 2.0.0-beta1
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 +1 -0
- package/lib/errors.js +1 -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/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/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/index.d.ts +171 -157
- package/lib/resolvers/mutations/index.js +14 -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 +4 -1
- package/lib/resolvers/type/user-types.js +8 -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 +50 -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 +32 -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 +9 -8
- 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 +5 -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/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/removeWebAuthnCredentials.ts +30 -0
- package/src/resolvers/mutations/{index.js → index.ts} +14 -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 +14 -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 +50 -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 +32 -1
- package/src/schema/types/warehousing.js +23 -1
- package/src/user-context.ts +23 -9
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,11 @@ 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
|
+
|
|
16
21
|
"""
|
|
17
22
|
Create a new user.
|
|
18
23
|
"""
|
|
@@ -20,6 +25,10 @@ export default [
|
|
|
20
25
|
username: String
|
|
21
26
|
email: String
|
|
22
27
|
password: HashedPasswordInput
|
|
28
|
+
@deprecated(
|
|
29
|
+
reason: "Use plainPassword, there is not a lot of added security by hashing on the client"
|
|
30
|
+
)
|
|
31
|
+
webAuthnPublicKeyCredentials: JSON
|
|
23
32
|
plainPassword: String
|
|
24
33
|
profile: UserProfileInput
|
|
25
34
|
): LoginMethodResponse
|
|
@@ -95,6 +104,26 @@ export default [
|
|
|
95
104
|
"""
|
|
96
105
|
disableTOTP(code: String!, userId: ID): User
|
|
97
106
|
|
|
107
|
+
"""
|
|
108
|
+
Create WebAuthn PublicKeyCredentialCreationOptions to use for Registering a new WebAuthn Device
|
|
109
|
+
"""
|
|
110
|
+
createWebAuthnCredentialCreationOptions(username: String!, extensionOptions: JSON): JSON!
|
|
111
|
+
|
|
112
|
+
"""
|
|
113
|
+
Register WebAuthn Credentials for current user
|
|
114
|
+
"""
|
|
115
|
+
addWebAuthnCredentials(credentials: JSON!): User!
|
|
116
|
+
|
|
117
|
+
"""
|
|
118
|
+
Remove WebAuthn Credentials for current user
|
|
119
|
+
"""
|
|
120
|
+
removeWebAuthnCredentials(credentialsId: ID!): User!
|
|
121
|
+
|
|
122
|
+
"""
|
|
123
|
+
Create WebAuthn PublicKeyCredentialRequestrOptions to use for WebAuthn Login Flow
|
|
124
|
+
"""
|
|
125
|
+
createWebAuthnCredentialRequestOptions(username: String, extensionOptions: JSON): JSON!
|
|
126
|
+
|
|
98
127
|
"""
|
|
99
128
|
Creates an alternative cart. If you use this feature, you should use explicit orderId's when using the
|
|
100
129
|
cart mutations. Else it will work like a stack and the checkout will use the very first cart of the user.
|
|
@@ -302,7 +331,7 @@ export default [
|
|
|
302
331
|
"""
|
|
303
332
|
Set tags of user
|
|
304
333
|
"""
|
|
305
|
-
setUserTags(tags: [
|
|
334
|
+
setUserTags(tags: [LowerCaseString]!, userId: ID!): User
|
|
306
335
|
|
|
307
336
|
"""
|
|
308
337
|
Update Profile of any user or logged in user if userId is not provided
|
|
@@ -379,6 +408,14 @@ export default [
|
|
|
379
408
|
"""
|
|
380
409
|
updateProductPlan(productId: ID!, plan: UpdateProductPlanInput!): Product
|
|
381
410
|
|
|
411
|
+
"""
|
|
412
|
+
Modify tokenization part of a product
|
|
413
|
+
"""
|
|
414
|
+
updateProductTokenization(
|
|
415
|
+
productId: ID!
|
|
416
|
+
tokenization: UpdateProductTokenizationInput!
|
|
417
|
+
): TokenizedProduct
|
|
418
|
+
|
|
382
419
|
"""
|
|
383
420
|
Modify warehousing part of a product
|
|
384
421
|
"""
|
|
@@ -607,7 +644,11 @@ export default [
|
|
|
607
644
|
"""
|
|
608
645
|
Add a new product to an assortment
|
|
609
646
|
"""
|
|
610
|
-
addAssortmentProduct(
|
|
647
|
+
addAssortmentProduct(
|
|
648
|
+
assortmentId: ID!
|
|
649
|
+
productId: ID!
|
|
650
|
+
tags: [LowerCaseString!]
|
|
651
|
+
): AssortmentProduct!
|
|
611
652
|
|
|
612
653
|
"""
|
|
613
654
|
Remove a product from an assortment
|
|
@@ -625,7 +666,7 @@ export default [
|
|
|
625
666
|
addAssortmentLink(
|
|
626
667
|
parentAssortmentId: ID!
|
|
627
668
|
childAssortmentId: ID!
|
|
628
|
-
tags: [
|
|
669
|
+
tags: [LowerCaseString!]
|
|
629
670
|
): AssortmentLink!
|
|
630
671
|
|
|
631
672
|
"""
|
|
@@ -641,7 +682,7 @@ export default [
|
|
|
641
682
|
"""
|
|
642
683
|
Add a new filter to an assortment
|
|
643
684
|
"""
|
|
644
|
-
addAssortmentFilter(assortmentId: ID!, filterId: ID!, tags: [
|
|
685
|
+
addAssortmentFilter(assortmentId: ID!, filterId: ID!, tags: [LowerCaseString!]): AssortmentFilter!
|
|
645
686
|
|
|
646
687
|
"""
|
|
647
688
|
Remove a product from an assortment
|
|
@@ -846,6 +887,11 @@ export default [
|
|
|
846
887
|
prepareAssortmentMediaUpload(mediaName: String!, assortmentId: ID!): MediaUploadTicket!
|
|
847
888
|
prepareUserAvatarUpload(mediaName: String!, userId: ID): MediaUploadTicket!
|
|
848
889
|
confirmMediaUpload(mediaUploadTicketId: ID!, size: Int!, type: String!): Media!
|
|
890
|
+
|
|
891
|
+
"""
|
|
892
|
+
Tokenize
|
|
893
|
+
"""
|
|
894
|
+
exportToken(tokenId: ID!, quantity: Int! = 1, recipientWalletAddress: String!): Token!
|
|
849
895
|
}
|
|
850
896
|
`,
|
|
851
897
|
];
|
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
|
+
];
|
package/src/schema/types/user.js
CHANGED
|
@@ -49,6 +49,35 @@ export default [
|
|
|
49
49
|
countryCode: String
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
type WebAuthnMDSv3Metadata {
|
|
53
|
+
legalHeader: String
|
|
54
|
+
description: String
|
|
55
|
+
authenticatorVersion: Int
|
|
56
|
+
protocolFamily: String
|
|
57
|
+
schema: Int
|
|
58
|
+
upv: [JSON!]
|
|
59
|
+
authenticationAlgorithms: [String!]
|
|
60
|
+
publicKeyAlgAndEncodings: [String!]
|
|
61
|
+
attestationTypes: [String!]
|
|
62
|
+
userVerificationDetails: [JSON!]
|
|
63
|
+
keyProtection: [String!]
|
|
64
|
+
matcherProtection: [String!]
|
|
65
|
+
cryptoStrength: Int
|
|
66
|
+
attachmentHint: [String!]
|
|
67
|
+
tcDisplay: [JSON!]
|
|
68
|
+
attestationRootCertificates: [String!]
|
|
69
|
+
icon: String
|
|
70
|
+
authenticatorGetInfo: JSON
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
type WebAuthnCredentials {
|
|
74
|
+
_id: ID!
|
|
75
|
+
created: DateTime!
|
|
76
|
+
aaguid: String!
|
|
77
|
+
counter: Int!
|
|
78
|
+
mdsMetadata: WebAuthnMDSv3Metadata
|
|
79
|
+
}
|
|
80
|
+
|
|
52
81
|
type User {
|
|
53
82
|
_id: ID!
|
|
54
83
|
email: String @deprecated(reason: "Please use primaryEmail.address instead")
|
|
@@ -57,6 +86,7 @@ export default [
|
|
|
57
86
|
isGuest: Boolean!
|
|
58
87
|
isTwoFactorEnabled: Boolean!
|
|
59
88
|
isInitialPassword: Boolean!
|
|
89
|
+
webAuthnCredentials: [WebAuthnCredentials!]!
|
|
60
90
|
name: String!
|
|
61
91
|
avatar: Media
|
|
62
92
|
profile: UserProfile
|
|
@@ -68,7 +98,7 @@ export default [
|
|
|
68
98
|
primaryEmail: UserEmail
|
|
69
99
|
emails: [UserEmail!]
|
|
70
100
|
roles: [String!]
|
|
71
|
-
tags: [
|
|
101
|
+
tags: [LowerCaseString!]
|
|
72
102
|
cart(orderNumber: String): Order
|
|
73
103
|
orders(includeCarts: Boolean = false, sort: [SortOptionInput!], queryString: String): [Order!]!
|
|
74
104
|
quotations(sort: [SortOptionInput!], queryString: String): [Quotation!]!
|
|
@@ -76,6 +106,7 @@ export default [
|
|
|
76
106
|
paymentCredentials: [PaymentCredentials!]!
|
|
77
107
|
enrollments(sort: [SortOptionInput!], queryString: String): [Enrollment!]!
|
|
78
108
|
allowedActions: [RoleAction!]!
|
|
109
|
+
tokens: [Token!]!
|
|
79
110
|
}
|
|
80
111
|
`,
|
|
81
112
|
];
|
|
@@ -8,9 +8,13 @@ export default [
|
|
|
8
8
|
|
|
9
9
|
enum WarehousingProviderType {
|
|
10
10
|
"""
|
|
11
|
-
Physical
|
|
11
|
+
Physical warehousing providers resemble stores or facilities that hold a quantity of stocks physically in stock.
|
|
12
12
|
"""
|
|
13
13
|
PHYSICAL
|
|
14
|
+
"""
|
|
15
|
+
Virtual warehousing providers resemble software that control ownership and validity of virtual products (for ex. smart contract bridges)
|
|
16
|
+
"""
|
|
17
|
+
VIRTUAL
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
enum WarehousingProviderError {
|
|
@@ -31,5 +35,23 @@ export default [
|
|
|
31
35
|
configurationError: WarehousingProviderError
|
|
32
36
|
isActive: Boolean
|
|
33
37
|
}
|
|
38
|
+
|
|
39
|
+
enum TokenExportStatus {
|
|
40
|
+
CENTRALIZED
|
|
41
|
+
EXPORTING
|
|
42
|
+
DECENTRALIZED
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
type Token {
|
|
46
|
+
_id: ID!
|
|
47
|
+
user: User
|
|
48
|
+
walletAddress: String
|
|
49
|
+
product: TokenizedProduct!
|
|
50
|
+
status: TokenExportStatus!
|
|
51
|
+
quantity: Int!
|
|
52
|
+
contractAddress: String
|
|
53
|
+
chainId: String
|
|
54
|
+
chainTokenId: String
|
|
55
|
+
}
|
|
34
56
|
`,
|
|
35
57
|
];
|
package/src/user-context.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { UnchainedUserContext } from '@unchainedshop/types/api';
|
|
2
2
|
import { UnchainedCore } from '@unchainedshop/types/core';
|
|
3
|
-
import { IncomingMessage } from 'http';
|
|
3
|
+
import { IncomingMessage, OutgoingMessage } from 'http';
|
|
4
|
+
import cookie from 'cookie';
|
|
4
5
|
|
|
5
6
|
function isString(input) {
|
|
6
7
|
return typeof input === 'string' && Object.prototype.toString.call(input) === '[object String]';
|
|
@@ -8,16 +9,28 @@ function isString(input) {
|
|
|
8
9
|
|
|
9
10
|
export const getUserContext = async (
|
|
10
11
|
req: IncomingMessage & { cookies?: any },
|
|
12
|
+
res: OutgoingMessage,
|
|
11
13
|
unchainedAPI: UnchainedCore,
|
|
12
14
|
): Promise<UnchainedUserContext> => {
|
|
13
15
|
// there is a possible current user connected!
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const cookieName = process.env.UNCHAINED_COOKIE_NAME || 'unchained_token';
|
|
17
|
+
const domain = process.env.UNCHAINED_COOKIE_DOMAIN;
|
|
18
|
+
|
|
19
|
+
let loginToken = req.cookies?.[cookieName];
|
|
20
|
+
|
|
21
|
+
function setLoginToken(token: string, expires: Date) {
|
|
22
|
+
if (!domain) return;
|
|
23
|
+
const authCookie = cookie.serialize(cookieName, token || null, {
|
|
24
|
+
domain,
|
|
25
|
+
httpOnly: true,
|
|
26
|
+
expires: token ? expires : undefined,
|
|
27
|
+
maxAge: token ? undefined : -1,
|
|
28
|
+
sameSite: 'lax',
|
|
29
|
+
secure: process.env.NODE_ENV === 'production',
|
|
30
|
+
});
|
|
31
|
+
res.setHeader('Set-Cookie', authCookie);
|
|
20
32
|
}
|
|
33
|
+
|
|
21
34
|
if (req.headers.authorization) {
|
|
22
35
|
const [type, token] = req.headers.authorization.split(' ');
|
|
23
36
|
if (type === 'Bearer') {
|
|
@@ -54,11 +67,12 @@ export const getUserContext = async (
|
|
|
54
67
|
user: currentUser,
|
|
55
68
|
userId: currentUser._id,
|
|
56
69
|
loginToken: loginToken as string,
|
|
70
|
+
setLoginToken,
|
|
57
71
|
};
|
|
58
72
|
}
|
|
59
73
|
}
|
|
60
|
-
return { loginToken: loginToken as string };
|
|
74
|
+
return { loginToken: loginToken as string, setLoginToken };
|
|
61
75
|
}
|
|
62
76
|
|
|
63
|
-
return {};
|
|
77
|
+
return { setLoginToken };
|
|
64
78
|
};
|