@webbycrown/webbycommerce 1.1.0 → 1.2.0
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/README.md +14 -2
- package/dist/_chunks/{Settings-C3yoIgMy.js → Settings-DZXAkI24.js} +242 -90
- package/dist/_chunks/{Settings-BWuSG1Bc.mjs → Settings-yLx-YvVy.mjs} +132 -1
- package/dist/_chunks/{en-DIeqB4AB.js → en-CiQ97iC8.js} +15 -0
- package/dist/_chunks/{en-7gtFcumM.mjs → en-DE15m4xZ.mjs} +15 -0
- package/dist/_chunks/{index-DIGoLhGE.mjs → index-CXGrFKp6.mjs} +3 -3
- package/dist/_chunks/{index-CtxKh-aM.js → index-DgocXUgC.js} +3 -3
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +15408 -217
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -580,8 +580,20 @@ Authorization: Bearer YOUR_JWT_TOKEN
|
|
|
580
580
|
|
|
581
581
|
## 📜 Changelog
|
|
582
582
|
|
|
583
|
-
## [1.
|
|
584
|
-
|
|
583
|
+
## [1.2.0] - New feature
|
|
584
|
+
|
|
585
|
+
### Added
|
|
586
|
+
- Created auth login method API
|
|
587
|
+
- Created unified auth method API
|
|
588
|
+
|
|
589
|
+
### Fixed
|
|
590
|
+
- Fixed bugs of update schema
|
|
591
|
+
|
|
592
|
+
## [1.1.2] - Patch Release
|
|
593
|
+
- Fixed bugs and resolved issues with the category slug API.
|
|
594
|
+
|
|
595
|
+
## [1.1.0] - New feature
|
|
596
|
+
- Added Bulk Product API
|
|
585
597
|
|
|
586
598
|
## [1.0.2] – Patch Release
|
|
587
599
|
|
|
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const reactIntl = require("react-intl");
|
|
6
6
|
const designSystem = require("@strapi/design-system");
|
|
7
|
-
const index = require("./index-
|
|
7
|
+
const index = require("./index-DgocXUgC.js");
|
|
8
8
|
const icons = require("@strapi/icons");
|
|
9
9
|
require("react-dom/client");
|
|
10
10
|
const ReactDOM = require("react-dom");
|
|
@@ -10310,7 +10310,7 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
|
|
|
10310
10310
|
var ys = arrObjKeys(obj, inspect2);
|
|
10311
10311
|
var isPlainObject2 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
|
10312
10312
|
var protoTag = obj instanceof Object ? "" : "null prototype";
|
|
10313
|
-
var stringTag2 = !isPlainObject2 && toStringTag$1 && Object(obj) === obj && toStringTag$1 in obj ? $slice.call(toStr
|
|
10313
|
+
var stringTag2 = !isPlainObject2 && toStringTag$1 && Object(obj) === obj && toStringTag$1 in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
|
|
10314
10314
|
var constructorTag = isPlainObject2 || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
|
|
10315
10315
|
var tag = constructorTag + (stringTag2 || protoTag ? "[" + $join.call($concat$1.call([], stringTag2 || [], protoTag || []), ": ") + "] " : "");
|
|
10316
10316
|
if (ys.length === 0) {
|
|
@@ -10335,25 +10335,25 @@ function canTrustToString(obj) {
|
|
|
10335
10335
|
return !toStringTag$1 || !(typeof obj === "object" && (toStringTag$1 in obj || typeof obj[toStringTag$1] !== "undefined"));
|
|
10336
10336
|
}
|
|
10337
10337
|
function isArray$4(obj) {
|
|
10338
|
-
return toStr
|
|
10338
|
+
return toStr(obj) === "[object Array]" && canTrustToString(obj);
|
|
10339
10339
|
}
|
|
10340
10340
|
function isDate$2(obj) {
|
|
10341
|
-
return toStr
|
|
10341
|
+
return toStr(obj) === "[object Date]" && canTrustToString(obj);
|
|
10342
10342
|
}
|
|
10343
10343
|
function isRegExp$2(obj) {
|
|
10344
|
-
return toStr
|
|
10344
|
+
return toStr(obj) === "[object RegExp]" && canTrustToString(obj);
|
|
10345
10345
|
}
|
|
10346
10346
|
function isError(obj) {
|
|
10347
|
-
return toStr
|
|
10347
|
+
return toStr(obj) === "[object Error]" && canTrustToString(obj);
|
|
10348
10348
|
}
|
|
10349
10349
|
function isString$1(obj) {
|
|
10350
|
-
return toStr
|
|
10350
|
+
return toStr(obj) === "[object String]" && canTrustToString(obj);
|
|
10351
10351
|
}
|
|
10352
10352
|
function isNumber$1(obj) {
|
|
10353
|
-
return toStr
|
|
10353
|
+
return toStr(obj) === "[object Number]" && canTrustToString(obj);
|
|
10354
10354
|
}
|
|
10355
10355
|
function isBoolean$1(obj) {
|
|
10356
|
-
return toStr
|
|
10356
|
+
return toStr(obj) === "[object Boolean]" && canTrustToString(obj);
|
|
10357
10357
|
}
|
|
10358
10358
|
function isSymbol(obj) {
|
|
10359
10359
|
if (hasShammedSymbols) {
|
|
@@ -10389,7 +10389,7 @@ var hasOwn$1 = Object.prototype.hasOwnProperty || function(key) {
|
|
|
10389
10389
|
function has$5(obj, key) {
|
|
10390
10390
|
return hasOwn$1.call(obj, key);
|
|
10391
10391
|
}
|
|
10392
|
-
function toStr
|
|
10392
|
+
function toStr(obj) {
|
|
10393
10393
|
return objectToString.call(obj);
|
|
10394
10394
|
}
|
|
10395
10395
|
function nameOf(f2) {
|
|
@@ -10698,7 +10698,7 @@ var syntax = SyntaxError;
|
|
|
10698
10698
|
var uri = URIError;
|
|
10699
10699
|
var abs$1 = Math.abs;
|
|
10700
10700
|
var floor$1 = Math.floor;
|
|
10701
|
-
var max$
|
|
10701
|
+
var max$1 = Math.max;
|
|
10702
10702
|
var min$1 = Math.min;
|
|
10703
10703
|
var pow$1 = Math.pow;
|
|
10704
10704
|
var round$1 = Math.round;
|
|
@@ -10827,78 +10827,99 @@ function requireObject_getPrototypeOf() {
|
|
|
10827
10827
|
Object_getPrototypeOf = $Object2.getPrototypeOf || null;
|
|
10828
10828
|
return Object_getPrototypeOf;
|
|
10829
10829
|
}
|
|
10830
|
-
var
|
|
10831
|
-
var
|
|
10832
|
-
|
|
10833
|
-
|
|
10834
|
-
|
|
10835
|
-
var
|
|
10836
|
-
|
|
10837
|
-
|
|
10838
|
-
|
|
10839
|
-
|
|
10840
|
-
arr
|
|
10841
|
-
|
|
10842
|
-
|
|
10843
|
-
};
|
|
10844
|
-
var slicy = function slicy2(arrLike, offset) {
|
|
10845
|
-
var arr = [];
|
|
10846
|
-
for (var i2 = offset, j2 = 0; i2 < arrLike.length; i2 += 1, j2 += 1) {
|
|
10847
|
-
arr[j2] = arrLike[i2];
|
|
10848
|
-
}
|
|
10849
|
-
return arr;
|
|
10850
|
-
};
|
|
10851
|
-
var joiny = function(arr, joiner) {
|
|
10852
|
-
var str = "";
|
|
10853
|
-
for (var i2 = 0; i2 < arr.length; i2 += 1) {
|
|
10854
|
-
str += arr[i2];
|
|
10855
|
-
if (i2 + 1 < arr.length) {
|
|
10856
|
-
str += joiner;
|
|
10830
|
+
var implementation;
|
|
10831
|
+
var hasRequiredImplementation;
|
|
10832
|
+
function requireImplementation() {
|
|
10833
|
+
if (hasRequiredImplementation) return implementation;
|
|
10834
|
+
hasRequiredImplementation = 1;
|
|
10835
|
+
var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
|
|
10836
|
+
var toStr2 = Object.prototype.toString;
|
|
10837
|
+
var max2 = Math.max;
|
|
10838
|
+
var funcType = "[object Function]";
|
|
10839
|
+
var concatty = function concatty2(a2, b2) {
|
|
10840
|
+
var arr = [];
|
|
10841
|
+
for (var i2 = 0; i2 < a2.length; i2 += 1) {
|
|
10842
|
+
arr[i2] = a2[i2];
|
|
10857
10843
|
}
|
|
10858
|
-
|
|
10859
|
-
|
|
10860
|
-
}
|
|
10861
|
-
|
|
10862
|
-
|
|
10863
|
-
|
|
10864
|
-
|
|
10865
|
-
|
|
10866
|
-
|
|
10867
|
-
|
|
10868
|
-
|
|
10869
|
-
|
|
10870
|
-
|
|
10871
|
-
|
|
10872
|
-
|
|
10873
|
-
|
|
10874
|
-
if (
|
|
10875
|
-
|
|
10844
|
+
for (var j2 = 0; j2 < b2.length; j2 += 1) {
|
|
10845
|
+
arr[j2 + a2.length] = b2[j2];
|
|
10846
|
+
}
|
|
10847
|
+
return arr;
|
|
10848
|
+
};
|
|
10849
|
+
var slicy = function slicy2(arrLike, offset) {
|
|
10850
|
+
var arr = [];
|
|
10851
|
+
for (var i2 = offset, j2 = 0; i2 < arrLike.length; i2 += 1, j2 += 1) {
|
|
10852
|
+
arr[j2] = arrLike[i2];
|
|
10853
|
+
}
|
|
10854
|
+
return arr;
|
|
10855
|
+
};
|
|
10856
|
+
var joiny = function(arr, joiner) {
|
|
10857
|
+
var str = "";
|
|
10858
|
+
for (var i2 = 0; i2 < arr.length; i2 += 1) {
|
|
10859
|
+
str += arr[i2];
|
|
10860
|
+
if (i2 + 1 < arr.length) {
|
|
10861
|
+
str += joiner;
|
|
10876
10862
|
}
|
|
10877
|
-
return this;
|
|
10878
10863
|
}
|
|
10879
|
-
return
|
|
10880
|
-
that,
|
|
10881
|
-
concatty(args, arguments)
|
|
10882
|
-
);
|
|
10864
|
+
return str;
|
|
10883
10865
|
};
|
|
10884
|
-
|
|
10885
|
-
|
|
10886
|
-
|
|
10887
|
-
|
|
10888
|
-
|
|
10889
|
-
|
|
10890
|
-
|
|
10891
|
-
var
|
|
10866
|
+
implementation = function bind2(that) {
|
|
10867
|
+
var target = this;
|
|
10868
|
+
if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
|
|
10869
|
+
throw new TypeError(ERROR_MESSAGE + target);
|
|
10870
|
+
}
|
|
10871
|
+
var args = slicy(arguments, 1);
|
|
10872
|
+
var bound;
|
|
10873
|
+
var binder = function() {
|
|
10874
|
+
if (this instanceof bound) {
|
|
10875
|
+
var result = target.apply(
|
|
10876
|
+
this,
|
|
10877
|
+
concatty(args, arguments)
|
|
10878
|
+
);
|
|
10879
|
+
if (Object(result) === result) {
|
|
10880
|
+
return result;
|
|
10881
|
+
}
|
|
10882
|
+
return this;
|
|
10883
|
+
}
|
|
10884
|
+
return target.apply(
|
|
10885
|
+
that,
|
|
10886
|
+
concatty(args, arguments)
|
|
10887
|
+
);
|
|
10892
10888
|
};
|
|
10893
|
-
|
|
10894
|
-
|
|
10895
|
-
|
|
10896
|
-
|
|
10897
|
-
|
|
10898
|
-
};
|
|
10899
|
-
|
|
10900
|
-
var
|
|
10901
|
-
|
|
10889
|
+
var boundLength = max2(0, target.length - args.length);
|
|
10890
|
+
var boundArgs = [];
|
|
10891
|
+
for (var i2 = 0; i2 < boundLength; i2++) {
|
|
10892
|
+
boundArgs[i2] = "$" + i2;
|
|
10893
|
+
}
|
|
10894
|
+
bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
|
|
10895
|
+
if (target.prototype) {
|
|
10896
|
+
var Empty = function Empty2() {
|
|
10897
|
+
};
|
|
10898
|
+
Empty.prototype = target.prototype;
|
|
10899
|
+
bound.prototype = new Empty();
|
|
10900
|
+
Empty.prototype = null;
|
|
10901
|
+
}
|
|
10902
|
+
return bound;
|
|
10903
|
+
};
|
|
10904
|
+
return implementation;
|
|
10905
|
+
}
|
|
10906
|
+
var functionBind;
|
|
10907
|
+
var hasRequiredFunctionBind;
|
|
10908
|
+
function requireFunctionBind() {
|
|
10909
|
+
if (hasRequiredFunctionBind) return functionBind;
|
|
10910
|
+
hasRequiredFunctionBind = 1;
|
|
10911
|
+
var implementation2 = requireImplementation();
|
|
10912
|
+
functionBind = Function.prototype.bind || implementation2;
|
|
10913
|
+
return functionBind;
|
|
10914
|
+
}
|
|
10915
|
+
var functionCall;
|
|
10916
|
+
var hasRequiredFunctionCall;
|
|
10917
|
+
function requireFunctionCall() {
|
|
10918
|
+
if (hasRequiredFunctionCall) return functionCall;
|
|
10919
|
+
hasRequiredFunctionCall = 1;
|
|
10920
|
+
functionCall = Function.prototype.call;
|
|
10921
|
+
return functionCall;
|
|
10922
|
+
}
|
|
10902
10923
|
var functionApply;
|
|
10903
10924
|
var hasRequiredFunctionApply;
|
|
10904
10925
|
function requireFunctionApply() {
|
|
@@ -10908,14 +10929,14 @@ function requireFunctionApply() {
|
|
|
10908
10929
|
return functionApply;
|
|
10909
10930
|
}
|
|
10910
10931
|
var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
|
|
10911
|
-
var bind$3 =
|
|
10932
|
+
var bind$3 = requireFunctionBind();
|
|
10912
10933
|
var $apply$1 = requireFunctionApply();
|
|
10913
|
-
var $call$2 =
|
|
10934
|
+
var $call$2 = requireFunctionCall();
|
|
10914
10935
|
var $reflectApply = reflectApply;
|
|
10915
10936
|
var actualApply = $reflectApply || bind$3.call($call$2, $apply$1);
|
|
10916
|
-
var bind$2 =
|
|
10937
|
+
var bind$2 = requireFunctionBind();
|
|
10917
10938
|
var $TypeError$4 = type;
|
|
10918
|
-
var $call$1 =
|
|
10939
|
+
var $call$1 = requireFunctionCall();
|
|
10919
10940
|
var $actualApply = actualApply;
|
|
10920
10941
|
var callBindApplyHelpers = function callBindBasic(args) {
|
|
10921
10942
|
if (args.length < 1 || typeof args[0] !== "function") {
|
|
@@ -10981,8 +11002,8 @@ function requireHasown() {
|
|
|
10981
11002
|
hasRequiredHasown = 1;
|
|
10982
11003
|
var call = Function.prototype.call;
|
|
10983
11004
|
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
10984
|
-
var
|
|
10985
|
-
hasown =
|
|
11005
|
+
var bind2 = requireFunctionBind();
|
|
11006
|
+
hasown = bind2.call(call, $hasOwn);
|
|
10986
11007
|
return hasown;
|
|
10987
11008
|
}
|
|
10988
11009
|
var undefined$1;
|
|
@@ -10996,7 +11017,7 @@ var $TypeError$3 = type;
|
|
|
10996
11017
|
var $URIError = uri;
|
|
10997
11018
|
var abs = abs$1;
|
|
10998
11019
|
var floor = floor$1;
|
|
10999
|
-
var max = max$
|
|
11020
|
+
var max = max$1;
|
|
11000
11021
|
var min = min$1;
|
|
11001
11022
|
var pow = pow$1;
|
|
11002
11023
|
var round = round$1;
|
|
@@ -11030,7 +11051,7 @@ var getProto = requireGetProto();
|
|
|
11030
11051
|
var $ObjectGPO = requireObject_getPrototypeOf();
|
|
11031
11052
|
var $ReflectGPO = requireReflect_getPrototypeOf();
|
|
11032
11053
|
var $apply = requireFunctionApply();
|
|
11033
|
-
var $call =
|
|
11054
|
+
var $call = requireFunctionCall();
|
|
11034
11055
|
var needsEval = {};
|
|
11035
11056
|
var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
|
|
11036
11057
|
var INTRINSICS = {
|
|
@@ -11201,7 +11222,7 @@ var LEGACY_ALIASES = {
|
|
|
11201
11222
|
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
11202
11223
|
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
11203
11224
|
};
|
|
11204
|
-
var bind$1 =
|
|
11225
|
+
var bind$1 = requireFunctionBind();
|
|
11205
11226
|
var hasOwn = requireHasown();
|
|
11206
11227
|
var $concat = bind$1.call($call, Array.prototype.concat);
|
|
11207
11228
|
var $spliceApply = bind$1.call($apply, Array.prototype.splice);
|
|
@@ -15532,7 +15553,7 @@ const admin = adminApi.enhanceEndpoints({
|
|
|
15532
15553
|
overrideExisting: false
|
|
15533
15554
|
});
|
|
15534
15555
|
const { useInitQuery, useTelemetryPropertiesQuery, useInformationQuery, useProjectSettingsQuery, useUpdateProjectSettingsMutation, useGetPluginsQuery, useGetLicenseLimitsQuery, useGetLicenseTrialTimeLeftQuery, useGetGuidedTourMetaQuery } = admin;
|
|
15535
|
-
function
|
|
15556
|
+
function bind(fn2, thisArg) {
|
|
15536
15557
|
return function wrap() {
|
|
15537
15558
|
return fn2.apply(thisArg, arguments);
|
|
15538
15559
|
};
|
|
@@ -15669,7 +15690,7 @@ function merge2() {
|
|
|
15669
15690
|
const extend = (a2, b2, thisArg, { allOwnKeys } = {}) => {
|
|
15670
15691
|
forEach$1(b2, (val, key) => {
|
|
15671
15692
|
if (thisArg && isFunction$1(val)) {
|
|
15672
|
-
a2[key] =
|
|
15693
|
+
a2[key] = bind(val, thisArg);
|
|
15673
15694
|
} else {
|
|
15674
15695
|
a2[key] = val;
|
|
15675
15696
|
}
|
|
@@ -17949,7 +17970,7 @@ Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
|
|
|
17949
17970
|
});
|
|
17950
17971
|
function createInstance(defaultConfig) {
|
|
17951
17972
|
const context = new Axios$1(defaultConfig);
|
|
17952
|
-
const instance =
|
|
17973
|
+
const instance = bind(Axios$1.prototype.request, context);
|
|
17953
17974
|
utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
|
|
17954
17975
|
utils$1.extend(instance, context, null, { allOwnKeys: true });
|
|
17955
17976
|
instance.create = function create2(instanceConfig) {
|
|
@@ -21625,6 +21646,7 @@ const MainSubNav = styled.styled(designSystem.SubNav)`
|
|
|
21625
21646
|
position: sticky;
|
|
21626
21647
|
top: 0;
|
|
21627
21648
|
border-right: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
21649
|
+
overscroll-behavior: contain;
|
|
21628
21650
|
}
|
|
21629
21651
|
${({ theme }) => theme.breakpoints.large} {
|
|
21630
21652
|
height: 100dvh;
|
|
@@ -26464,6 +26486,97 @@ const ApiCollectionsContent = () => {
|
|
|
26464
26486
|
"email": "user@example.com",
|
|
26465
26487
|
"otp": "123456",
|
|
26466
26488
|
"type": "email"
|
|
26489
|
+
}`
|
|
26490
|
+
},
|
|
26491
|
+
{
|
|
26492
|
+
id: "auth-method",
|
|
26493
|
+
method: "GET",
|
|
26494
|
+
path: getApiPath("/api/webbycommerce/auth/method"),
|
|
26495
|
+
title: formatMessage({
|
|
26496
|
+
id: `${index.PLUGIN_ID}.settings.apiCollections.authMethod.title`,
|
|
26497
|
+
defaultMessage: "Get Authentication Method"
|
|
26498
|
+
}),
|
|
26499
|
+
summary: formatMessage({
|
|
26500
|
+
id: `${index.PLUGIN_ID}.settings.apiCollections.authMethod.summary`,
|
|
26501
|
+
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."
|
|
26502
|
+
}),
|
|
26503
|
+
auth: formatMessage({
|
|
26504
|
+
id: `${index.PLUGIN_ID}.settings.apiCollections.authMethod.auth`,
|
|
26505
|
+
defaultMessage: "Auth: public (no authentication required)."
|
|
26506
|
+
}),
|
|
26507
|
+
response: `{
|
|
26508
|
+
"method": "default",
|
|
26509
|
+
"message": "Current authentication method: default"
|
|
26510
|
+
}`,
|
|
26511
|
+
usage: [
|
|
26512
|
+
formatMessage({
|
|
26513
|
+
id: `${index.PLUGIN_ID}.settings.apiCollections.authMethod.usage.frontend`,
|
|
26514
|
+
defaultMessage: "Call this endpoint on app initialization to determine which auth UI to show."
|
|
26515
|
+
}),
|
|
26516
|
+
formatMessage({
|
|
26517
|
+
id: `${index.PLUGIN_ID}.settings.apiCollections.authMethod.usage.conditional`,
|
|
26518
|
+
defaultMessage: 'If method is "otp", show OTP login/register form. If "default", show email/password form.'
|
|
26519
|
+
}),
|
|
26520
|
+
formatMessage({
|
|
26521
|
+
id: `${index.PLUGIN_ID}.settings.apiCollections.authMethod.usage.dynamic`,
|
|
26522
|
+
defaultMessage: "Method can change based on plugin settings, so check this endpoint periodically."
|
|
26523
|
+
})
|
|
26524
|
+
],
|
|
26525
|
+
getCurl: () => `curl http://localhost:1337${getApiPath("/api/webbycommerce/auth/method")}`
|
|
26526
|
+
},
|
|
26527
|
+
{
|
|
26528
|
+
id: "unified-auth",
|
|
26529
|
+
method: "POST",
|
|
26530
|
+
path: getApiPath("/api/webbycommerce/auth/unified"),
|
|
26531
|
+
title: formatMessage({
|
|
26532
|
+
id: `${index.PLUGIN_ID}.settings.apiCollections.unifiedAuth.title`,
|
|
26533
|
+
defaultMessage: "Unified Authentication"
|
|
26534
|
+
}),
|
|
26535
|
+
summary: formatMessage({
|
|
26536
|
+
id: `${index.PLUGIN_ID}.settings.apiCollections.unifiedAuth.summary`,
|
|
26537
|
+
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."
|
|
26538
|
+
}),
|
|
26539
|
+
auth: formatMessage({
|
|
26540
|
+
id: `${index.PLUGIN_ID}.settings.apiCollections.unifiedAuth.auth`,
|
|
26541
|
+
defaultMessage: "Auth: public (no authentication required)."
|
|
26542
|
+
}),
|
|
26543
|
+
response: `{
|
|
26544
|
+
"success": true,
|
|
26545
|
+
"step": "login",
|
|
26546
|
+
"method": "default",
|
|
26547
|
+
"message": "Login successfully!",
|
|
26548
|
+
"jwt": "eyJhbGciOi...",
|
|
26549
|
+
"user": {
|
|
26550
|
+
"id": 1,
|
|
26551
|
+
"username": "user1234",
|
|
26552
|
+
"email": "user@example.com"
|
|
26553
|
+
}
|
|
26554
|
+
}`,
|
|
26555
|
+
usage: [
|
|
26556
|
+
formatMessage({
|
|
26557
|
+
id: `${index.PLUGIN_ID}.settings.apiCollections.unifiedAuth.usage.unified`,
|
|
26558
|
+
defaultMessage: "Use this single endpoint for all authentication needs - OTP and default methods."
|
|
26559
|
+
}),
|
|
26560
|
+
formatMessage({
|
|
26561
|
+
id: `${index.PLUGIN_ID}.settings.apiCollections.unifiedAuth.usage.otp`,
|
|
26562
|
+
defaultMessage: 'For OTP: First call with step="request" and email/mobile, then call with step="verify" and OTP code.'
|
|
26563
|
+
}),
|
|
26564
|
+
formatMessage({
|
|
26565
|
+
id: `${index.PLUGIN_ID}.settings.apiCollections.unifiedAuth.usage.default`,
|
|
26566
|
+
defaultMessage: 'For default: Call with step="login" and identifier/password, or step="register" with username/email/password.'
|
|
26567
|
+
}),
|
|
26568
|
+
formatMessage({
|
|
26569
|
+
id: `${index.PLUGIN_ID}.settings.apiCollections.unifiedAuth.usage.auto`,
|
|
26570
|
+
defaultMessage: 'Method is auto-detected from request body, or specify authMethod="otp" or "default" explicitly.'
|
|
26571
|
+
})
|
|
26572
|
+
],
|
|
26573
|
+
getCurl: () => `curl -X POST http://localhost:1337${getApiPath("/api/webbycommerce/auth/unified")} \\
|
|
26574
|
+
-H "Content-Type: application/json" \\
|
|
26575
|
+
-d '{"step": "login", "identifier": "user@example.com", "password": "password"}'`,
|
|
26576
|
+
requestBody: `{
|
|
26577
|
+
"step": "login",
|
|
26578
|
+
"identifier": "user@example.com",
|
|
26579
|
+
"password": "password"
|
|
26467
26580
|
}`
|
|
26468
26581
|
},
|
|
26469
26582
|
{
|
|
@@ -30857,6 +30970,45 @@ const LoginRegisterContent = () => {
|
|
|
30857
30970
|
] })
|
|
30858
30971
|
] })
|
|
30859
30972
|
}
|
|
30973
|
+
),
|
|
30974
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
30975
|
+
designSystem.Box,
|
|
30976
|
+
{
|
|
30977
|
+
as: "label",
|
|
30978
|
+
padding: 3,
|
|
30979
|
+
background: method === "both" ? "primary100" : "neutral0",
|
|
30980
|
+
hasRadius: true,
|
|
30981
|
+
style: {
|
|
30982
|
+
cursor: "pointer",
|
|
30983
|
+
border: `1px solid ${method === "both" ? "#4945ff" : "#dcdce4"}`
|
|
30984
|
+
},
|
|
30985
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "flex-start", children: [
|
|
30986
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
30987
|
+
"input",
|
|
30988
|
+
{
|
|
30989
|
+
type: "radio",
|
|
30990
|
+
name: "loginMethod",
|
|
30991
|
+
value: "both",
|
|
30992
|
+
checked: method === "both",
|
|
30993
|
+
onChange: (e2) => setMethod(e2.target.value),
|
|
30994
|
+
style: {
|
|
30995
|
+
marginTop: "4px",
|
|
30996
|
+
cursor: "pointer"
|
|
30997
|
+
}
|
|
30998
|
+
}
|
|
30999
|
+
),
|
|
31000
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
31001
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral800", fontWeight: "semiBold", children: formatMessage({
|
|
31002
|
+
id: `${index.PLUGIN_ID}.settings.loginRegister.method.both`,
|
|
31003
|
+
defaultMessage: "Both Methods (Unified)"
|
|
31004
|
+
}) }),
|
|
31005
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", marginTop: 1, display: "block", children: formatMessage({
|
|
31006
|
+
id: `${index.PLUGIN_ID}.settings.loginRegister.method.both.description`,
|
|
31007
|
+
defaultMessage: "Users can choose between OTP or email/password authentication. Use the unified /auth/unified endpoint to support both methods simultaneously."
|
|
31008
|
+
}) })
|
|
31009
|
+
] })
|
|
31010
|
+
] })
|
|
31011
|
+
}
|
|
30860
31012
|
)
|
|
30861
31013
|
] }) }),
|
|
30862
31014
|
error && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 4, padding: 3, background: "danger100", hasRadius: true, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "danger700", children: error }) }),
|
|
@@ -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-
|
|
6
|
+
import { P as PLUGIN_ID } from "./index-CXGrFKp6.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";
|
|
@@ -21625,6 +21625,7 @@ const MainSubNav = styled(SubNav)`
|
|
|
21625
21625
|
position: sticky;
|
|
21626
21626
|
top: 0;
|
|
21627
21627
|
border-right: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
21628
|
+
overscroll-behavior: contain;
|
|
21628
21629
|
}
|
|
21629
21630
|
${({ theme }) => theme.breakpoints.large} {
|
|
21630
21631
|
height: 100dvh;
|
|
@@ -26464,6 +26465,97 @@ const ApiCollectionsContent = () => {
|
|
|
26464
26465
|
"email": "user@example.com",
|
|
26465
26466
|
"otp": "123456",
|
|
26466
26467
|
"type": "email"
|
|
26468
|
+
}`
|
|
26469
|
+
},
|
|
26470
|
+
{
|
|
26471
|
+
id: "auth-method",
|
|
26472
|
+
method: "GET",
|
|
26473
|
+
path: getApiPath("/api/webbycommerce/auth/method"),
|
|
26474
|
+
title: formatMessage({
|
|
26475
|
+
id: `${PLUGIN_ID}.settings.apiCollections.authMethod.title`,
|
|
26476
|
+
defaultMessage: "Get Authentication Method"
|
|
26477
|
+
}),
|
|
26478
|
+
summary: formatMessage({
|
|
26479
|
+
id: `${PLUGIN_ID}.settings.apiCollections.authMethod.summary`,
|
|
26480
|
+
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."
|
|
26481
|
+
}),
|
|
26482
|
+
auth: formatMessage({
|
|
26483
|
+
id: `${PLUGIN_ID}.settings.apiCollections.authMethod.auth`,
|
|
26484
|
+
defaultMessage: "Auth: public (no authentication required)."
|
|
26485
|
+
}),
|
|
26486
|
+
response: `{
|
|
26487
|
+
"method": "default",
|
|
26488
|
+
"message": "Current authentication method: default"
|
|
26489
|
+
}`,
|
|
26490
|
+
usage: [
|
|
26491
|
+
formatMessage({
|
|
26492
|
+
id: `${PLUGIN_ID}.settings.apiCollections.authMethod.usage.frontend`,
|
|
26493
|
+
defaultMessage: "Call this endpoint on app initialization to determine which auth UI to show."
|
|
26494
|
+
}),
|
|
26495
|
+
formatMessage({
|
|
26496
|
+
id: `${PLUGIN_ID}.settings.apiCollections.authMethod.usage.conditional`,
|
|
26497
|
+
defaultMessage: 'If method is "otp", show OTP login/register form. If "default", show email/password form.'
|
|
26498
|
+
}),
|
|
26499
|
+
formatMessage({
|
|
26500
|
+
id: `${PLUGIN_ID}.settings.apiCollections.authMethod.usage.dynamic`,
|
|
26501
|
+
defaultMessage: "Method can change based on plugin settings, so check this endpoint periodically."
|
|
26502
|
+
})
|
|
26503
|
+
],
|
|
26504
|
+
getCurl: () => `curl http://localhost:1337${getApiPath("/api/webbycommerce/auth/method")}`
|
|
26505
|
+
},
|
|
26506
|
+
{
|
|
26507
|
+
id: "unified-auth",
|
|
26508
|
+
method: "POST",
|
|
26509
|
+
path: getApiPath("/api/webbycommerce/auth/unified"),
|
|
26510
|
+
title: formatMessage({
|
|
26511
|
+
id: `${PLUGIN_ID}.settings.apiCollections.unifiedAuth.title`,
|
|
26512
|
+
defaultMessage: "Unified Authentication"
|
|
26513
|
+
}),
|
|
26514
|
+
summary: formatMessage({
|
|
26515
|
+
id: `${PLUGIN_ID}.settings.apiCollections.unifiedAuth.summary`,
|
|
26516
|
+
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."
|
|
26517
|
+
}),
|
|
26518
|
+
auth: formatMessage({
|
|
26519
|
+
id: `${PLUGIN_ID}.settings.apiCollections.unifiedAuth.auth`,
|
|
26520
|
+
defaultMessage: "Auth: public (no authentication required)."
|
|
26521
|
+
}),
|
|
26522
|
+
response: `{
|
|
26523
|
+
"success": true,
|
|
26524
|
+
"step": "login",
|
|
26525
|
+
"method": "default",
|
|
26526
|
+
"message": "Login successfully!",
|
|
26527
|
+
"jwt": "eyJhbGciOi...",
|
|
26528
|
+
"user": {
|
|
26529
|
+
"id": 1,
|
|
26530
|
+
"username": "user1234",
|
|
26531
|
+
"email": "user@example.com"
|
|
26532
|
+
}
|
|
26533
|
+
}`,
|
|
26534
|
+
usage: [
|
|
26535
|
+
formatMessage({
|
|
26536
|
+
id: `${PLUGIN_ID}.settings.apiCollections.unifiedAuth.usage.unified`,
|
|
26537
|
+
defaultMessage: "Use this single endpoint for all authentication needs - OTP and default methods."
|
|
26538
|
+
}),
|
|
26539
|
+
formatMessage({
|
|
26540
|
+
id: `${PLUGIN_ID}.settings.apiCollections.unifiedAuth.usage.otp`,
|
|
26541
|
+
defaultMessage: 'For OTP: First call with step="request" and email/mobile, then call with step="verify" and OTP code.'
|
|
26542
|
+
}),
|
|
26543
|
+
formatMessage({
|
|
26544
|
+
id: `${PLUGIN_ID}.settings.apiCollections.unifiedAuth.usage.default`,
|
|
26545
|
+
defaultMessage: 'For default: Call with step="login" and identifier/password, or step="register" with username/email/password.'
|
|
26546
|
+
}),
|
|
26547
|
+
formatMessage({
|
|
26548
|
+
id: `${PLUGIN_ID}.settings.apiCollections.unifiedAuth.usage.auto`,
|
|
26549
|
+
defaultMessage: 'Method is auto-detected from request body, or specify authMethod="otp" or "default" explicitly.'
|
|
26550
|
+
})
|
|
26551
|
+
],
|
|
26552
|
+
getCurl: () => `curl -X POST http://localhost:1337${getApiPath("/api/webbycommerce/auth/unified")} \\
|
|
26553
|
+
-H "Content-Type: application/json" \\
|
|
26554
|
+
-d '{"step": "login", "identifier": "user@example.com", "password": "password"}'`,
|
|
26555
|
+
requestBody: `{
|
|
26556
|
+
"step": "login",
|
|
26557
|
+
"identifier": "user@example.com",
|
|
26558
|
+
"password": "password"
|
|
26467
26559
|
}`
|
|
26468
26560
|
},
|
|
26469
26561
|
{
|
|
@@ -30857,6 +30949,45 @@ const LoginRegisterContent = () => {
|
|
|
30857
30949
|
] })
|
|
30858
30950
|
] })
|
|
30859
30951
|
}
|
|
30952
|
+
),
|
|
30953
|
+
/* @__PURE__ */ jsx(
|
|
30954
|
+
Box,
|
|
30955
|
+
{
|
|
30956
|
+
as: "label",
|
|
30957
|
+
padding: 3,
|
|
30958
|
+
background: method === "both" ? "primary100" : "neutral0",
|
|
30959
|
+
hasRadius: true,
|
|
30960
|
+
style: {
|
|
30961
|
+
cursor: "pointer",
|
|
30962
|
+
border: `1px solid ${method === "both" ? "#4945ff" : "#dcdce4"}`
|
|
30963
|
+
},
|
|
30964
|
+
children: /* @__PURE__ */ jsxs(Flex, { gap: 2, alignItems: "flex-start", children: [
|
|
30965
|
+
/* @__PURE__ */ jsx(
|
|
30966
|
+
"input",
|
|
30967
|
+
{
|
|
30968
|
+
type: "radio",
|
|
30969
|
+
name: "loginMethod",
|
|
30970
|
+
value: "both",
|
|
30971
|
+
checked: method === "both",
|
|
30972
|
+
onChange: (e2) => setMethod(e2.target.value),
|
|
30973
|
+
style: {
|
|
30974
|
+
marginTop: "4px",
|
|
30975
|
+
cursor: "pointer"
|
|
30976
|
+
}
|
|
30977
|
+
}
|
|
30978
|
+
),
|
|
30979
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
30980
|
+
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral800", fontWeight: "semiBold", children: formatMessage({
|
|
30981
|
+
id: `${PLUGIN_ID}.settings.loginRegister.method.both`,
|
|
30982
|
+
defaultMessage: "Both Methods (Unified)"
|
|
30983
|
+
}) }),
|
|
30984
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", marginTop: 1, display: "block", children: formatMessage({
|
|
30985
|
+
id: `${PLUGIN_ID}.settings.loginRegister.method.both.description`,
|
|
30986
|
+
defaultMessage: "Users can choose between OTP or email/password authentication. Use the unified /auth/unified endpoint to support both methods simultaneously."
|
|
30987
|
+
}) })
|
|
30988
|
+
] })
|
|
30989
|
+
] })
|
|
30990
|
+
}
|
|
30860
30991
|
)
|
|
30861
30992
|
] }) }),
|
|
30862
30993
|
error && /* @__PURE__ */ jsx(Box, { marginTop: 4, padding: 3, background: "danger100", hasRadius: true, children: /* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "danger700", children: error }) }),
|