@decaf-ts/integrations 0.3.12 → 0.4.1-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/README.md +11 -3
- package/dist/integrations.cjs +445 -7
- package/dist/integrations.js +479 -8
- package/jest.config.cjs +1 -1
- package/lib/cjs/feature-flags/constants.cjs +16 -0
- package/lib/cjs/feature-flags/decorators.cjs +65 -0
- package/lib/cjs/feature-flags/environment.cjs +26 -0
- package/lib/cjs/feature-flags/index.cjs +31 -0
- package/lib/cjs/feature-flags/models/FeatureFlag.model.cjs +81 -0
- package/lib/cjs/feature-flags/models/FeatureFlagAccess.model.cjs +78 -0
- package/lib/cjs/feature-flags/readers/FeatureFlagReader.cjs +25 -0
- package/lib/cjs/feature-flags/readers/index.cjs +19 -0
- package/lib/cjs/feature-flags/services/FeatureFlag.service.cjs +259 -0
- package/lib/cjs/feature-flags/types.cjs +4 -0
- package/lib/cjs/feature-flags/utils.cjs +141 -0
- package/lib/cjs/graph/engine/execution/SwitchGraphNodeExecutor.cjs +9 -9
- package/lib/cjs/graph/shared/nodes/flow-control.cjs +4 -3
- package/lib/cjs/graph/shared/types.cjs +2 -2
- package/lib/cjs/index.cjs +6 -5
- package/lib/cjs/kibana/builders/KibanaIndexBuilder.cjs +329 -0
- package/lib/cjs/kibana/builders/KibanaIndexBuilderCollection.cjs +37 -0
- package/lib/cjs/kibana/builders/index.cjs +20 -0
- package/lib/cjs/kibana/helpers.cjs +20 -16
- package/lib/cjs/kibana/index.cjs +3 -2
- package/lib/cjs/kibana/types.cjs +11 -2
- package/lib/cjs/loader/ObjectLoader.cjs +154 -0
- package/lib/cjs/loader/families.cjs +78 -0
- package/lib/cjs/loader/index.cjs +28 -0
- package/lib/cjs/loader/types.cjs +4 -0
- package/lib/cjs/nest/decorators.cjs +17 -0
- package/lib/cjs/nest/index.cjs +3 -3
- package/lib/cjs/nest/keycloakAuthHandler.cjs +74 -35
- package/lib/cjs/nest/keycloakModule.cjs +7 -10
- package/lib/cjs/nest/types.cjs +2 -2
- package/lib/cjs/nest/utils.cjs +58 -50
- package/lib/cjs/plugins/contract.cjs +76 -0
- package/lib/cjs/plugins/index.cjs +35 -0
- package/lib/cjs/plugins/kibana/host.cjs +24 -0
- package/lib/cjs/plugins/kibana/index.cjs +38 -0
- package/lib/cjs/plugins/kibana/installer.cjs +180 -0
- package/lib/cjs/plugins/kibana/manifest.cjs +33 -0
- package/lib/cjs/plugins/kibana/templates.cjs +503 -0
- package/lib/cjs/plugins/kibana/types.cjs +33 -0
- package/lib/cjs/plugins/superset/host.cjs +26 -0
- package/lib/cjs/plugins/superset/index.cjs +40 -0
- package/lib/cjs/plugins/superset/installer.cjs +232 -0
- package/lib/cjs/plugins/superset/manifest.cjs +35 -0
- package/lib/cjs/plugins/superset/templates.cjs +844 -0
- package/lib/cjs/plugins/superset/types.cjs +39 -0
- package/lib/esm/feature-flags/constants.js +12 -0
- package/lib/esm/feature-flags/decorators.js +49 -0
- package/lib/esm/feature-flags/environment.js +18 -0
- package/lib/esm/feature-flags/index.js +14 -0
- package/lib/esm/feature-flags/models/FeatureFlag.model.js +72 -0
- package/lib/esm/feature-flags/models/FeatureFlagAccess.model.js +69 -0
- package/lib/esm/feature-flags/readers/FeatureFlagReader.js +19 -0
- package/lib/esm/feature-flags/readers/index.js +2 -0
- package/lib/esm/feature-flags/services/FeatureFlag.service.js +250 -0
- package/lib/esm/feature-flags/types.js +2 -0
- package/lib/esm/feature-flags/utils.js +126 -0
- package/lib/esm/graph/engine/execution/SwitchGraphNodeExecutor.js +8 -8
- package/lib/esm/graph/shared/nodes/flow-control.js +3 -2
- package/lib/esm/graph/shared/types.js +1 -1
- package/lib/esm/index.js +5 -4
- package/lib/esm/kibana/builders/KibanaIndexBuilder.js +319 -0
- package/lib/esm/kibana/builders/KibanaIndexBuilderCollection.js +32 -0
- package/lib/esm/kibana/builders/index.js +3 -0
- package/lib/esm/kibana/helpers.js +19 -15
- package/lib/esm/kibana/index.js +2 -1
- package/lib/esm/kibana/types.js +13 -2
- package/lib/esm/loader/ObjectLoader.js +115 -0
- package/lib/esm/loader/families.js +66 -0
- package/lib/esm/loader/index.js +11 -0
- package/lib/esm/loader/types.js +2 -0
- package/lib/esm/nest/decorators.js +12 -0
- package/lib/esm/nest/index.js +2 -2
- package/lib/esm/nest/keycloakAuthHandler.js +67 -35
- package/lib/esm/nest/keycloakModule.js +7 -10
- package/lib/esm/nest/types.js +1 -1
- package/lib/esm/nest/utils.js +55 -46
- package/lib/esm/plugins/contract.js +68 -0
- package/lib/esm/plugins/index.js +18 -0
- package/lib/esm/plugins/kibana/host.js +19 -0
- package/lib/esm/plugins/kibana/index.js +14 -0
- package/lib/esm/plugins/kibana/installer.js +140 -0
- package/lib/esm/plugins/kibana/manifest.js +32 -0
- package/lib/esm/plugins/kibana/templates.js +499 -0
- package/lib/esm/plugins/kibana/types.js +10 -0
- package/lib/esm/plugins/superset/host.js +21 -0
- package/lib/esm/plugins/superset/index.js +16 -0
- package/lib/esm/plugins/superset/installer.js +192 -0
- package/lib/esm/plugins/superset/manifest.js +30 -0
- package/lib/esm/plugins/superset/templates.js +840 -0
- package/lib/esm/plugins/superset/types.js +11 -0
- package/lib/types/feature-flags/constants.d.cts +11 -0
- package/lib/types/feature-flags/constants.d.mts +11 -0
- package/lib/types/feature-flags/decorators.d.cts +11 -0
- package/lib/types/feature-flags/decorators.d.mts +11 -0
- package/lib/types/feature-flags/environment.d.cts +11 -0
- package/lib/types/feature-flags/environment.d.mts +11 -0
- package/lib/types/feature-flags/index.d.cts +13 -0
- package/lib/types/feature-flags/index.d.mts +13 -0
- package/lib/types/feature-flags/models/FeatureFlag.model.d.cts +16 -0
- package/lib/types/feature-flags/models/FeatureFlag.model.d.mts +16 -0
- package/lib/types/feature-flags/models/FeatureFlagAccess.model.d.cts +15 -0
- package/lib/types/feature-flags/models/FeatureFlagAccess.model.d.mts +15 -0
- package/lib/types/feature-flags/readers/FeatureFlagReader.d.cts +10 -0
- package/lib/types/feature-flags/readers/FeatureFlagReader.d.mts +10 -0
- package/lib/types/feature-flags/readers/index.d.cts +1 -0
- package/lib/types/feature-flags/readers/index.d.mts +1 -0
- package/lib/types/feature-flags/services/FeatureFlag.service.d.cts +43 -0
- package/lib/types/feature-flags/services/FeatureFlag.service.d.mts +43 -0
- package/lib/types/feature-flags/types.d.cts +39 -0
- package/lib/types/feature-flags/types.d.mts +39 -0
- package/lib/types/feature-flags/utils.d.cts +13 -0
- package/lib/types/feature-flags/utils.d.mts +13 -0
- package/lib/types/graph/engine/execution/SwitchGraphNodeExecutor.d.cts +2 -2
- package/lib/types/graph/engine/execution/SwitchGraphNodeExecutor.d.mts +2 -2
- package/lib/types/graph/shared/types.d.cts +3 -3
- package/lib/types/graph/shared/types.d.mts +3 -3
- package/lib/types/index.d.cts +3 -2
- package/lib/types/index.d.mts +3 -2
- package/lib/types/kibana/builders/KibanaIndexBuilder.d.cts +67 -0
- package/lib/types/kibana/builders/KibanaIndexBuilder.d.mts +67 -0
- package/lib/types/kibana/builders/KibanaIndexBuilderCollection.d.cts +17 -0
- package/lib/types/kibana/builders/KibanaIndexBuilderCollection.d.mts +17 -0
- package/lib/types/kibana/builders/index.d.cts +2 -0
- package/lib/types/kibana/builders/index.d.mts +2 -0
- package/lib/types/kibana/index.d.cts +1 -0
- package/lib/types/kibana/index.d.mts +1 -0
- package/lib/types/kibana/types.d.cts +11 -0
- package/lib/types/kibana/types.d.mts +11 -0
- package/lib/types/loader/ObjectLoader.d.cts +27 -0
- package/lib/types/loader/ObjectLoader.d.mts +27 -0
- package/lib/types/loader/families.d.cts +34 -0
- package/lib/types/loader/families.d.mts +34 -0
- package/lib/types/loader/index.d.cts +10 -0
- package/lib/types/loader/index.d.mts +10 -0
- package/lib/types/loader/types.d.cts +24 -0
- package/lib/types/loader/types.d.mts +24 -0
- package/lib/types/nest/decorators.d.cts +8 -0
- package/lib/types/nest/decorators.d.mts +8 -0
- package/lib/types/nest/index.d.cts +1 -1
- package/lib/types/nest/index.d.mts +1 -1
- package/lib/types/nest/keycloakAuthHandler.d.cts +19 -42
- package/lib/types/nest/keycloakAuthHandler.d.mts +19 -42
- package/lib/types/nest/keycloakModule.d.cts +3 -5
- package/lib/types/nest/keycloakModule.d.mts +3 -5
- package/lib/types/nest/types.d.cts +2 -0
- package/lib/types/nest/types.d.mts +2 -0
- package/lib/types/nest/utils.d.cts +3 -4
- package/lib/types/nest/utils.d.mts +3 -4
- package/lib/types/plugins/contract.d.cts +180 -0
- package/lib/types/plugins/contract.d.mts +180 -0
- package/lib/types/plugins/index.d.cts +17 -0
- package/lib/types/plugins/index.d.mts +17 -0
- package/lib/types/plugins/kibana/host.d.cts +18 -0
- package/lib/types/plugins/kibana/host.d.mts +18 -0
- package/lib/types/plugins/kibana/index.d.cts +13 -0
- package/lib/types/plugins/kibana/index.d.mts +13 -0
- package/lib/types/plugins/kibana/installer.d.cts +45 -0
- package/lib/types/plugins/kibana/installer.d.mts +45 -0
- package/lib/types/plugins/kibana/manifest.d.cts +31 -0
- package/lib/types/plugins/kibana/manifest.d.mts +31 -0
- package/lib/types/plugins/kibana/templates.d.cts +12 -0
- package/lib/types/plugins/kibana/templates.d.mts +12 -0
- package/lib/types/plugins/kibana/types.d.cts +9 -0
- package/lib/types/plugins/kibana/types.d.mts +9 -0
- package/lib/types/plugins/superset/host.d.cts +20 -0
- package/lib/types/plugins/superset/host.d.mts +20 -0
- package/lib/types/plugins/superset/index.d.cts +15 -0
- package/lib/types/plugins/superset/index.d.mts +15 -0
- package/lib/types/plugins/superset/installer.d.cts +70 -0
- package/lib/types/plugins/superset/installer.d.mts +70 -0
- package/lib/types/plugins/superset/manifest.d.cts +28 -0
- package/lib/types/plugins/superset/manifest.d.mts +28 -0
- package/lib/types/plugins/superset/templates.d.cts +12 -0
- package/lib/types/plugins/superset/templates.d.mts +12 -0
- package/lib/types/plugins/superset/types.d.cts +10 -0
- package/lib/types/plugins/superset/types.d.mts +10 -0
- package/package.json +62 -3
- package/plugins/kibana/.gitignore +16 -0
- package/plugins/kibana/Dockerfile +19 -0
- package/plugins/kibana/docker-compose.yml +50 -0
- package/plugins/kibana/host/index.html +101 -0
- package/plugins/kibana/setup-dashboards.sh +84 -0
- package/plugins/superset/.gitignore +17 -0
- package/plugins/superset/Dockerfile +79 -0
- package/plugins/superset/docker-compose.yml +62 -0
- package/plugins/superset/host/index.html +168 -0
- package/plugins/superset/setup-dashboards.sh +106 -0
- package/plugins/superset/superset_config.py +49 -0
- package/lib/cjs/nest/authService.cjs +0 -91
- package/lib/esm/nest/authService.js +0 -86
- package/lib/types/nest/authService.d.cts +0 -63
- package/lib/types/nest/authService.d.mts +0 -63
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module integrations/plugins/superset/types
|
|
3
|
+
* @summary Superset embed plugin types.
|
|
4
|
+
* @description Re-exports the shared contract types and Superset-specific
|
|
5
|
+
* constants/types for the org-agnostic dashboard embed plugin.
|
|
6
|
+
*/
|
|
7
|
+
export * from "./../contract.js";
|
|
8
|
+
export { SUPERSET_PLUGIN_ID, SUPERSET_APP_ID, SUPERSET_PLUGIN_VERSION, buildSupersetManifest, } from "./manifest.js";
|
|
9
|
+
export { supersetPatchFiles } from "./templates.js";
|
|
10
|
+
export { SupersetDashboardEmbedPlugin, supersetDashboardEmbedPlugin, createSupersetDashboardEmbedPlugin, buildSupersetEmbedUrl, SUPERSET_DEFAULT_BASE_PATH, } from "./installer.js";
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvcGx1Z2lucy9zdXBlcnNldC90eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7R0FLRztBQUNILGlDQUE0QjtBQUM1QixPQUFPLEVBQ0wsa0JBQWtCLEVBQ2xCLGVBQWUsRUFDZix1QkFBdUIsRUFDdkIscUJBQXFCLEdBRXRCLHNCQUFtQjtBQUNwQixPQUFPLEVBQUUsa0JBQWtCLEVBQTBCLHVCQUFvQjtBQUN6RSxPQUFPLEVBQ0wsNEJBQTRCLEVBQzVCLDRCQUE0QixFQUM1QixrQ0FBa0MsRUFDbEMscUJBQXFCLEVBQ3JCLDBCQUEwQixHQUUzQix1QkFBb0IiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBtb2R1bGUgaW50ZWdyYXRpb25zL3BsdWdpbnMvc3VwZXJzZXQvdHlwZXNcbiAqIEBzdW1tYXJ5IFN1cGVyc2V0IGVtYmVkIHBsdWdpbiB0eXBlcy5cbiAqIEBkZXNjcmlwdGlvbiBSZS1leHBvcnRzIHRoZSBzaGFyZWQgY29udHJhY3QgdHlwZXMgYW5kIFN1cGVyc2V0LXNwZWNpZmljXG4gKiBjb25zdGFudHMvdHlwZXMgZm9yIHRoZSBvcmctYWdub3N0aWMgZGFzaGJvYXJkIGVtYmVkIHBsdWdpbi5cbiAqL1xuZXhwb3J0ICogZnJvbSBcIi4uL2NvbnRyYWN0XCI7XG5leHBvcnQge1xuICBTVVBFUlNFVF9QTFVHSU5fSUQsXG4gIFNVUEVSU0VUX0FQUF9JRCxcbiAgU1VQRVJTRVRfUExVR0lOX1ZFUlNJT04sXG4gIGJ1aWxkU3VwZXJzZXRNYW5pZmVzdCxcbiAgdHlwZSBTdXBlcnNldE1hbmlmZXN0LFxufSBmcm9tIFwiLi9tYW5pZmVzdFwiO1xuZXhwb3J0IHsgc3VwZXJzZXRQYXRjaEZpbGVzLCB0eXBlIFN1cGVyc2V0UGF0Y2hGaWxlIH0gZnJvbSBcIi4vdGVtcGxhdGVzXCI7XG5leHBvcnQge1xuICBTdXBlcnNldERhc2hib2FyZEVtYmVkUGx1Z2luLFxuICBzdXBlcnNldERhc2hib2FyZEVtYmVkUGx1Z2luLFxuICBjcmVhdGVTdXBlcnNldERhc2hib2FyZEVtYmVkUGx1Z2luLFxuICBidWlsZFN1cGVyc2V0RW1iZWRVcmwsXG4gIFNVUEVSU0VUX0RFRkFVTFRfQkFTRV9QQVRILFxuICB0eXBlIFN1cGVyc2V0SW5zdGFsbE9wdGlvbnMsXG59IGZyb20gXCIuL2luc3RhbGxlclwiO1xuIl19
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module integrations/feature-flags
|
|
3
|
+
* @summary Feature flag constants and metadata keys.
|
|
4
|
+
*/
|
|
5
|
+
export declare const FEATURE_FLAG_ENV_ROOT = "featureFlag";
|
|
6
|
+
export declare const FEATURE_FLAG_ENV_PREFIX = "FEATURE_FLAG";
|
|
7
|
+
export declare const FEATURE_FLAG_MODEL_KEY = "feature-flags:model";
|
|
8
|
+
export declare const FEATURE_FLAG_AUTH_KEY = "feature-flags:auth";
|
|
9
|
+
export declare const FEATURE_FLAG_BLOCK_KEY = "feature-flags:block";
|
|
10
|
+
export declare const FEATURE_FLAG_RENDER_KEY = "feature-flags:render-if";
|
|
11
|
+
export declare const FEATURE_FLAG_HIDE_KEY = "feature-flags:hide-on";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module integrations/feature-flags
|
|
3
|
+
* @summary Feature flag constants and metadata keys.
|
|
4
|
+
*/
|
|
5
|
+
export declare const FEATURE_FLAG_ENV_ROOT = "featureFlag";
|
|
6
|
+
export declare const FEATURE_FLAG_ENV_PREFIX = "FEATURE_FLAG";
|
|
7
|
+
export declare const FEATURE_FLAG_MODEL_KEY = "feature-flags:model";
|
|
8
|
+
export declare const FEATURE_FLAG_AUTH_KEY = "feature-flags:auth";
|
|
9
|
+
export declare const FEATURE_FLAG_BLOCK_KEY = "feature-flags:block";
|
|
10
|
+
export declare const FEATURE_FLAG_RENDER_KEY = "feature-flags:render-if";
|
|
11
|
+
export declare const FEATURE_FLAG_HIDE_KEY = "feature-flags:hide-on";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FEATURE_FLAG_AUTH_KEY, FEATURE_FLAG_BLOCK_KEY, FEATURE_FLAG_HIDE_KEY, FEATURE_FLAG_MODEL_KEY, FEATURE_FLAG_RENDER_KEY } from "./constants.d.cts";
|
|
2
|
+
import type { FeatureFlagRule } from "./types.d.cts";
|
|
3
|
+
export declare function featureFlags(...features: string[]): (target: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor) => any;
|
|
4
|
+
export declare function featureAuth(...features: string[]): (target: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor) => any;
|
|
5
|
+
export declare function blockFeatureOperations(...features: string[]): (target: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor) => any;
|
|
6
|
+
export declare function renderIfFeature(...features: string[]): (target: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor) => any;
|
|
7
|
+
export declare function hideOnFeature(...features: string[]): (target: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor) => any;
|
|
8
|
+
export declare function getFeatureGateMetadata(target: object, key: typeof FEATURE_FLAG_MODEL_KEY | typeof FEATURE_FLAG_AUTH_KEY | typeof FEATURE_FLAG_BLOCK_KEY | typeof FEATURE_FLAG_RENDER_KEY | typeof FEATURE_FLAG_HIDE_KEY, propertyKey?: string | symbol): FeatureFlagRule | undefined;
|
|
9
|
+
export declare function shouldExposeForFeatures(target: object, enabledFeatures: Record<string, unknown>, key: typeof FEATURE_FLAG_MODEL_KEY | typeof FEATURE_FLAG_AUTH_KEY | typeof FEATURE_FLAG_BLOCK_KEY | typeof FEATURE_FLAG_RENDER_KEY | typeof FEATURE_FLAG_HIDE_KEY, propertyKey?: string | symbol): boolean;
|
|
10
|
+
export declare function shouldHideForFeatures(target: object, enabledFeatures: Record<string, unknown>, key: typeof FEATURE_FLAG_MODEL_KEY | typeof FEATURE_FLAG_AUTH_KEY | typeof FEATURE_FLAG_BLOCK_KEY | typeof FEATURE_FLAG_RENDER_KEY | typeof FEATURE_FLAG_HIDE_KEY, propertyKey?: string | symbol): boolean;
|
|
11
|
+
export { FEATURE_FLAG_AUTH_KEY, FEATURE_FLAG_BLOCK_KEY, FEATURE_FLAG_HIDE_KEY, FEATURE_FLAG_MODEL_KEY, FEATURE_FLAG_RENDER_KEY, };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FEATURE_FLAG_AUTH_KEY, FEATURE_FLAG_BLOCK_KEY, FEATURE_FLAG_HIDE_KEY, FEATURE_FLAG_MODEL_KEY, FEATURE_FLAG_RENDER_KEY } from "./constants.d.mts";
|
|
2
|
+
import type { FeatureFlagRule } from "./types.d.mts";
|
|
3
|
+
export declare function featureFlags(...features: string[]): (target: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor) => any;
|
|
4
|
+
export declare function featureAuth(...features: string[]): (target: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor) => any;
|
|
5
|
+
export declare function blockFeatureOperations(...features: string[]): (target: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor) => any;
|
|
6
|
+
export declare function renderIfFeature(...features: string[]): (target: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor) => any;
|
|
7
|
+
export declare function hideOnFeature(...features: string[]): (target: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor) => any;
|
|
8
|
+
export declare function getFeatureGateMetadata(target: object, key: typeof FEATURE_FLAG_MODEL_KEY | typeof FEATURE_FLAG_AUTH_KEY | typeof FEATURE_FLAG_BLOCK_KEY | typeof FEATURE_FLAG_RENDER_KEY | typeof FEATURE_FLAG_HIDE_KEY, propertyKey?: string | symbol): FeatureFlagRule | undefined;
|
|
9
|
+
export declare function shouldExposeForFeatures(target: object, enabledFeatures: Record<string, unknown>, key: typeof FEATURE_FLAG_MODEL_KEY | typeof FEATURE_FLAG_AUTH_KEY | typeof FEATURE_FLAG_BLOCK_KEY | typeof FEATURE_FLAG_RENDER_KEY | typeof FEATURE_FLAG_HIDE_KEY, propertyKey?: string | symbol): boolean;
|
|
10
|
+
export declare function shouldHideForFeatures(target: object, enabledFeatures: Record<string, unknown>, key: typeof FEATURE_FLAG_MODEL_KEY | typeof FEATURE_FLAG_AUTH_KEY | typeof FEATURE_FLAG_BLOCK_KEY | typeof FEATURE_FLAG_RENDER_KEY | typeof FEATURE_FLAG_HIDE_KEY, propertyKey?: string | symbol): boolean;
|
|
11
|
+
export { FEATURE_FLAG_AUTH_KEY, FEATURE_FLAG_BLOCK_KEY, FEATURE_FLAG_HIDE_KEY, FEATURE_FLAG_MODEL_KEY, FEATURE_FLAG_RENDER_KEY, };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FEATURE_FLAG_ENV_ROOT, FEATURE_FLAG_ENV_PREFIX } from "./constants.d.cts";
|
|
2
|
+
import type { FeatureFlagEnvironmentShape, FeatureFlagRegistry, FeatureFlagValue } from "./types.d.cts";
|
|
3
|
+
export declare const FeatureFlagEnvironment: import("@decaf-ts/logging").AccumulatedEnvironment<{
|
|
4
|
+
app: string | undefined;
|
|
5
|
+
} & import("@decaf-ts/logging").LoggingConfig<object> & {
|
|
6
|
+
env: any;
|
|
7
|
+
} & FeatureFlagEnvironmentShape>;
|
|
8
|
+
export declare function loadFeatureFlagsFromEnvironment(source?: Pick<FeatureFlagEnvironmentShape, "featureFlag">): Promise<FeatureFlagRegistry>;
|
|
9
|
+
export declare function resolveFeatureFlagFromEnvironment(featureName: string, source?: Pick<FeatureFlagEnvironmentShape, "featureFlag">): Promise<FeatureFlagValue | undefined>;
|
|
10
|
+
export declare function hasFeatureFlagInEnvironment(featureName: string, source?: Pick<FeatureFlagEnvironmentShape, "featureFlag">): Promise<boolean>;
|
|
11
|
+
export { FEATURE_FLAG_ENV_PREFIX, FEATURE_FLAG_ENV_ROOT };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FEATURE_FLAG_ENV_ROOT, FEATURE_FLAG_ENV_PREFIX } from "./constants.d.mts";
|
|
2
|
+
import type { FeatureFlagEnvironmentShape, FeatureFlagRegistry, FeatureFlagValue } from "./types.d.mts";
|
|
3
|
+
export declare const FeatureFlagEnvironment: import("@decaf-ts/logging").AccumulatedEnvironment<{
|
|
4
|
+
app: string | undefined;
|
|
5
|
+
} & import("@decaf-ts/logging").LoggingConfig<object> & {
|
|
6
|
+
env: any;
|
|
7
|
+
} & FeatureFlagEnvironmentShape>;
|
|
8
|
+
export declare function loadFeatureFlagsFromEnvironment(source?: Pick<FeatureFlagEnvironmentShape, "featureFlag">): Promise<FeatureFlagRegistry>;
|
|
9
|
+
export declare function resolveFeatureFlagFromEnvironment(featureName: string, source?: Pick<FeatureFlagEnvironmentShape, "featureFlag">): Promise<FeatureFlagValue | undefined>;
|
|
10
|
+
export declare function hasFeatureFlagInEnvironment(featureName: string, source?: Pick<FeatureFlagEnvironmentShape, "featureFlag">): Promise<boolean>;
|
|
11
|
+
export { FEATURE_FLAG_ENV_PREFIX, FEATURE_FLAG_ENV_ROOT };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module integrations/feature-flags
|
|
3
|
+
* @summary Feature-flag models, services, decorators, and environment helpers.
|
|
4
|
+
*/
|
|
5
|
+
export * from "./constants.d.cts";
|
|
6
|
+
export * from "./types.d.cts";
|
|
7
|
+
export * from "./utils.d.cts";
|
|
8
|
+
export * from "./environment.d.cts";
|
|
9
|
+
export * from "./models/FeatureFlag.model.d.cts";
|
|
10
|
+
export * from "./models/FeatureFlagAccess.model.d.cts";
|
|
11
|
+
export * from "./readers/index.d.cts";
|
|
12
|
+
export * from "./services/FeatureFlag.service.d.cts";
|
|
13
|
+
export * from "./decorators.d.cts";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module integrations/feature-flags
|
|
3
|
+
* @summary Feature-flag models, services, decorators, and environment helpers.
|
|
4
|
+
*/
|
|
5
|
+
export * from "./constants.d.mts";
|
|
6
|
+
export * from "./types.d.mts";
|
|
7
|
+
export * from "./utils.d.mts";
|
|
8
|
+
export * from "./environment.d.mts";
|
|
9
|
+
export * from "./models/FeatureFlag.model.d.mts";
|
|
10
|
+
export * from "./models/FeatureFlagAccess.model.d.mts";
|
|
11
|
+
export * from "./readers/index.d.mts";
|
|
12
|
+
export * from "./services/FeatureFlag.service.d.mts";
|
|
13
|
+
export * from "./decorators.d.mts";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseModel } from "@decaf-ts/core";
|
|
2
|
+
import type { FeatureFlagConfig } from "../types.d.cts";
|
|
3
|
+
export declare class FeatureFlag extends BaseModel {
|
|
4
|
+
constructor(data?: Partial<FeatureFlag>);
|
|
5
|
+
id: string;
|
|
6
|
+
key: string;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
description?: string;
|
|
9
|
+
scope?: string;
|
|
10
|
+
metadata?: Record<string, unknown>;
|
|
11
|
+
config?: FeatureFlagConfig;
|
|
12
|
+
createdBy?: string;
|
|
13
|
+
updatedBy?: string;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
updatedAt: Date;
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseModel } from "@decaf-ts/core";
|
|
2
|
+
import type { FeatureFlagConfig } from "../types.d.mts";
|
|
3
|
+
export declare class FeatureFlag extends BaseModel {
|
|
4
|
+
constructor(data?: Partial<FeatureFlag>);
|
|
5
|
+
id: string;
|
|
6
|
+
key: string;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
description?: string;
|
|
9
|
+
scope?: string;
|
|
10
|
+
metadata?: Record<string, unknown>;
|
|
11
|
+
config?: FeatureFlagConfig;
|
|
12
|
+
createdBy?: string;
|
|
13
|
+
updatedBy?: string;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
updatedAt: Date;
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseModel } from "@decaf-ts/core";
|
|
2
|
+
import type { FeatureFlagAccessSubjectType } from "../types.d.cts";
|
|
3
|
+
export declare class FeatureFlagAccess extends BaseModel {
|
|
4
|
+
constructor(data?: Partial<FeatureFlagAccess>);
|
|
5
|
+
id: string;
|
|
6
|
+
featureKey: string;
|
|
7
|
+
subjectType: FeatureFlagAccessSubjectType | string;
|
|
8
|
+
subjectKey: string;
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
metadata?: Record<string, unknown>;
|
|
11
|
+
createdBy?: string;
|
|
12
|
+
updatedBy?: string;
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
updatedAt: Date;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseModel } from "@decaf-ts/core";
|
|
2
|
+
import type { FeatureFlagAccessSubjectType } from "../types.d.mts";
|
|
3
|
+
export declare class FeatureFlagAccess extends BaseModel {
|
|
4
|
+
constructor(data?: Partial<FeatureFlagAccess>);
|
|
5
|
+
id: string;
|
|
6
|
+
featureKey: string;
|
|
7
|
+
subjectType: FeatureFlagAccessSubjectType | string;
|
|
8
|
+
subjectKey: string;
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
metadata?: Record<string, unknown>;
|
|
11
|
+
createdBy?: string;
|
|
12
|
+
updatedBy?: string;
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
updatedAt: Date;
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FeatureFlagReaderInput, FeatureFlagRegistry, FeatureFlagValue } from "../types.d.cts";
|
|
2
|
+
export declare abstract class FeatureFlagReader {
|
|
3
|
+
abstract read(input?: FeatureFlagReaderInput): Promise<FeatureFlagRegistry>;
|
|
4
|
+
readOne(featureName: string, input?: FeatureFlagReaderInput): Promise<FeatureFlagValue | undefined>;
|
|
5
|
+
}
|
|
6
|
+
export declare class EnvironmeFlagReader extends FeatureFlagReader {
|
|
7
|
+
read(input?: FeatureFlagReaderInput): Promise<FeatureFlagRegistry>;
|
|
8
|
+
}
|
|
9
|
+
export type FeatureFlagReaderConstructor = new () => FeatureFlagReader;
|
|
10
|
+
export type FeatureFlagReaderLike = FeatureFlagReader | FeatureFlagReaderConstructor;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FeatureFlagReaderInput, FeatureFlagRegistry, FeatureFlagValue } from "../types.d.mts";
|
|
2
|
+
export declare abstract class FeatureFlagReader {
|
|
3
|
+
abstract read(input?: FeatureFlagReaderInput): Promise<FeatureFlagRegistry>;
|
|
4
|
+
readOne(featureName: string, input?: FeatureFlagReaderInput): Promise<FeatureFlagValue | undefined>;
|
|
5
|
+
}
|
|
6
|
+
export declare class EnvironmeFlagReader extends FeatureFlagReader {
|
|
7
|
+
read(input?: FeatureFlagReaderInput): Promise<FeatureFlagRegistry>;
|
|
8
|
+
}
|
|
9
|
+
export type FeatureFlagReaderConstructor = new () => FeatureFlagReader;
|
|
10
|
+
export type FeatureFlagReaderLike = FeatureFlagReader | FeatureFlagReaderConstructor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./FeatureFlagReader.d.cts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./FeatureFlagReader.d.mts";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ModelService, Repository } from "@decaf-ts/core";
|
|
2
|
+
import type { Repo } from "@decaf-ts/core";
|
|
3
|
+
import { FeatureFlagAccess } from "../models/FeatureFlagAccess.model.d.cts";
|
|
4
|
+
import { FeatureFlag } from "../models/FeatureFlag.model.d.cts";
|
|
5
|
+
import { FeatureFlagReader, FeatureFlagReaderLike } from "../readers/index.d.cts";
|
|
6
|
+
import type { FeatureFlagAccessInput, FeatureFlagAccessQuery, FeatureFlagAccessSubject, FeatureFlagReaderConfig, FeatureFlagReaderInput, FeatureFlagRegistry } from "../types.d.cts";
|
|
7
|
+
export interface FeatureFlagServiceConfig extends FeatureFlagReaderConfig {
|
|
8
|
+
reader?: FeatureFlagReaderLike;
|
|
9
|
+
repository?: Repository<FeatureFlag, any>;
|
|
10
|
+
}
|
|
11
|
+
export declare class FeatureFlagService extends ModelService<FeatureFlag> {
|
|
12
|
+
private reader;
|
|
13
|
+
private cachedRegistry;
|
|
14
|
+
protected accessRepository: Repo<FeatureFlagAccess>;
|
|
15
|
+
constructor();
|
|
16
|
+
initialize(...args: any[]): Promise<{
|
|
17
|
+
config: FeatureFlagServiceConfig;
|
|
18
|
+
client: FeatureFlagReader;
|
|
19
|
+
}>;
|
|
20
|
+
private cloneRegistry;
|
|
21
|
+
private refreshCachedRegistry;
|
|
22
|
+
private setCachedFlag;
|
|
23
|
+
private getAccessRepository;
|
|
24
|
+
private assertInitialized;
|
|
25
|
+
private normalizeFeatureAccessInput;
|
|
26
|
+
private buildAccessCondition;
|
|
27
|
+
create(model: FeatureFlag, ...args: any[]): Promise<FeatureFlag>;
|
|
28
|
+
update(model: FeatureFlag, ...args: any[]): Promise<FeatureFlag>;
|
|
29
|
+
findOneBy(key: keyof FeatureFlag, value: any, ...args: any[]): Promise<FeatureFlag>;
|
|
30
|
+
readAll(keys: any[], ...args: any[]): Promise<FeatureFlag[]>;
|
|
31
|
+
listEnabled(...args: any[]): Promise<FeatureFlag[]>;
|
|
32
|
+
grantFeatureAccess(input: FeatureFlagAccessInput, ...args: any[]): Promise<FeatureFlagAccess>;
|
|
33
|
+
revokeFeatureAccess(input: FeatureFlagAccessSubject & {
|
|
34
|
+
featureKey: string;
|
|
35
|
+
}, ...args: any[]): Promise<FeatureFlagAccess | undefined>;
|
|
36
|
+
findFeatureAccess(query: FeatureFlagAccessQuery, ...args: any[]): Promise<FeatureFlagAccess>;
|
|
37
|
+
listFeatureAccess(query: FeatureFlagAccessQuery, ...args: any[]): Promise<FeatureFlagAccess[]>;
|
|
38
|
+
resolveFeatureFlagsForSubject(subject: FeatureFlagAccessSubject, ...args: any[]): Promise<FeatureFlagRegistry>;
|
|
39
|
+
isEnabledForSubject(key: string, subject: FeatureFlagAccessSubject, ...args: any[]): Promise<boolean>;
|
|
40
|
+
isEnabled(key: string): boolean;
|
|
41
|
+
resolveFeatureFlags(): Promise<FeatureFlagRegistry>;
|
|
42
|
+
syncFromEnvironment(options?: FeatureFlagReaderInput, ...args: any[]): Promise<FeatureFlag[]>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ModelService, Repository } from "@decaf-ts/core";
|
|
2
|
+
import type { Repo } from "@decaf-ts/core";
|
|
3
|
+
import { FeatureFlagAccess } from "../models/FeatureFlagAccess.model.d.mts";
|
|
4
|
+
import { FeatureFlag } from "../models/FeatureFlag.model.d.mts";
|
|
5
|
+
import { FeatureFlagReader, FeatureFlagReaderLike } from "../readers/index.d.mts";
|
|
6
|
+
import type { FeatureFlagAccessInput, FeatureFlagAccessQuery, FeatureFlagAccessSubject, FeatureFlagReaderConfig, FeatureFlagReaderInput, FeatureFlagRegistry } from "../types.d.mts";
|
|
7
|
+
export interface FeatureFlagServiceConfig extends FeatureFlagReaderConfig {
|
|
8
|
+
reader?: FeatureFlagReaderLike;
|
|
9
|
+
repository?: Repository<FeatureFlag, any>;
|
|
10
|
+
}
|
|
11
|
+
export declare class FeatureFlagService extends ModelService<FeatureFlag> {
|
|
12
|
+
private reader;
|
|
13
|
+
private cachedRegistry;
|
|
14
|
+
protected accessRepository: Repo<FeatureFlagAccess>;
|
|
15
|
+
constructor();
|
|
16
|
+
initialize(...args: any[]): Promise<{
|
|
17
|
+
config: FeatureFlagServiceConfig;
|
|
18
|
+
client: FeatureFlagReader;
|
|
19
|
+
}>;
|
|
20
|
+
private cloneRegistry;
|
|
21
|
+
private refreshCachedRegistry;
|
|
22
|
+
private setCachedFlag;
|
|
23
|
+
private getAccessRepository;
|
|
24
|
+
private assertInitialized;
|
|
25
|
+
private normalizeFeatureAccessInput;
|
|
26
|
+
private buildAccessCondition;
|
|
27
|
+
create(model: FeatureFlag, ...args: any[]): Promise<FeatureFlag>;
|
|
28
|
+
update(model: FeatureFlag, ...args: any[]): Promise<FeatureFlag>;
|
|
29
|
+
findOneBy(key: keyof FeatureFlag, value: any, ...args: any[]): Promise<FeatureFlag>;
|
|
30
|
+
readAll(keys: any[], ...args: any[]): Promise<FeatureFlag[]>;
|
|
31
|
+
listEnabled(...args: any[]): Promise<FeatureFlag[]>;
|
|
32
|
+
grantFeatureAccess(input: FeatureFlagAccessInput, ...args: any[]): Promise<FeatureFlagAccess>;
|
|
33
|
+
revokeFeatureAccess(input: FeatureFlagAccessSubject & {
|
|
34
|
+
featureKey: string;
|
|
35
|
+
}, ...args: any[]): Promise<FeatureFlagAccess | undefined>;
|
|
36
|
+
findFeatureAccess(query: FeatureFlagAccessQuery, ...args: any[]): Promise<FeatureFlagAccess>;
|
|
37
|
+
listFeatureAccess(query: FeatureFlagAccessQuery, ...args: any[]): Promise<FeatureFlagAccess[]>;
|
|
38
|
+
resolveFeatureFlagsForSubject(subject: FeatureFlagAccessSubject, ...args: any[]): Promise<FeatureFlagRegistry>;
|
|
39
|
+
isEnabledForSubject(key: string, subject: FeatureFlagAccessSubject, ...args: any[]): Promise<boolean>;
|
|
40
|
+
isEnabled(key: string): boolean;
|
|
41
|
+
resolveFeatureFlags(): Promise<FeatureFlagRegistry>;
|
|
42
|
+
syncFromEnvironment(options?: FeatureFlagReaderInput, ...args: any[]): Promise<FeatureFlag[]>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type FeatureFlagMatchMode = "any" | "all";
|
|
2
|
+
export type FeatureFlagAccessSubjectType = "user" | "account" | "namespace" | "model" | "route" | "ui";
|
|
3
|
+
export interface FeatureFlagRule {
|
|
4
|
+
features: string[];
|
|
5
|
+
match?: FeatureFlagMatchMode;
|
|
6
|
+
}
|
|
7
|
+
export interface FeatureFlagConfig {
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
description?: string;
|
|
10
|
+
metadata?: Record<string, unknown>;
|
|
11
|
+
scope?: string;
|
|
12
|
+
targets?: string[];
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
export type FeatureFlagValue = boolean | FeatureFlagConfig;
|
|
16
|
+
export type FeatureFlagRegistry = Record<string, FeatureFlagValue>;
|
|
17
|
+
export interface FeatureFlagEnvironmentShape {
|
|
18
|
+
featureFlag?: FeatureFlagRegistry;
|
|
19
|
+
}
|
|
20
|
+
export interface FeatureFlagAccessSubject {
|
|
21
|
+
subjectType: FeatureFlagAccessSubjectType;
|
|
22
|
+
subjectKey: string;
|
|
23
|
+
}
|
|
24
|
+
export interface FeatureFlagAccessInput extends FeatureFlagAccessSubject {
|
|
25
|
+
featureKey: string;
|
|
26
|
+
enabled?: boolean;
|
|
27
|
+
metadata?: Record<string, unknown>;
|
|
28
|
+
}
|
|
29
|
+
export interface FeatureFlagAccessQuery extends FeatureFlagAccessSubject {
|
|
30
|
+
featureKeys?: string[];
|
|
31
|
+
enabled?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface FeatureFlagReaderInput {
|
|
34
|
+
source?: FeatureFlagEnvironmentShape | unknown;
|
|
35
|
+
[key: string]: unknown;
|
|
36
|
+
}
|
|
37
|
+
export interface FeatureFlagReaderConfig {
|
|
38
|
+
readerConfig?: FeatureFlagReaderInput;
|
|
39
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type FeatureFlagMatchMode = "any" | "all";
|
|
2
|
+
export type FeatureFlagAccessSubjectType = "user" | "account" | "namespace" | "model" | "route" | "ui";
|
|
3
|
+
export interface FeatureFlagRule {
|
|
4
|
+
features: string[];
|
|
5
|
+
match?: FeatureFlagMatchMode;
|
|
6
|
+
}
|
|
7
|
+
export interface FeatureFlagConfig {
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
description?: string;
|
|
10
|
+
metadata?: Record<string, unknown>;
|
|
11
|
+
scope?: string;
|
|
12
|
+
targets?: string[];
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
export type FeatureFlagValue = boolean | FeatureFlagConfig;
|
|
16
|
+
export type FeatureFlagRegistry = Record<string, FeatureFlagValue>;
|
|
17
|
+
export interface FeatureFlagEnvironmentShape {
|
|
18
|
+
featureFlag?: FeatureFlagRegistry;
|
|
19
|
+
}
|
|
20
|
+
export interface FeatureFlagAccessSubject {
|
|
21
|
+
subjectType: FeatureFlagAccessSubjectType;
|
|
22
|
+
subjectKey: string;
|
|
23
|
+
}
|
|
24
|
+
export interface FeatureFlagAccessInput extends FeatureFlagAccessSubject {
|
|
25
|
+
featureKey: string;
|
|
26
|
+
enabled?: boolean;
|
|
27
|
+
metadata?: Record<string, unknown>;
|
|
28
|
+
}
|
|
29
|
+
export interface FeatureFlagAccessQuery extends FeatureFlagAccessSubject {
|
|
30
|
+
featureKeys?: string[];
|
|
31
|
+
enabled?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface FeatureFlagReaderInput {
|
|
34
|
+
source?: FeatureFlagEnvironmentShape | unknown;
|
|
35
|
+
[key: string]: unknown;
|
|
36
|
+
}
|
|
37
|
+
export interface FeatureFlagReaderConfig {
|
|
38
|
+
readerConfig?: FeatureFlagReaderInput;
|
|
39
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FeatureFlagAccessSubjectType, FeatureFlagMatchMode, FeatureFlagRegistry, FeatureFlagRule, FeatureFlagValue } from "./types.d.cts";
|
|
2
|
+
export declare function normalizeFeatureName(name: string): string;
|
|
3
|
+
export declare function parseRuntimeValue(value: unknown): unknown;
|
|
4
|
+
export declare function normalizeFeatureConfig(value: unknown): FeatureFlagValue | undefined;
|
|
5
|
+
export declare function normalizeFeatureRegistry(value: unknown): FeatureFlagRegistry;
|
|
6
|
+
export declare function isFeatureFlagEnabled(value: FeatureFlagValue | undefined): boolean;
|
|
7
|
+
export declare function isFeatureFlagEnabledByName(registry: FeatureFlagRegistry | undefined, featureName: string): boolean;
|
|
8
|
+
export declare function normalizeFeatureRule(features: string[], match?: FeatureFlagMatchMode): FeatureFlagRule;
|
|
9
|
+
export declare function isFeatureRuleSatisfied(rule: FeatureFlagRule | undefined, registry: FeatureFlagRegistry | undefined): boolean;
|
|
10
|
+
export declare function isFeatureRuleBlocked(rule: FeatureFlagRule | undefined, registry: FeatureFlagRegistry | undefined): boolean;
|
|
11
|
+
export declare function readMetadata<T = unknown>(target: object, key: string): T | undefined;
|
|
12
|
+
export declare function normalizeFeatureSubjectType(subjectType: FeatureFlagAccessSubjectType | string): FeatureFlagAccessSubjectType;
|
|
13
|
+
export declare function normalizeFeatureSubjectKey(subjectKey: string): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FeatureFlagAccessSubjectType, FeatureFlagMatchMode, FeatureFlagRegistry, FeatureFlagRule, FeatureFlagValue } from "./types.d.mts";
|
|
2
|
+
export declare function normalizeFeatureName(name: string): string;
|
|
3
|
+
export declare function parseRuntimeValue(value: unknown): unknown;
|
|
4
|
+
export declare function normalizeFeatureConfig(value: unknown): FeatureFlagValue | undefined;
|
|
5
|
+
export declare function normalizeFeatureRegistry(value: unknown): FeatureFlagRegistry;
|
|
6
|
+
export declare function isFeatureFlagEnabled(value: FeatureFlagValue | undefined): boolean;
|
|
7
|
+
export declare function isFeatureFlagEnabledByName(registry: FeatureFlagRegistry | undefined, featureName: string): boolean;
|
|
8
|
+
export declare function normalizeFeatureRule(features: string[], match?: FeatureFlagMatchMode): FeatureFlagRule;
|
|
9
|
+
export declare function isFeatureRuleSatisfied(rule: FeatureFlagRule | undefined, registry: FeatureFlagRegistry | undefined): boolean;
|
|
10
|
+
export declare function isFeatureRuleBlocked(rule: FeatureFlagRule | undefined, registry: FeatureFlagRegistry | undefined): boolean;
|
|
11
|
+
export declare function readMetadata<T = unknown>(target: object, key: string): T | undefined;
|
|
12
|
+
export declare function normalizeFeatureSubjectType(subjectType: FeatureFlagAccessSubjectType | string): FeatureFlagAccessSubjectType;
|
|
13
|
+
export declare function normalizeFeatureSubjectKey(subjectKey: string): string;
|
|
@@ -16,8 +16,8 @@ import type { CodeSandboxEvaluator } from "./CodeSandboxEvaluator.d.cts";
|
|
|
16
16
|
*
|
|
17
17
|
* Evaluates each case's condition in order and routes the input to the
|
|
18
18
|
* first matching case's output port. When no case matches:
|
|
19
|
-
* - If `hasDefault` is `true
|
|
20
|
-
* - If `hasDefault` is `false
|
|
19
|
+
* - If `hasDefault` is `true`, routes to the `default` output port.
|
|
20
|
+
* - If `hasDefault` is `false` (the default), throws `GRAPH_SWITCH_NO_MATCH`.
|
|
21
21
|
*
|
|
22
22
|
* Condition evaluation:
|
|
23
23
|
* - `ConditionExpression` — evaluated via {@link ConditionExpressionEvaluator}.
|
|
@@ -16,8 +16,8 @@ import type { CodeSandboxEvaluator } from "./CodeSandboxEvaluator.d.mts";
|
|
|
16
16
|
*
|
|
17
17
|
* Evaluates each case's condition in order and routes the input to the
|
|
18
18
|
* first matching case's output port. When no case matches:
|
|
19
|
-
* - If `hasDefault` is `true
|
|
20
|
-
* - If `hasDefault` is `false
|
|
19
|
+
* - If `hasDefault` is `true`, routes to the `default` output port.
|
|
20
|
+
* - If `hasDefault` is `false` (the default), throws `GRAPH_SWITCH_NO_MATCH`.
|
|
21
21
|
*
|
|
22
22
|
* Condition evaluation:
|
|
23
23
|
* - `ConditionExpression` — evaluated via {@link ConditionExpressionEvaluator}.
|
|
@@ -103,9 +103,9 @@ export interface SwitchCase {
|
|
|
103
103
|
/**
|
|
104
104
|
* Metadata for a Switch node, stored in `metadata.switch`.
|
|
105
105
|
*
|
|
106
|
-
* When `hasDefault` is `false
|
|
107
|
-
*
|
|
108
|
-
* `hasDefault` is `true
|
|
106
|
+
* When `hasDefault` is `false` (the default), the `default` output port is
|
|
107
|
+
* hidden and the executor throws a `GraphExecutionError` when no case
|
|
108
|
+
* matches. When `hasDefault` is `true`, the `default` output port is visible
|
|
109
109
|
* and receives the input when no case matches (DECAF-34 §6.2).
|
|
110
110
|
*/
|
|
111
111
|
export interface SwitchNodeMetadata {
|
|
@@ -103,9 +103,9 @@ export interface SwitchCase {
|
|
|
103
103
|
/**
|
|
104
104
|
* Metadata for a Switch node, stored in `metadata.switch`.
|
|
105
105
|
*
|
|
106
|
-
* When `hasDefault` is `false
|
|
107
|
-
*
|
|
108
|
-
* `hasDefault` is `true
|
|
106
|
+
* When `hasDefault` is `false` (the default), the `default` output port is
|
|
107
|
+
* hidden and the executor throws a `GraphExecutionError` when no case
|
|
108
|
+
* matches. When `hasDefault` is `true`, the `default` output port is visible
|
|
109
109
|
* and receives the input when no case matches (DECAF-34 §6.2).
|
|
110
110
|
*/
|
|
111
111
|
export interface SwitchNodeMetadata {
|
package/lib/types/index.d.cts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export * from "./utils.d.cts";
|
|
7
7
|
export * from "./namespaces/index.d.cts";
|
|
8
|
+
export * from "./feature-flags/index.d.cts";
|
|
8
9
|
export declare const VERSION: string;
|
|
9
|
-
export declare const COMMIT = "
|
|
10
|
-
export declare const FULL_VERSION = "0.
|
|
10
|
+
export declare const COMMIT = "7e1a5ac";
|
|
11
|
+
export declare const FULL_VERSION = "0.4.0-7e1a5ac";
|
|
11
12
|
export declare const PACKAGE_NAME: string;
|
package/lib/types/index.d.mts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export * from "./utils.d.mts";
|
|
7
7
|
export * from "./namespaces/index.d.mts";
|
|
8
|
+
export * from "./feature-flags/index.d.mts";
|
|
8
9
|
export declare const VERSION: string;
|
|
9
|
-
export declare const COMMIT = "
|
|
10
|
-
export declare const FULL_VERSION = "0.
|
|
10
|
+
export declare const COMMIT = "7e1a5ac";
|
|
11
|
+
export declare const FULL_VERSION = "0.4.0-7e1a5ac";
|
|
11
12
|
export declare const PACKAGE_NAME: string;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module integrations/kibana/builders/KibanaIndexBuilder
|
|
3
|
+
* @summary Fluent builder for Kibana index pattern (data view) configurations.
|
|
4
|
+
* @description Implements the project Builder Pattern (constitution §2):
|
|
5
|
+
* extends `Model`, uses `@decaf-ts/decorator-validation` decorators, fluent
|
|
6
|
+
* `setX(): this` methods, and a terminal `build()` that validates via
|
|
7
|
+
* `hasErrors()` and returns a `KibanaDataViewConfig`.
|
|
8
|
+
*
|
|
9
|
+
* Supports three base matching modes:
|
|
10
|
+
* - `EXACT` — single, fully-qualified index name (no wildcards).
|
|
11
|
+
* - `PREFIX` — wildcard pattern (e.g. `filebeat-pla-demo-*`).
|
|
12
|
+
* - `LOGGER_GENERATED` — derives index name segments from a log pattern
|
|
13
|
+
* compiled via `compileLogPattern()` and rendered via
|
|
14
|
+
* `logParameterRegistry.render()`.
|
|
15
|
+
*
|
|
16
|
+
* **Compounding:** Logger-generated segments can be compounded with ANY
|
|
17
|
+
* base matching mode. When `logPattern` + `logPayload` are provided
|
|
18
|
+
* alongside EXACT or PREFIX mode, the rendered segments are appended to
|
|
19
|
+
* the base index name and a trailing `*` is added.
|
|
20
|
+
*/
|
|
21
|
+
import { Model, ModelArg } from "@decaf-ts/decorator-validation";
|
|
22
|
+
import { type LogParameterPayload } from "@decaf-ts/logging";
|
|
23
|
+
import { KibanaDataViewConfig, KibanaIndexMatchMode } from "../types.d.cts";
|
|
24
|
+
export declare class KibanaIndexBuilder extends Model {
|
|
25
|
+
matchMode: KibanaIndexMatchMode;
|
|
26
|
+
prefix?: string;
|
|
27
|
+
exactIndexName?: string;
|
|
28
|
+
logPattern?: string;
|
|
29
|
+
logPayload?: Partial<LogParameterPayload>;
|
|
30
|
+
separator: string;
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
timeFieldName?: string;
|
|
34
|
+
namespaces?: string[];
|
|
35
|
+
sourceFilters?: Array<{
|
|
36
|
+
value: string;
|
|
37
|
+
}>;
|
|
38
|
+
runtimeFieldMap?: Record<string, unknown>;
|
|
39
|
+
fieldAttrs?: Record<string, unknown>;
|
|
40
|
+
allowNoIndex?: boolean;
|
|
41
|
+
constructor(arg?: ModelArg<KibanaIndexBuilder>);
|
|
42
|
+
setMatchMode(mode: KibanaIndexMatchMode): this;
|
|
43
|
+
setPrefix(prefix: string): this;
|
|
44
|
+
setExactIndexName(name: string): this;
|
|
45
|
+
setLogPattern(pattern: string): this;
|
|
46
|
+
setLogPayload(payload: Partial<LogParameterPayload>): this;
|
|
47
|
+
setSeparator(sep: string): this;
|
|
48
|
+
setId(id: string): this;
|
|
49
|
+
setName(name: string): this;
|
|
50
|
+
setTimeFieldName(field: string): this;
|
|
51
|
+
setNamespaces(ns: string[]): this;
|
|
52
|
+
setSourceFilters(filters: Array<{
|
|
53
|
+
value: string;
|
|
54
|
+
}>): this;
|
|
55
|
+
setRuntimeFieldMap(map: Record<string, unknown>): this;
|
|
56
|
+
setFieldAttrs(attrs: Record<string, unknown>): this;
|
|
57
|
+
setAllowNoIndex(allow: boolean): this;
|
|
58
|
+
build(): KibanaDataViewConfig;
|
|
59
|
+
protected composeTitle(): string;
|
|
60
|
+
protected composeBaseSegments(): string[];
|
|
61
|
+
protected composeLoggerGeneratedSegments(): string[];
|
|
62
|
+
/**
|
|
63
|
+
* Fill missing LogParameterPayload fields with sensible defaults
|
|
64
|
+
* so partial payloads can be accepted from the caller.
|
|
65
|
+
*/
|
|
66
|
+
protected buildFullPayload(partial: Partial<LogParameterPayload>): LogParameterPayload;
|
|
67
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module integrations/kibana/builders/KibanaIndexBuilder
|
|
3
|
+
* @summary Fluent builder for Kibana index pattern (data view) configurations.
|
|
4
|
+
* @description Implements the project Builder Pattern (constitution §2):
|
|
5
|
+
* extends `Model`, uses `@decaf-ts/decorator-validation` decorators, fluent
|
|
6
|
+
* `setX(): this` methods, and a terminal `build()` that validates via
|
|
7
|
+
* `hasErrors()` and returns a `KibanaDataViewConfig`.
|
|
8
|
+
*
|
|
9
|
+
* Supports three base matching modes:
|
|
10
|
+
* - `EXACT` — single, fully-qualified index name (no wildcards).
|
|
11
|
+
* - `PREFIX` — wildcard pattern (e.g. `filebeat-pla-demo-*`).
|
|
12
|
+
* - `LOGGER_GENERATED` — derives index name segments from a log pattern
|
|
13
|
+
* compiled via `compileLogPattern()` and rendered via
|
|
14
|
+
* `logParameterRegistry.render()`.
|
|
15
|
+
*
|
|
16
|
+
* **Compounding:** Logger-generated segments can be compounded with ANY
|
|
17
|
+
* base matching mode. When `logPattern` + `logPayload` are provided
|
|
18
|
+
* alongside EXACT or PREFIX mode, the rendered segments are appended to
|
|
19
|
+
* the base index name and a trailing `*` is added.
|
|
20
|
+
*/
|
|
21
|
+
import { Model, ModelArg } from "@decaf-ts/decorator-validation";
|
|
22
|
+
import { type LogParameterPayload } from "@decaf-ts/logging";
|
|
23
|
+
import { KibanaDataViewConfig, KibanaIndexMatchMode } from "../types.d.mts";
|
|
24
|
+
export declare class KibanaIndexBuilder extends Model {
|
|
25
|
+
matchMode: KibanaIndexMatchMode;
|
|
26
|
+
prefix?: string;
|
|
27
|
+
exactIndexName?: string;
|
|
28
|
+
logPattern?: string;
|
|
29
|
+
logPayload?: Partial<LogParameterPayload>;
|
|
30
|
+
separator: string;
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
timeFieldName?: string;
|
|
34
|
+
namespaces?: string[];
|
|
35
|
+
sourceFilters?: Array<{
|
|
36
|
+
value: string;
|
|
37
|
+
}>;
|
|
38
|
+
runtimeFieldMap?: Record<string, unknown>;
|
|
39
|
+
fieldAttrs?: Record<string, unknown>;
|
|
40
|
+
allowNoIndex?: boolean;
|
|
41
|
+
constructor(arg?: ModelArg<KibanaIndexBuilder>);
|
|
42
|
+
setMatchMode(mode: KibanaIndexMatchMode): this;
|
|
43
|
+
setPrefix(prefix: string): this;
|
|
44
|
+
setExactIndexName(name: string): this;
|
|
45
|
+
setLogPattern(pattern: string): this;
|
|
46
|
+
setLogPayload(payload: Partial<LogParameterPayload>): this;
|
|
47
|
+
setSeparator(sep: string): this;
|
|
48
|
+
setId(id: string): this;
|
|
49
|
+
setName(name: string): this;
|
|
50
|
+
setTimeFieldName(field: string): this;
|
|
51
|
+
setNamespaces(ns: string[]): this;
|
|
52
|
+
setSourceFilters(filters: Array<{
|
|
53
|
+
value: string;
|
|
54
|
+
}>): this;
|
|
55
|
+
setRuntimeFieldMap(map: Record<string, unknown>): this;
|
|
56
|
+
setFieldAttrs(attrs: Record<string, unknown>): this;
|
|
57
|
+
setAllowNoIndex(allow: boolean): this;
|
|
58
|
+
build(): KibanaDataViewConfig;
|
|
59
|
+
protected composeTitle(): string;
|
|
60
|
+
protected composeBaseSegments(): string[];
|
|
61
|
+
protected composeLoggerGeneratedSegments(): string[];
|
|
62
|
+
/**
|
|
63
|
+
* Fill missing LogParameterPayload fields with sensible defaults
|
|
64
|
+
* so partial payloads can be accepted from the caller.
|
|
65
|
+
*/
|
|
66
|
+
protected buildFullPayload(partial: Partial<LogParameterPayload>): LogParameterPayload;
|
|
67
|
+
}
|