@plyaz/core 1.7.1 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/domain/base/BaseFrontendDomainService.d.ts.map +1 -1
- package/dist/domain/example/FrontendExampleDomainService.d.ts.map +1 -1
- package/dist/entry-backend.js +36 -10
- package/dist/entry-backend.js.map +1 -1
- package/dist/entry-backend.mjs +36 -10
- package/dist/entry-backend.mjs.map +1 -1
- package/dist/entry-frontend-browser.js +48 -11
- package/dist/entry-frontend-browser.js.map +1 -1
- package/dist/entry-frontend-browser.mjs +48 -11
- package/dist/entry-frontend-browser.mjs.map +1 -1
- package/dist/entry-frontend.js +48 -11
- package/dist/entry-frontend.js.map +1 -1
- package/dist/entry-frontend.mjs +48 -11
- package/dist/entry-frontend.mjs.map +1 -1
- package/dist/frontend/providers/PlyazProvider.d.ts.map +1 -1
- package/dist/index.js +48 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +48 -11
- package/dist/index.mjs.map +1 -1
- package/dist/init/CoreInitializer.d.ts.map +1 -1
- package/dist/init/nestjs/index.js +2 -4
- package/dist/init/nestjs/index.js.map +1 -1
- package/dist/init/nestjs/index.mjs +2 -4
- package/dist/init/nestjs/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/entry-backend.mjs
CHANGED
|
@@ -3739,10 +3739,8 @@ var init_CoreInitializer = __esm({
|
|
|
3739
3739
|
});
|
|
3740
3740
|
const backendFlagStore = createStandaloneFeatureFlagStore();
|
|
3741
3741
|
const compositeStore = {
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
// Feature flag store methods
|
|
3745
|
-
...backendFlagStore
|
|
3742
|
+
errors: backendErrorStore,
|
|
3743
|
+
featureFlags: backendFlagStore
|
|
3746
3744
|
};
|
|
3747
3745
|
_Core._rootStore = {
|
|
3748
3746
|
getState: /* @__PURE__ */ __name(() => compositeStore, "getState"),
|
|
@@ -5016,7 +5014,34 @@ var init_BaseFrontendDomainService = __esm({
|
|
|
5016
5014
|
);
|
|
5017
5015
|
}
|
|
5018
5016
|
const rawData = this.unwrapResponseData(response.data);
|
|
5019
|
-
|
|
5017
|
+
this.logDebug("fetchAll: checking config keys", {
|
|
5018
|
+
responseSuccessKey: this.config.responseSuccessKey,
|
|
5019
|
+
responseErrorKey: this.config.responseErrorKey,
|
|
5020
|
+
responseDataKey: this.config.responseDataKey,
|
|
5021
|
+
configKeys: Object.keys(this.config)
|
|
5022
|
+
});
|
|
5023
|
+
this.logDebug("fetchAll: response structure", {
|
|
5024
|
+
responseType: typeof response,
|
|
5025
|
+
responseKeys: response ? Object.keys(response) : [],
|
|
5026
|
+
responseDataType: typeof response.data,
|
|
5027
|
+
hasOk: "ok" in response,
|
|
5028
|
+
hasData: "data" in response
|
|
5029
|
+
});
|
|
5030
|
+
this.logDebug("fetchAll: after unwrap", {
|
|
5031
|
+
rawDataType: typeof rawData,
|
|
5032
|
+
isArray: Array.isArray(rawData),
|
|
5033
|
+
rawDataKeys: rawData && typeof rawData === "object" ? Object.keys(rawData) : []
|
|
5034
|
+
});
|
|
5035
|
+
if (!Array.isArray(rawData)) {
|
|
5036
|
+
this.logWarn("fetchAll: unwrapped data is not an array, check responseDataKey config", {
|
|
5037
|
+
responseDataKey: this.config.responseDataKey,
|
|
5038
|
+
actualType: typeof rawData,
|
|
5039
|
+
// Help debug by showing what we got
|
|
5040
|
+
receivedData: rawData
|
|
5041
|
+
});
|
|
5042
|
+
return [];
|
|
5043
|
+
}
|
|
5044
|
+
const entities = rawData.map((dto) => this.mapper.toDomain(dto));
|
|
5020
5045
|
this.syncEntitiesToStore(entities);
|
|
5021
5046
|
await this.afterFetchAll?.(entities, query);
|
|
5022
5047
|
this.emitEvent("fetched", {
|
|
@@ -7740,22 +7765,23 @@ var init_FrontendExampleDomainService = __esm({
|
|
|
7740
7765
|
// Fetchers - using apiClient directly for testing/example purposes
|
|
7741
7766
|
// In production, these would be imported from @plyaz/api services
|
|
7742
7767
|
// Note: Validation is handled by validator class, mapping by mapper class
|
|
7768
|
+
// Note: Use relative paths since apiClient.baseURL is already set to apiBasePath
|
|
7743
7769
|
fetchers: {
|
|
7744
7770
|
fetchAll: /* @__PURE__ */ __name(async (query) => {
|
|
7745
|
-
return this.apiClient.get(
|
|
7771
|
+
return this.apiClient.get("", { params: query });
|
|
7746
7772
|
}, "fetchAll"),
|
|
7747
7773
|
fetchById: /* @__PURE__ */ __name(async (id) => {
|
|
7748
|
-
return this.apiClient.get(
|
|
7774
|
+
return this.apiClient.get(`/${id}`);
|
|
7749
7775
|
}, "fetchById"),
|
|
7750
7776
|
create: /* @__PURE__ */ __name(async (data) => {
|
|
7751
|
-
return this.apiClient.post(
|
|
7777
|
+
return this.apiClient.post("", data);
|
|
7752
7778
|
}, "create"),
|
|
7753
7779
|
update: /* @__PURE__ */ __name(async (payload) => {
|
|
7754
7780
|
const { id, data } = payload;
|
|
7755
|
-
return this.apiClient.patch(
|
|
7781
|
+
return this.apiClient.patch(`/${id}`, data);
|
|
7756
7782
|
}, "update"),
|
|
7757
7783
|
delete: /* @__PURE__ */ __name(async (id) => {
|
|
7758
|
-
return this.apiClient.delete(
|
|
7784
|
+
return this.apiClient.delete(`/${id}`);
|
|
7759
7785
|
}, "delete")
|
|
7760
7786
|
}
|
|
7761
7787
|
// Store handlers - customize how data syncs to store
|