@plyaz/api 1.4.1 → 1.5.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/api/endpoints/featureFlags.d.ts +51 -0
- package/dist/api/endpoints/featureFlags.d.ts.map +1 -0
- package/dist/api/endpoints/index.d.ts +45 -0
- package/dist/api/endpoints/index.d.ts.map +1 -1
- package/dist/api/services/featureFlags/DELETE/deleteFeatureFlag.d.ts +22 -0
- package/dist/api/services/featureFlags/DELETE/deleteFeatureFlag.d.ts.map +1 -0
- package/dist/api/services/featureFlags/DELETE/index.d.ts +9 -0
- package/dist/api/services/featureFlags/DELETE/index.d.ts.map +1 -0
- package/dist/api/services/featureFlags/DELETE/removeFeatureFlagOverride.d.ts +23 -0
- package/dist/api/services/featureFlags/DELETE/removeFeatureFlagOverride.d.ts.map +1 -0
- package/dist/api/services/featureFlags/DELETE/useDeleteFeatureFlag.d.ts +11 -0
- package/dist/api/services/featureFlags/DELETE/useDeleteFeatureFlag.d.ts.map +1 -0
- package/dist/api/services/featureFlags/DELETE/useRemoveFeatureFlagOverride.d.ts +11 -0
- package/dist/api/services/featureFlags/DELETE/useRemoveFeatureFlagOverride.d.ts.map +1 -0
- package/dist/api/services/featureFlags/GET/fetchFeatureFlagHealth.d.ts +24 -0
- package/dist/api/services/featureFlags/GET/fetchFeatureFlagHealth.d.ts.map +1 -0
- package/dist/api/services/featureFlags/GET/fetchFeatureFlagRules.d.ts +23 -0
- package/dist/api/services/featureFlags/GET/fetchFeatureFlagRules.d.ts.map +1 -0
- package/dist/api/services/featureFlags/GET/index.d.ts +7 -0
- package/dist/api/services/featureFlags/GET/index.d.ts.map +1 -0
- package/dist/api/services/featureFlags/POST/checkFeatureFlagEnabled.d.ts +40 -0
- package/dist/api/services/featureFlags/POST/checkFeatureFlagEnabled.d.ts.map +1 -0
- package/dist/api/services/featureFlags/POST/createFeatureFlag.d.ts +29 -0
- package/dist/api/services/featureFlags/POST/createFeatureFlag.d.ts.map +1 -0
- package/dist/api/services/featureFlags/POST/evaluateAllFeatureFlags.d.ts +42 -0
- package/dist/api/services/featureFlags/POST/evaluateAllFeatureFlags.d.ts.map +1 -0
- package/dist/api/services/featureFlags/POST/evaluateFeatureFlag.d.ts +39 -0
- package/dist/api/services/featureFlags/POST/evaluateFeatureFlag.d.ts.map +1 -0
- package/dist/api/services/featureFlags/POST/index.d.ts +14 -0
- package/dist/api/services/featureFlags/POST/index.d.ts.map +1 -0
- package/dist/api/services/featureFlags/POST/refreshFeatureFlagCache.d.ts +22 -0
- package/dist/api/services/featureFlags/POST/refreshFeatureFlagCache.d.ts.map +1 -0
- package/dist/api/services/featureFlags/POST/setFeatureFlagOverride.d.ts +34 -0
- package/dist/api/services/featureFlags/POST/setFeatureFlagOverride.d.ts.map +1 -0
- package/dist/api/services/featureFlags/POST/useCheckFeatureFlagEnabled.d.ts +42 -0
- package/dist/api/services/featureFlags/POST/useCheckFeatureFlagEnabled.d.ts.map +1 -0
- package/dist/api/services/featureFlags/POST/useCreateFeatureFlag.d.ts +22 -0
- package/dist/api/services/featureFlags/POST/useCreateFeatureFlag.d.ts.map +1 -0
- package/dist/api/services/featureFlags/POST/useEvaluateAllFeatureFlags.d.ts +33 -0
- package/dist/api/services/featureFlags/POST/useEvaluateAllFeatureFlags.d.ts.map +1 -0
- package/dist/api/services/featureFlags/PUT/index.d.ts +7 -0
- package/dist/api/services/featureFlags/PUT/index.d.ts.map +1 -0
- package/dist/api/services/featureFlags/PUT/updateFeatureFlag.d.ts +35 -0
- package/dist/api/services/featureFlags/PUT/updateFeatureFlag.d.ts.map +1 -0
- package/dist/api/services/featureFlags/PUT/useUpdateFeatureFlag.d.ts +12 -0
- package/dist/api/services/featureFlags/PUT/useUpdateFeatureFlag.d.ts.map +1 -0
- package/dist/api/services/featureFlags/index.d.ts +9 -0
- package/dist/api/services/featureFlags/index.d.ts.map +1 -0
- package/dist/api/services/index.d.ts +1 -0
- package/dist/api/services/index.d.ts.map +1 -1
- package/dist/index.cjs +365 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +348 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature Flag endpoints configuration
|
|
3
|
+
* Each endpoint can override ALL global settings
|
|
4
|
+
*/
|
|
5
|
+
export declare const featureFlagEndpoints: {
|
|
6
|
+
readonly evaluateFeatureFlag: {
|
|
7
|
+
readonly url: "/feature-flags/:key/evaluate";
|
|
8
|
+
readonly method: "POST";
|
|
9
|
+
};
|
|
10
|
+
readonly checkFeatureFlagEnabled: {
|
|
11
|
+
readonly url: "/feature-flags/:key/enabled";
|
|
12
|
+
readonly method: "POST";
|
|
13
|
+
};
|
|
14
|
+
readonly evaluateAllFeatureFlags: {
|
|
15
|
+
readonly url: "/feature-flags/evaluate-all";
|
|
16
|
+
readonly method: "POST";
|
|
17
|
+
};
|
|
18
|
+
readonly createFeatureFlag: {
|
|
19
|
+
readonly url: "/feature-flags";
|
|
20
|
+
readonly method: "POST";
|
|
21
|
+
};
|
|
22
|
+
readonly updateFeatureFlag: {
|
|
23
|
+
readonly url: "/feature-flags/:key";
|
|
24
|
+
readonly method: "PUT";
|
|
25
|
+
};
|
|
26
|
+
readonly deleteFeatureFlag: {
|
|
27
|
+
readonly url: "/feature-flags/:key";
|
|
28
|
+
readonly method: "DELETE";
|
|
29
|
+
};
|
|
30
|
+
readonly setFeatureFlagOverride: {
|
|
31
|
+
readonly url: "/feature-flags/:key/override";
|
|
32
|
+
readonly method: "POST";
|
|
33
|
+
};
|
|
34
|
+
readonly removeFeatureFlagOverride: {
|
|
35
|
+
readonly url: "/feature-flags/:key/override";
|
|
36
|
+
readonly method: "DELETE";
|
|
37
|
+
};
|
|
38
|
+
readonly getFeatureFlagRules: {
|
|
39
|
+
readonly url: "/feature-flags/:key/rules";
|
|
40
|
+
readonly method: "GET";
|
|
41
|
+
};
|
|
42
|
+
readonly refreshFeatureFlagCache: {
|
|
43
|
+
readonly url: "/feature-flags/refresh";
|
|
44
|
+
readonly method: "POST";
|
|
45
|
+
};
|
|
46
|
+
readonly getFeatureFlagHealth: {
|
|
47
|
+
readonly url: "/feature-flags/health";
|
|
48
|
+
readonly method: "GET";
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=featureFlags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featureFlags.d.ts","sourceRoot":"","sources":["../../../src/api/endpoints/featureFlags.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDvB,CAAC"}
|
|
@@ -131,6 +131,50 @@ export declare const endpoints: {
|
|
|
131
131
|
readonly url: "/resources/:resourceId/reserve";
|
|
132
132
|
readonly method: "POST";
|
|
133
133
|
};
|
|
134
|
+
readonly evaluateFeatureFlag: {
|
|
135
|
+
readonly url: "/feature-flags/:key/evaluate";
|
|
136
|
+
readonly method: "POST";
|
|
137
|
+
};
|
|
138
|
+
readonly checkFeatureFlagEnabled: {
|
|
139
|
+
readonly url: "/feature-flags/:key/enabled";
|
|
140
|
+
readonly method: "POST";
|
|
141
|
+
};
|
|
142
|
+
readonly evaluateAllFeatureFlags: {
|
|
143
|
+
readonly url: "/feature-flags/evaluate-all";
|
|
144
|
+
readonly method: "POST";
|
|
145
|
+
};
|
|
146
|
+
readonly createFeatureFlag: {
|
|
147
|
+
readonly url: "/feature-flags";
|
|
148
|
+
readonly method: "POST";
|
|
149
|
+
};
|
|
150
|
+
readonly updateFeatureFlag: {
|
|
151
|
+
readonly url: "/feature-flags/:key";
|
|
152
|
+
readonly method: "PUT";
|
|
153
|
+
};
|
|
154
|
+
readonly deleteFeatureFlag: {
|
|
155
|
+
readonly url: "/feature-flags/:key";
|
|
156
|
+
readonly method: "DELETE";
|
|
157
|
+
};
|
|
158
|
+
readonly setFeatureFlagOverride: {
|
|
159
|
+
readonly url: "/feature-flags/:key/override";
|
|
160
|
+
readonly method: "POST";
|
|
161
|
+
};
|
|
162
|
+
readonly removeFeatureFlagOverride: {
|
|
163
|
+
readonly url: "/feature-flags/:key/override";
|
|
164
|
+
readonly method: "DELETE";
|
|
165
|
+
};
|
|
166
|
+
readonly getFeatureFlagRules: {
|
|
167
|
+
readonly url: "/feature-flags/:key/rules";
|
|
168
|
+
readonly method: "GET";
|
|
169
|
+
};
|
|
170
|
+
readonly refreshFeatureFlagCache: {
|
|
171
|
+
readonly url: "/feature-flags/refresh";
|
|
172
|
+
readonly method: "POST";
|
|
173
|
+
};
|
|
174
|
+
readonly getFeatureFlagHealth: {
|
|
175
|
+
readonly url: "/feature-flags/health";
|
|
176
|
+
readonly method: "GET";
|
|
177
|
+
};
|
|
134
178
|
readonly getCampaign: {
|
|
135
179
|
readonly url: "/campaigns/:id";
|
|
136
180
|
readonly method: "GET";
|
|
@@ -173,6 +217,7 @@ export type EndpointsList = typeof endpoints;
|
|
|
173
217
|
* Export individual endpoint groups for selective imports
|
|
174
218
|
*/
|
|
175
219
|
export { campaignEndpoints } from './campaigns';
|
|
220
|
+
export { featureFlagEndpoints } from './featureFlags';
|
|
176
221
|
export { pollingEndpoints } from './polling';
|
|
177
222
|
export { infobipEndpoints, infobipEmailEndpoints } from './infobip';
|
|
178
223
|
export { virusTotalEndpoints } from './virustotal';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/endpoints/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/endpoints/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH;;;GAGG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcZ,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,OAAO,SAAS,CAAC;AAE7C;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAEhG;;GAEG;AACH,OAAO,EAEL,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,QAAQ,EACR,gBAAgB,GACjB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAEL,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACZ,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delete Feature Flag Service
|
|
3
|
+
* Deletes a feature flag
|
|
4
|
+
*/
|
|
5
|
+
import { type ServiceOptions, type DeleteFlagResponse } from '@plyaz/types/api';
|
|
6
|
+
import type { EndpointsList } from '@/api/endpoints';
|
|
7
|
+
import type { FetchResponse } from 'fetchff';
|
|
8
|
+
/**
|
|
9
|
+
* Delete a feature flag
|
|
10
|
+
* Uses endpoint: DELETE /feature-flags/:key
|
|
11
|
+
*
|
|
12
|
+
* @param key - Feature flag key to delete
|
|
13
|
+
* @param options - Optional service options
|
|
14
|
+
* @returns Promise<DeleteFlagResponse>
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* await deleteFeatureFlag('old-feature');
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function deleteFeatureFlag<TKey extends string = string, TEndpoints = EndpointsList>(key: TKey, options?: ServiceOptions<TEndpoints>): Promise<FetchResponse<DeleteFlagResponse>>;
|
|
22
|
+
//# sourceMappingURL=deleteFeatureFlag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteFeatureFlag.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/featureFlags/DELETE/deleteFeatureFlag.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAmB,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;;;;;;;;GAYG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,EAAE,UAAU,GAAG,aAAa,EAC9F,GAAG,EAAE,IAAI,EACT,OAAO,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,GACnC,OAAO,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC,CA0B5C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature Flag DELETE Operations
|
|
3
|
+
* Exports all DELETE services and hooks for feature flags
|
|
4
|
+
*/
|
|
5
|
+
export { deleteFeatureFlag } from './deleteFeatureFlag';
|
|
6
|
+
export { removeFeatureFlagOverride } from './removeFeatureFlagOverride';
|
|
7
|
+
export { useDeleteFeatureFlag } from './useDeleteFeatureFlag';
|
|
8
|
+
export { useRemoveFeatureFlagOverride } from './useRemoveFeatureFlagOverride';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/featureFlags/DELETE/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAGxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remove Feature Flag Override Service
|
|
3
|
+
* Removes a manual override from a feature flag
|
|
4
|
+
*/
|
|
5
|
+
import { type ServiceOptions, type RemoveOverrideResponse } from '@plyaz/types/api';
|
|
6
|
+
import type { EndpointsList } from '@/api/endpoints';
|
|
7
|
+
import type { FetchResponse } from 'fetchff';
|
|
8
|
+
/**
|
|
9
|
+
* Remove a manual override from a feature flag
|
|
10
|
+
* Uses endpoint: DELETE /feature-flags/:key/override
|
|
11
|
+
*
|
|
12
|
+
* @param key - Feature flag key
|
|
13
|
+
* @param options - Optional service options
|
|
14
|
+
* @returns Promise<RemoveOverrideResponse>
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* // Remove override after testing
|
|
19
|
+
* await removeFeatureFlagOverride('new-feature');
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function removeFeatureFlagOverride<TKey extends string = string, TEndpoints = EndpointsList>(key: TKey, options?: ServiceOptions<TEndpoints>): Promise<FetchResponse<RemoveOverrideResponse>>;
|
|
23
|
+
//# sourceMappingURL=removeFeatureFlagOverride.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeFeatureFlagOverride.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/featureFlags/DELETE/removeFeatureFlagOverride.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;;;;;;;;;GAaG;AACH,wBAAsB,yBAAyB,CAC7C,IAAI,SAAS,MAAM,GAAG,MAAM,EAC5B,UAAU,GAAG,aAAa,EAC1B,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC,CA0BjG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Query Mutation Hook for Deleting Feature Flags
|
|
3
|
+
*/
|
|
4
|
+
import { createApiMutation } from '../../../hooks/factories';
|
|
5
|
+
import type { DeleteFlagResponse, ServiceOptions, FeatureFlagErrorResponse } from '@plyaz/types/api';
|
|
6
|
+
import type { EndpointsList } from '@/api/endpoints';
|
|
7
|
+
/**
|
|
8
|
+
* Hook for deleting feature flags
|
|
9
|
+
*/
|
|
10
|
+
export declare function useDeleteFeatureFlag<TKey extends string = string, TEndpoints = EndpointsList>(serviceOptions?: ServiceOptions<TEndpoints>, mutationOptions?: Parameters<ReturnType<typeof createApiMutation<DeleteFlagResponse, FeatureFlagErrorResponse, TKey, unknown, TEndpoints>>>[1]): ReturnType<ReturnType<typeof createApiMutation<DeleteFlagResponse, FeatureFlagErrorResponse, TKey, unknown, TEndpoints>>>;
|
|
11
|
+
//# sourceMappingURL=useDeleteFeatureFlag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDeleteFeatureFlag.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/featureFlags/DELETE/useDeleteFeatureFlag.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACd,wBAAwB,EACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,EAAE,UAAU,GAAG,aAAa,EAC3F,cAAc,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,EAC3C,eAAe,CAAC,EAAE,UAAU,CAC1B,UAAU,CACR,OAAO,iBAAiB,CACtB,kBAAkB,EAClB,wBAAwB,EACxB,IAAI,EACJ,OAAO,EACP,UAAU,CACX,CACF,CACF,CAAC,CAAC,CAAC,GACH,UAAU,CACX,UAAU,CACR,OAAO,iBAAiB,CACtB,kBAAkB,EAClB,wBAAwB,EACxB,IAAI,EACJ,OAAO,EACP,UAAU,CACX,CACF,CACF,CAaA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Query Mutation Hook for Removing Feature Flag Overrides
|
|
3
|
+
*/
|
|
4
|
+
import { createApiMutation } from '../../../hooks/factories';
|
|
5
|
+
import type { RemoveOverrideResponse, ServiceOptions, FeatureFlagErrorResponse } from '@plyaz/types/api';
|
|
6
|
+
import type { EndpointsList } from '@/api/endpoints';
|
|
7
|
+
/**
|
|
8
|
+
* Hook for removing feature flag overrides
|
|
9
|
+
*/
|
|
10
|
+
export declare function useRemoveFeatureFlagOverride<TKey extends string = string, TEndpoints = EndpointsList>(serviceOptions?: ServiceOptions<TEndpoints>, mutationOptions?: Parameters<ReturnType<typeof createApiMutation<RemoveOverrideResponse, FeatureFlagErrorResponse, TKey, unknown, TEndpoints>>>[1]): ReturnType<ReturnType<typeof createApiMutation<RemoveOverrideResponse, FeatureFlagErrorResponse, TKey, unknown, TEndpoints>>>;
|
|
11
|
+
//# sourceMappingURL=useRemoveFeatureFlagOverride.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRemoveFeatureFlagOverride.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/featureFlags/DELETE/useRemoveFeatureFlagOverride.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAK,EACV,sBAAsB,EACtB,cAAc,EACd,wBAAwB,EACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,SAAS,MAAM,GAAG,MAAM,EAC5B,UAAU,GAAG,aAAa,EAE1B,cAAc,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,EAC3C,eAAe,CAAC,EAAE,UAAU,CAC1B,UAAU,CACR,OAAO,iBAAiB,CACtB,sBAAsB,EACtB,wBAAwB,EACxB,IAAI,EACJ,OAAO,EACP,UAAU,CACX,CACF,CACF,CAAC,CAAC,CAAC,GACH,UAAU,CACX,UAAU,CACR,OAAO,iBAAiB,CACtB,sBAAsB,EACtB,wBAAwB,EACxB,IAAI,EACJ,OAAO,EACP,UAAU,CACX,CACF,CACF,CAQA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetch Feature Flag Health Service
|
|
3
|
+
* Gets the health status of the feature flag service
|
|
4
|
+
*/
|
|
5
|
+
import type { ServiceOptions, FeatureFlagHealthResponse } from '@plyaz/types/api';
|
|
6
|
+
import type { EndpointsList } from '@/api/endpoints';
|
|
7
|
+
import type { FetchResponse } from 'fetchff';
|
|
8
|
+
/**
|
|
9
|
+
* Get feature flag service health status
|
|
10
|
+
* Uses endpoint: GET /feature-flags/health
|
|
11
|
+
*
|
|
12
|
+
* @param options - Optional service options
|
|
13
|
+
* @returns Promise<FeatureFlagHealthResponse>
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const health = await fetchFeatureFlagHealth();
|
|
18
|
+
* if (health.data.isInitialized) {
|
|
19
|
+
* console.log('Feature flag service ready');
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function fetchFeatureFlagHealth<TEndpoints = EndpointsList>(options?: ServiceOptions<TEndpoints>): Promise<FetchResponse<FeatureFlagHealthResponse>>;
|
|
24
|
+
//# sourceMappingURL=fetchFeatureFlagHealth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchFeatureFlagHealth.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/featureFlags/GET/fetchFeatureFlagHealth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,sBAAsB,CAAC,UAAU,GAAG,aAAa,EACrE,OAAO,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,GACnC,OAAO,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC,CAenD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetch Feature Flag Rules Service
|
|
3
|
+
* Gets all rules for a specific feature flag
|
|
4
|
+
*/
|
|
5
|
+
import { type ServiceOptions, type GetFlagRulesResponse } from '@plyaz/types/api';
|
|
6
|
+
import type { EndpointsList } from '@/api/endpoints';
|
|
7
|
+
import type { FetchResponse } from 'fetchff';
|
|
8
|
+
/**
|
|
9
|
+
* Get rules for a feature flag
|
|
10
|
+
* Uses endpoint: GET /feature-flags/:key/rules
|
|
11
|
+
*
|
|
12
|
+
* @param key - Feature flag key
|
|
13
|
+
* @param options - Optional service options
|
|
14
|
+
* @returns Promise<GetFlagRulesResponse>
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const rules = await fetchFeatureFlagRules('premium-feature');
|
|
19
|
+
* rules.data.data.forEach(rule => console.log(rule.condition));
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function fetchFeatureFlagRules<TKey extends string = string, TEndpoints = EndpointsList>(key: TKey, options?: ServiceOptions<TEndpoints>): Promise<FetchResponse<GetFlagRulesResponse<TKey>>>;
|
|
23
|
+
//# sourceMappingURL=fetchFeatureFlagRules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchFeatureFlagRules.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/featureFlags/GET/fetchFeatureFlagRules.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAmB,KAAK,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACnG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;;;;;;;;;GAaG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,SAAS,MAAM,GAAG,MAAM,EAC5B,UAAU,GAAG,aAAa,EAE1B,GAAG,EAAE,IAAI,EACT,OAAO,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,GACnC,OAAO,CAAC,aAAa,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CA0BpD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature Flag GET Operations
|
|
3
|
+
* Exports all GET services and hooks for feature flags
|
|
4
|
+
*/
|
|
5
|
+
export { fetchFeatureFlagRules } from './fetchFeatureFlagRules';
|
|
6
|
+
export { fetchFeatureFlagHealth } from './fetchFeatureFlagHealth';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/featureFlags/GET/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check Feature Flag Enabled Service
|
|
3
|
+
* Checks if a feature flag is enabled for the given context
|
|
4
|
+
*/
|
|
5
|
+
import { type ServiceOptions, type IsEnabledResponse } from '@plyaz/types/api';
|
|
6
|
+
import type { FeatureFlagContext } from '@plyaz/types/features';
|
|
7
|
+
import type { EndpointsList } from '@/api/endpoints';
|
|
8
|
+
import type { FetchResponse } from 'fetchff';
|
|
9
|
+
/**
|
|
10
|
+
* Request payload for checkFeatureFlagEnabled
|
|
11
|
+
*/
|
|
12
|
+
export interface CheckFeatureFlagEnabledPayload<TKey extends string = string> {
|
|
13
|
+
key: TKey;
|
|
14
|
+
context?: FeatureFlagContext;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Check if a feature flag is enabled
|
|
18
|
+
* Uses endpoint: POST /feature-flags/:key/enabled
|
|
19
|
+
*
|
|
20
|
+
* @param payload - Flag key and optional context
|
|
21
|
+
* @param options - Optional service options
|
|
22
|
+
* @returns Promise<IsEnabledResponse>
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* // Basic usage
|
|
27
|
+
* const result = await checkFeatureFlagEnabled({ key: 'new-dashboard' });
|
|
28
|
+
* if (result.data.isEnabled) {
|
|
29
|
+
* // Show new dashboard
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* // With user context
|
|
33
|
+
* const result = await checkFeatureFlagEnabled({
|
|
34
|
+
* key: 'premium-feature',
|
|
35
|
+
* context: { userId: 'user-123', userRole: 'premium' }
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function checkFeatureFlagEnabled<TKey extends string = string, TEndpoints = EndpointsList>(payload: CheckFeatureFlagEnabledPayload<TKey>, options?: ServiceOptions<TEndpoints>): Promise<FetchResponse<IsEnabledResponse>>;
|
|
40
|
+
//# sourceMappingURL=checkFeatureFlagEnabled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkFeatureFlagEnabled.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/featureFlags/POST/checkFeatureFlagEnabled.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAmB,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAChG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,8BAA8B,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM;IAC1E,GAAG,EAAE,IAAI,CAAC;IACV,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,SAAS,MAAM,GAAG,MAAM,EAC5B,UAAU,GAAG,aAAa,EAE1B,OAAO,EAAE,8BAA8B,CAAC,IAAI,CAAC,EAC7C,OAAO,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,GACnC,OAAO,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,CA4B3C"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create Feature Flag Service
|
|
3
|
+
* Creates a new feature flag
|
|
4
|
+
*/
|
|
5
|
+
import type { ServiceOptions, CreateFlagResponse } from '@plyaz/types/api';
|
|
6
|
+
import type { CreateFlagRequest } from '@plyaz/types/features';
|
|
7
|
+
import type { EndpointsList } from '@/api/endpoints';
|
|
8
|
+
import type { FetchResponse } from 'fetchff';
|
|
9
|
+
/**
|
|
10
|
+
* Create a new feature flag
|
|
11
|
+
* Uses endpoint: POST /feature-flags
|
|
12
|
+
*
|
|
13
|
+
* @param data - Feature flag creation data
|
|
14
|
+
* @param options - Optional service options
|
|
15
|
+
* @returns Promise<CreateFlagResponse>
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const result = await createFeatureFlag({
|
|
20
|
+
* key: 'new-dashboard',
|
|
21
|
+
* name: 'New Dashboard',
|
|
22
|
+
* description: 'Enable new dashboard UI',
|
|
23
|
+
* defaultValue: false,
|
|
24
|
+
* isEnabled: true
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function createFeatureFlag<TKey extends string = string, TEndpoints = EndpointsList>(data: CreateFlagRequest<TKey>, options?: ServiceOptions<TEndpoints>): Promise<FetchResponse<CreateFlagResponse<TKey>>>;
|
|
29
|
+
//# sourceMappingURL=createFeatureFlag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createFeatureFlag.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/featureFlags/POST/createFeatureFlag.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,EAAE,UAAU,GAAG,aAAa,EAC9F,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC,EAC7B,OAAO,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,GACnC,OAAO,CAAC,aAAa,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAiBlD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evaluate All Feature Flags Service
|
|
3
|
+
* Evaluates all feature flags at once for the given context
|
|
4
|
+
*/
|
|
5
|
+
import type { ServiceOptions, EvaluateAllFlagsResponse } from '@plyaz/types/api';
|
|
6
|
+
import type { FeatureFlagContext } from '@plyaz/types/features';
|
|
7
|
+
import type { EndpointsList } from '@/api/endpoints';
|
|
8
|
+
import type { FetchResponse } from 'fetchff';
|
|
9
|
+
/**
|
|
10
|
+
* Request payload for evaluateAllFeatureFlags
|
|
11
|
+
*/
|
|
12
|
+
export interface EvaluateAllFeatureFlagsPayload {
|
|
13
|
+
context?: FeatureFlagContext;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Evaluate all feature flags at once
|
|
17
|
+
* Uses endpoint: POST /feature-flags/evaluate-all
|
|
18
|
+
*
|
|
19
|
+
* @param payload - Optional context for evaluation
|
|
20
|
+
* @param options - Optional service options
|
|
21
|
+
* @returns Promise<EvaluateAllFlagsResponse>
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* // Basic usage - get all flags
|
|
26
|
+
* const flags = await evaluateAllFeatureFlags({});
|
|
27
|
+
* if (flags.data.data['new-dashboard'].isEnabled) {
|
|
28
|
+
* // Show new dashboard
|
|
29
|
+
* }
|
|
30
|
+
*
|
|
31
|
+
* // With user context
|
|
32
|
+
* const flags = await evaluateAllFeatureFlags({
|
|
33
|
+
* context: { userId: 'user-123', userRole: 'admin' }
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* // Use in app initialization
|
|
37
|
+
* const flags = await evaluateAllFeatureFlags({ context: userContext });
|
|
38
|
+
* setFeatureFlags(flags.data.data);
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function evaluateAllFeatureFlags<TKey extends string = string, TEndpoints = EndpointsList>(payload?: EvaluateAllFeatureFlagsPayload, options?: ServiceOptions<TEndpoints>): Promise<FetchResponse<EvaluateAllFlagsResponse<TKey>>>;
|
|
42
|
+
//# sourceMappingURL=evaluateAllFeatureFlags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evaluateAllFeatureFlags.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/featureFlags/POST/evaluateAllFeatureFlags.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,SAAS,MAAM,GAAG,MAAM,EAC5B,UAAU,GAAG,aAAa,EAE1B,OAAO,GAAE,8BAAmC,EAC5C,OAAO,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,GACnC,OAAO,CAAC,aAAa,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC,CAAC,CAkBxD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evaluate Feature Flag Service
|
|
3
|
+
* Evaluates a single feature flag with full details
|
|
4
|
+
*/
|
|
5
|
+
import { type ServiceOptions, type EvaluateFlagResponse } from '@plyaz/types/api';
|
|
6
|
+
import type { FeatureFlagContext } from '@plyaz/types/features';
|
|
7
|
+
import type { EndpointsList } from '@/api/endpoints';
|
|
8
|
+
import type { FetchResponse } from 'fetchff';
|
|
9
|
+
/**
|
|
10
|
+
* Request payload for evaluateFeatureFlag
|
|
11
|
+
*/
|
|
12
|
+
export interface EvaluateFeatureFlagPayload<TKey extends string = string> {
|
|
13
|
+
key: TKey;
|
|
14
|
+
context?: FeatureFlagContext;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Evaluate a feature flag with full details
|
|
18
|
+
* Uses endpoint: POST /feature-flags/:key/evaluate
|
|
19
|
+
*
|
|
20
|
+
* @param payload - Flag key and optional context
|
|
21
|
+
* @param options - Optional service options
|
|
22
|
+
* @returns Promise<EvaluateFlagResponse>
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* // Basic usage
|
|
27
|
+
* const result = await evaluateFeatureFlag({ key: 'experiment-a' });
|
|
28
|
+
* console.log(result.data.data.value); // 'variant-1'
|
|
29
|
+
* console.log(result.data.data.reason); // 'matched rule: premium users'
|
|
30
|
+
*
|
|
31
|
+
* // With context
|
|
32
|
+
* const result = await evaluateFeatureFlag({
|
|
33
|
+
* key: 'pricing-tier',
|
|
34
|
+
* context: { userId: 'user-123', attributes: { plan: 'enterprise' } }
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function evaluateFeatureFlag<TKey extends string = string, TEndpoints = EndpointsList>(payload: EvaluateFeatureFlagPayload<TKey>, options?: ServiceOptions<TEndpoints>): Promise<FetchResponse<EvaluateFlagResponse<TKey>>>;
|
|
39
|
+
//# sourceMappingURL=evaluateFeatureFlag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evaluateFeatureFlag.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/featureFlags/POST/evaluateFeatureFlag.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAmB,KAAK,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACnG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,0BAA0B,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM;IACtE,GAAG,EAAE,IAAI,CAAC;IACV,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,EAAE,UAAU,GAAG,aAAa,EAChG,OAAO,EAAE,0BAA0B,CAAC,IAAI,CAAC,EACzC,OAAO,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,GACnC,OAAO,CAAC,aAAa,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CA4BpD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature Flag POST Operations
|
|
3
|
+
* Exports all POST services and hooks for feature flags
|
|
4
|
+
*/
|
|
5
|
+
export { checkFeatureFlagEnabled, type CheckFeatureFlagEnabledPayload, } from './checkFeatureFlagEnabled';
|
|
6
|
+
export { evaluateFeatureFlag, type EvaluateFeatureFlagPayload } from './evaluateFeatureFlag';
|
|
7
|
+
export { evaluateAllFeatureFlags, type EvaluateAllFeatureFlagsPayload, } from './evaluateAllFeatureFlags';
|
|
8
|
+
export { createFeatureFlag } from './createFeatureFlag';
|
|
9
|
+
export { setFeatureFlagOverride, type SetFeatureFlagOverridePayload, } from './setFeatureFlagOverride';
|
|
10
|
+
export { refreshFeatureFlagCache } from './refreshFeatureFlagCache';
|
|
11
|
+
export { useCheckFeatureFlagEnabled } from './useCheckFeatureFlagEnabled';
|
|
12
|
+
export { useEvaluateAllFeatureFlags } from './useEvaluateAllFeatureFlags';
|
|
13
|
+
export { useCreateFeatureFlag } from './useCreateFeatureFlag';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/featureFlags/POST/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,uBAAuB,EACvB,KAAK,8BAA8B,GACpC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,KAAK,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAC7F,OAAO,EACL,uBAAuB,EACvB,KAAK,8BAA8B,GACpC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,KAAK,6BAA6B,GACnC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refresh Feature Flag Cache Service
|
|
3
|
+
* Forces a refresh of the feature flag cache
|
|
4
|
+
*/
|
|
5
|
+
import type { ServiceOptions, RefreshCacheResponse } from '@plyaz/types/api';
|
|
6
|
+
import type { EndpointsList } from '@/api/endpoints';
|
|
7
|
+
import type { FetchResponse } from 'fetchff';
|
|
8
|
+
/**
|
|
9
|
+
* Force refresh of the feature flag cache
|
|
10
|
+
* Uses endpoint: POST /feature-flags/refresh
|
|
11
|
+
*
|
|
12
|
+
* @param options - Optional service options
|
|
13
|
+
* @returns Promise<RefreshCacheResponse>
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* // Force refresh after flag updates
|
|
18
|
+
* await refreshFeatureFlagCache();
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function refreshFeatureFlagCache<TEndpoints = EndpointsList>(options?: ServiceOptions<TEndpoints>): Promise<FetchResponse<RefreshCacheResponse>>;
|
|
22
|
+
//# sourceMappingURL=refreshFeatureFlagCache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refreshFeatureFlagCache.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/featureFlags/POST/refreshFeatureFlagCache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;;;;;;;;GAYG;AACH,wBAAsB,uBAAuB,CAAC,UAAU,GAAG,aAAa,EACtE,OAAO,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,GACnC,OAAO,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC,CAe9C"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Set Feature Flag Override Service
|
|
3
|
+
* Sets a manual override for a feature flag
|
|
4
|
+
*/
|
|
5
|
+
import { type ServiceOptions, type SetOverrideResponse } from '@plyaz/types/api';
|
|
6
|
+
import type { FeatureFlagValue } from '@plyaz/types/features';
|
|
7
|
+
import type { EndpointsList } from '@/api/endpoints';
|
|
8
|
+
import type { FetchResponse } from 'fetchff';
|
|
9
|
+
/**
|
|
10
|
+
* Request payload for setFeatureFlagOverride
|
|
11
|
+
*/
|
|
12
|
+
export interface SetFeatureFlagOverridePayload<TKey extends string = string> {
|
|
13
|
+
key: TKey;
|
|
14
|
+
value: FeatureFlagValue;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Set a manual override for a feature flag
|
|
18
|
+
* Uses endpoint: POST /feature-flags/:key/override
|
|
19
|
+
*
|
|
20
|
+
* @param payload - Flag key and override value
|
|
21
|
+
* @param options - Optional service options
|
|
22
|
+
* @returns Promise<SetOverrideResponse>
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* // Override a flag to true for testing
|
|
27
|
+
* await setFeatureFlagOverride({
|
|
28
|
+
* key: 'new-feature',
|
|
29
|
+
* value: true
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function setFeatureFlagOverride<TKey extends string = string, TEndpoints = EndpointsList>(payload: SetFeatureFlagOverridePayload<TKey>, options?: ServiceOptions<TEndpoints>): Promise<FetchResponse<SetOverrideResponse>>;
|
|
34
|
+
//# sourceMappingURL=setFeatureFlagOverride.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setFeatureFlagOverride.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/featureFlags/POST/setFeatureFlagOverride.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAmB,KAAK,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAClG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,6BAA6B,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM;IACzE,GAAG,EAAE,IAAI,CAAC;IACV,KAAK,EAAE,gBAAgB,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,SAAS,MAAM,GAAG,MAAM,EAC5B,UAAU,GAAG,aAAa,EAE1B,OAAO,EAAE,6BAA6B,CAAC,IAAI,CAAC,EAC5C,OAAO,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,GACnC,OAAO,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC,CA2B7C"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Query Mutation Hook for Checking Feature Flag
|
|
3
|
+
* Checks if a feature flag is enabled for the given context
|
|
4
|
+
*/
|
|
5
|
+
import { createApiMutation } from '../../../hooks/factories';
|
|
6
|
+
import { type CheckFeatureFlagEnabledPayload } from './checkFeatureFlagEnabled';
|
|
7
|
+
import type { IsEnabledResponse, ServiceOptions, FeatureFlagErrorResponse } from '@plyaz/types/api';
|
|
8
|
+
import type { EndpointsList } from '@/api/endpoints';
|
|
9
|
+
/**
|
|
10
|
+
* Hook for checking if a feature flag is enabled
|
|
11
|
+
*
|
|
12
|
+
* @param serviceOptions - Service options (apiClient, apiConfig, updateConfigOptions)
|
|
13
|
+
* @param mutationOptions - React Query mutation options
|
|
14
|
+
* @returns React Query mutation result
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* // Basic usage
|
|
19
|
+
* const { mutateAsync, isPending } = useCheckFeatureFlagEnabled();
|
|
20
|
+
*
|
|
21
|
+
* const checkFlag = async () => {
|
|
22
|
+
* const result = await mutateAsync({ key: 'new-feature' });
|
|
23
|
+
* if (result.isEnabled) {
|
|
24
|
+
* // Show new feature
|
|
25
|
+
* }
|
|
26
|
+
* };
|
|
27
|
+
*
|
|
28
|
+
* // With context
|
|
29
|
+
* const result = await mutateAsync({
|
|
30
|
+
* key: 'premium-feature',
|
|
31
|
+
* context: { userId: 'user-123', userRole: 'premium' }
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* // In component with immediate check
|
|
35
|
+
* useEffect(() => {
|
|
36
|
+
* mutateAsync({ key: 'feature-x', context: userContext })
|
|
37
|
+
* .then(r => setFeatureEnabled(r.isEnabled));
|
|
38
|
+
* }, [userContext]);
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function useCheckFeatureFlagEnabled<TKey extends string = string, TEndpoints = EndpointsList>(serviceOptions?: ServiceOptions<TEndpoints>, mutationOptions?: Parameters<ReturnType<typeof createApiMutation<IsEnabledResponse, FeatureFlagErrorResponse, CheckFeatureFlagEnabledPayload<TKey>, unknown, TEndpoints>>>[1]): ReturnType<ReturnType<typeof createApiMutation<IsEnabledResponse, FeatureFlagErrorResponse, CheckFeatureFlagEnabledPayload<TKey>, unknown, TEndpoints>>>;
|
|
42
|
+
//# sourceMappingURL=useCheckFeatureFlagEnabled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCheckFeatureFlagEnabled.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/featureFlags/POST/useCheckFeatureFlagEnabled.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAEL,KAAK,8BAA8B,EACpC,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACpG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,SAAS,MAAM,GAAG,MAAM,EAC5B,UAAU,GAAG,aAAa,EAE1B,cAAc,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,EAC3C,eAAe,CAAC,EAAE,UAAU,CAC1B,UAAU,CACR,OAAO,iBAAiB,CACtB,iBAAiB,EACjB,wBAAwB,EACxB,8BAA8B,CAAC,IAAI,CAAC,EACpC,OAAO,EACP,UAAU,CACX,CACF,CACF,CAAC,CAAC,CAAC,GACH,UAAU,CACX,UAAU,CACR,OAAO,iBAAiB,CACtB,iBAAiB,EACjB,wBAAwB,EACxB,8BAA8B,CAAC,IAAI,CAAC,EACpC,OAAO,EACP,UAAU,CACX,CACF,CACF,CAQA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Query Mutation Hook for Creating Feature Flags
|
|
3
|
+
*/
|
|
4
|
+
import { createApiMutation } from '../../../hooks/factories';
|
|
5
|
+
import type { CreateFlagResponse, ServiceOptions, FeatureFlagErrorResponse } from '@plyaz/types/api';
|
|
6
|
+
import type { CreateFlagRequest } from '@plyaz/types/features';
|
|
7
|
+
import type { EndpointsList } from '@/api/endpoints';
|
|
8
|
+
/**
|
|
9
|
+
* Hook for creating feature flags
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const { mutate } = useCreateFeatureFlag();
|
|
14
|
+
* mutate({
|
|
15
|
+
* key: 'new-feature',
|
|
16
|
+
* name: 'New Feature',
|
|
17
|
+
* defaultValue: false
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function useCreateFeatureFlag<TKey extends string = string, TEndpoints = EndpointsList>(serviceOptions?: ServiceOptions<TEndpoints>, mutationOptions?: Parameters<ReturnType<typeof createApiMutation<CreateFlagResponse<TKey>, FeatureFlagErrorResponse, CreateFlagRequest<TKey>, unknown, TEndpoints>>>[1]): ReturnType<ReturnType<typeof createApiMutation<CreateFlagResponse<TKey>, FeatureFlagErrorResponse, CreateFlagRequest<TKey>, unknown, TEndpoints>>>;
|
|
22
|
+
//# sourceMappingURL=useCreateFeatureFlag.d.ts.map
|