@vendure/core 2.3.2 → 2.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/README.md +11 -11
  2. package/dist/api/config/generate-error-code-enum.js +3 -3
  3. package/dist/api/config/generate-permissions.js +29 -29
  4. package/dist/api/config/graphql-custom-fields.js +150 -150
  5. package/dist/api/schema/admin-api/administrator.api.graphql +47 -47
  6. package/dist/api/schema/admin-api/administrator.type.graphql +14 -14
  7. package/dist/api/schema/admin-api/asset.api.graphql +68 -68
  8. package/dist/api/schema/admin-api/auth.api.graphql +22 -22
  9. package/dist/api/schema/admin-api/channel.api.graphql +69 -69
  10. package/dist/api/schema/admin-api/collection-admin.type.graphql +4 -4
  11. package/dist/api/schema/admin-api/collection.api.graphql +94 -94
  12. package/dist/api/schema/admin-api/country.api.graphql +41 -41
  13. package/dist/api/schema/admin-api/customer-admin.type.graphql +4 -4
  14. package/dist/api/schema/admin-api/customer-group.api.graphql +37 -37
  15. package/dist/api/schema/admin-api/customer.api.graphql +63 -63
  16. package/dist/api/schema/admin-api/duplicate-entity.api.graphql +40 -40
  17. package/dist/api/schema/admin-api/facet-admin.type.graphql +3 -3
  18. package/dist/api/schema/admin-api/facet.api.graphql +100 -100
  19. package/dist/api/schema/admin-api/global-settings.api.graphql +26 -26
  20. package/dist/api/schema/admin-api/global-settings.type.graphql +28 -28
  21. package/dist/api/schema/admin-api/history-entry-admin.type.graphql +4 -4
  22. package/dist/api/schema/admin-api/import.api.graphql +3 -3
  23. package/dist/api/schema/admin-api/import.type.graphql +5 -5
  24. package/dist/api/schema/admin-api/job.api.graphql +63 -63
  25. package/dist/api/schema/admin-api/order-admin.type.graphql +37 -37
  26. package/dist/api/schema/admin-api/order.api.graphql +461 -461
  27. package/dist/api/schema/admin-api/payment-method.api.graphql +65 -65
  28. package/dist/api/schema/admin-api/payment.api.graphql +2 -2
  29. package/dist/api/schema/admin-api/product-admin.type.graphql +21 -21
  30. package/dist/api/schema/admin-api/product-option-group.api.graphql +58 -58
  31. package/dist/api/schema/admin-api/product-search-admin.type.graphql +5 -5
  32. package/dist/api/schema/admin-api/product-search.api.graphql +10 -10
  33. package/dist/api/schema/admin-api/product.api.graphql +214 -214
  34. package/dist/api/schema/admin-api/promotion.api.graphql +70 -70
  35. package/dist/api/schema/admin-api/province.api.graphql +37 -37
  36. package/dist/api/schema/admin-api/role.api.graphql +33 -33
  37. package/dist/api/schema/admin-api/seller.api.graphql +31 -31
  38. package/dist/api/schema/admin-api/shipping-method.api.graphql +91 -91
  39. package/dist/api/schema/admin-api/stock-level.type.graphql +9 -9
  40. package/dist/api/schema/admin-api/stock-location.api.graphql +51 -51
  41. package/dist/api/schema/admin-api/stock-location.type.graphql +7 -7
  42. package/dist/api/schema/admin-api/stock-movement.type.graphql +80 -80
  43. package/dist/api/schema/admin-api/tag.api.graphql +25 -25
  44. package/dist/api/schema/admin-api/tax-category.api.graphql +36 -36
  45. package/dist/api/schema/admin-api/tax-rate.api.graphql +37 -37
  46. package/dist/api/schema/admin-api/zone.api.graphql +42 -42
  47. package/dist/api/schema/common/address.type.graphql +16 -16
  48. package/dist/api/schema/common/asset.type.graphql +31 -31
  49. package/dist/api/schema/common/auth.type.graphql +12 -12
  50. package/dist/api/schema/common/channel.type.graphql +24 -24
  51. package/dist/api/schema/common/collection.type.graphql +40 -40
  52. package/dist/api/schema/common/common-enums.graphql +35 -35
  53. package/dist/api/schema/common/common-error-results.graphql +98 -98
  54. package/dist/api/schema/common/common-types.graphql +284 -284
  55. package/dist/api/schema/common/currency-code.graphql +322 -322
  56. package/dist/api/schema/common/custom-field-types.graphql +166 -166
  57. package/dist/api/schema/common/customer-group.type.graphql +10 -10
  58. package/dist/api/schema/common/customer.type.graphql +18 -18
  59. package/dist/api/schema/common/facet-value.type.graphql +19 -19
  60. package/dist/api/schema/common/facet.type.graphql +35 -35
  61. package/dist/api/schema/common/history-entry.type.graphql +43 -43
  62. package/dist/api/schema/common/language-code.graphql +325 -325
  63. package/dist/api/schema/common/order.type.graphql +257 -257
  64. package/dist/api/schema/common/payment-method.type.graphql +21 -21
  65. package/dist/api/schema/common/product-option-group.type.graphql +38 -38
  66. package/dist/api/schema/common/product-search.type.graphql +69 -69
  67. package/dist/api/schema/common/product.type.graphql +70 -70
  68. package/dist/api/schema/common/promotion.type.graphql +31 -31
  69. package/dist/api/schema/common/region.type.graphql +65 -65
  70. package/dist/api/schema/common/role.type.graphql +14 -14
  71. package/dist/api/schema/common/seller.type.graphql +6 -6
  72. package/dist/api/schema/common/shipping-method.type.graphql +27 -27
  73. package/dist/api/schema/common/tag.type.graphql +11 -11
  74. package/dist/api/schema/common/tax-category.type.graphql +7 -7
  75. package/dist/api/schema/common/tax-rate.type.graphql +16 -16
  76. package/dist/api/schema/common/user.type.graphql +17 -17
  77. package/dist/api/schema/common/zone.type.graphql +8 -8
  78. package/dist/api/schema/shop-api/shop-error-results.graphql +114 -114
  79. package/dist/api/schema/shop-api/shop.api.graphql +250 -250
  80. package/dist/config/auth/native-authentication-strategy.js +5 -5
  81. package/dist/i18n/messages/de.json +116 -116
  82. package/dist/i18n/messages/en.json +138 -138
  83. package/dist/i18n/messages/es.json +38 -38
  84. package/dist/i18n/messages/fr.json +138 -138
  85. package/dist/i18n/messages/pt_BR.json +99 -99
  86. package/dist/i18n/messages/pt_PT.json +118 -118
  87. package/dist/i18n/messages/ru.json +118 -118
  88. package/dist/i18n/messages/uk.json +118 -118
  89. package/dist/migrate.js +15 -15
  90. package/dist/plugin/default-search-plugin/api/api-extensions.js +8 -8
  91. package/dist/plugin/default-search-plugin/search-strategy/mysql-search-strategy.js +3 -3
  92. package/dist/plugin/default-search-plugin/search-strategy/postgres-search-strategy.js +7 -5
  93. package/dist/plugin/default-search-plugin/search-strategy/postgres-search-strategy.js.map +1 -1
  94. package/dist/plugin/default-search-plugin/search-strategy/sqlite-search-strategy.js +4 -4
  95. package/dist/service/helpers/request-context/request-context.service.js +6 -2
  96. package/dist/service/helpers/request-context/request-context.service.js.map +1 -1
  97. package/dist/service/services/product.service.js +5 -3
  98. package/dist/service/services/product.service.js.map +1 -1
  99. package/package.json +3 -3
  100. package/LICENSE +0 -9
  101. package/cli/cli-utils.d.ts +0 -1
  102. package/cli/cli-utils.js +0 -8
  103. package/cli/cli-utils.js.map +0 -1
  104. package/cli/vendure-cli.d.ts +0 -2
  105. package/cli/vendure-cli.js +0 -119
  106. package/cli/vendure-cli.js.map +0 -1
@@ -1,250 +1,250 @@
1
- type Query {
2
- "The active Channel"
3
- activeChannel: Channel!
4
- "The active Customer"
5
- activeCustomer: Customer
6
- """
7
- The active Order. Will be `null` until an Order is created via `addItemToOrder`. Once an Order reaches the
8
- state of `PaymentAuthorized` or `PaymentSettled`, then that Order is no longer considered "active" and this
9
- query will once again return `null`.
10
- """
11
- activeOrder: Order
12
- "An array of supported Countries"
13
- availableCountries: [Country!]!
14
- "A list of Collections available to the shop"
15
- collections(options: CollectionListOptions): CollectionList!
16
- "Returns a Collection either by its id or slug. If neither 'id' nor 'slug' is specified, an error will result."
17
- collection(id: ID, slug: String): Collection
18
- "Returns a list of eligible shipping methods based on the current active Order"
19
- eligibleShippingMethods: [ShippingMethodQuote!]!
20
- "Returns a list of payment methods and their eligibility based on the current active Order"
21
- eligiblePaymentMethods: [PaymentMethodQuote!]!
22
- "A list of Facets available to the shop"
23
- facets(options: FacetListOptions): FacetList!
24
- "Returns a Facet by its id"
25
- facet(id: ID!): Facet
26
- "Returns information about the current authenticated User"
27
- me: CurrentUser
28
- "Returns the possible next states that the activeOrder can transition to"
29
- nextOrderStates: [String!]!
30
- """
31
- Returns an Order based on the id. Note that in the Shop API, only orders belonging to the
32
- currently-authenticated User may be queried.
33
- """
34
- order(id: ID!): Order
35
- """
36
- Returns an Order based on the order `code`. For guest Orders (i.e. Orders placed by non-authenticated Customers)
37
- this query will only return the Order within 2 hours of the Order being placed. This allows an Order confirmation
38
- screen to be shown immediately after completion of a guest checkout, yet prevents security risks of allowing
39
- general anonymous access to Order data.
40
- """
41
- orderByCode(code: String!): Order
42
- "Get a Product either by id or slug. If neither 'id' nor 'slug' is specified, an error will result."
43
- product(id: ID, slug: String): Product
44
- "Get a list of Products"
45
- products(options: ProductListOptions): ProductList!
46
- "Search Products based on the criteria set by the `SearchInput`"
47
- search(input: SearchInput!): SearchResponse!
48
- }
49
-
50
- type Mutation {
51
- "Adds an item to the order. If custom fields are defined on the OrderLine entity, a third argument 'customFields' will be available."
52
- addItemToOrder(productVariantId: ID!, quantity: Int!): UpdateOrderItemsResult!
53
- "Remove an OrderLine from the Order"
54
- removeOrderLine(orderLineId: ID!): RemoveOrderItemsResult!
55
- "Remove all OrderLine from the Order"
56
- removeAllOrderLines: RemoveOrderItemsResult!
57
- "Adjusts an OrderLine. If custom fields are defined on the OrderLine entity, a third argument 'customFields' of type `OrderLineCustomFieldsInput` will be available."
58
- adjustOrderLine(orderLineId: ID!, quantity: Int!): UpdateOrderItemsResult!
59
- "Applies the given coupon code to the active Order"
60
- applyCouponCode(couponCode: String!): ApplyCouponCodeResult!
61
- "Removes the given coupon code from the active Order"
62
- removeCouponCode(couponCode: String!): Order
63
- "Transitions an Order to a new state. Valid next states can be found by querying `nextOrderStates`"
64
- transitionOrderToState(state: String!): TransitionOrderToStateResult
65
- "Sets the shipping address for this order"
66
- setOrderShippingAddress(input: CreateAddressInput!): ActiveOrderResult!
67
- "Sets the billing address for this order"
68
- setOrderBillingAddress(input: CreateAddressInput!): ActiveOrderResult!
69
- "Allows any custom fields to be set for the active order"
70
- setOrderCustomFields(input: UpdateOrderInput!): ActiveOrderResult!
71
- """
72
- Sets the shipping method by id, which can be obtained with the `eligibleShippingMethods` query.
73
- An Order can have multiple shipping methods, in which case you can pass an array of ids. In this case,
74
- you should configure a custom ShippingLineAssignmentStrategy in order to know which OrderLines each
75
- shipping method will apply to.
76
- """
77
- setOrderShippingMethod(shippingMethodId: [ID!]!): SetOrderShippingMethodResult!
78
- "Add a Payment to the Order"
79
- addPaymentToOrder(input: PaymentInput!): AddPaymentToOrderResult!
80
- "Set the Customer for the Order. Required only if the Customer is not currently logged in"
81
- setCustomerForOrder(input: CreateCustomerInput!): SetCustomerForOrderResult!
82
- """
83
- Authenticates the user using the native authentication strategy. This mutation is an alias for authenticate({ native: { ... }})
84
-
85
- The `rememberMe` option applies when using cookie-based sessions, and if `true` it will set the maxAge of the session cookie
86
- to 1 year.
87
- """
88
- login(username: String!, password: String!, rememberMe: Boolean): NativeAuthenticationResult!
89
- "Authenticates the user using a named authentication strategy"
90
- authenticate(input: AuthenticationInput!, rememberMe: Boolean): AuthenticationResult!
91
- "End the current authenticated session"
92
- logout: Success!
93
- """
94
- Register a Customer account with the given credentials. There are three possible registration flows:
95
-
96
- _If `authOptions.requireVerification` is set to `true`:_
97
-
98
- 1. **The Customer is registered _with_ a password**. A verificationToken will be created (and typically emailed to the Customer). That
99
- verificationToken would then be passed to the `verifyCustomerAccount` mutation _without_ a password. The Customer is then
100
- verified and authenticated in one step.
101
- 2. **The Customer is registered _without_ a password**. A verificationToken will be created (and typically emailed to the Customer). That
102
- verificationToken would then be passed to the `verifyCustomerAccount` mutation _with_ the chosen password of the Customer. The Customer is then
103
- verified and authenticated in one step.
104
-
105
- _If `authOptions.requireVerification` is set to `false`:_
106
-
107
- 3. The Customer _must_ be registered _with_ a password. No further action is needed - the Customer is able to authenticate immediately.
108
- """
109
- registerCustomerAccount(input: RegisterCustomerInput!): RegisterCustomerAccountResult!
110
- "Regenerate and send a verification token for a new Customer registration. Only applicable if `authOptions.requireVerification` is set to true."
111
- refreshCustomerVerification(emailAddress: String!): RefreshCustomerVerificationResult!
112
- "Update an existing Customer"
113
- updateCustomer(input: UpdateCustomerInput!): Customer!
114
- "Create a new Customer Address"
115
- createCustomerAddress(input: CreateAddressInput!): Address!
116
- "Update an existing Address"
117
- updateCustomerAddress(input: UpdateAddressInput!): Address!
118
- "Delete an existing Address"
119
- deleteCustomerAddress(id: ID!): Success!
120
- """
121
- Verify a Customer email address with the token sent to that address. Only applicable if `authOptions.requireVerification` is set to true.
122
-
123
- If the Customer was not registered with a password in the `registerCustomerAccount` mutation, the password _must_ be
124
- provided here.
125
- """
126
- verifyCustomerAccount(token: String!, password: String): VerifyCustomerAccountResult!
127
- "Update the password of the active Customer"
128
- updateCustomerPassword(currentPassword: String!, newPassword: String!): UpdateCustomerPasswordResult!
129
- """
130
- Request to update the emailAddress of the active Customer. If `authOptions.requireVerification` is enabled
131
- (as is the default), then the `identifierChangeToken` will be assigned to the current User and
132
- a IdentifierChangeRequestEvent will be raised. This can then be used e.g. by the EmailPlugin to email
133
- that verification token to the Customer, which is then used to verify the change of email address.
134
- """
135
- requestUpdateCustomerEmailAddress(
136
- password: String!
137
- newEmailAddress: String!
138
- ): RequestUpdateCustomerEmailAddressResult!
139
- """
140
- Confirm the update of the emailAddress with the provided token, which has been generated by the
141
- `requestUpdateCustomerEmailAddress` mutation.
142
- """
143
- updateCustomerEmailAddress(token: String!): UpdateCustomerEmailAddressResult!
144
- "Requests a password reset email to be sent"
145
- requestPasswordReset(emailAddress: String!): RequestPasswordResetResult
146
- "Resets a Customer's password based on the provided token"
147
- resetPassword(token: String!, password: String!): ResetPasswordResult!
148
- }
149
-
150
- # Populated at run-time
151
- input AuthenticationInput
152
-
153
- input RegisterCustomerInput {
154
- emailAddress: String!
155
- title: String
156
- firstName: String
157
- lastName: String
158
- phoneNumber: String
159
- password: String
160
- }
161
-
162
- input UpdateCustomerInput {
163
- title: String
164
- firstName: String
165
- lastName: String
166
- phoneNumber: String
167
- }
168
-
169
- # Populated with any custom fields at run-time
170
- input UpdateOrderInput
171
-
172
- """
173
- Passed as input to the `addPaymentToOrder` mutation.
174
- """
175
- input PaymentInput {
176
- """
177
- This field should correspond to the `code` property of a PaymentMethod.
178
- """
179
- method: String!
180
- """
181
- This field should contain arbitrary data passed to the specified PaymentMethodHandler's `createPayment()` method
182
- as the "metadata" argument. For example, it could contain an ID for the payment and other
183
- data generated by the payment provider.
184
- """
185
- metadata: JSON!
186
- }
187
-
188
- # generated by generateListOptions function
189
- input CollectionListOptions {
190
- topLevelOnly: Boolean
191
- }
192
-
193
- # generated by generateListOptions function
194
- input FacetListOptions
195
-
196
- # generated by generateListOptions function
197
- input OrderListOptions
198
-
199
- # generated by generateListOptions function
200
- input ProductListOptions
201
-
202
- # generated by generateListOptions function
203
- input ProductVariantListOptions
204
-
205
- union AddPaymentToOrderResult =
206
- Order
207
- | OrderPaymentStateError
208
- | IneligiblePaymentMethodError
209
- | PaymentFailedError
210
- | PaymentDeclinedError
211
- | OrderStateTransitionError
212
- | NoActiveOrderError
213
- union TransitionOrderToStateResult = Order | OrderStateTransitionError
214
- union SetCustomerForOrderResult = Order | AlreadyLoggedInError | EmailAddressConflictError | NoActiveOrderError | GuestCheckoutError
215
- union RegisterCustomerAccountResult = Success | MissingPasswordError | PasswordValidationError | NativeAuthStrategyError
216
- union RefreshCustomerVerificationResult = Success | NativeAuthStrategyError
217
- union VerifyCustomerAccountResult =
218
- CurrentUser
219
- | VerificationTokenInvalidError
220
- | VerificationTokenExpiredError
221
- | MissingPasswordError
222
- | PasswordValidationError
223
- | PasswordAlreadySetError
224
- | NativeAuthStrategyError
225
- union UpdateCustomerPasswordResult = Success | InvalidCredentialsError | PasswordValidationError | NativeAuthStrategyError
226
- union RequestUpdateCustomerEmailAddressResult =
227
- Success
228
- | InvalidCredentialsError
229
- | EmailAddressConflictError
230
- | NativeAuthStrategyError
231
- union UpdateCustomerEmailAddressResult =
232
- Success
233
- | IdentifierChangeTokenInvalidError
234
- | IdentifierChangeTokenExpiredError
235
- | NativeAuthStrategyError
236
- union RequestPasswordResetResult = Success | NativeAuthStrategyError
237
- union ResetPasswordResult =
238
- CurrentUser
239
- | PasswordResetTokenInvalidError
240
- | PasswordResetTokenExpiredError
241
- | PasswordValidationError
242
- | NativeAuthStrategyError
243
- | NotVerifiedError
244
- union NativeAuthenticationResult =
245
- CurrentUser
246
- | InvalidCredentialsError
247
- | NotVerifiedError
248
- | NativeAuthStrategyError
249
- union AuthenticationResult = CurrentUser | InvalidCredentialsError | NotVerifiedError
250
- union ActiveOrderResult = Order | NoActiveOrderError
1
+ type Query {
2
+ "The active Channel"
3
+ activeChannel: Channel!
4
+ "The active Customer"
5
+ activeCustomer: Customer
6
+ """
7
+ The active Order. Will be `null` until an Order is created via `addItemToOrder`. Once an Order reaches the
8
+ state of `PaymentAuthorized` or `PaymentSettled`, then that Order is no longer considered "active" and this
9
+ query will once again return `null`.
10
+ """
11
+ activeOrder: Order
12
+ "An array of supported Countries"
13
+ availableCountries: [Country!]!
14
+ "A list of Collections available to the shop"
15
+ collections(options: CollectionListOptions): CollectionList!
16
+ "Returns a Collection either by its id or slug. If neither 'id' nor 'slug' is specified, an error will result."
17
+ collection(id: ID, slug: String): Collection
18
+ "Returns a list of eligible shipping methods based on the current active Order"
19
+ eligibleShippingMethods: [ShippingMethodQuote!]!
20
+ "Returns a list of payment methods and their eligibility based on the current active Order"
21
+ eligiblePaymentMethods: [PaymentMethodQuote!]!
22
+ "A list of Facets available to the shop"
23
+ facets(options: FacetListOptions): FacetList!
24
+ "Returns a Facet by its id"
25
+ facet(id: ID!): Facet
26
+ "Returns information about the current authenticated User"
27
+ me: CurrentUser
28
+ "Returns the possible next states that the activeOrder can transition to"
29
+ nextOrderStates: [String!]!
30
+ """
31
+ Returns an Order based on the id. Note that in the Shop API, only orders belonging to the
32
+ currently-authenticated User may be queried.
33
+ """
34
+ order(id: ID!): Order
35
+ """
36
+ Returns an Order based on the order `code`. For guest Orders (i.e. Orders placed by non-authenticated Customers)
37
+ this query will only return the Order within 2 hours of the Order being placed. This allows an Order confirmation
38
+ screen to be shown immediately after completion of a guest checkout, yet prevents security risks of allowing
39
+ general anonymous access to Order data.
40
+ """
41
+ orderByCode(code: String!): Order
42
+ "Get a Product either by id or slug. If neither 'id' nor 'slug' is specified, an error will result."
43
+ product(id: ID, slug: String): Product
44
+ "Get a list of Products"
45
+ products(options: ProductListOptions): ProductList!
46
+ "Search Products based on the criteria set by the `SearchInput`"
47
+ search(input: SearchInput!): SearchResponse!
48
+ }
49
+
50
+ type Mutation {
51
+ "Adds an item to the order. If custom fields are defined on the OrderLine entity, a third argument 'customFields' will be available."
52
+ addItemToOrder(productVariantId: ID!, quantity: Int!): UpdateOrderItemsResult!
53
+ "Remove an OrderLine from the Order"
54
+ removeOrderLine(orderLineId: ID!): RemoveOrderItemsResult!
55
+ "Remove all OrderLine from the Order"
56
+ removeAllOrderLines: RemoveOrderItemsResult!
57
+ "Adjusts an OrderLine. If custom fields are defined on the OrderLine entity, a third argument 'customFields' of type `OrderLineCustomFieldsInput` will be available."
58
+ adjustOrderLine(orderLineId: ID!, quantity: Int!): UpdateOrderItemsResult!
59
+ "Applies the given coupon code to the active Order"
60
+ applyCouponCode(couponCode: String!): ApplyCouponCodeResult!
61
+ "Removes the given coupon code from the active Order"
62
+ removeCouponCode(couponCode: String!): Order
63
+ "Transitions an Order to a new state. Valid next states can be found by querying `nextOrderStates`"
64
+ transitionOrderToState(state: String!): TransitionOrderToStateResult
65
+ "Sets the shipping address for this order"
66
+ setOrderShippingAddress(input: CreateAddressInput!): ActiveOrderResult!
67
+ "Sets the billing address for this order"
68
+ setOrderBillingAddress(input: CreateAddressInput!): ActiveOrderResult!
69
+ "Allows any custom fields to be set for the active order"
70
+ setOrderCustomFields(input: UpdateOrderInput!): ActiveOrderResult!
71
+ """
72
+ Sets the shipping method by id, which can be obtained with the `eligibleShippingMethods` query.
73
+ An Order can have multiple shipping methods, in which case you can pass an array of ids. In this case,
74
+ you should configure a custom ShippingLineAssignmentStrategy in order to know which OrderLines each
75
+ shipping method will apply to.
76
+ """
77
+ setOrderShippingMethod(shippingMethodId: [ID!]!): SetOrderShippingMethodResult!
78
+ "Add a Payment to the Order"
79
+ addPaymentToOrder(input: PaymentInput!): AddPaymentToOrderResult!
80
+ "Set the Customer for the Order. Required only if the Customer is not currently logged in"
81
+ setCustomerForOrder(input: CreateCustomerInput!): SetCustomerForOrderResult!
82
+ """
83
+ Authenticates the user using the native authentication strategy. This mutation is an alias for authenticate({ native: { ... }})
84
+
85
+ The `rememberMe` option applies when using cookie-based sessions, and if `true` it will set the maxAge of the session cookie
86
+ to 1 year.
87
+ """
88
+ login(username: String!, password: String!, rememberMe: Boolean): NativeAuthenticationResult!
89
+ "Authenticates the user using a named authentication strategy"
90
+ authenticate(input: AuthenticationInput!, rememberMe: Boolean): AuthenticationResult!
91
+ "End the current authenticated session"
92
+ logout: Success!
93
+ """
94
+ Register a Customer account with the given credentials. There are three possible registration flows:
95
+
96
+ _If `authOptions.requireVerification` is set to `true`:_
97
+
98
+ 1. **The Customer is registered _with_ a password**. A verificationToken will be created (and typically emailed to the Customer). That
99
+ verificationToken would then be passed to the `verifyCustomerAccount` mutation _without_ a password. The Customer is then
100
+ verified and authenticated in one step.
101
+ 2. **The Customer is registered _without_ a password**. A verificationToken will be created (and typically emailed to the Customer). That
102
+ verificationToken would then be passed to the `verifyCustomerAccount` mutation _with_ the chosen password of the Customer. The Customer is then
103
+ verified and authenticated in one step.
104
+
105
+ _If `authOptions.requireVerification` is set to `false`:_
106
+
107
+ 3. The Customer _must_ be registered _with_ a password. No further action is needed - the Customer is able to authenticate immediately.
108
+ """
109
+ registerCustomerAccount(input: RegisterCustomerInput!): RegisterCustomerAccountResult!
110
+ "Regenerate and send a verification token for a new Customer registration. Only applicable if `authOptions.requireVerification` is set to true."
111
+ refreshCustomerVerification(emailAddress: String!): RefreshCustomerVerificationResult!
112
+ "Update an existing Customer"
113
+ updateCustomer(input: UpdateCustomerInput!): Customer!
114
+ "Create a new Customer Address"
115
+ createCustomerAddress(input: CreateAddressInput!): Address!
116
+ "Update an existing Address"
117
+ updateCustomerAddress(input: UpdateAddressInput!): Address!
118
+ "Delete an existing Address"
119
+ deleteCustomerAddress(id: ID!): Success!
120
+ """
121
+ Verify a Customer email address with the token sent to that address. Only applicable if `authOptions.requireVerification` is set to true.
122
+
123
+ If the Customer was not registered with a password in the `registerCustomerAccount` mutation, the password _must_ be
124
+ provided here.
125
+ """
126
+ verifyCustomerAccount(token: String!, password: String): VerifyCustomerAccountResult!
127
+ "Update the password of the active Customer"
128
+ updateCustomerPassword(currentPassword: String!, newPassword: String!): UpdateCustomerPasswordResult!
129
+ """
130
+ Request to update the emailAddress of the active Customer. If `authOptions.requireVerification` is enabled
131
+ (as is the default), then the `identifierChangeToken` will be assigned to the current User and
132
+ a IdentifierChangeRequestEvent will be raised. This can then be used e.g. by the EmailPlugin to email
133
+ that verification token to the Customer, which is then used to verify the change of email address.
134
+ """
135
+ requestUpdateCustomerEmailAddress(
136
+ password: String!
137
+ newEmailAddress: String!
138
+ ): RequestUpdateCustomerEmailAddressResult!
139
+ """
140
+ Confirm the update of the emailAddress with the provided token, which has been generated by the
141
+ `requestUpdateCustomerEmailAddress` mutation.
142
+ """
143
+ updateCustomerEmailAddress(token: String!): UpdateCustomerEmailAddressResult!
144
+ "Requests a password reset email to be sent"
145
+ requestPasswordReset(emailAddress: String!): RequestPasswordResetResult
146
+ "Resets a Customer's password based on the provided token"
147
+ resetPassword(token: String!, password: String!): ResetPasswordResult!
148
+ }
149
+
150
+ # Populated at run-time
151
+ input AuthenticationInput
152
+
153
+ input RegisterCustomerInput {
154
+ emailAddress: String!
155
+ title: String
156
+ firstName: String
157
+ lastName: String
158
+ phoneNumber: String
159
+ password: String
160
+ }
161
+
162
+ input UpdateCustomerInput {
163
+ title: String
164
+ firstName: String
165
+ lastName: String
166
+ phoneNumber: String
167
+ }
168
+
169
+ # Populated with any custom fields at run-time
170
+ input UpdateOrderInput
171
+
172
+ """
173
+ Passed as input to the `addPaymentToOrder` mutation.
174
+ """
175
+ input PaymentInput {
176
+ """
177
+ This field should correspond to the `code` property of a PaymentMethod.
178
+ """
179
+ method: String!
180
+ """
181
+ This field should contain arbitrary data passed to the specified PaymentMethodHandler's `createPayment()` method
182
+ as the "metadata" argument. For example, it could contain an ID for the payment and other
183
+ data generated by the payment provider.
184
+ """
185
+ metadata: JSON!
186
+ }
187
+
188
+ # generated by generateListOptions function
189
+ input CollectionListOptions {
190
+ topLevelOnly: Boolean
191
+ }
192
+
193
+ # generated by generateListOptions function
194
+ input FacetListOptions
195
+
196
+ # generated by generateListOptions function
197
+ input OrderListOptions
198
+
199
+ # generated by generateListOptions function
200
+ input ProductListOptions
201
+
202
+ # generated by generateListOptions function
203
+ input ProductVariantListOptions
204
+
205
+ union AddPaymentToOrderResult =
206
+ Order
207
+ | OrderPaymentStateError
208
+ | IneligiblePaymentMethodError
209
+ | PaymentFailedError
210
+ | PaymentDeclinedError
211
+ | OrderStateTransitionError
212
+ | NoActiveOrderError
213
+ union TransitionOrderToStateResult = Order | OrderStateTransitionError
214
+ union SetCustomerForOrderResult = Order | AlreadyLoggedInError | EmailAddressConflictError | NoActiveOrderError | GuestCheckoutError
215
+ union RegisterCustomerAccountResult = Success | MissingPasswordError | PasswordValidationError | NativeAuthStrategyError
216
+ union RefreshCustomerVerificationResult = Success | NativeAuthStrategyError
217
+ union VerifyCustomerAccountResult =
218
+ CurrentUser
219
+ | VerificationTokenInvalidError
220
+ | VerificationTokenExpiredError
221
+ | MissingPasswordError
222
+ | PasswordValidationError
223
+ | PasswordAlreadySetError
224
+ | NativeAuthStrategyError
225
+ union UpdateCustomerPasswordResult = Success | InvalidCredentialsError | PasswordValidationError | NativeAuthStrategyError
226
+ union RequestUpdateCustomerEmailAddressResult =
227
+ Success
228
+ | InvalidCredentialsError
229
+ | EmailAddressConflictError
230
+ | NativeAuthStrategyError
231
+ union UpdateCustomerEmailAddressResult =
232
+ Success
233
+ | IdentifierChangeTokenInvalidError
234
+ | IdentifierChangeTokenExpiredError
235
+ | NativeAuthStrategyError
236
+ union RequestPasswordResetResult = Success | NativeAuthStrategyError
237
+ union ResetPasswordResult =
238
+ CurrentUser
239
+ | PasswordResetTokenInvalidError
240
+ | PasswordResetTokenExpiredError
241
+ | PasswordValidationError
242
+ | NativeAuthStrategyError
243
+ | NotVerifiedError
244
+ union NativeAuthenticationResult =
245
+ CurrentUser
246
+ | InvalidCredentialsError
247
+ | NotVerifiedError
248
+ | NativeAuthStrategyError
249
+ union AuthenticationResult = CurrentUser | InvalidCredentialsError | NotVerifiedError
250
+ union ActiveOrderResult = Order | NoActiveOrderError
@@ -30,11 +30,11 @@ class NativeAuthenticationStrategy {
30
30
  this.userService = injector.get(UserService);
31
31
  }
32
32
  defineInputType() {
33
- return (0, graphql_tag_1.default) `
34
- input NativeAuthInput {
35
- username: String!
36
- password: String!
37
- }
33
+ return (0, graphql_tag_1.default) `
34
+ input NativeAuthInput {
35
+ username: String!
36
+ password: String!
37
+ }
38
38
  `;
39
39
  }
40
40
  async authenticate(ctx, data) {