@webbycrown/webbycommerce 1.2.0 → 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.
package/README.md CHANGED
@@ -580,6 +580,11 @@ Authorization: Bearer YOUR_JWT_TOKEN
580
580
 
581
581
  ## 📜 Changelog
582
582
 
583
+ ## [1.2.1] - Patch Release
584
+
585
+ ### Fixed
586
+ - Fixed bugs of update schema
587
+
583
588
  ## [1.2.0] - New feature
584
589
 
585
590
  ### Added
@@ -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-DgocXUgC.js");
7
+ const index = require("./index-NRuOdjd7.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(obj), 8, -1) : protoTag ? "Object" : "";
10313
+ var stringTag2 = !isPlainObject2 && toStringTag$1 && Object(obj) === obj && toStringTag$1 in obj ? $slice.call(toStr$1(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(obj) === "[object Array]" && canTrustToString(obj);
10338
+ return toStr$1(obj) === "[object Array]" && canTrustToString(obj);
10339
10339
  }
10340
10340
  function isDate$2(obj) {
10341
- return toStr(obj) === "[object Date]" && canTrustToString(obj);
10341
+ return toStr$1(obj) === "[object Date]" && canTrustToString(obj);
10342
10342
  }
10343
10343
  function isRegExp$2(obj) {
10344
- return toStr(obj) === "[object RegExp]" && canTrustToString(obj);
10344
+ return toStr$1(obj) === "[object RegExp]" && canTrustToString(obj);
10345
10345
  }
10346
10346
  function isError(obj) {
10347
- return toStr(obj) === "[object Error]" && canTrustToString(obj);
10347
+ return toStr$1(obj) === "[object Error]" && canTrustToString(obj);
10348
10348
  }
10349
10349
  function isString$1(obj) {
10350
- return toStr(obj) === "[object String]" && canTrustToString(obj);
10350
+ return toStr$1(obj) === "[object String]" && canTrustToString(obj);
10351
10351
  }
10352
10352
  function isNumber$1(obj) {
10353
- return toStr(obj) === "[object Number]" && canTrustToString(obj);
10353
+ return toStr$1(obj) === "[object Number]" && canTrustToString(obj);
10354
10354
  }
10355
10355
  function isBoolean$1(obj) {
10356
- return toStr(obj) === "[object Boolean]" && canTrustToString(obj);
10356
+ return toStr$1(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(obj) {
10392
+ function toStr$1(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$1 = Math.max;
10701
+ var max$2 = Math.max;
10702
10702
  var min$1 = Math.min;
10703
10703
  var pow$1 = Math.pow;
10704
10704
  var round$1 = Math.round;
@@ -10827,99 +10827,78 @@ function requireObject_getPrototypeOf() {
10827
10827
  Object_getPrototypeOf = $Object2.getPrototypeOf || null;
10828
10828
  return Object_getPrototypeOf;
10829
10829
  }
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];
10843
- }
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];
10830
+ var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
10831
+ var toStr = Object.prototype.toString;
10832
+ var max$1 = Math.max;
10833
+ var funcType = "[object Function]";
10834
+ var concatty = function concatty2(a2, b2) {
10835
+ var arr = [];
10836
+ for (var i2 = 0; i2 < a2.length; i2 += 1) {
10837
+ arr[i2] = a2[i2];
10838
+ }
10839
+ for (var j2 = 0; j2 < b2.length; j2 += 1) {
10840
+ arr[j2 + a2.length] = b2[j2];
10841
+ }
10842
+ return arr;
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;
10853
10857
  }
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;
10858
+ }
10859
+ return str;
10860
+ };
10861
+ var implementation$1 = function bind(that) {
10862
+ var target = this;
10863
+ if (typeof target !== "function" || toStr.apply(target) !== funcType) {
10864
+ throw new TypeError(ERROR_MESSAGE + target);
10865
+ }
10866
+ var args = slicy(arguments, 1);
10867
+ var bound;
10868
+ var binder = function() {
10869
+ if (this instanceof bound) {
10870
+ var result = target.apply(
10871
+ this,
10872
+ concatty(args, arguments)
10873
+ );
10874
+ if (Object(result) === result) {
10875
+ return result;
10862
10876
  }
10877
+ return this;
10863
10878
  }
10864
- return str;
10879
+ return target.apply(
10880
+ that,
10881
+ concatty(args, arguments)
10882
+ );
10865
10883
  };
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
- );
10884
+ var boundLength = max$1(0, target.length - args.length);
10885
+ var boundArgs = [];
10886
+ for (var i2 = 0; i2 < boundLength; i2++) {
10887
+ boundArgs[i2] = "$" + i2;
10888
+ }
10889
+ bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
10890
+ if (target.prototype) {
10891
+ var Empty = function Empty2() {
10888
10892
  };
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
- }
10893
+ Empty.prototype = target.prototype;
10894
+ bound.prototype = new Empty();
10895
+ Empty.prototype = null;
10896
+ }
10897
+ return bound;
10898
+ };
10899
+ var implementation = implementation$1;
10900
+ var functionBind = Function.prototype.bind || implementation;
10901
+ var functionCall = Function.prototype.call;
10923
10902
  var functionApply;
10924
10903
  var hasRequiredFunctionApply;
10925
10904
  function requireFunctionApply() {
@@ -10929,14 +10908,14 @@ function requireFunctionApply() {
10929
10908
  return functionApply;
10930
10909
  }
10931
10910
  var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
10932
- var bind$3 = requireFunctionBind();
10911
+ var bind$3 = functionBind;
10933
10912
  var $apply$1 = requireFunctionApply();
10934
- var $call$2 = requireFunctionCall();
10913
+ var $call$2 = functionCall;
10935
10914
  var $reflectApply = reflectApply;
10936
10915
  var actualApply = $reflectApply || bind$3.call($call$2, $apply$1);
10937
- var bind$2 = requireFunctionBind();
10916
+ var bind$2 = functionBind;
10938
10917
  var $TypeError$4 = type;
10939
- var $call$1 = requireFunctionCall();
10918
+ var $call$1 = functionCall;
10940
10919
  var $actualApply = actualApply;
10941
10920
  var callBindApplyHelpers = function callBindBasic(args) {
10942
10921
  if (args.length < 1 || typeof args[0] !== "function") {
@@ -11002,8 +10981,8 @@ function requireHasown() {
11002
10981
  hasRequiredHasown = 1;
11003
10982
  var call = Function.prototype.call;
11004
10983
  var $hasOwn = Object.prototype.hasOwnProperty;
11005
- var bind2 = requireFunctionBind();
11006
- hasown = bind2.call(call, $hasOwn);
10984
+ var bind3 = functionBind;
10985
+ hasown = bind3.call(call, $hasOwn);
11007
10986
  return hasown;
11008
10987
  }
11009
10988
  var undefined$1;
@@ -11017,7 +10996,7 @@ var $TypeError$3 = type;
11017
10996
  var $URIError = uri;
11018
10997
  var abs = abs$1;
11019
10998
  var floor = floor$1;
11020
- var max = max$1;
10999
+ var max = max$2;
11021
11000
  var min = min$1;
11022
11001
  var pow = pow$1;
11023
11002
  var round = round$1;
@@ -11051,7 +11030,7 @@ var getProto = requireGetProto();
11051
11030
  var $ObjectGPO = requireObject_getPrototypeOf();
11052
11031
  var $ReflectGPO = requireReflect_getPrototypeOf();
11053
11032
  var $apply = requireFunctionApply();
11054
- var $call = requireFunctionCall();
11033
+ var $call = functionCall;
11055
11034
  var needsEval = {};
11056
11035
  var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
11057
11036
  var INTRINSICS = {
@@ -11222,7 +11201,7 @@ var LEGACY_ALIASES = {
11222
11201
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
11223
11202
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
11224
11203
  };
11225
- var bind$1 = requireFunctionBind();
11204
+ var bind$1 = functionBind;
11226
11205
  var hasOwn = requireHasown();
11227
11206
  var $concat = bind$1.call($call, Array.prototype.concat);
11228
11207
  var $spliceApply = bind$1.call($apply, Array.prototype.splice);
@@ -15553,7 +15532,7 @@ const admin = adminApi.enhanceEndpoints({
15553
15532
  overrideExisting: false
15554
15533
  });
15555
15534
  const { useInitQuery, useTelemetryPropertiesQuery, useInformationQuery, useProjectSettingsQuery, useUpdateProjectSettingsMutation, useGetPluginsQuery, useGetLicenseLimitsQuery, useGetLicenseTrialTimeLeftQuery, useGetGuidedTourMetaQuery } = admin;
15556
- function bind(fn2, thisArg) {
15535
+ function bind2(fn2, thisArg) {
15557
15536
  return function wrap() {
15558
15537
  return fn2.apply(thisArg, arguments);
15559
15538
  };
@@ -15690,7 +15669,7 @@ function merge2() {
15690
15669
  const extend = (a2, b2, thisArg, { allOwnKeys } = {}) => {
15691
15670
  forEach$1(b2, (val, key) => {
15692
15671
  if (thisArg && isFunction$1(val)) {
15693
- a2[key] = bind(val, thisArg);
15672
+ a2[key] = bind2(val, thisArg);
15694
15673
  } else {
15695
15674
  a2[key] = val;
15696
15675
  }
@@ -17970,7 +17949,7 @@ Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
17970
17949
  });
17971
17950
  function createInstance(defaultConfig) {
17972
17951
  const context = new Axios$1(defaultConfig);
17973
- const instance = bind(Axios$1.prototype.request, context);
17952
+ const instance = bind2(Axios$1.prototype.request, context);
17974
17953
  utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
17975
17954
  utils$1.extend(instance, context, null, { allOwnKeys: true });
17976
17955
  instance.create = function create2(instanceConfig) {
@@ -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-CXGrFKp6.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) {
@@ -92,7 +92,7 @@ const index = {
92
92
  defaultMessage: "Configure"
93
93
  },
94
94
  to: `${PLUGIN_ID}`,
95
- Component: () => import("./Settings-yLx-YvVy.mjs")
95
+ Component: () => import("./Settings-BonPzbwr.mjs")
96
96
  }
97
97
  );
98
98
  },
@@ -93,7 +93,7 @@ const index = {
93
93
  defaultMessage: "Configure"
94
94
  },
95
95
  to: `${PLUGIN_ID}`,
96
- Component: () => Promise.resolve().then(() => require("./Settings-DZXAkI24.js"))
96
+ Component: () => Promise.resolve().then(() => require("./Settings-Bg2JyQ4c.js"))
97
97
  }
98
98
  );
99
99
  },
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-DgocXUgC.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-CXGrFKp6.mjs";
1
+ import { i } from "../_chunks/index-BWVy9o1d.mjs";
2
2
  export {
3
3
  i as default
4
4
  };
@@ -3326,6 +3326,24 @@ var require_bootstrap = __commonJS({
3326
3326
  const apiDir = path.join(appDir, "src", "api", apiName);
3327
3327
  const contentTypeDir = path.join(apiDir, "content-types", contentTypeName);
3328
3328
  const schemaPath = path.join(contentTypeDir, "schema.json");
3329
+ if (contentType.action === "delete") {
3330
+ strapi2.log.info(`[webbycommerce] EARLY: Deleting collection: ${contentType.uid}`);
3331
+ if (fs.existsSync(schemaPath)) {
3332
+ fs.unlinkSync(schemaPath);
3333
+ strapi2.log.info(`[webbycommerce] EARLY: \u2713 Deleted schema file: ${schemaPath}`);
3334
+ }
3335
+ if (fs.existsSync(contentTypeDir)) {
3336
+ try {
3337
+ fs.rmSync(contentTypeDir, { recursive: true, force: true });
3338
+ strapi2.log.info(`[webbycommerce] EARLY: \u2713 Deleted content type directory: ${contentTypeDir}`);
3339
+ } catch (error) {
3340
+ strapi2.log.warn(`[webbycommerce] EARLY: Could not delete directory: ${error.message}`);
3341
+ }
3342
+ }
3343
+ ctx.state.schemaFileCreated = true;
3344
+ ctx.state.schemaDeleted = true;
3345
+ continue;
3346
+ }
3329
3347
  fs.mkdirSync(contentTypeDir, { recursive: true });
3330
3348
  let existingSchema = {};
3331
3349
  if (fs.existsSync(schemaPath)) {
@@ -3338,6 +3356,16 @@ var require_bootstrap = __commonJS({
3338
3356
  const attributes = { ...existingSchema.attributes || {} };
3339
3357
  if (contentType.attributes && Array.isArray(contentType.attributes)) {
3340
3358
  for (const attr of contentType.attributes) {
3359
+ const action = attr.action || "update";
3360
+ if (action === "delete" && attr.name) {
3361
+ if (attributes[attr.name]) {
3362
+ delete attributes[attr.name];
3363
+ strapi2.log.info(`[webbycommerce] EARLY: \u2713 Deleted attribute: ${attr.name}`);
3364
+ } else {
3365
+ strapi2.log.warn(`[webbycommerce] EARLY: Attribute not found for deletion: ${attr.name}`);
3366
+ }
3367
+ continue;
3368
+ }
3341
3369
  if (attr.name && attr.properties) {
3342
3370
  const attributeDef = { ...attr.properties };
3343
3371
  if (attributeDef.type === "component") {
@@ -3359,7 +3387,6 @@ var require_bootstrap = __commonJS({
3359
3387
  }
3360
3388
  }
3361
3389
  attributes[attr.name] = attributeDef;
3362
- const action = attr.action || "update";
3363
3390
  strapi2.log.info(`[webbycommerce] EARLY: ${action === "create" ? "Added" : "Updated"} attribute: ${attr.name} (type: ${attributeDef.type || "unknown"})`);
3364
3391
  }
3365
3392
  }
@@ -3443,11 +3470,24 @@ var require_bootstrap = __commonJS({
3443
3470
  }
3444
3471
  }
3445
3472
  }
3446
- if (ctx.state.schemaFileCreated && contentTypes3.length > 0) {
3473
+ const hasContentTypes = (ctx.state.schemaFileCreated || ctx.state.schemaDeleted) && contentTypes3.length > 0;
3474
+ const hasComponents = ctx.state.componentsCreated === true || ctx.state.componentsDeleted === true;
3475
+ strapi2.log.info(`[webbycommerce] EARLY: Checking early return conditions...`);
3476
+ strapi2.log.info(`[webbycommerce] EARLY: hasContentTypes=${hasContentTypes}, hasComponents=${hasComponents}`);
3477
+ strapi2.log.info(`[webbycommerce] EARLY: ctx.state.schemaFileCreated=${ctx.state.schemaFileCreated}, ctx.state.componentsCreated=${ctx.state.componentsCreated}`);
3478
+ strapi2.log.info(`[webbycommerce] EARLY: contentTypes.length=${contentTypes3.length}, components.length=${components.length}`);
3479
+ if (hasContentTypes || hasComponents) {
3447
3480
  strapi2.log.info(`[webbycommerce] EARLY: \u2713 Schema file(s) created successfully`);
3481
+ if (hasContentTypes) {
3482
+ strapi2.log.info(`[webbycommerce] EARLY: \u2713 Created ${contentTypes3.length} content type(s)`);
3483
+ }
3484
+ if (hasComponents) {
3485
+ strapi2.log.info(`[webbycommerce] EARLY: \u2713 Created ${components.length} component(s)`);
3486
+ }
3448
3487
  strapi2.log.info(`[webbycommerce] EARLY: \u2713 File watcher will detect change and trigger auto-restart`);
3449
- strapi2.log.info(`[webbycommerce] EARLY: \u2713 After restart, collection will be automatically registered with all fields/components`);
3488
+ strapi2.log.info(`[webbycommerce] EARLY: \u2713 After restart, collections and components will be automatically registered with all fields`);
3450
3489
  ctx.status = 200;
3490
+ ctx.set("Content-Type", "application/json");
3451
3491
  ctx.body = {
3452
3492
  data: {
3453
3493
  contentTypes: contentTypes3.map((ct) => {
@@ -3471,15 +3511,30 @@ var require_bootstrap = __commonJS({
3471
3511
  }
3472
3512
  };
3473
3513
  }),
3474
- components: (components || []).map((comp) => ({
3475
- uid: comp.uid,
3476
- category: comp.uid ? comp.uid.split(".")[0] : "",
3477
- apiID: comp.uid
3478
- }))
3514
+ components: (components || []).map((comp) => {
3515
+ const uidParts = comp.uid ? comp.uid.split(".") : [];
3516
+ return {
3517
+ uid: comp.uid,
3518
+ category: uidParts[0] || "",
3519
+ apiID: comp.uid,
3520
+ schema: {
3521
+ collectionName: comp.collectionName || "components_" + comp.uid.replace(/\./g, "_"),
3522
+ info: {
3523
+ displayName: comp.displayName || comp.modelName || uidParts[1] || "New Component",
3524
+ description: comp.description || ""
3525
+ }
3526
+ }
3527
+ };
3528
+ })
3479
3529
  }
3480
3530
  };
3481
3531
  strapi2.log.info(`[webbycommerce] EARLY: \u2713 Success response sent - request handled`);
3532
+ strapi2.log.info(`[webbycommerce] EARLY: \u2713 Returning early to prevent Strapi from processing request again`);
3482
3533
  return;
3534
+ } else {
3535
+ strapi2.log.warn(`[webbycommerce] EARLY: \u26A0 Not returning early - conditions not met`);
3536
+ strapi2.log.warn(`[webbycommerce] EARLY: \u26A0 schemaFileCreated=${ctx.state.schemaFileCreated}, componentsCreated=${ctx.state.componentsCreated}`);
3537
+ strapi2.log.warn(`[webbycommerce] EARLY: \u26A0 contentTypes.length=${contentTypes3.length}, components.length=${components.length}`);
3483
3538
  }
3484
3539
  } catch (error) {
3485
3540
  strapi2.log.error("[webbycommerce] EARLY: Error in content-type-builder fix:", error.message);
@@ -5328,54 +5383,107 @@ var require_bootstrap = __commonJS({
5328
5383
  strapi2.dirs.app.root = appDir;
5329
5384
  strapi2.log.info("[webbycommerce] Set strapi.dirs.app.root to:", appDir);
5330
5385
  }
5386
+ let componentsCreated = false;
5331
5387
  for (const component of components) {
5332
5388
  if (component.uid && component.uid.includes(".")) {
5333
5389
  const uidParts = component.uid.split(".");
5334
5390
  if (uidParts.length >= 2) {
5335
5391
  const category = uidParts[0];
5336
5392
  const componentName = uidParts[1];
5393
+ strapi2.log.info(`[webbycommerce] EARLY: Processing component: ${component.uid}`);
5337
5394
  const componentsDir = path.join(appDir, "src", "components", category);
5338
- const componentDir = path.join(componentsDir, componentName);
5339
- if (!fs.existsSync(componentsDir)) {
5340
- fs.mkdirSync(componentsDir, { recursive: true });
5341
- strapi2.log.info(`[webbycommerce] Created component category directory: ${componentsDir}`);
5342
- }
5343
- if (!fs.existsSync(componentDir)) {
5344
- fs.mkdirSync(componentDir, { recursive: true });
5345
- strapi2.log.info(`[webbycommerce] Created component directory: ${componentDir}`);
5346
- }
5347
- const componentSchemaPath = path.join(componentDir, "schema.json");
5348
- let componentSchema = {};
5395
+ fs.mkdirSync(componentsDir, { recursive: true });
5396
+ const componentSchemaPath = path.join(componentsDir, `${componentName}.json`);
5397
+ let existingComponentSchema = {};
5349
5398
  if (fs.existsSync(componentSchemaPath)) {
5350
5399
  try {
5351
- componentSchema = JSON.parse(fs.readFileSync(componentSchemaPath, "utf8"));
5400
+ existingComponentSchema = JSON.parse(fs.readFileSync(componentSchemaPath, "utf8"));
5352
5401
  } catch (error) {
5353
- strapi2.log.warn(`[webbycommerce] Could not parse existing component schema: ${error.message}`);
5402
+ strapi2.log.warn(`[webbycommerce] EARLY: Could not parse existing component schema: ${error.message}`);
5403
+ existingComponentSchema = {};
5354
5404
  }
5355
5405
  }
5356
- if (!componentSchema.info) {
5357
- componentSchema.info = {};
5358
- }
5359
- if (!componentSchema.info.displayName) {
5360
- componentSchema.info.displayName = component.displayName || component.modelName || componentName || "New Component";
5361
- }
5362
- if (!componentSchema.info.description) {
5363
- componentSchema.info.description = component.description || "";
5364
- }
5365
- if (!componentSchema.category || componentSchema.category === "undefined" || componentSchema.category === "Undefined") {
5366
- componentSchema.category = component.category || "WebbyCommerce Shared";
5367
- }
5368
- if (!componentSchema.collectionName) {
5369
- componentSchema.collectionName = "components_" + component.uid.replace(/\./g, "_");
5406
+ if (component.action === "delete") {
5407
+ strapi2.log.info(`[webbycommerce] EARLY: Deleting component: ${component.uid}`);
5408
+ if (fs.existsSync(componentSchemaPath)) {
5409
+ fs.unlinkSync(componentSchemaPath);
5410
+ strapi2.log.info(`[webbycommerce] EARLY: \u2713 Deleted component file: ${componentSchemaPath}`);
5411
+ }
5412
+ ctx.state.componentsCreated = true;
5413
+ ctx.state.componentsDeleted = true;
5414
+ continue;
5370
5415
  }
5371
- if (!componentSchema.options) {
5372
- componentSchema.options = {};
5416
+ const componentAttributes = { ...existingComponentSchema.attributes || {} };
5417
+ if (component.attributes && Array.isArray(component.attributes)) {
5418
+ for (const attr of component.attributes) {
5419
+ const action = attr.action || "update";
5420
+ if (action === "delete" && attr.name) {
5421
+ if (componentAttributes[attr.name]) {
5422
+ delete componentAttributes[attr.name];
5423
+ strapi2.log.info(`[webbycommerce] EARLY: \u2713 Deleted component attribute: ${attr.name}`);
5424
+ } else {
5425
+ strapi2.log.warn(`[webbycommerce] EARLY: Component attribute not found for deletion: ${attr.name}`);
5426
+ }
5427
+ continue;
5428
+ }
5429
+ if (attr.name && attr.properties) {
5430
+ const attributeDef = { ...attr.properties };
5431
+ componentAttributes[attr.name] = attributeDef;
5432
+ strapi2.log.info(`[webbycommerce] EARLY: ${action === "create" ? "Added" : "Updated"} component attribute: ${attr.name} (type: ${attributeDef.type || "unknown"})`);
5433
+ }
5434
+ }
5373
5435
  }
5374
- if (!componentSchema.attributes) {
5375
- componentSchema.attributes = {};
5436
+ const componentSchema = {
5437
+ collectionName: component.collectionName || existingComponentSchema.collectionName || "components_" + component.uid.replace(/\./g, "_"),
5438
+ info: {
5439
+ displayName: component.displayName || component.modelName || existingComponentSchema.info?.displayName || componentName || "New Component",
5440
+ description: component.description || existingComponentSchema.info?.description || "",
5441
+ icon: component.icon || existingComponentSchema.info?.icon || ""
5442
+ },
5443
+ options: component.options || existingComponentSchema.options || {},
5444
+ attributes: componentAttributes
5445
+ };
5446
+ const componentSchemaJson = JSON.stringify(componentSchema, null, 2);
5447
+ fs.writeFileSync(componentSchemaPath, componentSchemaJson, "utf8");
5448
+ if (fs.existsSync(componentSchemaPath)) {
5449
+ try {
5450
+ const verifyComponentSchema = JSON.parse(fs.readFileSync(componentSchemaPath, "utf8"));
5451
+ const fileStats = fs.statSync(componentSchemaPath);
5452
+ strapi2.log.info(`[webbycommerce] ========================================`);
5453
+ strapi2.log.info(`[webbycommerce] \u2713 COMPONENT SCHEMA CREATED/UPDATED`);
5454
+ strapi2.log.info(`[webbycommerce] ========================================`);
5455
+ strapi2.log.info(`[webbycommerce] \u2713 Component: ${component.uid}`);
5456
+ strapi2.log.info(`[webbycommerce] \u2713 File: ${componentSchemaPath}`);
5457
+ strapi2.log.info(`[webbycommerce] \u2713 File size: ${fileStats.size} bytes`);
5458
+ strapi2.log.info(`[webbycommerce] \u2713 Schema is valid JSON`);
5459
+ strapi2.log.info(`[webbycommerce] \u2713 Display name: ${verifyComponentSchema.info?.displayName || "N/A"}`);
5460
+ strapi2.log.info(`[webbycommerce] \u2713 Total attributes: ${Object.keys(verifyComponentSchema.attributes || {}).length}`);
5461
+ const attrNames = Object.keys(verifyComponentSchema.attributes || {});
5462
+ if (attrNames.length > 0) {
5463
+ strapi2.log.info(`[webbycommerce] \u2713 Component attributes:`);
5464
+ attrNames.forEach((attrName) => {
5465
+ const attr = verifyComponentSchema.attributes[attrName];
5466
+ const attrType = attr.type || "unknown";
5467
+ strapi2.log.info(`[webbycommerce] - ${attrName}: ${attrType}`);
5468
+ });
5469
+ }
5470
+ strapi2.log.info(`[webbycommerce] \u2713 File will trigger auto-restart`);
5471
+ strapi2.log.info(`[webbycommerce] \u2713 After restart, component will be registered with all fields`);
5472
+ strapi2.log.info(`[webbycommerce] ========================================`);
5473
+ fs.chmodSync(componentSchemaPath, 420);
5474
+ const now = /* @__PURE__ */ new Date();
5475
+ fs.utimesSync(componentSchemaPath, now, now);
5476
+ fs.fsyncSync(fs.openSync(componentSchemaPath, "r+"));
5477
+ componentsCreated = true;
5478
+ ctx.state.componentsCreated = true;
5479
+ strapi2.log.info(`[webbycommerce] EARLY: \u2713 Set ctx.state.componentsCreated = true for component ${component.uid}`);
5480
+ strapi2.log.info(`[webbycommerce] EARLY: \u2713 Component file synced to disk - file watcher will detect change`);
5481
+ } catch (verifyError) {
5482
+ strapi2.log.error(`[webbycommerce] \u2717 Component schema verification failed: ${verifyError.message}`);
5483
+ }
5484
+ } else {
5485
+ strapi2.log.error(`[webbycommerce] \u2717 Component schema file was not created: ${componentSchemaPath}`);
5376
5486
  }
5377
- fs.writeFileSync(componentSchemaPath, JSON.stringify(componentSchema, null, 2));
5378
- strapi2.log.info(`[webbycommerce] ${fs.existsSync(componentSchemaPath) ? "Updated" : "Created"} component schema file: ${componentSchemaPath}`);
5379
5487
  }
5380
5488
  }
5381
5489
  }
@@ -5389,11 +5497,27 @@ var require_bootstrap = __commonJS({
5389
5497
  const contentTypeName = apiAndType[1];
5390
5498
  const apiDir = path.join(appDir, "src", "api", apiName);
5391
5499
  const contentTypeDir = path.join(apiDir, "content-types", contentTypeName);
5500
+ const schemaPath = path.join(contentTypeDir, "schema.json");
5392
5501
  strapi2.log.info(`[webbycommerce] Processing content type: ${contentType.uid}`);
5393
5502
  strapi2.log.info(`[webbycommerce] API Name: ${apiName}, Content Type Name: ${contentTypeName}`);
5394
- strapi2.log.info(`[webbycommerce] App Directory: ${appDir}`);
5395
- strapi2.log.info(`[webbycommerce] API Directory: ${apiDir}`);
5396
- strapi2.log.info(`[webbycommerce] Content Type Directory: ${contentTypeDir}`);
5503
+ if (contentType.action === "delete") {
5504
+ strapi2.log.info(`[webbycommerce] Deleting collection: ${contentType.uid}`);
5505
+ if (fs.existsSync(schemaPath)) {
5506
+ fs.unlinkSync(schemaPath);
5507
+ strapi2.log.info(`[webbycommerce] \u2713 Deleted schema file: ${schemaPath}`);
5508
+ }
5509
+ if (fs.existsSync(contentTypeDir)) {
5510
+ try {
5511
+ fs.rmSync(contentTypeDir, { recursive: true, force: true });
5512
+ strapi2.log.info(`[webbycommerce] \u2713 Deleted content type directory: ${contentTypeDir}`);
5513
+ } catch (error) {
5514
+ strapi2.log.warn(`[webbycommerce] Could not delete directory: ${error.message}`);
5515
+ }
5516
+ }
5517
+ ctx.state.schemaFileCreated = true;
5518
+ ctx.state.schemaDeleted = true;
5519
+ continue;
5520
+ }
5397
5521
  if (!fs.existsSync(apiDir)) {
5398
5522
  fs.mkdirSync(apiDir, { recursive: true });
5399
5523
  strapi2.log.info(`[webbycommerce] \u2713 Created API directory: ${apiDir}`);
@@ -5406,7 +5530,6 @@ var require_bootstrap = __commonJS({
5406
5530
  } else {
5407
5531
  strapi2.log.info(`[webbycommerce] \u2713 Content type directory already exists: ${contentTypeDir}`);
5408
5532
  }
5409
- const schemaPath = path.join(contentTypeDir, "schema.json");
5410
5533
  strapi2.log.info(`[webbycommerce] Schema path: ${schemaPath}`);
5411
5534
  let schemaNeedsUpdate = false;
5412
5535
  let currentSchema = {};
@@ -5427,23 +5550,49 @@ var require_bootstrap = __commonJS({
5427
5550
  schemaNeedsUpdate = true;
5428
5551
  }
5429
5552
  if (schemaNeedsUpdate) {
5430
- const minimalSchema = {
5431
- kind: contentType.kind || "collectionType",
5432
- collectionName: contentType.collectionName || (contentType.kind === "singleType" ? contentTypeName : `${contentTypeName}s`),
5553
+ const attributes = { ...currentSchema.attributes || {} };
5554
+ if (contentType.attributes && Array.isArray(contentType.attributes)) {
5555
+ for (const attr of contentType.attributes) {
5556
+ const action = attr.action || "update";
5557
+ if (action === "delete" && attr.name) {
5558
+ if (attributes[attr.name]) {
5559
+ delete attributes[attr.name];
5560
+ strapi2.log.info(`[webbycommerce] \u2713 Deleted attribute: ${attr.name}`);
5561
+ }
5562
+ continue;
5563
+ }
5564
+ if (attr.name && attr.properties) {
5565
+ attributes[attr.name] = { ...attr.properties };
5566
+ strapi2.log.info(`[webbycommerce] ${action === "create" ? "Added" : "Updated"} attribute: ${attr.name}`);
5567
+ }
5568
+ }
5569
+ }
5570
+ const schema = {
5571
+ kind: contentType.kind || currentSchema.kind || "collectionType",
5572
+ collectionName: contentType.collectionName || currentSchema.collectionName || (contentType.kind === "singleType" ? contentTypeName : `${contentTypeName}s`),
5433
5573
  info: {
5434
- singularName: contentType.singularName || contentTypeName,
5435
- pluralName: contentType.pluralName || (contentType.kind === "singleType" ? contentTypeName : `${contentTypeName}s`),
5436
- displayName: contentType.displayName || contentType.modelName || contentTypeName,
5437
- description: contentType.description || ""
5574
+ singularName: contentType.singularName || currentSchema.info?.singularName || contentTypeName,
5575
+ pluralName: contentType.pluralName || currentSchema.info?.pluralName || (contentType.kind === "singleType" ? contentTypeName : `${contentTypeName}s`),
5576
+ displayName: contentType.displayName || contentType.modelName || currentSchema.info?.displayName || contentTypeName,
5577
+ description: contentType.description || currentSchema.info?.description || ""
5438
5578
  },
5439
5579
  options: {
5440
- draftAndPublish: contentType.draftAndPublish !== void 0 ? contentType.draftAndPublish : false
5580
+ draftAndPublish: contentType.draftAndPublish !== void 0 ? contentType.draftAndPublish : currentSchema.options?.draftAndPublish !== void 0 ? currentSchema.options.draftAndPublish : false
5581
+ },
5582
+ pluginOptions: contentType.pluginOptions || currentSchema.pluginOptions || {
5583
+ "content-manager": {
5584
+ visible: true
5585
+ },
5586
+ "content-api": {
5587
+ visible: true
5588
+ }
5441
5589
  },
5442
- attributes: {}
5590
+ attributes
5443
5591
  };
5444
- fs.writeFileSync(schemaPath, JSON.stringify(minimalSchema, null, 2));
5592
+ fs.writeFileSync(schemaPath, JSON.stringify(schema, null, 2));
5445
5593
  strapi2.log.info(`[webbycommerce] \u2713 Created/Updated schema file: ${schemaPath}`);
5446
5594
  strapi2.log.info(`[webbycommerce] \u2713 File watcher will detect change and trigger auto-restart`);
5595
+ ctx.state.schemaFileCreated = true;
5447
5596
  }
5448
5597
  const controllersDir = path.join(apiDir, "controllers", contentTypeName);
5449
5598
  const servicesDir = path.join(apiDir, "services", contentTypeName);
@@ -5470,6 +5619,67 @@ var require_bootstrap = __commonJS({
5470
5619
  }
5471
5620
  }
5472
5621
  strapi2.log.info("[webbycommerce] ===== Finished processing content-type-builder request =====");
5622
+ const hasContentTypes = (ctx.state.schemaFileCreated || ctx.state.schemaDeleted) && contentTypes3.length > 0;
5623
+ const hasComponents = ctx.state.componentsCreated === true || ctx.state.componentsDeleted === true;
5624
+ strapi2.log.info(`[webbycommerce] EARLY (SECOND): Checking early return conditions...`);
5625
+ strapi2.log.info(`[webbycommerce] EARLY (SECOND): hasContentTypes=${hasContentTypes}, hasComponents=${hasComponents}`);
5626
+ strapi2.log.info(`[webbycommerce] EARLY (SECOND): ctx.state.schemaFileCreated=${ctx.state.schemaFileCreated}, ctx.state.componentsCreated=${ctx.state.componentsCreated}`);
5627
+ if (hasContentTypes || hasComponents) {
5628
+ strapi2.log.info(`[webbycommerce] EARLY (SECOND): \u2713 Schema file(s) created successfully`);
5629
+ if (hasContentTypes) {
5630
+ strapi2.log.info(`[webbycommerce] EARLY (SECOND): \u2713 Created ${contentTypes3.length} content type(s)`);
5631
+ }
5632
+ if (hasComponents) {
5633
+ strapi2.log.info(`[webbycommerce] EARLY (SECOND): \u2713 Created ${components.length} component(s)`);
5634
+ }
5635
+ strapi2.log.info(`[webbycommerce] EARLY (SECOND): \u2713 File watcher will detect change and trigger auto-restart`);
5636
+ strapi2.log.info(`[webbycommerce] EARLY (SECOND): \u2713 After restart, collections and components will be automatically registered with all fields`);
5637
+ ctx.status = 200;
5638
+ ctx.set("Content-Type", "application/json");
5639
+ ctx.body = {
5640
+ data: {
5641
+ contentTypes: contentTypes3.map((ct) => {
5642
+ const uidParts = ct.uid.split("::");
5643
+ const apiAndType = uidParts.length === 2 ? uidParts[1].split(".") : [];
5644
+ return {
5645
+ uid: ct.uid,
5646
+ apiID: ct.uid,
5647
+ schema: {
5648
+ kind: ct.kind || "collectionType",
5649
+ collectionName: ct.collectionName || (ct.kind === "singleType" ? apiAndType[1] : `${apiAndType[1]}s`),
5650
+ info: {
5651
+ singularName: ct.singularName || apiAndType[1],
5652
+ pluralName: ct.pluralName || (ct.kind === "singleType" ? apiAndType[1] : `${apiAndType[1]}s`),
5653
+ displayName: ct.displayName || ct.modelName || apiAndType[1],
5654
+ description: ct.description || ""
5655
+ },
5656
+ options: {
5657
+ draftAndPublish: ct.draftAndPublish !== void 0 ? ct.draftAndPublish : false
5658
+ }
5659
+ }
5660
+ };
5661
+ }),
5662
+ components: (components || []).map((comp) => {
5663
+ const uidParts = comp.uid ? comp.uid.split(".") : [];
5664
+ return {
5665
+ uid: comp.uid,
5666
+ category: uidParts[0] || "",
5667
+ apiID: comp.uid,
5668
+ schema: {
5669
+ collectionName: comp.collectionName || "components_" + comp.uid.replace(/\./g, "_"),
5670
+ info: {
5671
+ displayName: comp.displayName || comp.modelName || uidParts[1] || "New Component",
5672
+ description: comp.description || ""
5673
+ }
5674
+ }
5675
+ };
5676
+ })
5677
+ }
5678
+ };
5679
+ strapi2.log.info(`[webbycommerce] EARLY (SECOND): \u2713 Success response sent - request handled`);
5680
+ strapi2.log.info(`[webbycommerce] EARLY (SECOND): \u2713 Returning early to prevent Strapi from processing request again`);
5681
+ return;
5682
+ }
5473
5683
  } catch (error) {
5474
5684
  strapi2.log.error("[webbycommerce] \u2717 Error ensuring API directory structure:", error.message);
5475
5685
  strapi2.log.error("[webbycommerce] Error stack:", error.stack);
@@ -5750,13 +5960,61 @@ var require_bootstrap = __commonJS({
5750
5960
  if (apiContentTypes.length > 0) {
5751
5961
  strapi2.log.info(`[webbycommerce] Registered collections: ${apiContentTypes.join(", ")}`);
5752
5962
  }
5963
+ try {
5964
+ let componentKeys = [];
5965
+ if (strapi2.components && strapi2.components instanceof Map) {
5966
+ componentKeys = Array.from(strapi2.components.keys());
5967
+ } else if (strapi2.get && typeof strapi2.get === "function") {
5968
+ const components = strapi2.get("components");
5969
+ if (components instanceof Map) {
5970
+ componentKeys = Array.from(components.keys());
5971
+ } else if (components && typeof components === "object") {
5972
+ componentKeys = Object.keys(components);
5973
+ }
5974
+ } else if (strapi2.components && typeof strapi2.components === "object") {
5975
+ componentKeys = Object.keys(strapi2.components);
5976
+ }
5977
+ const userComponents = componentKeys.filter(
5978
+ (uid) => (uid.startsWith("shared.") || uid.includes(".")) && !uid.startsWith("plugin::")
5979
+ );
5980
+ strapi2.log.info(`[webbycommerce] Currently registered user components: ${userComponents.length}`);
5981
+ if (userComponents.length > 0) {
5982
+ strapi2.log.info(`[webbycommerce] Registered components: ${userComponents.join(", ")}`);
5983
+ } else {
5984
+ strapi2.log.warn(`[webbycommerce] \u26A0 No user components found - checking component files...`);
5985
+ const appDir = strapi2.dirs?.app?.root || path.resolve(__dirname, "../..");
5986
+ const componentsDir = path.join(appDir, "src", "components");
5987
+ if (fs.existsSync(componentsDir)) {
5988
+ const categoryDirs = fs.readdirSync(componentsDir, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name);
5989
+ let totalComponentFiles = 0;
5990
+ for (const category of categoryDirs) {
5991
+ const categoryPath = path.join(componentsDir, category);
5992
+ const files = fs.readdirSync(categoryPath, { withFileTypes: true }).filter((dirent) => dirent.isFile() && dirent.name.endsWith(".json")).map((dirent) => dirent.name);
5993
+ for (const jsonFile of files) {
5994
+ const componentName = jsonFile.replace(".json", "");
5995
+ const componentPath = path.join(categoryPath, jsonFile);
5996
+ if (fs.existsSync(componentPath)) {
5997
+ totalComponentFiles++;
5998
+ strapi2.log.info(`[webbycommerce] - Found component file: ${category}.${componentName} at ${componentPath}`);
5999
+ }
6000
+ }
6001
+ }
6002
+ if (totalComponentFiles > 0) {
6003
+ strapi2.log.warn(`[webbycommerce] \u26A0 Found ${totalComponentFiles} component files but Strapi hasn't loaded them yet`);
6004
+ strapi2.log.warn(`[webbycommerce] \u26A0 Components should appear after Strapi finishes loading - try refreshing the browser`);
6005
+ }
6006
+ }
6007
+ }
6008
+ } catch (compError) {
6009
+ strapi2.log.debug(`[webbycommerce] Could not list components: ${compError.message}`);
6010
+ }
5753
6011
  } catch (error) {
5754
6012
  }
5755
6013
  strapi2.log.info("[webbycommerce] Plugin bootstrapped successfully");
5756
6014
  strapi2.log.info(
5757
6015
  "[webbycommerce] Health endpoint is available at: /webbycommerce/health and /api/webbycommerce/health"
5758
6016
  );
5759
- strapi2.log.info("[webbycommerce] Auto-restart enabled: Strapi will automatically restart when new collections are added");
6017
+ strapi2.log.info("[webbycommerce] Auto-restart enabled: Strapi will automatically restart when new collections or components are added");
5760
6018
  strapi2.log.info("[webbycommerce] ========================================");
5761
6019
  } catch (error) {
5762
6020
  strapi2.log.error("[webbycommerce] Bootstrap error:", error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webbycrown/webbycommerce",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "keywords": [
5
5
  "strapi",
6
6
  "plugin",
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "devDependencies": {
50
50
  "@strapi/sdk-plugin": "^5.3.2",
51
- "@strapi/strapi": "^5.36.0",
51
+ "@strapi/strapi": ">=4.0.0",
52
52
  "esbuild": "^0.27.2",
53
53
  "prettier": "^3.5.3",
54
54
  "react": "^18.3.1",
@@ -56,8 +56,8 @@
56
56
  "styled-components": "^6.1.17"
57
57
  },
58
58
  "peerDependencies": {
59
- "@strapi/sdk-plugin": "^5.3.2",
60
- "@strapi/strapi": "^5.36.0",
59
+ "@strapi/sdk-plugin": ">=4.0.0 || ^5.0.0",
60
+ "@strapi/strapi": ">=4.0.0",
61
61
  "react": "^18.3.1",
62
62
  "react-dom": "^18.3.1",
63
63
  "styled-components": "^6.1.17"