@plyaz/types 1.19.4 → 1.19.5
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/api/index.cjs +29 -0
- package/dist/api/index.cjs.map +1 -1
- package/dist/api/index.js +29 -0
- package/dist/api/index.js.map +1 -1
- package/dist/core/auth/types.d.ts +1 -1
- package/dist/core/domain/index.d.ts +5 -0
- package/dist/core/domain/types.d.ts +123 -0
- package/dist/core/events/enums.d.ts +25 -1
- package/dist/core/events/index.d.ts +3 -3
- package/dist/core/events/payloads.d.ts +80 -1
- package/dist/core/featureFlag/types.d.ts +16 -16
- package/dist/core/frontend/featureFlags.d.ts +106 -0
- package/dist/core/frontend/index.d.ts +6 -0
- package/dist/core/frontend/types.d.ts +318 -0
- package/dist/core/index.d.ts +6 -2
- package/dist/core/init/index.d.ts +5 -0
- package/dist/core/init/types.d.ts +347 -0
- package/dist/core/modules.d.ts +19 -3
- package/dist/core/services/index.d.ts +5 -0
- package/dist/core/{services.d.ts → services/types.d.ts} +74 -6
- package/dist/errors/codes.d.ts +3 -0
- package/dist/errors/index.cjs +29 -0
- package/dist/errors/index.cjs.map +1 -1
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.js +29 -0
- package/dist/errors/index.js.map +1 -1
- package/dist/errors/middleware.d.ts +105 -0
- package/dist/errors/store.d.ts +140 -0
- package/dist/examples/index.d.ts +1 -1
- package/dist/examples/types.d.ts +64 -0
- package/dist/features/feature-flag/dto.types.d.ts +67 -0
- package/dist/features/feature-flag/index.d.ts +3 -0
- package/dist/features/feature-flag/service.types.d.ts +184 -0
- package/dist/features/feature-flag/store.types.d.ts +166 -0
- package/dist/features/feature-flag/types.d.ts +16 -4
- package/dist/globals.d.ts +23 -0
- package/dist/index.cjs +49 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +49 -1
- package/dist/index.js.map +1 -1
- package/dist/store/index.cjs +13 -0
- package/dist/store/index.cjs.map +1 -1
- package/dist/store/index.d.ts +2 -0
- package/dist/store/index.js +11 -0
- package/dist/store/index.js.map +1 -1
- package/dist/store/keys.d.ts +23 -0
- package/dist/store/types.d.ts +62 -71
- package/dist/testing/features/feature-flags/types.d.ts +3 -3
- package/package.json +6 -2
package/dist/store/index.cjs
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
// @plyaz package - Built with tsup
|
|
4
|
+
|
|
5
|
+
// src/store/keys.ts
|
|
6
|
+
var STORE_KEYS = {
|
|
7
|
+
/** Error store slice - tracks application errors */
|
|
8
|
+
ERROR: "error",
|
|
9
|
+
/** Feature flags store slice - manages feature flag state */
|
|
10
|
+
FEATURE_FLAGS: "featureFlags"
|
|
11
|
+
};
|
|
12
|
+
var ALL_STORE_KEYS = Object.values(STORE_KEYS);
|
|
13
|
+
|
|
14
|
+
exports.ALL_STORE_KEYS = ALL_STORE_KEYS;
|
|
15
|
+
exports.STORE_KEYS = STORE_KEYS;
|
|
3
16
|
//# sourceMappingURL=index.cjs.map
|
|
4
17
|
//# sourceMappingURL=index.cjs.map
|
package/dist/store/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
|
1
|
+
{"version":3,"sources":["../../src/store/keys.ts"],"names":[],"mappings":";;;;;AAUO,IAAM,UAAA,GAAa;AAAA;AAAA,EAExB,KAAA,EAAO,OAAA;AAAA;AAAA,EAEP,aAAA,EAAe;AACjB;AAUO,IAAM,cAAA,GAAiB,MAAA,CAAO,MAAA,CAAO,UAAU","file":"index.cjs","sourcesContent":["/**\n * Store Keys Types\n *\n * Type definitions for store keys used across packages.\n * The actual runtime values are defined in @plyaz/store.\n */\n\n/**\n * Keys for all available store slices.\n */\nexport const STORE_KEYS = {\n /** Error store slice - tracks application errors */\n ERROR: 'error',\n /** Feature flags store slice - manages feature flag state */\n FEATURE_FLAGS: 'featureFlags',\n} as const;\n\n/**\n * Type for store keys.\n */\nexport type StoreKey = (typeof STORE_KEYS)[keyof typeof STORE_KEYS];\n\n/**\n * Array of all store keys for iteration.\n */\nexport const ALL_STORE_KEYS = Object.values(STORE_KEYS) as StoreKey[];\n"]}
|
package/dist/store/index.d.ts
CHANGED
package/dist/store/index.js
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
// @plyaz package - Built with tsup
|
|
1
2
|
|
|
3
|
+
// src/store/keys.ts
|
|
4
|
+
var STORE_KEYS = {
|
|
5
|
+
/** Error store slice - tracks application errors */
|
|
6
|
+
ERROR: "error",
|
|
7
|
+
/** Feature flags store slice - manages feature flag state */
|
|
8
|
+
FEATURE_FLAGS: "featureFlags"
|
|
9
|
+
};
|
|
10
|
+
var ALL_STORE_KEYS = Object.values(STORE_KEYS);
|
|
11
|
+
|
|
12
|
+
export { ALL_STORE_KEYS, STORE_KEYS };
|
|
2
13
|
//# sourceMappingURL=index.js.map
|
|
3
14
|
//# sourceMappingURL=index.js.map
|
package/dist/store/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/store/keys.ts"],"names":[],"mappings":";;;AAUO,IAAM,UAAA,GAAa;AAAA;AAAA,EAExB,KAAA,EAAO,OAAA;AAAA;AAAA,EAEP,aAAA,EAAe;AACjB;AAUO,IAAM,cAAA,GAAiB,MAAA,CAAO,MAAA,CAAO,UAAU","file":"index.js","sourcesContent":["/**\n * Store Keys Types\n *\n * Type definitions for store keys used across packages.\n * The actual runtime values are defined in @plyaz/store.\n */\n\n/**\n * Keys for all available store slices.\n */\nexport const STORE_KEYS = {\n /** Error store slice - tracks application errors */\n ERROR: 'error',\n /** Feature flags store slice - manages feature flag state */\n FEATURE_FLAGS: 'featureFlags',\n} as const;\n\n/**\n * Type for store keys.\n */\nexport type StoreKey = (typeof STORE_KEYS)[keyof typeof STORE_KEYS];\n\n/**\n * Array of all store keys for iteration.\n */\nexport const ALL_STORE_KEYS = Object.values(STORE_KEYS) as StoreKey[];\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store Keys Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for store keys used across packages.
|
|
5
|
+
* The actual runtime values are defined in @plyaz/store.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Keys for all available store slices.
|
|
9
|
+
*/
|
|
10
|
+
export declare const STORE_KEYS: {
|
|
11
|
+
/** Error store slice - tracks application errors */
|
|
12
|
+
readonly ERROR: "error";
|
|
13
|
+
/** Feature flags store slice - manages feature flag state */
|
|
14
|
+
readonly FEATURE_FLAGS: "featureFlags";
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Type for store keys.
|
|
18
|
+
*/
|
|
19
|
+
export type StoreKey = (typeof STORE_KEYS)[keyof typeof STORE_KEYS];
|
|
20
|
+
/**
|
|
21
|
+
* Array of all store keys for iteration.
|
|
22
|
+
*/
|
|
23
|
+
export declare const ALL_STORE_KEYS: StoreKey[];
|
package/dist/store/types.d.ts
CHANGED
|
@@ -1,82 +1,73 @@
|
|
|
1
|
-
import type { StateCreator } from 'zustand';
|
|
2
|
-
import type { BaseErrorContext } from '../errors';
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
2
|
+
* Store Types
|
|
5
3
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @
|
|
9
|
-
* @
|
|
4
|
+
* Type definitions for Zustand store configurations used by @plyaz/store.
|
|
5
|
+
*
|
|
6
|
+
* @fileoverview Store configuration and hook result types
|
|
7
|
+
* @version 2.0.0
|
|
10
8
|
*/
|
|
11
|
-
type
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export interface ErrorLogEntry {
|
|
20
|
-
id: string;
|
|
21
|
-
error: BaseError;
|
|
22
|
-
timestamp: string;
|
|
23
|
-
severity?: ErrorSeverity;
|
|
24
|
-
source?: string;
|
|
25
|
-
correlationId?: string;
|
|
26
|
-
dismissed?: boolean;
|
|
27
|
-
context?: Record<string, object>;
|
|
28
|
-
}
|
|
29
|
-
export interface ErrorOptions {
|
|
30
|
-
source?: string;
|
|
31
|
-
context?: Record<string, object>;
|
|
32
|
-
severity?: ErrorSeverity;
|
|
33
|
-
correlationId?: string;
|
|
9
|
+
import type { SerializedError, ErrorStoreActions, ErrorStoreSlice } from '../errors/store';
|
|
10
|
+
import type { FeatureFlagStoreState, FeatureFlagStoreSlice } from '../features/feature-flag/store.types';
|
|
11
|
+
/**
|
|
12
|
+
* Configuration for creating an error store.
|
|
13
|
+
*/
|
|
14
|
+
export interface ErrorStoreConfig {
|
|
15
|
+
/** Maximum errors to keep (default: 100) */
|
|
16
|
+
maxErrors?: number;
|
|
34
17
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
getActiveErrorCount: () => number;
|
|
18
|
+
/**
|
|
19
|
+
* Result type for useErrorState hook.
|
|
20
|
+
* Combines error state with actions.
|
|
21
|
+
*/
|
|
22
|
+
export interface UseErrorStateResult extends ErrorStoreActions {
|
|
23
|
+
/** All errors in the store */
|
|
24
|
+
errors: SerializedError[];
|
|
25
|
+
/** Active (undismissed) errors */
|
|
26
|
+
activeErrors: SerializedError[];
|
|
27
|
+
/** Most recent error */
|
|
28
|
+
lastError: SerializedError | null;
|
|
29
|
+
/** Total error count */
|
|
30
|
+
errorCount: number;
|
|
31
|
+
/** Active (undismissed) error count */
|
|
32
|
+
activeErrorCount: number;
|
|
33
|
+
/** Whether there are any errors */
|
|
34
|
+
hasErrors: boolean;
|
|
35
|
+
/** Whether there are any active errors */
|
|
36
|
+
hasActiveErrors: boolean;
|
|
37
|
+
/** Whether error middleware is connected */
|
|
38
|
+
isConnected: boolean;
|
|
57
39
|
}
|
|
58
40
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* Used for slices **without** middleware such as `persist` or `immer`.
|
|
41
|
+
* Configuration for creating a Zustand feature flag store.
|
|
42
|
+
* Used by createFeatureFlagStore in @plyaz/store.
|
|
62
43
|
*/
|
|
63
|
-
export
|
|
64
|
-
|
|
44
|
+
export interface FeatureFlagStoreConfig {
|
|
45
|
+
/** Enable Redux DevTools integration */
|
|
46
|
+
devtools?: boolean;
|
|
47
|
+
/** DevTools store name */
|
|
48
|
+
devtoolsName?: string;
|
|
49
|
+
/** Enable persistence */
|
|
50
|
+
persist?: boolean;
|
|
51
|
+
/** Persistence storage name */
|
|
52
|
+
persistName?: string;
|
|
53
|
+
/** Keys to persist (defaults to ['flags', 'defaults']) */
|
|
54
|
+
persistPartialize?: (keyof FeatureFlagStoreState)[];
|
|
55
|
+
}
|
|
65
56
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* Note: You don't need to manually specify middleware type tuples
|
|
70
|
-
* (like `["zustand/persist", T]`) since Zustand automatically infers them.
|
|
57
|
+
* Combined root store state and actions.
|
|
58
|
+
* Merges all slice types into a single store interface.
|
|
71
59
|
*/
|
|
72
|
-
export type
|
|
60
|
+
export type RootStoreSlice = ErrorStoreSlice & FeatureFlagStoreSlice;
|
|
73
61
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* Currently includes only `ErrorSliceType`, but can later be extended
|
|
77
|
-
* to include other slices such as `AuthSliceType`, `UserSliceType`, etc.
|
|
78
|
-
*
|
|
79
|
-
* @typedef {ErrorSliceType} RootStore
|
|
62
|
+
* Configuration for creating the root store.
|
|
80
63
|
*/
|
|
81
|
-
export
|
|
82
|
-
|
|
64
|
+
export interface RootStoreConfig {
|
|
65
|
+
/** Error store configuration */
|
|
66
|
+
errors?: ErrorStoreConfig;
|
|
67
|
+
/** Feature flag store configuration */
|
|
68
|
+
featureFlags?: FeatureFlagStoreConfig;
|
|
69
|
+
/** Enable Redux DevTools integration */
|
|
70
|
+
devtools?: boolean;
|
|
71
|
+
/** DevTools store name */
|
|
72
|
+
devtoolsName?: string;
|
|
73
|
+
}
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
import type * as Vitest from 'vitest';
|
|
47
47
|
import type * as React from 'react';
|
|
48
48
|
import type { UnknownRecord, UnknownArray, Arrayable, SetOptional } from 'type-fest';
|
|
49
|
-
import type { FeatureFlag, FeatureFlagCondition, FeatureFlagConfig, FeatureFlagContext, FeatureFlagEvaluation, FeatureFlagRule, FeatureFlagValue, FeatureFlagProvider as IFeatureFlagProvider, FeatureFlagContextValue } from '../../../features';
|
|
49
|
+
import type { FeatureFlag, FeatureFlagCondition, FeatureFlagConfig, FeatureFlagContext, FeatureFlagEvaluation, FeatureFlagRule, FeatureFlagValue, FeatureFlagProvider as IFeatureFlagProvider, FeatureFlagContextValue, FeatureFlagProviderType } from '../../../features';
|
|
50
50
|
import type { MockLogger, RenderFunction, RenderHookFunction } from '../../common';
|
|
51
51
|
import type { Promisable } from 'type-fest';
|
|
52
52
|
import type { Describable, KeyValuePair, Resettable, WithMetadata, WithTimestamp } from '../../../common';
|
|
@@ -461,7 +461,7 @@ export interface FeatureFlagTestOptions<FeatureFlagKey extends string> {
|
|
|
461
461
|
/** Default evaluation context */
|
|
462
462
|
context?: FeatureFlagContext;
|
|
463
463
|
/** Provider type to use */
|
|
464
|
-
provider?:
|
|
464
|
+
provider?: FeatureFlagProviderType;
|
|
465
465
|
/** Enable caching */
|
|
466
466
|
cache?: boolean;
|
|
467
467
|
/** Enable auto-refresh */
|
|
@@ -643,7 +643,7 @@ export interface FeatureFlagHelpersMock<FeatureFlagKey extends string> {
|
|
|
643
643
|
*/
|
|
644
644
|
export interface FeatureFlagTestConfig {
|
|
645
645
|
/** Default provider type */
|
|
646
|
-
defaultProvider:
|
|
646
|
+
defaultProvider: FeatureFlagProviderType;
|
|
647
647
|
/** Default request timeout */
|
|
648
648
|
defaultTimeout: number;
|
|
649
649
|
/** Enable caching */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plyaz/types",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.5",
|
|
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.",
|
|
@@ -210,6 +210,9 @@
|
|
|
210
210
|
"import": "./dist/campaign/index.js",
|
|
211
211
|
"require": "./dist/campaign/index.cjs"
|
|
212
212
|
},
|
|
213
|
+
"./globals": {
|
|
214
|
+
"types": "./dist/globals.d.ts"
|
|
215
|
+
},
|
|
213
216
|
"./package.json": "./package.json"
|
|
214
217
|
},
|
|
215
218
|
"files": [
|
|
@@ -300,9 +303,10 @@
|
|
|
300
303
|
}
|
|
301
304
|
},
|
|
302
305
|
"scripts": {
|
|
303
|
-
"build": "pnpm clean && pnpm build:js && pnpm build:types",
|
|
306
|
+
"build": "pnpm clean && pnpm build:js && pnpm build:types && pnpm build:globals",
|
|
304
307
|
"build:js": "tsup",
|
|
305
308
|
"build:types": "tsc src/index.ts --emitDeclarationOnly --esModuleInterop --outDir dist --declaration --skipLibCheck",
|
|
309
|
+
"build:globals": "cp src/globals.d.ts dist/globals.d.ts",
|
|
306
310
|
"build:watch": "tsup --watch",
|
|
307
311
|
"dev": "tsup --watch",
|
|
308
312
|
"lint": "eslint ./src",
|