@webbycrown/webbycommerce 1.1.2 → 1.2.1

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.
@@ -3,7 +3,7 @@ import * as React from "react";
3
3
  import React__default, { useContext, useRef, useCallback, useDebugValue, useMemo, useState, useEffect, useLayoutEffect, createContext as createContext$1, createElement, useReducer } from "react";
4
4
  import { useIntl, FormattedMessage } from "react-intl";
5
5
  import { Flex, Box, Popover, Typography, Button, LinkButton, Link as Link$1, Portal, Alert, Field, SubNav, Badge, TextInput, Pagination, PreviousLink, Dots, PageLink, NextLink, Modal, Main } from "@strapi/design-system";
6
- import { P as PLUGIN_ID } from "./index-BHqcM1qU.mjs";
6
+ import { P as PLUGIN_ID } from "./index-BWVy9o1d.mjs";
7
7
  import { WarningCircle, CaretDown, Trash } from "@strapi/icons";
8
8
  import "react-dom/client";
9
9
  import ReactDOM, { unstable_batchedUpdates as unstable_batchedUpdates$1 } from "react-dom";
@@ -10289,7 +10289,7 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
10289
10289
  var ys = arrObjKeys(obj, inspect2);
10290
10290
  var isPlainObject2 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
10291
10291
  var protoTag = obj instanceof Object ? "" : "null prototype";
10292
- var stringTag2 = !isPlainObject2 && toStringTag$1 && Object(obj) === obj && toStringTag$1 in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
10292
+ var stringTag2 = !isPlainObject2 && toStringTag$1 && Object(obj) === obj && toStringTag$1 in obj ? $slice.call(toStr$1(obj), 8, -1) : protoTag ? "Object" : "";
10293
10293
  var constructorTag = isPlainObject2 || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
10294
10294
  var tag = constructorTag + (stringTag2 || protoTag ? "[" + $join.call($concat$1.call([], stringTag2 || [], protoTag || []), ": ") + "] " : "");
10295
10295
  if (ys.length === 0) {
@@ -10314,25 +10314,25 @@ function canTrustToString(obj) {
10314
10314
  return !toStringTag$1 || !(typeof obj === "object" && (toStringTag$1 in obj || typeof obj[toStringTag$1] !== "undefined"));
10315
10315
  }
10316
10316
  function isArray$4(obj) {
10317
- return toStr(obj) === "[object Array]" && canTrustToString(obj);
10317
+ return toStr$1(obj) === "[object Array]" && canTrustToString(obj);
10318
10318
  }
10319
10319
  function isDate$2(obj) {
10320
- return toStr(obj) === "[object Date]" && canTrustToString(obj);
10320
+ return toStr$1(obj) === "[object Date]" && canTrustToString(obj);
10321
10321
  }
10322
10322
  function isRegExp$2(obj) {
10323
- return toStr(obj) === "[object RegExp]" && canTrustToString(obj);
10323
+ return toStr$1(obj) === "[object RegExp]" && canTrustToString(obj);
10324
10324
  }
10325
10325
  function isError(obj) {
10326
- return toStr(obj) === "[object Error]" && canTrustToString(obj);
10326
+ return toStr$1(obj) === "[object Error]" && canTrustToString(obj);
10327
10327
  }
10328
10328
  function isString$1(obj) {
10329
- return toStr(obj) === "[object String]" && canTrustToString(obj);
10329
+ return toStr$1(obj) === "[object String]" && canTrustToString(obj);
10330
10330
  }
10331
10331
  function isNumber$1(obj) {
10332
- return toStr(obj) === "[object Number]" && canTrustToString(obj);
10332
+ return toStr$1(obj) === "[object Number]" && canTrustToString(obj);
10333
10333
  }
10334
10334
  function isBoolean$1(obj) {
10335
- return toStr(obj) === "[object Boolean]" && canTrustToString(obj);
10335
+ return toStr$1(obj) === "[object Boolean]" && canTrustToString(obj);
10336
10336
  }
10337
10337
  function isSymbol(obj) {
10338
10338
  if (hasShammedSymbols) {
@@ -10368,7 +10368,7 @@ var hasOwn$1 = Object.prototype.hasOwnProperty || function(key) {
10368
10368
  function has$5(obj, key) {
10369
10369
  return hasOwn$1.call(obj, key);
10370
10370
  }
10371
- function toStr(obj) {
10371
+ function toStr$1(obj) {
10372
10372
  return objectToString.call(obj);
10373
10373
  }
10374
10374
  function nameOf(f2) {
@@ -10677,7 +10677,7 @@ var syntax = SyntaxError;
10677
10677
  var uri = URIError;
10678
10678
  var abs$1 = Math.abs;
10679
10679
  var floor$1 = Math.floor;
10680
- var max$1 = Math.max;
10680
+ var max$2 = Math.max;
10681
10681
  var min$1 = Math.min;
10682
10682
  var pow$1 = Math.pow;
10683
10683
  var round$1 = Math.round;
@@ -10806,99 +10806,78 @@ function requireObject_getPrototypeOf() {
10806
10806
  Object_getPrototypeOf = $Object2.getPrototypeOf || null;
10807
10807
  return Object_getPrototypeOf;
10808
10808
  }
10809
- var implementation;
10810
- var hasRequiredImplementation;
10811
- function requireImplementation() {
10812
- if (hasRequiredImplementation) return implementation;
10813
- hasRequiredImplementation = 1;
10814
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
10815
- var toStr2 = Object.prototype.toString;
10816
- var max2 = Math.max;
10817
- var funcType = "[object Function]";
10818
- var concatty = function concatty2(a2, b2) {
10819
- var arr = [];
10820
- for (var i2 = 0; i2 < a2.length; i2 += 1) {
10821
- arr[i2] = a2[i2];
10822
- }
10823
- for (var j2 = 0; j2 < b2.length; j2 += 1) {
10824
- arr[j2 + a2.length] = b2[j2];
10825
- }
10826
- return arr;
10827
- };
10828
- var slicy = function slicy2(arrLike, offset) {
10829
- var arr = [];
10830
- for (var i2 = offset, j2 = 0; i2 < arrLike.length; i2 += 1, j2 += 1) {
10831
- arr[j2] = arrLike[i2];
10809
+ var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
10810
+ var toStr = Object.prototype.toString;
10811
+ var max$1 = Math.max;
10812
+ var funcType = "[object Function]";
10813
+ var concatty = function concatty2(a2, b2) {
10814
+ var arr = [];
10815
+ for (var i2 = 0; i2 < a2.length; i2 += 1) {
10816
+ arr[i2] = a2[i2];
10817
+ }
10818
+ for (var j2 = 0; j2 < b2.length; j2 += 1) {
10819
+ arr[j2 + a2.length] = b2[j2];
10820
+ }
10821
+ return arr;
10822
+ };
10823
+ var slicy = function slicy2(arrLike, offset) {
10824
+ var arr = [];
10825
+ for (var i2 = offset, j2 = 0; i2 < arrLike.length; i2 += 1, j2 += 1) {
10826
+ arr[j2] = arrLike[i2];
10827
+ }
10828
+ return arr;
10829
+ };
10830
+ var joiny = function(arr, joiner) {
10831
+ var str = "";
10832
+ for (var i2 = 0; i2 < arr.length; i2 += 1) {
10833
+ str += arr[i2];
10834
+ if (i2 + 1 < arr.length) {
10835
+ str += joiner;
10832
10836
  }
10833
- return arr;
10834
- };
10835
- var joiny = function(arr, joiner) {
10836
- var str = "";
10837
- for (var i2 = 0; i2 < arr.length; i2 += 1) {
10838
- str += arr[i2];
10839
- if (i2 + 1 < arr.length) {
10840
- str += joiner;
10837
+ }
10838
+ return str;
10839
+ };
10840
+ var implementation$1 = function bind(that) {
10841
+ var target = this;
10842
+ if (typeof target !== "function" || toStr.apply(target) !== funcType) {
10843
+ throw new TypeError(ERROR_MESSAGE + target);
10844
+ }
10845
+ var args = slicy(arguments, 1);
10846
+ var bound;
10847
+ var binder = function() {
10848
+ if (this instanceof bound) {
10849
+ var result = target.apply(
10850
+ this,
10851
+ concatty(args, arguments)
10852
+ );
10853
+ if (Object(result) === result) {
10854
+ return result;
10841
10855
  }
10856
+ return this;
10842
10857
  }
10843
- return str;
10858
+ return target.apply(
10859
+ that,
10860
+ concatty(args, arguments)
10861
+ );
10844
10862
  };
10845
- implementation = function bind2(that) {
10846
- var target = this;
10847
- if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
10848
- throw new TypeError(ERROR_MESSAGE + target);
10849
- }
10850
- var args = slicy(arguments, 1);
10851
- var bound;
10852
- var binder = function() {
10853
- if (this instanceof bound) {
10854
- var result = target.apply(
10855
- this,
10856
- concatty(args, arguments)
10857
- );
10858
- if (Object(result) === result) {
10859
- return result;
10860
- }
10861
- return this;
10862
- }
10863
- return target.apply(
10864
- that,
10865
- concatty(args, arguments)
10866
- );
10863
+ var boundLength = max$1(0, target.length - args.length);
10864
+ var boundArgs = [];
10865
+ for (var i2 = 0; i2 < boundLength; i2++) {
10866
+ boundArgs[i2] = "$" + i2;
10867
+ }
10868
+ bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
10869
+ if (target.prototype) {
10870
+ var Empty = function Empty2() {
10867
10871
  };
10868
- var boundLength = max2(0, target.length - args.length);
10869
- var boundArgs = [];
10870
- for (var i2 = 0; i2 < boundLength; i2++) {
10871
- boundArgs[i2] = "$" + i2;
10872
- }
10873
- bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
10874
- if (target.prototype) {
10875
- var Empty = function Empty2() {
10876
- };
10877
- Empty.prototype = target.prototype;
10878
- bound.prototype = new Empty();
10879
- Empty.prototype = null;
10880
- }
10881
- return bound;
10882
- };
10883
- return implementation;
10884
- }
10885
- var functionBind;
10886
- var hasRequiredFunctionBind;
10887
- function requireFunctionBind() {
10888
- if (hasRequiredFunctionBind) return functionBind;
10889
- hasRequiredFunctionBind = 1;
10890
- var implementation2 = requireImplementation();
10891
- functionBind = Function.prototype.bind || implementation2;
10892
- return functionBind;
10893
- }
10894
- var functionCall;
10895
- var hasRequiredFunctionCall;
10896
- function requireFunctionCall() {
10897
- if (hasRequiredFunctionCall) return functionCall;
10898
- hasRequiredFunctionCall = 1;
10899
- functionCall = Function.prototype.call;
10900
- return functionCall;
10901
- }
10872
+ Empty.prototype = target.prototype;
10873
+ bound.prototype = new Empty();
10874
+ Empty.prototype = null;
10875
+ }
10876
+ return bound;
10877
+ };
10878
+ var implementation = implementation$1;
10879
+ var functionBind = Function.prototype.bind || implementation;
10880
+ var functionCall = Function.prototype.call;
10902
10881
  var functionApply;
10903
10882
  var hasRequiredFunctionApply;
10904
10883
  function requireFunctionApply() {
@@ -10908,14 +10887,14 @@ function requireFunctionApply() {
10908
10887
  return functionApply;
10909
10888
  }
10910
10889
  var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
10911
- var bind$3 = requireFunctionBind();
10890
+ var bind$3 = functionBind;
10912
10891
  var $apply$1 = requireFunctionApply();
10913
- var $call$2 = requireFunctionCall();
10892
+ var $call$2 = functionCall;
10914
10893
  var $reflectApply = reflectApply;
10915
10894
  var actualApply = $reflectApply || bind$3.call($call$2, $apply$1);
10916
- var bind$2 = requireFunctionBind();
10895
+ var bind$2 = functionBind;
10917
10896
  var $TypeError$4 = type;
10918
- var $call$1 = requireFunctionCall();
10897
+ var $call$1 = functionCall;
10919
10898
  var $actualApply = actualApply;
10920
10899
  var callBindApplyHelpers = function callBindBasic(args) {
10921
10900
  if (args.length < 1 || typeof args[0] !== "function") {
@@ -10981,8 +10960,8 @@ function requireHasown() {
10981
10960
  hasRequiredHasown = 1;
10982
10961
  var call = Function.prototype.call;
10983
10962
  var $hasOwn = Object.prototype.hasOwnProperty;
10984
- var bind2 = requireFunctionBind();
10985
- hasown = bind2.call(call, $hasOwn);
10963
+ var bind3 = functionBind;
10964
+ hasown = bind3.call(call, $hasOwn);
10986
10965
  return hasown;
10987
10966
  }
10988
10967
  var undefined$1;
@@ -10996,7 +10975,7 @@ var $TypeError$3 = type;
10996
10975
  var $URIError = uri;
10997
10976
  var abs = abs$1;
10998
10977
  var floor = floor$1;
10999
- var max = max$1;
10978
+ var max = max$2;
11000
10979
  var min = min$1;
11001
10980
  var pow = pow$1;
11002
10981
  var round = round$1;
@@ -11030,7 +11009,7 @@ var getProto = requireGetProto();
11030
11009
  var $ObjectGPO = requireObject_getPrototypeOf();
11031
11010
  var $ReflectGPO = requireReflect_getPrototypeOf();
11032
11011
  var $apply = requireFunctionApply();
11033
- var $call = requireFunctionCall();
11012
+ var $call = functionCall;
11034
11013
  var needsEval = {};
11035
11014
  var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
11036
11015
  var INTRINSICS = {
@@ -11201,7 +11180,7 @@ var LEGACY_ALIASES = {
11201
11180
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
11202
11181
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
11203
11182
  };
11204
- var bind$1 = requireFunctionBind();
11183
+ var bind$1 = functionBind;
11205
11184
  var hasOwn = requireHasown();
11206
11185
  var $concat = bind$1.call($call, Array.prototype.concat);
11207
11186
  var $spliceApply = bind$1.call($apply, Array.prototype.splice);
@@ -15532,7 +15511,7 @@ const admin = adminApi.enhanceEndpoints({
15532
15511
  overrideExisting: false
15533
15512
  });
15534
15513
  const { useInitQuery, useTelemetryPropertiesQuery, useInformationQuery, useProjectSettingsQuery, useUpdateProjectSettingsMutation, useGetPluginsQuery, useGetLicenseLimitsQuery, useGetLicenseTrialTimeLeftQuery, useGetGuidedTourMetaQuery } = admin;
15535
- function bind(fn2, thisArg) {
15514
+ function bind2(fn2, thisArg) {
15536
15515
  return function wrap() {
15537
15516
  return fn2.apply(thisArg, arguments);
15538
15517
  };
@@ -15669,7 +15648,7 @@ function merge2() {
15669
15648
  const extend = (a2, b2, thisArg, { allOwnKeys } = {}) => {
15670
15649
  forEach$1(b2, (val, key) => {
15671
15650
  if (thisArg && isFunction$1(val)) {
15672
- a2[key] = bind(val, thisArg);
15651
+ a2[key] = bind2(val, thisArg);
15673
15652
  } else {
15674
15653
  a2[key] = val;
15675
15654
  }
@@ -17949,7 +17928,7 @@ Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
17949
17928
  });
17950
17929
  function createInstance(defaultConfig) {
17951
17930
  const context = new Axios$1(defaultConfig);
17952
- const instance = bind(Axios$1.prototype.request, context);
17931
+ const instance = bind2(Axios$1.prototype.request, context);
17953
17932
  utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
17954
17933
  utils$1.extend(instance, context, null, { allOwnKeys: true });
17955
17934
  instance.create = function create2(instanceConfig) {
@@ -26465,6 +26444,97 @@ const ApiCollectionsContent = () => {
26465
26444
  "email": "user@example.com",
26466
26445
  "otp": "123456",
26467
26446
  "type": "email"
26447
+ }`
26448
+ },
26449
+ {
26450
+ id: "auth-method",
26451
+ method: "GET",
26452
+ path: getApiPath("/api/webbycommerce/auth/method"),
26453
+ title: formatMessage({
26454
+ id: `${PLUGIN_ID}.settings.apiCollections.authMethod.title`,
26455
+ defaultMessage: "Get Authentication Method"
26456
+ }),
26457
+ summary: formatMessage({
26458
+ id: `${PLUGIN_ID}.settings.apiCollections.authMethod.summary`,
26459
+ defaultMessage: "Get the current authentication method (default or otp) configured in the plugin settings. Use this endpoint in your frontend to determine which authentication flow to display."
26460
+ }),
26461
+ auth: formatMessage({
26462
+ id: `${PLUGIN_ID}.settings.apiCollections.authMethod.auth`,
26463
+ defaultMessage: "Auth: public (no authentication required)."
26464
+ }),
26465
+ response: `{
26466
+ "method": "default",
26467
+ "message": "Current authentication method: default"
26468
+ }`,
26469
+ usage: [
26470
+ formatMessage({
26471
+ id: `${PLUGIN_ID}.settings.apiCollections.authMethod.usage.frontend`,
26472
+ defaultMessage: "Call this endpoint on app initialization to determine which auth UI to show."
26473
+ }),
26474
+ formatMessage({
26475
+ id: `${PLUGIN_ID}.settings.apiCollections.authMethod.usage.conditional`,
26476
+ defaultMessage: 'If method is "otp", show OTP login/register form. If "default", show email/password form.'
26477
+ }),
26478
+ formatMessage({
26479
+ id: `${PLUGIN_ID}.settings.apiCollections.authMethod.usage.dynamic`,
26480
+ defaultMessage: "Method can change based on plugin settings, so check this endpoint periodically."
26481
+ })
26482
+ ],
26483
+ getCurl: () => `curl http://localhost:1337${getApiPath("/api/webbycommerce/auth/method")}`
26484
+ },
26485
+ {
26486
+ id: "unified-auth",
26487
+ method: "POST",
26488
+ path: getApiPath("/api/webbycommerce/auth/unified"),
26489
+ title: formatMessage({
26490
+ id: `${PLUGIN_ID}.settings.apiCollections.unifiedAuth.title`,
26491
+ defaultMessage: "Unified Authentication"
26492
+ }),
26493
+ summary: formatMessage({
26494
+ id: `${PLUGIN_ID}.settings.apiCollections.unifiedAuth.summary`,
26495
+ defaultMessage: "Unified authentication endpoint that supports both OTP and default (email/password) methods. Automatically detects which method to use based on request body. Perfect for frontends that want to support both authentication methods simultaneously."
26496
+ }),
26497
+ auth: formatMessage({
26498
+ id: `${PLUGIN_ID}.settings.apiCollections.unifiedAuth.auth`,
26499
+ defaultMessage: "Auth: public (no authentication required)."
26500
+ }),
26501
+ response: `{
26502
+ "success": true,
26503
+ "step": "login",
26504
+ "method": "default",
26505
+ "message": "Login successfully!",
26506
+ "jwt": "eyJhbGciOi...",
26507
+ "user": {
26508
+ "id": 1,
26509
+ "username": "user1234",
26510
+ "email": "user@example.com"
26511
+ }
26512
+ }`,
26513
+ usage: [
26514
+ formatMessage({
26515
+ id: `${PLUGIN_ID}.settings.apiCollections.unifiedAuth.usage.unified`,
26516
+ defaultMessage: "Use this single endpoint for all authentication needs - OTP and default methods."
26517
+ }),
26518
+ formatMessage({
26519
+ id: `${PLUGIN_ID}.settings.apiCollections.unifiedAuth.usage.otp`,
26520
+ defaultMessage: 'For OTP: First call with step="request" and email/mobile, then call with step="verify" and OTP code.'
26521
+ }),
26522
+ formatMessage({
26523
+ id: `${PLUGIN_ID}.settings.apiCollections.unifiedAuth.usage.default`,
26524
+ defaultMessage: 'For default: Call with step="login" and identifier/password, or step="register" with username/email/password.'
26525
+ }),
26526
+ formatMessage({
26527
+ id: `${PLUGIN_ID}.settings.apiCollections.unifiedAuth.usage.auto`,
26528
+ defaultMessage: 'Method is auto-detected from request body, or specify authMethod="otp" or "default" explicitly.'
26529
+ })
26530
+ ],
26531
+ getCurl: () => `curl -X POST http://localhost:1337${getApiPath("/api/webbycommerce/auth/unified")} \\
26532
+ -H "Content-Type: application/json" \\
26533
+ -d '{"step": "login", "identifier": "user@example.com", "password": "password"}'`,
26534
+ requestBody: `{
26535
+ "step": "login",
26536
+ "identifier": "user@example.com",
26537
+ "password": "password"
26468
26538
  }`
26469
26539
  },
26470
26540
  {
@@ -30858,6 +30928,45 @@ const LoginRegisterContent = () => {
30858
30928
  ] })
30859
30929
  ] })
30860
30930
  }
30931
+ ),
30932
+ /* @__PURE__ */ jsx(
30933
+ Box,
30934
+ {
30935
+ as: "label",
30936
+ padding: 3,
30937
+ background: method === "both" ? "primary100" : "neutral0",
30938
+ hasRadius: true,
30939
+ style: {
30940
+ cursor: "pointer",
30941
+ border: `1px solid ${method === "both" ? "#4945ff" : "#dcdce4"}`
30942
+ },
30943
+ children: /* @__PURE__ */ jsxs(Flex, { gap: 2, alignItems: "flex-start", children: [
30944
+ /* @__PURE__ */ jsx(
30945
+ "input",
30946
+ {
30947
+ type: "radio",
30948
+ name: "loginMethod",
30949
+ value: "both",
30950
+ checked: method === "both",
30951
+ onChange: (e2) => setMethod(e2.target.value),
30952
+ style: {
30953
+ marginTop: "4px",
30954
+ cursor: "pointer"
30955
+ }
30956
+ }
30957
+ ),
30958
+ /* @__PURE__ */ jsxs(Box, { children: [
30959
+ /* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral800", fontWeight: "semiBold", children: formatMessage({
30960
+ id: `${PLUGIN_ID}.settings.loginRegister.method.both`,
30961
+ defaultMessage: "Both Methods (Unified)"
30962
+ }) }),
30963
+ /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", marginTop: 1, display: "block", children: formatMessage({
30964
+ id: `${PLUGIN_ID}.settings.loginRegister.method.both.description`,
30965
+ defaultMessage: "Users can choose between OTP or email/password authentication. Use the unified /auth/unified endpoint to support both methods simultaneously."
30966
+ }) })
30967
+ ] })
30968
+ ] })
30969
+ }
30861
30970
  )
30862
30971
  ] }) }),
30863
30972
  error && /* @__PURE__ */ jsx(Box, { marginTop: 4, padding: 3, background: "danger100", hasRadius: true, children: /* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "danger700", children: error }) }),
@@ -88,6 +88,19 @@ const en = {
88
88
  "webbycommerce.settings.apiCollections.verifyOtp.usage.verify": "Submit the OTP code received via email or SMS.",
89
89
  "webbycommerce.settings.apiCollections.verifyOtp.usage.token": "Receive a JWT token for authenticated API requests.",
90
90
  "webbycommerce.settings.apiCollections.verifyOtp.usage.store": "Store the JWT token securely and include it in subsequent requests.",
91
+ "webbycommerce.settings.apiCollections.authMethod.title": "Get Authentication Method",
92
+ "webbycommerce.settings.apiCollections.authMethod.summary": "Get the current authentication method (default or otp) configured in the plugin settings. Use this endpoint in your frontend to determine which authentication flow to display.",
93
+ "webbycommerce.settings.apiCollections.authMethod.auth": "Auth: public (no authentication required).",
94
+ "webbycommerce.settings.apiCollections.authMethod.usage.frontend": "Call this endpoint on app initialization to determine which auth UI to show.",
95
+ "webbycommerce.settings.apiCollections.authMethod.usage.conditional": 'If method is "otp", show OTP login/register form. If "default", show email/password form.',
96
+ "webbycommerce.settings.apiCollections.authMethod.usage.dynamic": "Method can change based on plugin settings, so check this endpoint periodically.",
97
+ "webbycommerce.settings.apiCollections.unifiedAuth.title": "Unified Authentication",
98
+ "webbycommerce.settings.apiCollections.unifiedAuth.summary": "Unified authentication endpoint that supports both OTP and default (email/password) methods. Automatically detects which method to use based on request body. Perfect for frontends that want to support both authentication methods simultaneously.",
99
+ "webbycommerce.settings.apiCollections.unifiedAuth.auth": "Auth: public (no authentication required).",
100
+ "webbycommerce.settings.apiCollections.unifiedAuth.usage.unified": "Use this single endpoint for all authentication needs - OTP and default methods.",
101
+ "webbycommerce.settings.apiCollections.unifiedAuth.usage.otp": 'For OTP: First call with step="request" and email/mobile, then call with step="verify" and OTP code.',
102
+ "webbycommerce.settings.apiCollections.unifiedAuth.usage.default": 'For default: Call with step="login" and identifier/password, or step="register" with username/email/password.',
103
+ "webbycommerce.settings.apiCollections.unifiedAuth.usage.auto": 'Method is auto-detected from request body, or specify authMethod="otp" or "default" explicitly.',
91
104
  "webbycommerce.settings.apiCollections.defaultLogin.title": "Default Login (Email/Password)",
92
105
  "webbycommerce.settings.apiCollections.defaultLogin.summary": "Use Strapi's built-in /auth/local endpoint for email/password login when the authentication method is set to Default.",
93
106
  "webbycommerce.settings.apiCollections.defaultLogin.auth": "Auth: public (uses Strapi's core Users & Permissions authentication).",
@@ -130,6 +143,8 @@ const en = {
130
143
  "webbycommerce.settings.loginRegister.method.default.description": "Uses Strapi's built-in authentication system with email and password.",
131
144
  "webbycommerce.settings.loginRegister.method.otp": "OTP (Email/Mobile Verification)",
132
145
  "webbycommerce.settings.loginRegister.method.otp.description": "Users can login or register using email or mobile number. An OTP (One-Time Password) will be sent for verification.",
146
+ "webbycommerce.settings.loginRegister.method.both": "Both Methods (Unified)",
147
+ "webbycommerce.settings.loginRegister.method.both.description": "Users can choose between OTP or email/password authentication. Use the unified /auth/unified endpoint to support both methods simultaneously.",
133
148
  "webbycommerce.settings.loginRegister.save": "Save settings",
134
149
  "webbycommerce.settings.loginRegister.save.success": "Settings updated successfully.",
135
150
  "webbycommerce.settings.loginRegister.save.error": "Failed to save settings.",
@@ -86,6 +86,19 @@ const en = {
86
86
  "webbycommerce.settings.apiCollections.verifyOtp.usage.verify": "Submit the OTP code received via email or SMS.",
87
87
  "webbycommerce.settings.apiCollections.verifyOtp.usage.token": "Receive a JWT token for authenticated API requests.",
88
88
  "webbycommerce.settings.apiCollections.verifyOtp.usage.store": "Store the JWT token securely and include it in subsequent requests.",
89
+ "webbycommerce.settings.apiCollections.authMethod.title": "Get Authentication Method",
90
+ "webbycommerce.settings.apiCollections.authMethod.summary": "Get the current authentication method (default or otp) configured in the plugin settings. Use this endpoint in your frontend to determine which authentication flow to display.",
91
+ "webbycommerce.settings.apiCollections.authMethod.auth": "Auth: public (no authentication required).",
92
+ "webbycommerce.settings.apiCollections.authMethod.usage.frontend": "Call this endpoint on app initialization to determine which auth UI to show.",
93
+ "webbycommerce.settings.apiCollections.authMethod.usage.conditional": 'If method is "otp", show OTP login/register form. If "default", show email/password form.',
94
+ "webbycommerce.settings.apiCollections.authMethod.usage.dynamic": "Method can change based on plugin settings, so check this endpoint periodically.",
95
+ "webbycommerce.settings.apiCollections.unifiedAuth.title": "Unified Authentication",
96
+ "webbycommerce.settings.apiCollections.unifiedAuth.summary": "Unified authentication endpoint that supports both OTP and default (email/password) methods. Automatically detects which method to use based on request body. Perfect for frontends that want to support both authentication methods simultaneously.",
97
+ "webbycommerce.settings.apiCollections.unifiedAuth.auth": "Auth: public (no authentication required).",
98
+ "webbycommerce.settings.apiCollections.unifiedAuth.usage.unified": "Use this single endpoint for all authentication needs - OTP and default methods.",
99
+ "webbycommerce.settings.apiCollections.unifiedAuth.usage.otp": 'For OTP: First call with step="request" and email/mobile, then call with step="verify" and OTP code.',
100
+ "webbycommerce.settings.apiCollections.unifiedAuth.usage.default": 'For default: Call with step="login" and identifier/password, or step="register" with username/email/password.',
101
+ "webbycommerce.settings.apiCollections.unifiedAuth.usage.auto": 'Method is auto-detected from request body, or specify authMethod="otp" or "default" explicitly.',
89
102
  "webbycommerce.settings.apiCollections.defaultLogin.title": "Default Login (Email/Password)",
90
103
  "webbycommerce.settings.apiCollections.defaultLogin.summary": "Use Strapi's built-in /auth/local endpoint for email/password login when the authentication method is set to Default.",
91
104
  "webbycommerce.settings.apiCollections.defaultLogin.auth": "Auth: public (uses Strapi's core Users & Permissions authentication).",
@@ -128,6 +141,8 @@ const en = {
128
141
  "webbycommerce.settings.loginRegister.method.default.description": "Uses Strapi's built-in authentication system with email and password.",
129
142
  "webbycommerce.settings.loginRegister.method.otp": "OTP (Email/Mobile Verification)",
130
143
  "webbycommerce.settings.loginRegister.method.otp.description": "Users can login or register using email or mobile number. An OTP (One-Time Password) will be sent for verification.",
144
+ "webbycommerce.settings.loginRegister.method.both": "Both Methods (Unified)",
145
+ "webbycommerce.settings.loginRegister.method.both.description": "Users can choose between OTP or email/password authentication. Use the unified /auth/unified endpoint to support both methods simultaneously.",
131
146
  "webbycommerce.settings.loginRegister.save": "Save settings",
132
147
  "webbycommerce.settings.loginRegister.save.success": "Settings updated successfully.",
133
148
  "webbycommerce.settings.loginRegister.save.error": "Failed to save settings.",
@@ -92,7 +92,7 @@ const index = {
92
92
  defaultMessage: "Configure"
93
93
  },
94
94
  to: `${PLUGIN_ID}`,
95
- Component: () => import("./Settings-VM6V_KJt.mjs")
95
+ Component: () => import("./Settings-BonPzbwr.mjs")
96
96
  }
97
97
  );
98
98
  },
@@ -106,14 +106,14 @@ const index = {
106
106
  locales.map(async (locale) => {
107
107
  if (locale === "en") {
108
108
  try {
109
- const { default: data } = await import("./en-7gtFcumM.mjs");
109
+ const { default: data } = await import("./en-DE15m4xZ.mjs");
110
110
  return { data, locale };
111
111
  } catch {
112
112
  return { data: {}, locale };
113
113
  }
114
114
  }
115
115
  try {
116
- const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => import("./en-7gtFcumM.mjs") }), `./translations/${locale}.json`, 3);
116
+ const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => import("./en-DE15m4xZ.mjs") }), `./translations/${locale}.json`, 3);
117
117
  return { data, locale };
118
118
  } catch {
119
119
  return { data: {}, locale };
@@ -93,7 +93,7 @@ const index = {
93
93
  defaultMessage: "Configure"
94
94
  },
95
95
  to: `${PLUGIN_ID}`,
96
- Component: () => Promise.resolve().then(() => require("./Settings-D6uf1nI1.js"))
96
+ Component: () => Promise.resolve().then(() => require("./Settings-Bg2JyQ4c.js"))
97
97
  }
98
98
  );
99
99
  },
@@ -107,14 +107,14 @@ const index = {
107
107
  locales.map(async (locale) => {
108
108
  if (locale === "en") {
109
109
  try {
110
- const { default: data } = await Promise.resolve().then(() => require("./en-DIeqB4AB.js"));
110
+ const { default: data } = await Promise.resolve().then(() => require("./en-CiQ97iC8.js"));
111
111
  return { data, locale };
112
112
  } catch {
113
113
  return { data: {}, locale };
114
114
  }
115
115
  }
116
116
  try {
117
- const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("./en-DIeqB4AB.js")) }), `./translations/${locale}.json`, 3);
117
+ const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("./en-CiQ97iC8.js")) }), `./translations/${locale}.json`, 3);
118
118
  return { data, locale };
119
119
  } catch {
120
120
  return { data: {}, locale };
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-RtBCA1lD.js");
2
+ const index = require("../_chunks/index-NRuOdjd7.js");
3
3
  module.exports = index.index;
@@ -1,4 +1,4 @@
1
- import { i } from "../_chunks/index-BHqcM1qU.mjs";
1
+ import { i } from "../_chunks/index-BWVy9o1d.mjs";
2
2
  export {
3
3
  i as default
4
4
  };