@webbycrown/webbycommerce 1.0.0 → 1.0.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
@@ -46,8 +46,40 @@ module.exports = ({ env }) => ({
46
46
  });
47
47
  ```
48
48
 
49
+
49
50
  ## ⚙️ Initial Setup
50
51
 
52
+ ### 0. (Optional) Seed Demo Data
53
+
54
+ You can populate your store with sample products/categories/etc using any of the following options:
55
+
56
+ #### Option A: Run the setup and answer `y`
57
+
58
+ ```bash
59
+ npx strapi-ecommerce-setup
60
+ ```
61
+
62
+ When prompted **"Would you like to seed example data? (y/n):"**, answer **`y`**.
63
+
64
+ #### Option B: Seed from Strapi Admin (works even if you answered `n`)
65
+
66
+ - Go to **Strapi Admin → Settings → Advanced Ecommerce**
67
+ - Click **"Seed Demo Data"**
68
+
69
+ #### Option C: Seed via `.env` flag (programmatic / CI-friendly)
70
+
71
+ Add this to your Strapi project’s `.env` and then start Strapi:
72
+
73
+ ```bash
74
+ STRAPI_PLUGIN_ADVANCED_ECOMMERCE_SEED_DATA=true
75
+ ```
76
+
77
+ ```bash
78
+ npm run develop
79
+ ```
80
+
81
+ After the demo data is seeded once, set it back to `false` (or remove it) to avoid reseeding on every startup.
82
+
51
83
  ### 1. Enable Permissions
52
84
 
53
85
  After installation, navigate to **Settings → Users & Permissions → Roles** and select the **Public** role (or any role you want to grant access).
@@ -77,7 +109,7 @@ Navigate to **Settings → WebbyCommerce** in the Strapi admin panel. You'll fin
77
109
 
78
110
  ### 3. User Schema Extension
79
111
 
80
- The plugin automatically extends the user schema with ecommerce-specific fields. Ensure your user schema includes:
112
+ The plugin automatically extends the user schema with ecommerce-specific fields. The plugin will attempt to automatically add OTP fields to the user schema when it starts up.
81
113
 
82
114
  **Required Fields:**
83
115
  - `username` (string, required, unique)
@@ -90,11 +122,53 @@ The plugin automatically extends the user schema with ecommerce-specific fields.
90
122
  - `display_name` (string)
91
123
  - `company_name` (string)
92
124
 
93
- **OTP Fields (if using OTP authentication):**
94
- - `otp` (integer)
95
- - `isOtpVerified` (boolean, default: false)
96
-
97
- The plugin includes a schema extension file at `src/extensions/users-permissions/content-types/user/schema.json` that adds these fields automatically.
125
+ **OTP Fields (required if using OTP authentication):**
126
+ - `otp` (integer, nullable) - Stores the OTP code
127
+ - `isOtpVerified` (boolean, default: false) - Tracks if OTP has been verified
128
+
129
+ #### Automatic Schema Extension
130
+
131
+ The plugin automatically adds OTP fields to the user schema on startup. If you see an error about OTP fields not being available, you may need to manually extend the schema.
132
+
133
+ #### Manual Schema Extension (if automatic extension fails)
134
+
135
+ If the automatic schema extension doesn't work, create a schema extension file in your main Strapi project:
136
+
137
+ 1. Create the directory structure:
138
+ ```
139
+ src/extensions/users-permissions/content-types/user/
140
+ ```
141
+
142
+ 2. Create `schema.json` in that directory with the following content:
143
+ ```json
144
+ {
145
+ "kind": "collectionType",
146
+ "collectionName": "up_users",
147
+ "info": {
148
+ "name": "user",
149
+ "description": "",
150
+ "singularName": "user",
151
+ "pluralName": "users"
152
+ },
153
+ "options": {},
154
+ "pluginOptions": {},
155
+ "attributes": {
156
+ "otp": {
157
+ "type": "integer",
158
+ "required": false,
159
+ "private": true
160
+ },
161
+ "isOtpVerified": {
162
+ "type": "boolean",
163
+ "default": false,
164
+ "required": false,
165
+ "private": true
166
+ }
167
+ }
168
+ }
169
+ ```
170
+
171
+ 3. Restart Strapi to apply the schema changes.
98
172
 
99
173
  ### 4. Address Content Type
100
174
 
@@ -506,7 +580,15 @@ Authorization: Bearer YOUR_JWT_TOKEN
506
580
 
507
581
  ## 📜 Changelog
508
582
 
509
- ### [1.0.0] – Initial Stable Release
583
+ ## [1.0.1] – Patch Release
584
+
585
+ ### Changed
586
+ - Updated README documentation
587
+
588
+ ### Fixed
589
+ - Resolved reported bugs
590
+
591
+ ## [1.0.0] – Initial Stable Release
510
592
 
511
593
  🎉 First production-ready release of WebbyCommerce, a complete ecommerce backend plugin for Strapi CMS.
512
594
 
@@ -2,8 +2,8 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  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
- import { Flex, Box, Popover, Typography, Button, LinkButton, Link as Link$1, Portal, Alert, Field, SubNav, Badge, TextInput, Pagination, PreviousLink, Dots, PageLink, NextLink, Modal, DesignSystemProvider, Main } from "@strapi/design-system";
6
- import { P as PLUGIN_ID } from "./index-BFH1VuAA.mjs";
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-rT-5a8Cs.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$1(obj), 8, -1) : protoTag ? "Object" : "";
10292
+ var stringTag2 = !isPlainObject2 && toStringTag$1 && Object(obj) === obj && toStringTag$1 in obj ? $slice.call(toStr(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$1(obj) === "[object Array]" && canTrustToString(obj);
10317
+ return toStr(obj) === "[object Array]" && canTrustToString(obj);
10318
10318
  }
10319
10319
  function isDate$2(obj) {
10320
- return toStr$1(obj) === "[object Date]" && canTrustToString(obj);
10320
+ return toStr(obj) === "[object Date]" && canTrustToString(obj);
10321
10321
  }
10322
10322
  function isRegExp$2(obj) {
10323
- return toStr$1(obj) === "[object RegExp]" && canTrustToString(obj);
10323
+ return toStr(obj) === "[object RegExp]" && canTrustToString(obj);
10324
10324
  }
10325
10325
  function isError(obj) {
10326
- return toStr$1(obj) === "[object Error]" && canTrustToString(obj);
10326
+ return toStr(obj) === "[object Error]" && canTrustToString(obj);
10327
10327
  }
10328
10328
  function isString$1(obj) {
10329
- return toStr$1(obj) === "[object String]" && canTrustToString(obj);
10329
+ return toStr(obj) === "[object String]" && canTrustToString(obj);
10330
10330
  }
10331
10331
  function isNumber$1(obj) {
10332
- return toStr$1(obj) === "[object Number]" && canTrustToString(obj);
10332
+ return toStr(obj) === "[object Number]" && canTrustToString(obj);
10333
10333
  }
10334
10334
  function isBoolean$1(obj) {
10335
- return toStr$1(obj) === "[object Boolean]" && canTrustToString(obj);
10335
+ return toStr(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$1(obj) {
10371
+ function toStr(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$2 = Math.max;
10680
+ var max$1 = Math.max;
10681
10681
  var min$1 = Math.min;
10682
10682
  var pow$1 = Math.pow;
10683
10683
  var round$1 = Math.round;
@@ -10806,78 +10806,99 @@ function requireObject_getPrototypeOf() {
10806
10806
  Object_getPrototypeOf = $Object2.getPrototypeOf || null;
10807
10807
  return Object_getPrototypeOf;
10808
10808
  }
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;
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];
10836
10822
  }
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;
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];
10832
+ }
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;
10855
10841
  }
10856
- return this;
10857
10842
  }
10858
- return target.apply(
10859
- that,
10860
- concatty(args, arguments)
10861
- );
10843
+ return str;
10862
10844
  };
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() {
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
+ );
10871
10867
  };
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;
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
+ }
10881
10902
  var functionApply;
10882
10903
  var hasRequiredFunctionApply;
10883
10904
  function requireFunctionApply() {
@@ -10887,14 +10908,14 @@ function requireFunctionApply() {
10887
10908
  return functionApply;
10888
10909
  }
10889
10910
  var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
10890
- var bind$3 = functionBind;
10911
+ var bind$3 = requireFunctionBind();
10891
10912
  var $apply$1 = requireFunctionApply();
10892
- var $call$2 = functionCall;
10913
+ var $call$2 = requireFunctionCall();
10893
10914
  var $reflectApply = reflectApply;
10894
10915
  var actualApply = $reflectApply || bind$3.call($call$2, $apply$1);
10895
- var bind$2 = functionBind;
10916
+ var bind$2 = requireFunctionBind();
10896
10917
  var $TypeError$4 = type;
10897
- var $call$1 = functionCall;
10918
+ var $call$1 = requireFunctionCall();
10898
10919
  var $actualApply = actualApply;
10899
10920
  var callBindApplyHelpers = function callBindBasic(args) {
10900
10921
  if (args.length < 1 || typeof args[0] !== "function") {
@@ -10960,8 +10981,8 @@ function requireHasown() {
10960
10981
  hasRequiredHasown = 1;
10961
10982
  var call = Function.prototype.call;
10962
10983
  var $hasOwn = Object.prototype.hasOwnProperty;
10963
- var bind3 = functionBind;
10964
- hasown = bind3.call(call, $hasOwn);
10984
+ var bind2 = requireFunctionBind();
10985
+ hasown = bind2.call(call, $hasOwn);
10965
10986
  return hasown;
10966
10987
  }
10967
10988
  var undefined$1;
@@ -10975,7 +10996,7 @@ var $TypeError$3 = type;
10975
10996
  var $URIError = uri;
10976
10997
  var abs = abs$1;
10977
10998
  var floor = floor$1;
10978
- var max = max$2;
10999
+ var max = max$1;
10979
11000
  var min = min$1;
10980
11001
  var pow = pow$1;
10981
11002
  var round = round$1;
@@ -11009,7 +11030,7 @@ var getProto = requireGetProto();
11009
11030
  var $ObjectGPO = requireObject_getPrototypeOf();
11010
11031
  var $ReflectGPO = requireReflect_getPrototypeOf();
11011
11032
  var $apply = requireFunctionApply();
11012
- var $call = functionCall;
11033
+ var $call = requireFunctionCall();
11013
11034
  var needsEval = {};
11014
11035
  var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
11015
11036
  var INTRINSICS = {
@@ -11180,7 +11201,7 @@ var LEGACY_ALIASES = {
11180
11201
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
11181
11202
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
11182
11203
  };
11183
- var bind$1 = functionBind;
11204
+ var bind$1 = requireFunctionBind();
11184
11205
  var hasOwn = requireHasown();
11185
11206
  var $concat = bind$1.call($call, Array.prototype.concat);
11186
11207
  var $spliceApply = bind$1.call($apply, Array.prototype.splice);
@@ -15511,7 +15532,7 @@ const admin = adminApi.enhanceEndpoints({
15511
15532
  overrideExisting: false
15512
15533
  });
15513
15534
  const { useInitQuery, useTelemetryPropertiesQuery, useInformationQuery, useProjectSettingsQuery, useUpdateProjectSettingsMutation, useGetPluginsQuery, useGetLicenseLimitsQuery, useGetLicenseTrialTimeLeftQuery, useGetGuidedTourMetaQuery } = admin;
15514
- function bind2(fn2, thisArg) {
15535
+ function bind(fn2, thisArg) {
15515
15536
  return function wrap() {
15516
15537
  return fn2.apply(thisArg, arguments);
15517
15538
  };
@@ -15648,7 +15669,7 @@ function merge2() {
15648
15669
  const extend = (a2, b2, thisArg, { allOwnKeys } = {}) => {
15649
15670
  forEach$1(b2, (val, key) => {
15650
15671
  if (thisArg && isFunction$1(val)) {
15651
- a2[key] = bind2(val, thisArg);
15672
+ a2[key] = bind(val, thisArg);
15652
15673
  } else {
15653
15674
  a2[key] = val;
15654
15675
  }
@@ -17928,7 +17949,7 @@ Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
17928
17949
  });
17929
17950
  function createInstance(defaultConfig) {
17930
17951
  const context = new Axios$1(defaultConfig);
17931
- const instance = bind2(Axios$1.prototype.request, context);
17952
+ const instance = bind(Axios$1.prototype.request, context);
17932
17953
  utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
17933
17954
  utils$1.extend(instance, context, null, { allOwnKeys: true });
17934
17955
  instance.create = function create2(instanceConfig) {
@@ -31137,7 +31158,7 @@ const Settings = () => {
31137
31158
  const { formatMessage } = useIntl();
31138
31159
  const [activeView, setActiveView] = useState("configure");
31139
31160
  const titleId = `${PLUGIN_ID}-settings-title`;
31140
- return /* @__PURE__ */ jsx(DesignSystemProvider, { children: /* @__PURE__ */ jsx(Main, { labelledBy: titleId, children: /* @__PURE__ */ jsxs(Box, { padding: 8, background: "neutral100", children: [
31161
+ return /* @__PURE__ */ jsx(Main, { labelledBy: titleId, children: /* @__PURE__ */ jsxs(Box, { padding: 8, background: "neutral100", children: [
31141
31162
  /* @__PURE__ */ jsx(Box, { paddingBottom: 4, children: /* @__PURE__ */ jsx(Typography, { id: titleId, variant: "alpha", as: "h1", children: formatMessage({
31142
31163
  id: `${PLUGIN_ID}.settings.section`,
31143
31164
  defaultMessage: "Advanced Ecommerce"
@@ -31206,7 +31227,7 @@ const Settings = () => {
31206
31227
  activeView === "smtp" && /* @__PURE__ */ jsx(SmtpContent, {}),
31207
31228
  activeView === "api-collections" && /* @__PURE__ */ jsx(ApiCollectionsContent, {})
31208
31229
  ] })
31209
- ] }) }) });
31230
+ ] }) });
31210
31231
  };
31211
31232
  export {
31212
31233
  Settings as default