@plyaz/types 1.29.3 → 1.30.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.
@@ -799,6 +799,27 @@ export interface CoreBaseFrontendServiceConfig<TData = Record<string, unknown>,
799
799
  * @default undefined (auto-detect from 'error' or 'errors')
800
800
  */
801
801
  responseErrorKey?: string;
802
+ /**
803
+ * Key to use when syncing entities to the store.
804
+ *
805
+ * When fetching entities, the service will wrap them in an object with this key
806
+ * before calling store.setData(). Supports nested keys via dot notation.
807
+ *
808
+ * @example
809
+ * ```typescript
810
+ * // Store expects: { items: ExampleEntity[] }
811
+ * storeDataKey: 'items'
812
+ *
813
+ * // Store expects: { data: ExampleEntity[] }
814
+ * storeDataKey: 'data'
815
+ *
816
+ * // Store expects: { nested: { items: ExampleEntity[] } }
817
+ * storeDataKey: 'nested.items'
818
+ * ```
819
+ *
820
+ * @default 'items'
821
+ */
822
+ storeDataKey?: string;
802
823
  /** Fetcher functions for API operations (replaces direct apiClient usage) */
803
824
  fetchers?: CoreServiceFetchers<unknown, unknown, unknown, unknown, unknown, unknown, unknown>;
804
825
  /**
@@ -106,10 +106,12 @@ export type ExampleDeletedPayload = CoreEntityDeletedPayload;
106
106
  export type ExampleValidationFailedPayload = CoreValidationFailedPayload;
107
107
  /**
108
108
  * Example frontend store data type
109
+ * Used for setData() - only items is required, selectedId is preserved if not provided
109
110
  */
110
111
  export interface ExampleFrontendStoreData {
111
112
  items: ExampleEntity[];
112
- selectedId: string | null;
113
+ /** Optional - if not provided, current selection is preserved */
114
+ selectedId?: string | null;
113
115
  }
114
116
  /**
115
117
  * Example frontend store state shape.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plyaz/types",
3
- "version": "1.29.3",
3
+ "version": "1.30.0",
4
4
  "author": "Redeemer Pace",
5
5
  "license": "ISC",
6
6
  "description": "Provides shared TypeScript types and schema utilities for validation and parsing in the @playz ecosystem.",