@feardread/feature-factory 5.0.7 → 5.0.8
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 +0 -0
- package/dist/bundle.min.js +2 -2
- package/dist/index.esm.js +3 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +0 -0
- package/package.json +2 -1
- package/rollup.config.mjs +0 -0
- package/src/factory/api.js +5 -3
- package/src/factory/cache.js +0 -0
- package/src/factory/index.js +1 -1
- package/src/factory/service.js +0 -0
- package/src/factory/state.js +1 -1
- package/src/factory/thunk.js +4 -4
- package/src/index.js +0 -0
- package/tsup.config.ts +0 -0
- package/.env +0 -4
package/dist/index.mjs
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feardread/feature-factory",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.8",
|
|
4
4
|
"description": "Library to interact with redux toolkit and reduce boilerplate / repeated code",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@babel/core": "^7.28.0",
|
|
20
20
|
"@reduxjs/toolkit": "^2.8.2",
|
|
21
|
+
"@rollup/plugin-typescript": "^12.1.4",
|
|
21
22
|
"axios": "^1.11.0",
|
|
22
23
|
"react": "^19.1.0",
|
|
23
24
|
"react-redux": "^9.2.0",
|
package/rollup.config.mjs
CHANGED
|
File without changes
|
package/src/factory/api.js
CHANGED
|
@@ -9,9 +9,9 @@ const CONFIG = {
|
|
|
9
9
|
BASE_URL: null,
|
|
10
10
|
// API Base URLs
|
|
11
11
|
baseUrls: {
|
|
12
|
-
production: process.env.
|
|
13
|
-
development: process.env.
|
|
14
|
-
test: process.env.
|
|
12
|
+
production: process.env.API_BASE_URL_PROD || 'http://fear.master.com/fear/api/',
|
|
13
|
+
development: process.env.API_BASE_URL_DEV || 'http://localhost:4000/fear/api/',
|
|
14
|
+
test: process.env.API_BASE_URL_TEST || 'https://fear.dedyn.io/fear/api/',
|
|
15
15
|
},
|
|
16
16
|
tokenNames: {
|
|
17
17
|
bearer: 'Authorization',
|
|
@@ -232,6 +232,8 @@ const responseInterceptor = (response) => {
|
|
|
232
232
|
requestId: response.config.headers['X-Request-ID'],
|
|
233
233
|
};
|
|
234
234
|
|
|
235
|
+
console.log('Loaded Env = ', process.env);
|
|
236
|
+
|
|
235
237
|
// Log successful responses in development
|
|
236
238
|
if (process.env.NODE_ENV === 'development') {
|
|
237
239
|
console.log(`✅ API Success [${response.status}]:`, {
|
package/src/factory/cache.js
CHANGED
|
File without changes
|
package/src/factory/index.js
CHANGED
|
@@ -174,7 +174,7 @@ export function FeatureFactory(entity, reducers = {}, endpoints = null) {
|
|
|
174
174
|
reducers,
|
|
175
175
|
adapter,
|
|
176
176
|
manager: createReducerManager,
|
|
177
|
-
inject: mergeObjects,
|
|
177
|
+
inject: mergeObjects,
|
|
178
178
|
create: createFactorySlice,
|
|
179
179
|
// Utility methods
|
|
180
180
|
getEntityName: () => entity,
|
package/src/factory/service.js
CHANGED
|
File without changes
|
package/src/factory/state.js
CHANGED
package/src/factory/thunk.js
CHANGED
|
@@ -255,13 +255,13 @@ export const ThunkFactory = {
|
|
|
255
255
|
validateThunkParams(entity, 'crud');
|
|
256
256
|
|
|
257
257
|
return {
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
fetch: ThunkFactory.create(entity, 'all'),
|
|
259
|
+
read: ThunkFactory.create(entity, 'one'),
|
|
260
260
|
create: ThunkFactory.post(entity, 'create'),
|
|
261
261
|
update: ThunkFactory.put(entity, 'update'),
|
|
262
262
|
patch: ThunkFactory.patch(entity, 'patch'),
|
|
263
263
|
delete: ThunkFactory.delete(entity, 'delete'),
|
|
264
|
-
search: ThunkFactory.
|
|
264
|
+
search: ThunkFactory.post(entity, 'search'),
|
|
265
265
|
};
|
|
266
266
|
},
|
|
267
267
|
|
|
@@ -276,8 +276,8 @@ export const ThunkFactory = {
|
|
|
276
276
|
* @returns {Object} Standard operations object
|
|
277
277
|
*/
|
|
278
278
|
getStandardOperations: () => ({ ...STANDARD_OPERATIONS }),
|
|
279
|
+
setApiUrl: (url) => { ThunkFactory.API_URL = url; ThunkFactory.getApiUrl(); },
|
|
279
280
|
getApiUrl: () => { return ThunkFactory.API_URL },
|
|
280
|
-
setApiUrl: (url) => { ThunkFactory.API_URL = url }
|
|
281
281
|
};
|
|
282
282
|
|
|
283
283
|
export default ThunkFactory;
|
package/src/index.js
CHANGED
|
File without changes
|
package/tsup.config.ts
CHANGED
|
File without changes
|
package/.env
DELETED