@lana-commerce/core 13.1.0-alpha.15 → 13.1.0-alpha.17

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.
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = "fragment Customer on StorefrontCustomer{id email name display_name mobile mobile_notifications accepts_marketing reminder_messages addresses{...FullAddress}mobile mobile_notifications default_billing_address_id default_shipping_address_id default_payment_source_id is_guest password_defined oauth_provider webauthn_enabled}\n";
3
+ exports.default = "fragment Customer on StorefrontCustomer{id email name display_name mobile mobile_notifications accepts_marketing reminder_messages addresses{...FullAddress}mobile mobile_notifications default_billing_address_id default_shipping_address_id default_payment_source_id is_guest password_defined oauth_provider webauthn_keys{id name created_at}}\n";
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = "mutation DeleteWebauthn($shopID:String!){storefrontCustomersWebauthnDelete(shop_id:$shopID)}";
3
+ exports.default = "mutation DeleteWebauthn($shopID:String!$ids:[String!]!){storefrontCustomersWebauthnDelete(shop_id:$shopID ids:$ids)}";
@@ -2039,7 +2039,7 @@ function createWebauthnUtilsGraph(binding) {
2039
2039
  }));
2040
2040
  const deleteFx = (0, effector_1.createEffect)((p) => tslib_1.__awaiter(this, void 0, void 0, function* () {
2041
2041
  const { shopID, opts } = p.config;
2042
- return (0, request_js_1.request)(DeleteWebauthnMutation_js_1.default)({ shopID }, opts);
2042
+ return (0, request_js_1.request)(DeleteWebauthnMutation_js_1.default)({ shopID, ids: p.data }, opts);
2043
2043
  }));
2044
2044
  // create flow
2045
2045
  {
@@ -1 +1 @@
1
- export default "fragment Customer on StorefrontCustomer{id email name display_name mobile mobile_notifications accepts_marketing reminder_messages addresses{...FullAddress}mobile mobile_notifications default_billing_address_id default_shipping_address_id default_payment_source_id is_guest password_defined oauth_provider webauthn_enabled}\n";
1
+ export default "fragment Customer on StorefrontCustomer{id email name display_name mobile mobile_notifications accepts_marketing reminder_messages addresses{...FullAddress}mobile mobile_notifications default_billing_address_id default_shipping_address_id default_payment_source_id is_guest password_defined oauth_provider webauthn_keys{id name created_at}}\n";
@@ -1 +1 @@
1
- export default "mutation DeleteWebauthn($shopID:String!){storefrontCustomersWebauthnDelete(shop_id:$shopID)}";
1
+ export default "mutation DeleteWebauthn($shopID:String!$ids:[String!]!){storefrontCustomersWebauthnDelete(shop_id:$shopID ids:$ids)}";
@@ -2053,7 +2053,7 @@ function createWebauthnUtilsGraph(binding) {
2053
2053
  });
2054
2054
  const deleteFx = createEffect(async (p) => {
2055
2055
  const { shopID, opts } = p.config;
2056
- return request(deletedWebauthnMutation)({ shopID }, opts);
2056
+ return request(deletedWebauthnMutation)({ shopID, ids: p.data }, opts);
2057
2057
  });
2058
2058
  // create flow
2059
2059
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lana-commerce/core",
3
- "version": "13.1.0-alpha.15",
3
+ "version": "13.1.0-alpha.17",
4
4
  "description": "Lana JS Core",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -51,6 +51,11 @@ export type APIError = {
51
51
  code: undefined;
52
52
  } | {
53
53
  code: ErrorCode.Unauthorized;
54
+ meta?: {
55
+ oauth_providers?: string[];
56
+ password_defined?: boolean;
57
+ webauthn_defined?: boolean;
58
+ };
54
59
  } | {
55
60
  code: ErrorCode.NotFound;
56
61
  } | {
@@ -1,2 +1,2 @@
1
- declare const _default: "fragment Customer on StorefrontCustomer{id email name display_name mobile mobile_notifications accepts_marketing reminder_messages addresses{...FullAddress}mobile mobile_notifications default_billing_address_id default_shipping_address_id default_payment_source_id is_guest password_defined oauth_provider webauthn_enabled}\n";
1
+ declare const _default: "fragment Customer on StorefrontCustomer{id email name display_name mobile mobile_notifications accepts_marketing reminder_messages addresses{...FullAddress}mobile mobile_notifications default_billing_address_id default_shipping_address_id default_payment_source_id is_guest password_defined oauth_provider webauthn_keys{id name created_at}}\n";
2
2
  export default _default;
@@ -469,7 +469,11 @@ export interface CustomerFragment {
469
469
  oauth_provider: CustomerOAuthProviderKind | null;
470
470
  password_defined: boolean;
471
471
  reminder_messages: boolean;
472
- webauthn_enabled: boolean;
472
+ webauthn_keys: Array<{
473
+ created_at: string;
474
+ id: string;
475
+ name: string;
476
+ }>;
473
477
  }
474
478
  export interface CustomerBalanceFragment {
475
479
  balance: Array<{
@@ -1577,6 +1581,7 @@ export interface DeleteWebauthnMutation {
1577
1581
  storefrontCustomersWebauthnDelete: boolean | null;
1578
1582
  }
1579
1583
  export interface DeleteWebauthnMutationVariables {
1584
+ ids: Array<string>;
1580
1585
  shopID: string;
1581
1586
  }
1582
1587
  export interface DeleteWebauthnMutationMeta {
@@ -1018,8 +1018,8 @@ export interface Customer {
1018
1018
  total_spent: number;
1019
1019
  /** The date and time when the customer information was updated */
1020
1020
  updated_at: string;
1021
- /** Whether webauthn is enabled or not */
1022
- webauthn_enabled: boolean;
1021
+ /** Webauthn keys if any */
1022
+ webauthn_keys: Array<WebauthnKey>;
1023
1023
  }
1024
1024
  export interface CustomerBalance {
1025
1025
  /** Customer balance amounts per-currency */
@@ -8324,8 +8324,10 @@ export interface User {
8324
8324
  logged_in_at: string;
8325
8325
  /** Name of the user */
8326
8326
  name: string;
8327
- /** OAuth2 provider used for registering this account */
8327
+ /** OAuth2 provider used for registering this account (deprecated, use oauth_providers instead) */
8328
8328
  oauth_provider?: OAuth2Provider;
8329
+ /** OAuth2 providers enabled for this account if any */
8330
+ oauth_providers: Array<OAuth2Provider>;
8329
8331
  /** Whether user has password defined */
8330
8332
  password_defined: boolean;
8331
8333
  /** A set of permission bits in context of a given shop */
@@ -8353,8 +8355,8 @@ export interface User {
8353
8355
  /** The date and time when the user was last updated, RFC 3339 format */
8354
8356
  updated_at: string;
8355
8357
  user_file: UserFile | null;
8356
- /** Whether webauthn is enabled or not */
8357
- webauthn_enabled: boolean;
8358
+ /** Webauthn keys if any */
8359
+ webauthn_keys: Array<WebauthnKey>;
8358
8360
  }
8359
8361
  export type UserClass = "admin" | "user";
8360
8362
  export interface UserCreate {
@@ -8369,7 +8371,7 @@ export interface UserCreate {
8369
8371
  name?: string | null;
8370
8372
  /** OAuth2 authorization code provided by the provider */
8371
8373
  oauth_code?: string | null;
8372
- /** OAuth2 provider used for registering this account */
8374
+ /** OAuth2 provider used for registering this account (deprecated, use oauth_providers instead) */
8373
8375
  oauth_provider?: OAuth2Provider | null;
8374
8376
  /** The user's password */
8375
8377
  password?: string | null;
@@ -8433,9 +8435,11 @@ export interface UserLogin {
8433
8435
  email?: string | null;
8434
8436
  /** Your device fingerprint (internal, temporary, used for debug purposes) */
8435
8437
  fingerprint?: string | null;
8438
+ /** Force login if unregistered oauth provider is used (also connects the provider) */
8439
+ force?: boolean | null;
8436
8440
  /** OAuth2 authorization code provided by the provider */
8437
8441
  oauth_code?: string | null;
8438
- /** OAuth2 provider used for registering this account */
8442
+ /** OAuth2 provider used for registering this account (deprecated, use oauth_providers instead) */
8439
8443
  oauth_provider?: OAuth2Provider | null;
8440
8444
  /** The user's password */
8441
8445
  password?: string | null;
@@ -8664,6 +8668,16 @@ export interface WebauthnAdd {
8664
8668
  /** Session ID associated with webauthn login process */
8665
8669
  webauthn_session_id: string;
8666
8670
  }
8671
+ export interface WebauthnKey {
8672
+ /** The date and time when the key was created, RFC 3339 format */
8673
+ created_at: string;
8674
+ /** Unique identifier of the created key */
8675
+ id: string;
8676
+ /** Name of the authenticator (if identified) */
8677
+ name: string;
8678
+ /** The date and time when the key was last used, RFC 3339 format */
8679
+ used_at: string | null;
8680
+ }
8667
8681
  export interface WebauthnResponse {
8668
8682
  options: string;
8669
8683
  /** Session ID associated with webauthn login process */
@@ -14629,11 +14643,13 @@ export interface EndpointUsersInitWebauthn extends Endpoint<EndpointUsersInitWeb
14629
14643
  extract(v: Extractor<WebauthnResponse>): EndpointUsersInitWebauthn;
14630
14644
  }
14631
14645
  export interface EndpointUsersOauthDelete extends Endpoint<EndpointUsersOauthDelete, void> {
14646
+ /** OAuth2 provider used for registering this account (deprecated, use oauth_providers instead) */
14647
+ provider(v: OAuth2Provider): EndpointUsersOauthDelete;
14632
14648
  }
14633
14649
  export interface EndpointUsersOauth extends Endpoint<EndpointUsersOauth, void> {
14634
14650
  /** OAuth2 authorization code provided by the provider */
14635
14651
  code(v: string): EndpointUsersOauth;
14636
- /** OAuth2 provider used for registering this account */
14652
+ /** OAuth2 provider used for registering this account (deprecated, use oauth_providers instead) */
14637
14653
  provider(v: OAuth2Provider): EndpointUsersOauth;
14638
14654
  }
14639
14655
  export interface EndpointUsersTwoFactorDelete extends Endpoint<EndpointUsersTwoFactorDelete, void> {
@@ -14667,6 +14683,8 @@ export interface EndpointUsersTwoFactorValidate extends Endpoint<EndpointUsersTw
14667
14683
  extract(v: Extractor<Array<RecoveryOTP>>): EndpointUsersTwoFactorValidate;
14668
14684
  }
14669
14685
  export interface EndpointUsersWebauthnDelete extends Endpoint<EndpointUsersWebauthnDelete, void> {
14686
+ /** List of webauthn key ids. See also: [Unique Identifiers](/overview/concepts/unique-identifiers) */
14687
+ ids(v: Array<string>): EndpointUsersWebauthnDelete;
14670
14688
  }
14671
14689
  export interface EndpointUsersWebauthn extends Endpoint<EndpointUsersWebauthn, void> {
14672
14690
  data(v: WebauthnAdd): EndpointUsersWebauthn;
@@ -1556,8 +1556,8 @@ export interface StorefrontCustomer {
1556
1556
  total_spent: number;
1557
1557
  /** The date and time when the customer information was updated */
1558
1558
  updated_at: string;
1559
- /** Whether webauthn is enabled or not */
1560
- webauthn_enabled: boolean;
1559
+ /** Webauthn keys if any */
1560
+ webauthn_keys: Array<WebauthnKey>;
1561
1561
  }
1562
1562
  export interface StorefrontCustomerBalance {
1563
1563
  /** Customer balance amounts per-currency */
@@ -3063,6 +3063,16 @@ export interface WebauthnAdd {
3063
3063
  /** Session ID associated with webauthn login process */
3064
3064
  webauthn_session_id: string;
3065
3065
  }
3066
+ export interface WebauthnKey {
3067
+ /** The date and time when the key was created, RFC 3339 format */
3068
+ created_at: string;
3069
+ /** Unique identifier of the created key */
3070
+ id: string;
3071
+ /** Name of the authenticator (if identified) */
3072
+ name: string;
3073
+ /** The date and time when the key was last used, RFC 3339 format */
3074
+ used_at: string | null;
3075
+ }
3066
3076
  export interface WebauthnResponse {
3067
3077
  options: string;
3068
3078
  /** Session ID associated with webauthn login process */
@@ -3787,6 +3797,8 @@ export interface EndpointStorefrontCustomersOauth extends Endpoint<EndpointStore
3787
3797
  verifier(v: string): EndpointStorefrontCustomersOauth;
3788
3798
  }
3789
3799
  export interface EndpointStorefrontCustomersWebauthnDelete extends Endpoint<EndpointStorefrontCustomersWebauthnDelete, void> {
3800
+ /** List of webauthn key ids. See also: [Unique Identifiers](/overview/concepts/unique-identifiers) */
3801
+ ids(v: Array<string>): EndpointStorefrontCustomersWebauthnDelete;
3790
3802
  /** Unique shop identifier. See also: [Unique Identifiers](/overview/concepts/unique-identifiers) */
3791
3803
  shop_id(v: string): EndpointStorefrontCustomersWebauthnDelete;
3792
3804
  }
@@ -639,7 +639,7 @@ export declare function createCustomer(config: CustomerConfig, init: CustomerIni
639
639
  };
640
640
  webauthn: {
641
641
  create: Event<void>;
642
- delete: Event<void>;
642
+ delete: Event<string[]>;
643
643
  };
644
644
  };
645
645
  export type Customer = ReturnType<typeof createCustomer>;