@codeleap/debug 7.0.0 → 7.0.2

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.
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.EnvironmentManager = void 0;
15
+ const store_1 = require("@codeleap/store");
16
+ const types_1 = require("@codeleap/types");
17
+ const utils_1 = require("@codeleap/utils");
18
+ const react_1 = require("react");
19
+ const const_1 = require("./const");
20
+ /**
21
+ * Runtime switchboard for backend environments in debug builds.
22
+ *
23
+ * The override is opt-in: until `setEnabled` is called the manager always
24
+ * returns `defaultEnvironment`, making it safe to instantiate unconditionally.
25
+ * State is persisted via `@codeleap/store` `globalState` so it survives page
26
+ * reloads, but the `enabledBy` flag gates whether that persisted state is
27
+ * actually honoured.
28
+ *
29
+ * When the active environment is `customEnvironment`, `serverUrl` validates the
30
+ * stored URL against a strict regex and falls back to `defaultEnvironment` if
31
+ * it fails — callers can rely on `serverUrl` always returning a usable value.
32
+ */
33
+ class EnvironmentManager {
34
+ get environments() {
35
+ return this.config.environments;
36
+ }
37
+ get defaultConfig() {
38
+ return {
39
+ environment: this.config.defaultEnvironment,
40
+ customUrl: '',
41
+ enabledBy: null,
42
+ };
43
+ }
44
+ constructor(config) {
45
+ var _a;
46
+ this.config = config;
47
+ this.editors = const_1.EDITORS;
48
+ this.store = (0, store_1.globalState)(this.defaultConfig, { persistKey: (_a = config === null || config === void 0 ? void 0 : config.persistKey) !== null && _a !== void 0 ? _a : 'environment-manager' });
49
+ this.initialStoreValue = this.store.get();
50
+ }
51
+ testUrl(url) {
52
+ if (!url)
53
+ return false;
54
+ const urlValidator = /^https?:\/\/([a-zA-Z0-9.-]+|localhost|(\d{1,3}\.){3}\d{1,3})(?::\d+)?\/$/;
55
+ return urlValidator.test(url);
56
+ }
57
+ get env() {
58
+ var _a;
59
+ const value = (_a = this.store.get()) !== null && _a !== void 0 ? _a : this.defaultConfig;
60
+ if (value.enabledBy) {
61
+ if (value.environment === this.config.customEnvironment && !this.testUrl(value.customUrl)) {
62
+ value.environment = this.defaultConfig.environment;
63
+ }
64
+ return value;
65
+ }
66
+ return this.defaultConfig;
67
+ }
68
+ setEnabled(by = false) {
69
+ const disable = by === false || types_1.TypeGuards.isNil(by);
70
+ this.store.set({ enabledBy: disable ? null : by });
71
+ return !disable;
72
+ }
73
+ get isEnabled() {
74
+ return !types_1.TypeGuards.isNil(this.isEnabledBy);
75
+ }
76
+ get isEnabledBy() {
77
+ return this.store.get(s => s === null || s === void 0 ? void 0 : s.enabledBy);
78
+ }
79
+ get isEnabledBySystem() {
80
+ return this.isEnabledBy === const_1.EDITORS.SYSTEM;
81
+ }
82
+ get isEnabledByUser() {
83
+ return this.isEnabledBy === const_1.EDITORS.USER;
84
+ }
85
+ get is() {
86
+ const environment = this.store.get(s => { var _a; return (_a = s === null || s === void 0 ? void 0 : s.environment) !== null && _a !== void 0 ? _a : this.defaultConfig.environment; });
87
+ return Object.entries(this.environments).reduce((acc, [key, value]) => {
88
+ acc[(0, utils_1.capitalize)(key)] = environment === key;
89
+ return acc;
90
+ }, {});
91
+ }
92
+ get serverUrl() {
93
+ var _a;
94
+ const env = this.env;
95
+ if (env.environment === this.config.customEnvironment) {
96
+ if (!this.testUrl(env.customUrl)) {
97
+ return this.environments[this.defaultConfig.environment];
98
+ }
99
+ return env.customUrl;
100
+ }
101
+ return (_a = this.environments[env.environment]) !== null && _a !== void 0 ? _a : this.environments[this.defaultConfig.environment];
102
+ }
103
+ setEnvironment(environment) {
104
+ if (!this.isEnabled)
105
+ return;
106
+ this.store.set({ environment });
107
+ }
108
+ isEnvironment(env) {
109
+ const current = this.env;
110
+ return current.environment === env;
111
+ }
112
+ setCustomUrl(url) {
113
+ if (!url.endsWith('/')) {
114
+ url += '/';
115
+ }
116
+ if (!this.testUrl(url))
117
+ return;
118
+ this.store.set({ customUrl: url });
119
+ }
120
+ use() {
121
+ const value = this.store.use();
122
+ const _a = value !== null && value !== void 0 ? value : this.defaultConfig, { enabledBy } = _a, config = __rest(_a, ["enabledBy"]);
123
+ const [customUrl, setCustomUrl] = (0, react_1.useState)(config === null || config === void 0 ? void 0 : config.customUrl);
124
+ const changed = (0, react_1.useMemo)(() => !(0, utils_1.deepEqual)(value, this.initialStoreValue), [value]);
125
+ return {
126
+ enabled: !!enabledBy,
127
+ enabledByUser: enabledBy === const_1.EDITORS.USER,
128
+ enabledBySystem: enabledBy === const_1.EDITORS.SYSTEM,
129
+ config,
130
+ changed,
131
+ customUrl,
132
+ setCustomUrl,
133
+ };
134
+ }
135
+ }
136
+ exports.EnvironmentManager = EnvironmentManager;
137
+ //# sourceMappingURL=class.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"class.js","sourceRoot":"","sources":["../../src/EnvironmentManager/class.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2CAA6C;AAC7C,2CAAiE;AACjE,2CAAuD;AACvD,iCAAyC;AAEzC,mCAAiC;AAEjC;;;;;;;;;;;;GAYG;AACH,MAAa,kBAAkB;IAO7B,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAA;IACjC,CAAC;IAED,IAAI,aAAa;QACf,OAAO;YACL,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,kBAAkB;YAC3C,SAAS,EAAE,EAAE;YACb,SAAS,EAAE,IAAI;SACO,CAAA;IAC1B,CAAC;IAED,YAAoB,MAAmC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AAO,EAAC,GAAG,EAAE,CAAC,CAAC,IAAA,iBAAS,EAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;QAEjF,OAAO;YACL,OAAO,EAAE,CAAC,CAAC,SAAS;YACpB,aAAa,EAAE,SAAS,KAAK,eAAO,CAAC,IAAI;YACzC,eAAe,EAAE,SAAS,KAAK,eAAO,CAAC,MAAM;YAC7C,MAAM;YACN,OAAO;YACP,SAAS;YACT,YAAY;SACb,CAAA;IACH,CAAC;CACF;AApID,gDAoIC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EDITORS = void 0;
4
+ /**
5
+ * Identifies who enabled the environment override — the application itself
6
+ * (`SYSTEM`) or an end user via a debug UI (`USER`). Used to gate which
7
+ * controls are exposed and whether the override survives a session reset.
8
+ */
9
+ exports.EDITORS = {
10
+ SYSTEM: 'system',
11
+ USER: 'user',
12
+ };
13
+ //# sourceMappingURL=const.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"const.js","sourceRoot":"","sources":["../../src/EnvironmentManager/const.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,OAAO,GAAG;IACrB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;CACJ,CAAA"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createEnvironmentManager = createEnvironmentManager;
4
+ const class_1 = require("./class");
5
+ /**
6
+ * Preferred entry point for instantiating an `EnvironmentManager`.
7
+ * Keeps call-sites free of the generic `new` syntax and makes the config
8
+ * shape the only public API surface that needs to be imported.
9
+ */
10
+ function createEnvironmentManager(config) {
11
+ return new class_1.EnvironmentManager(config);
12
+ }
13
+ //# sourceMappingURL=factor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factor.js","sourceRoot":"","sources":["../../src/EnvironmentManager/factor.ts"],"names":[],"mappings":";;AASA,4DAEC;AAVD,mCAA4C;AAG5C;;;;GAIG;AACH,SAAgB,wBAAwB,CAAyB,MAAmC;IAClG,OAAO,IAAI,0BAAkB,CAAI,MAAM,CAAC,CAAA;AAC1C,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./factor"), exports);
18
+ __exportStar(require("./class"), exports);
19
+ __exportStar(require("./types"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/EnvironmentManager/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,0CAAuB;AACvB,0CAAuB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/EnvironmentManager/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,217 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.FakeRestApi = void 0;
13
+ /**
14
+ * A fake REST API implementation for testing and prototyping.
15
+ * Provides CRUD operations with pagination support and optional request delays.
16
+ * @template T - The type of items to manage, must extend FakeItem
17
+ * @template F - The type of filters to apply when listing items
18
+ */
19
+ class FakeRestApi {
20
+ /**
21
+ * Gets the ID of the last item in the data array.
22
+ * @private
23
+ * @returns The highest ID or 0 if no items exist
24
+ */
25
+ get lastId() {
26
+ return this.data.length > 0 ? Math.max(...this.data.map((i) => i.id)) : 0;
27
+ }
28
+ /**
29
+ * Gets the name of the API.
30
+ * @returns The API name
31
+ */
32
+ get name() {
33
+ return this.options.name;
34
+ }
35
+ /**
36
+ * Gets the current count of items.
37
+ * @returns The number of items in the data array
38
+ */
39
+ get count() {
40
+ return this.data.length;
41
+ }
42
+ /**
43
+ * Creates a new FakeRestApi instance.
44
+ * @param options - Configuration options for the API
45
+ */
46
+ constructor(options) {
47
+ this.data = [];
48
+ this.options = Object.assign({ delayMs: 2500, maxCount: 100, enableDelay: false, filterFn: () => true }, options);
49
+ this.initialize();
50
+ }
51
+ /**
52
+ * Initializes the data array with items up to maxCount.
53
+ * @private
54
+ */
55
+ initialize() {
56
+ this.data = Array.from({ length: this.options.maxCount }, (_, i) => this.generateItem(i + 1));
57
+ }
58
+ /**
59
+ * Updates the API options partially.
60
+ * @param newOptions - Partial options to update
61
+ */
62
+ setOptions(newOptions) {
63
+ this.options = Object.assign(Object.assign({}, this.options), newOptions);
64
+ }
65
+ /**
66
+ * Generates a new item using the generator function.
67
+ * @param id - The ID for the new item (defaults to lastId + 1)
68
+ * @returns A newly generated item
69
+ */
70
+ generateItem(id = this.lastId + 1) {
71
+ return this.options.generatorFn(id);
72
+ }
73
+ /**
74
+ * Introduces an artificial delay if enabled in options.
75
+ * @private
76
+ * @returns A promise that resolves after the delay period
77
+ */
78
+ delay() {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ if (!this.options.enableDelay)
81
+ return;
82
+ return new Promise((resolve) => {
83
+ setTimeout(resolve, this.options.delayMs);
84
+ });
85
+ });
86
+ }
87
+ /**
88
+ * Builds a URL with pagination parameters.
89
+ * @private
90
+ * @param limit - Number of items per page
91
+ * @param offset - Starting position
92
+ * @returns A formatted URL string
93
+ */
94
+ buildUrl(limit, offset) {
95
+ return `https://api.${this.name}?limit=${limit}&offset=${offset}`;
96
+ }
97
+ /**
98
+ * Retrieves a paginated list of items with optional filtering.
99
+ * @param limit - Number of items to return (default: 10)
100
+ * @param offset - Starting position (default: 0)
101
+ * @param filters - Optional filters to apply
102
+ * @returns A promise that resolves to a paginated response
103
+ */
104
+ listItems() {
105
+ return __awaiter(this, arguments, void 0, function* (limit = 10, offset = 0, filters) {
106
+ yield this.delay();
107
+ const hasFilters = filters && Object.keys(filters).length > 0;
108
+ const items = hasFilters
109
+ ? this.data.filter((item) => this.options.filterFn(item, filters))
110
+ : this.data;
111
+ const total = items.length;
112
+ const start = Math.max(0, offset);
113
+ const end = Math.min(start + limit, total);
114
+ const results = items.slice(start, end);
115
+ return {
116
+ count: total,
117
+ next: end < total ? this.buildUrl(limit, end) : null,
118
+ previous: start > 0 ? this.buildUrl(limit, Math.max(0, start - limit)) : null,
119
+ results,
120
+ };
121
+ });
122
+ }
123
+ /**
124
+ * Retrieves a single item by ID.
125
+ * @param id - The ID of the item to retrieve
126
+ * @returns A promise that resolves to the requested item
127
+ * @throws {Error} If the item is not found
128
+ */
129
+ retrieveItem(id) {
130
+ return __awaiter(this, void 0, void 0, function* () {
131
+ yield this.delay();
132
+ const item = this.data.find((i) => i.id === id);
133
+ if (!item) {
134
+ throw new Error(`${this.name} with id ${id} not found`);
135
+ }
136
+ return item;
137
+ });
138
+ }
139
+ /**
140
+ * Creates a new item and adds it to the data array.
141
+ * @param item - Optional partial item data (ID will be auto-generated)
142
+ * @returns A promise that resolves to the created item
143
+ */
144
+ createItem(item) {
145
+ return __awaiter(this, void 0, void 0, function* () {
146
+ yield this.delay();
147
+ const id = this.lastId + 1;
148
+ const newItem = item ? Object.assign(Object.assign({}, item), { id }) : this.generateItem(id);
149
+ this.data.push(newItem);
150
+ return newItem;
151
+ });
152
+ }
153
+ /**
154
+ * Updates an existing item by ID.
155
+ * @param id - The ID of the item to update
156
+ * @param updates - Partial item data to update
157
+ * @returns A promise that resolves to the updated item
158
+ * @throws {Error} If the item is not found
159
+ */
160
+ updateItem(id, updates) {
161
+ return __awaiter(this, void 0, void 0, function* () {
162
+ yield this.delay();
163
+ const index = this.data.findIndex((i) => i.id === id);
164
+ if (index === -1) {
165
+ throw new Error(`${this.name} with id ${id} not found`);
166
+ }
167
+ this.data[index] = Object.assign(Object.assign(Object.assign({}, this.data[index]), updates), { id });
168
+ return this.data[index];
169
+ });
170
+ }
171
+ /**
172
+ * Deletes an item by ID.
173
+ * @param id - The ID of the item to delete
174
+ * @returns A promise that resolves to the deleted item
175
+ * @throws {Error} If the item is not found
176
+ */
177
+ deleteItem(id) {
178
+ return __awaiter(this, void 0, void 0, function* () {
179
+ yield this.delay();
180
+ const index = this.data.findIndex((i) => i.id === id);
181
+ if (index === -1) {
182
+ throw new Error(`${this.name} with id ${id} not found`);
183
+ }
184
+ const [deleted] = this.data.splice(index, 1);
185
+ return deleted;
186
+ });
187
+ }
188
+ /**
189
+ * Resets the data array to its initial state by regenerating all items.
190
+ */
191
+ reset() {
192
+ this.initialize();
193
+ }
194
+ /**
195
+ * Clears all items from the data array.
196
+ */
197
+ clear() {
198
+ this.data = [];
199
+ }
200
+ /**
201
+ * Gets a readonly copy of all items in the data array.
202
+ * @returns A frozen array of all items
203
+ */
204
+ getData() {
205
+ return Object.freeze([...this.data]);
206
+ }
207
+ /**
208
+ * Gets a single item by ID without delay.
209
+ * @param id - The ID of the item to retrieve
210
+ * @returns The item if found, undefined otherwise
211
+ */
212
+ getItem(id) {
213
+ return this.data.find((i) => i.id === id);
214
+ }
215
+ }
216
+ exports.FakeRestApi = FakeRestApi;
217
+ //# sourceMappingURL=class.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"class.js","sourceRoot":"","sources":["../../src/FakeRestApi/class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA;;;;;GAKG;AACH,MAAa,WAAW;IAItB;;;;OAIG;IACH,IAAY,MAAM;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3E,CAAC;IAED;;;OAGG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAA;IAC1B,CAAC;IAED;;;OAGG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAA;IACzB,CAAC;IAED;;;OAGG;IACH,YAAY,OAAiC;QAhCrC,SAAI,GAAQ,EAAE,CAAA;QAiCpB,IAAI,CAAC,OAAO,mBACV,OAAO,EAAE,IAAI,EACb,QAAQ,EAAE,GAAG,EACb,WAAW,EAAE,KAAK,EAClB,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IACjB,OAAO,CACX,CAAA;QAED,IAAI,CAAC,UAAU,EAAE,CAAA;IACnB,CAAC;IAED;;;OAGG;IACK,UAAU;QAChB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ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,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;YAE5C,OAAO,OAAO,CAAA;QAChB,CAAC;KAAA;IAED;;OAEG;IACI,KAAK;QACV,IAAI,CAAC,UAAU,EAAE,CAAA;IACnB,CAAC;IAED;;OAEG;IACI,KAAK;QACV,IAAI,CAAC,IAAI,GAAG,EAAE,CAAA;IAChB,CAAC;IAED;;;OAGG;IACI,OAAO;QACZ,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IACtC,CAAC;IAED;;;;OAIG;IACI,OAAO,CAAC,EAAW;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;IAC3C,CAAC;CACF;AA1OD,kCA0OC"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createFakeRestApi = createFakeRestApi;
4
+ const class_1 = require("./class");
5
+ /**
6
+ * Factory function to create a new FakeRestApi instance.
7
+ * @template T - The type of items to manage, must extend FakeItem
8
+ * @template F - The type of filters to apply when listing items
9
+ * @param options - Configuration options for the API
10
+ * @returns A new FakeRestApi instance
11
+ * @example
12
+ * ```typescript
13
+ * type User = { id: number; name: string; email: string }
14
+ *
15
+ * const api = createFakeRestApi<User>({
16
+ * name: 'users',
17
+ * maxCount: 50,
18
+ * generatorFn: (id) => ({
19
+ * id,
20
+ * name: `User ${id}`,
21
+ * email: `user${id}@example.com`
22
+ * })
23
+ * })
24
+ * ```
25
+ */
26
+ function createFakeRestApi(options) {
27
+ return new class_1.FakeRestApi(options);
28
+ }
29
+ //# sourceMappingURL=factor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factor.js","sourceRoot":"","sources":["../../src/FakeRestApi/factor.ts"],"names":[],"mappings":";;AAwBA,8CAIC;AA5BD,mCAAqC;AAGrC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,iBAAiB,CAC/B,OAAiC;IAEjC,OAAO,IAAI,mBAAW,CAAO,OAAO,CAAC,CAAA;AACvC,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./factor"), exports);
18
+ __exportStar(require("./class"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/FakeRestApi/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,0CAAuB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/FakeRestApi/types.ts"],"names":[],"mappings":""}
package/dist/faker.js ADDED
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.faker = void 0;
4
+ const names = [
5
+ 'James', 'John', 'Robert', 'Michael', 'William', 'David', 'Richard', 'Joseph', 'Thomas',
6
+ 'Charles', 'Christopher', 'Daniel', 'Matthew', 'Anthony', 'Donald', 'Mark', 'Paul', 'Steven',
7
+ 'Andrew', 'Kenneth', 'Joshua', 'Kevin', 'Brian', 'George', 'Edward', 'Ronald', 'Timothy',
8
+ 'Jason', 'Jeffrey', 'Ryan', 'Gary', 'Jacob'
9
+ ];
10
+ const surnames = [
11
+ 'Smith', 'Johnson', 'Williams', 'Brown', 'Jones', 'Garcia', 'Miller', 'Davis',
12
+ 'Lopez', 'Wilson', 'Anderson', 'Thomas', 'Taylor', 'Moore',
13
+ 'Jackson', 'Martin', 'Lee', 'Perez', 'Thompson', 'White', 'Harris', 'Sanchez', 'Clark',
14
+ 'Ramirez', 'Lewis', 'Robinson', 'Walker', 'Young', 'Allen', 'King', 'Wright', 'Scott', 'Torres',
15
+ ];
16
+ const animals = [
17
+ 'lion', 'tiger', 'zebra', 'panda', 'koala', 'bear',
18
+ 'wolf', 'fox', 'rabbit', 'bat', 'spider', 'frog', 'shark'
19
+ ];
20
+ function getRandom(list) {
21
+ return list[Math.floor(Math.random() * list.length)];
22
+ }
23
+ function number(min = 0, max = 100) {
24
+ return Math.floor(Math.random() * (max - min + 1)) + min;
25
+ }
26
+ /**
27
+ * Lightweight fixture-data helper for tests and Storybook stories.
28
+ * All string generators draw from fixed lists, so output is deterministic
29
+ * in terms of domain (real-looking names/animals) but random in selection —
30
+ * not suitable as a seed-based reproducible faker. Use `number(min, max)`
31
+ * for bounded integers.
32
+ */
33
+ exports.faker = {
34
+ lastName: () => getRandom(surnames),
35
+ firstName: () => getRandom(names),
36
+ animal: () => getRandom(animals),
37
+ number,
38
+ name: () => `${getRandom(names)} ${getRandom(surnames)}`
39
+ };
40
+ //# sourceMappingURL=faker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"faker.js","sourceRoot":"","sources":["../src/faker.ts"],"names":[],"mappings":";;;AAAA,MAAM,KAAK,GAAG;IACZ,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAA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,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAA;AAC1D,CAAC;AAED;;;;;;GAMG;AACU,QAAA,KAAK,GAAG;IACnB,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC;IACnC,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC;IACjC,MAAM,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;IAChC,MAAM;IACN,IAAI,EAAE,GAAG,EAAE,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,EAAE;CACzD,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./FakeRestApi"), exports);
18
+ __exportStar(require("./EnvironmentManager"), exports);
19
+ __exportStar(require("./faker"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA6B;AAC7B,uDAAoC;AACpC,0CAAuB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@codeleap/debug",
3
- "version": "7.0.0",
4
- "main": "src/index.ts",
3
+ "version": "7.0.2",
4
+ "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {
7
7
  ".": {
@@ -22,10 +22,10 @@
22
22
  "directory": "packages/debug"
23
23
  },
24
24
  "devDependencies": {
25
- "@codeleap/config": "7.0.0",
26
- "@codeleap/store": "7.0.0",
27
- "@codeleap/types": "7.0.0",
28
- "@codeleap/utils": "7.0.0",
25
+ "@codeleap/config": "7.0.1",
26
+ "@codeleap/store": "7.0.1",
27
+ "@codeleap/types": "7.0.1",
28
+ "@codeleap/utils": "7.0.1",
29
29
  "ts-node-dev": "1.1.8"
30
30
  },
31
31
  "scripts": {
@@ -34,9 +34,9 @@
34
34
  },
35
35
  "peerDependencies": {
36
36
  "typescript": "5.5.2",
37
- "@codeleap/config": "7.0.0",
38
- "@codeleap/store": "7.0.0",
39
- "@codeleap/types": "7.0.0",
40
- "@codeleap/utils": "7.0.0"
37
+ "@codeleap/config": "7.0.1",
38
+ "@codeleap/store": "7.0.1",
39
+ "@codeleap/types": "7.0.1",
40
+ "@codeleap/utils": "7.0.1"
41
41
  }
42
42
  }