@pikku/addon-admin 0.12.3 → 0.12.6
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/.pikku/addon/agent/index.d.ts +1 -1
- package/dist/.pikku/addon/agent/index.js +1 -1
- package/dist/.pikku/addon/agent/pikku-agent-map.gen.d.ts +1 -1
- package/dist/.pikku/addon/agent/pikku-agent-types.gen.d.ts +6 -6
- package/dist/.pikku/addon/agent/pikku-agent-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/agent/pikku-model-aliases.gen.js +1 -1
- package/dist/.pikku/addon/agent/pikku-scorer-names.gen.d.ts +1 -1
- package/dist/.pikku/addon/analytics/index.d.ts +8 -0
- package/dist/.pikku/addon/analytics/index.d.ts.map +1 -0
- package/dist/.pikku/addon/analytics/index.js +8 -0
- package/dist/.pikku/addon/analytics/index.js.map +1 -0
- package/dist/.pikku/addon/analytics/pikku-analytics-types.gen.d.ts +6 -0
- package/dist/.pikku/addon/analytics/pikku-analytics-types.gen.d.ts.map +1 -0
- package/dist/.pikku/addon/analytics/pikku-analytics-types.gen.js +5 -0
- package/dist/.pikku/addon/analytics/pikku-analytics-types.gen.js.map +1 -0
- package/dist/.pikku/addon/auth/index.d.ts +1 -1
- package/dist/.pikku/addon/auth/index.js +1 -1
- package/dist/.pikku/addon/auth/pikku-auth-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/auth/pikku-auth-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/auth/pikku-auth-types.gen.js +1 -1
- package/dist/.pikku/addon/channel/index.d.ts +1 -1
- package/dist/.pikku/addon/channel/index.js +1 -1
- package/dist/.pikku/addon/channel/pikku-channel-types.gen.d.ts +3 -3
- package/dist/.pikku/addon/channel/pikku-channel-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/channel/pikku-channel-types.gen.js +1 -1
- package/dist/.pikku/addon/error/index.d.ts +1 -1
- package/dist/.pikku/addon/error/index.js +1 -1
- package/dist/.pikku/addon/error/pikku-error-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/error/pikku-error-types.gen.js +1 -1
- package/dist/.pikku/addon/function/index.d.ts +1 -1
- package/dist/.pikku/addon/function/index.js +1 -1
- package/dist/.pikku/addon/function/pikku-function-types.gen.d.ts +8 -7
- package/dist/.pikku/addon/function/pikku-function-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/function/pikku-function-types.gen.js +1 -1
- package/dist/.pikku/addon/function/pikku-function-types.gen.js.map +1 -1
- package/dist/.pikku/addon/function/pikku-functions-meta-verbose.gen.json +367 -2
- package/dist/.pikku/addon/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/addon/function/pikku-functions-meta.gen.json +279 -2
- package/dist/.pikku/addon/function/pikku-functions.gen.js +21 -1
- package/dist/.pikku/addon/function/pikku-functions.gen.js.map +1 -1
- package/dist/.pikku/addon/http/index.d.ts +1 -1
- package/dist/.pikku/addon/http/index.js +1 -1
- package/dist/.pikku/addon/http/pikku-http-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/addon/mcp/index.d.ts +1 -1
- package/dist/.pikku/addon/mcp/index.js +1 -1
- package/dist/.pikku/addon/mcp/pikku-mcp-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/addon/middleware/index.d.ts +1 -1
- package/dist/.pikku/addon/middleware/index.js +1 -1
- package/dist/.pikku/addon/middleware/pikku-middleware-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/middleware/pikku-middleware-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/middleware/pikku-middleware-types.gen.js +1 -1
- package/dist/.pikku/addon/pikku-bootstrap-scenarios.gen.d.ts +1 -1
- package/dist/.pikku/addon/pikku-bootstrap-scenarios.gen.js +1 -1
- package/dist/.pikku/addon/pikku-bootstrap.gen.d.ts +1 -1
- package/dist/.pikku/addon/pikku-bootstrap.gen.js +1 -1
- package/dist/.pikku/addon/pikku-package.gen.js +2 -2
- package/dist/.pikku/addon/pikku-package.gen.js.map +1 -1
- package/dist/.pikku/addon/pikku-services.gen.d.ts +7 -3
- package/dist/.pikku/addon/pikku-services.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/pikku-services.gen.js +5 -1
- package/dist/.pikku/addon/pikku-services.gen.js.map +1 -1
- package/dist/.pikku/addon/rpc/pikku-rpc-wirings-map.gen.d.ts +36 -2
- package/dist/.pikku/addon/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +36 -2
- package/dist/.pikku/addon/rpc/pikku-rpc-wirings-map.remote.gen.d.ts +26 -2
- package/dist/.pikku/addon/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/addon/rpc/pikku-rpc-wirings-meta.internal.gen.json +10 -0
- package/dist/.pikku/addon/scenarios/index.d.ts +1 -1
- package/dist/.pikku/addon/scenarios/index.js +1 -1
- package/dist/.pikku/addon/scenarios/pikku-personas.gen.d.ts +1 -1
- package/dist/.pikku/addon/scenarios/pikku-personas.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/scenarios/pikku-personas.gen.js +1 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-wirings-meta.gen.js +1 -1
- package/dist/.pikku/addon/scenarios/pikku-scenario-wirings.gen.d.ts +1 -1
- package/dist/.pikku/addon/scenarios/schemas/register.gen.d.ts +1 -1
- package/dist/.pikku/addon/scenarios/schemas/register.gen.js +1 -1
- package/dist/.pikku/addon/schemas/register.gen.js +33 -1
- package/dist/.pikku/addon/schemas/register.gen.js.map +1 -1
- package/dist/.pikku/addon/schemas/schemas/CreateUserInput.schema.json +1 -1
- package/dist/.pikku/addon/schemas/schemas/FlagClearOverrideInput.schema.json +1 -0
- package/dist/.pikku/addon/schemas/schemas/FlagClearOverrideOutput.schema.json +1 -0
- package/dist/.pikku/addon/schemas/schemas/FlagListOutput.schema.json +1 -0
- package/dist/.pikku/addon/schemas/schemas/FlagOverridesInput.schema.json +1 -0
- package/dist/.pikku/addon/schemas/schemas/FlagOverridesOutput.schema.json +1 -0
- package/dist/.pikku/addon/schemas/schemas/FlagPruneOutput.schema.json +1 -0
- package/dist/.pikku/addon/schemas/schemas/FlagSetEnabledInput.schema.json +1 -0
- package/dist/.pikku/addon/schemas/schemas/FlagSetEnabledOutput.schema.json +1 -0
- package/dist/.pikku/addon/schemas/schemas/FlagSetOverrideInput.schema.json +1 -0
- package/dist/.pikku/addon/schemas/schemas/FlagSetOverrideOutput.schema.json +1 -0
- package/dist/.pikku/addon/schemas/schemas/FlagSetRolloutInput.schema.json +1 -0
- package/dist/.pikku/addon/schemas/schemas/FlagSetRolloutOutput.schema.json +1 -0
- package/dist/.pikku/addon/schemas/schemas/FlagSyncOutput.schema.json +1 -0
- package/dist/.pikku/addon/schemas/schemas/PingOutput.schema.json +1 -0
- package/dist/.pikku/addon/schemas/schemas/SendSignInLinkInput.schema.json +1 -0
- package/dist/.pikku/addon/schemas/schemas/SendSignInLinkOutput.schema.json +1 -0
- package/dist/.pikku/addon/scopes/index.d.ts +2 -1
- package/dist/.pikku/addon/scopes/index.d.ts.map +1 -1
- package/dist/.pikku/addon/scopes/index.js +2 -1
- package/dist/.pikku/addon/scopes/index.js.map +1 -1
- package/dist/.pikku/addon/scopes/pikku-flags-meta.gen.json +1 -0
- package/dist/.pikku/addon/scopes/pikku-flags.gen.d.ts +42 -0
- package/dist/.pikku/addon/scopes/pikku-flags.gen.d.ts.map +1 -0
- package/dist/.pikku/addon/scopes/pikku-flags.gen.js +35 -0
- package/dist/.pikku/addon/scopes/pikku-flags.gen.js.map +1 -0
- package/dist/.pikku/addon/scopes/pikku-personas.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/scopes/pikku-personas.gen.js +1 -1
- package/dist/.pikku/addon/scopes/pikku-roles.gen.d.ts +1 -1
- package/dist/.pikku/addon/scopes/pikku-roles.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/scopes/pikku-scope-types.gen.d.ts +2 -1
- package/dist/.pikku/addon/scopes/pikku-scope-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/scopes/pikku-scope-types.gen.js +2 -1
- package/dist/.pikku/addon/scopes/pikku-scope-types.gen.js.map +1 -1
- package/dist/.pikku/addon/scopes/pikku-scopes-meta.gen.json +11 -0
- package/dist/.pikku/addon/scopes/pikku-scopes.gen.d.ts +2 -2
- package/dist/.pikku/addon/scopes/pikku-scopes.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/scopes/pikku-scopes.gen.js.map +1 -1
- package/dist/.pikku/addon/secrets/index.d.ts +1 -1
- package/dist/.pikku/addon/secrets/index.js +1 -1
- package/dist/.pikku/addon/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/addon/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/addon/secrets/pikku-secrets.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/addon/services/pikku-meta-service.gen.d.ts +1 -1
- package/dist/.pikku/addon/services/pikku-meta-service.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/services/pikku-meta-service.gen.js +1 -1
- package/dist/.pikku/addon/setup/index.d.ts +1 -1
- package/dist/.pikku/addon/setup/index.js +1 -1
- package/dist/.pikku/addon/setup/pikku-addon-setup-types.gen.d.ts +4 -4
- package/dist/.pikku/addon/setup/pikku-addon-setup-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/setup/pikku-addon-setup-types.gen.js +1 -1
- package/dist/.pikku/addon/setup/pikku-setup-types.gen.d.ts +2 -2
- package/dist/.pikku/addon/setup/pikku-setup-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/setup/pikku-setup-types.gen.js +1 -1
- package/dist/.pikku/addon/setup/pikku-setup-types.gen.js.map +1 -1
- package/dist/.pikku/addon/trigger/index.d.ts +1 -1
- package/dist/.pikku/addon/trigger/index.js +1 -1
- package/dist/.pikku/addon/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/addon/variables/index.d.ts +1 -1
- package/dist/.pikku/addon/variables/index.js +1 -1
- package/dist/.pikku/addon/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/addon/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/addon/variables/pikku-variables.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/addon/workflow/index.d.ts +1 -1
- package/dist/.pikku/addon/workflow/index.js +1 -1
- package/dist/.pikku/addon/workflow/pikku-scenario-step-map.gen.d.ts +1 -1
- package/dist/.pikku/addon/workflow/pikku-workflow-map.gen.d.ts +1 -1
- package/dist/.pikku/addon/workflow/pikku-workflow-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/workflow/pikku-workflow-types.gen.js +1 -1
- package/dist/.pikku/addon/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/addon/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
- package/dist/.pikku/addon/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/src/functions/create-user.function.d.ts +3 -3
- package/dist/src/functions/credential-delete.function.d.ts.map +1 -1
- package/dist/src/functions/credential-get.function.d.ts.map +1 -1
- package/dist/src/functions/credential-list-users.function.d.ts.map +1 -1
- package/dist/src/functions/credential-set.function.d.ts.map +1 -1
- package/dist/src/functions/credential-status.function.d.ts.map +1 -1
- package/dist/src/functions/credential-users.function.d.ts.map +1 -1
- package/dist/src/functions/flag-clear-override.function.d.ts +18 -0
- package/dist/src/functions/flag-clear-override.function.d.ts.map +1 -0
- package/dist/src/functions/flag-clear-override.function.js +13 -0
- package/dist/src/functions/flag-clear-override.function.js.map +1 -0
- package/dist/src/functions/flag-list.function.d.ts +12 -0
- package/dist/src/functions/flag-list.function.d.ts.map +1 -0
- package/dist/src/functions/flag-list.function.js +30 -0
- package/dist/src/functions/flag-list.function.js.map +1 -0
- package/dist/src/functions/flag-overrides.function.d.ts +18 -0
- package/dist/src/functions/flag-overrides.function.d.ts.map +1 -0
- package/dist/src/functions/flag-overrides.function.js +19 -0
- package/dist/src/functions/flag-overrides.function.js.map +1 -0
- package/dist/src/functions/flag-prune.function.d.ts +8 -0
- package/dist/src/functions/flag-prune.function.d.ts.map +1 -0
- package/dist/src/functions/flag-prune.function.js +12 -0
- package/dist/src/functions/flag-prune.function.js.map +1 -0
- package/dist/src/functions/flag-set-enabled.function.d.ts +20 -0
- package/dist/src/functions/flag-set-enabled.function.d.ts.map +1 -0
- package/dist/src/functions/flag-set-enabled.function.js +13 -0
- package/dist/src/functions/flag-set-enabled.function.js.map +1 -0
- package/dist/src/functions/flag-set-override.function.d.ts +21 -0
- package/dist/src/functions/flag-set-override.function.d.ts.map +1 -0
- package/dist/src/functions/flag-set-override.function.js +13 -0
- package/dist/src/functions/flag-set-override.function.js.map +1 -0
- package/dist/src/functions/flag-set-rollout.function.d.ts +17 -0
- package/dist/src/functions/flag-set-rollout.function.d.ts.map +1 -0
- package/dist/src/functions/flag-set-rollout.function.js +16 -0
- package/dist/src/functions/flag-set-rollout.function.js.map +1 -0
- package/dist/src/functions/flag-sync.function.d.ts +8 -0
- package/dist/src/functions/flag-sync.function.d.ts.map +1 -0
- package/dist/src/functions/flag-sync.function.js +21 -0
- package/dist/src/functions/flag-sync.function.js.map +1 -0
- package/dist/src/functions/ping.function.d.ts +25 -0
- package/dist/src/functions/ping.function.d.ts.map +1 -0
- package/dist/src/functions/ping.function.js +27 -0
- package/dist/src/functions/ping.function.js.map +1 -0
- package/dist/src/functions/scope-add-scope-to-user.function.d.ts.map +1 -1
- package/dist/src/functions/scope-add-user-to-role.function.d.ts.map +1 -1
- package/dist/src/functions/scope-create-role.function.d.ts.map +1 -1
- package/dist/src/functions/scope-delete-role.function.d.ts.map +1 -1
- package/dist/src/functions/scope-list-declared.function.d.ts.map +1 -1
- package/dist/src/functions/scope-list-roles.function.d.ts.map +1 -1
- package/dist/src/functions/scope-list-user-roles.function.d.ts.map +1 -1
- package/dist/src/functions/scope-remove-scope-from-user.function.d.ts.map +1 -1
- package/dist/src/functions/scope-remove-user-from-role.function.d.ts.map +1 -1
- package/dist/src/functions/scope-set-role-scopes.function.d.ts.map +1 -1
- package/dist/src/functions/send-sign-in-link.function.d.ts +17 -0
- package/dist/src/functions/send-sign-in-link.function.d.ts.map +1 -0
- package/dist/src/functions/send-sign-in-link.function.js +21 -0
- package/dist/src/functions/send-sign-in-link.function.js.map +1 -0
- package/dist/src/lib/flag-rows.d.ts +22 -0
- package/dist/src/lib/flag-rows.d.ts.map +1 -0
- package/dist/src/lib/flag-rows.js +21 -0
- package/dist/src/lib/flag-rows.js.map +1 -0
- package/dist/src/lib/flag-rows.test.d.ts +2 -0
- package/dist/src/lib/flag-rows.test.d.ts.map +1 -0
- package/dist/src/lib/flag-rows.test.js +29 -0
- package/dist/src/lib/flag-rows.test.js.map +1 -0
- package/dist/src/lib/flag-store.d.ts +16 -0
- package/dist/src/lib/flag-store.d.ts.map +1 -0
- package/dist/src/lib/flag-store.js +18 -0
- package/dist/src/lib/flag-store.js.map +1 -0
- package/dist/src/lib/is-person.d.ts.map +1 -1
- package/dist/src/lib/require-flag-store.d.ts +10 -0
- package/dist/src/lib/require-flag-store.d.ts.map +1 -0
- package/dist/src/lib/require-flag-store.js +19 -0
- package/dist/src/lib/require-flag-store.js.map +1 -0
- package/dist/src/lib/resolve-audit-users.d.ts +1 -1
- package/dist/src/lib/resolve-audit-users.d.ts.map +1 -1
- package/dist/src/lib/resolve-audit-users.test.js.map +1 -1
- package/dist/src/lib/user.schemas.d.ts +16 -1
- package/dist/src/lib/user.schemas.d.ts.map +1 -1
- package/dist/src/lib/user.schemas.js +16 -1
- package/dist/src/lib/user.schemas.js.map +1 -1
- package/dist/src/scopes.js +11 -0
- package/dist/src/scopes.js.map +1 -1
- package/dist/src/services.d.ts.map +1 -1
- package/dist/src/services.js +2 -1
- package/dist/src/services.js.map +1 -1
- package/package.json +12 -7
- package/CHANGELOG.md +0 -202
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-status.function.d.ts","sourceRoot":"","sources":["../../../src/functions/credential-status.function.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB;WAClB,MAAM,EAAE;aAAW,MAAM;;cACtB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC
|
|
1
|
+
{"version":3,"file":"credential-status.function.d.ts","sourceRoot":"","sources":["../../../src/functions/credential-status.function.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB;WAClB,MAAM,EAAE;aAAW,MAAM;;cACtB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;oGAcnC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-users.function.d.ts","sourceRoot":"","sources":["../../../src/functions/credential-users.function.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;UAClB,MAAM;;aACH,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"credential-users.function.d.ts","sourceRoot":"","sources":["../../../src/functions/credential-users.function.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;UAClB,MAAM;;aACH,MAAM,EAAE;;;;;;;;;oGAUnB,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FlagSubject } from '@pikku/core/flag';
|
|
2
|
+
export declare const flagClearOverride: import("#pikku/addon/function").PikkuFunctionConfig<{
|
|
3
|
+
name: string;
|
|
4
|
+
subject: FlagSubject;
|
|
5
|
+
}, {
|
|
6
|
+
success: boolean;
|
|
7
|
+
}, "rpc" | "session", import("#pikku/addon/function").PikkuFunction<{
|
|
8
|
+
name: string;
|
|
9
|
+
subject: FlagSubject;
|
|
10
|
+
}, {
|
|
11
|
+
success: boolean;
|
|
12
|
+
}, "rpc" | "session", import("#pikku/addon/function").WiredServices> | import("#pikku/addon/function").PikkuFunctionSessionless<{
|
|
13
|
+
name: string;
|
|
14
|
+
subject: FlagSubject;
|
|
15
|
+
}, {
|
|
16
|
+
success: boolean;
|
|
17
|
+
}, "rpc" | "session", import("#pikku/addon/function").WiredServices, unknown>, undefined, undefined>;
|
|
18
|
+
//# sourceMappingURL=flag-clear-override.function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-clear-override.function.d.ts","sourceRoot":"","sources":["../../../src/functions/flag-clear-override.function.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAGnD,eAAO,MAAM,iBAAiB;UACpB,MAAM;aAAW,WAAW;;aACzB,OAAO;;;;;;;;;;;oGAWlB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { pikkuFunc } from '#pikku/addon/function';
|
|
2
|
+
import { requireFlagStore } from '../lib/require-flag-store.js';
|
|
3
|
+
export const flagClearOverride = pikkuFunc({
|
|
4
|
+
title: 'Clear a Feature Flag Override',
|
|
5
|
+
description: 'Returns one subject to the flag it would otherwise resolve to. Not the same as overriding it to false, which keeps the subject pinned off through a later rollout.',
|
|
6
|
+
expose: true,
|
|
7
|
+
scopes: ['admin:flags:manage'],
|
|
8
|
+
func: async ({ featureFlags }, { name, subject }) => {
|
|
9
|
+
await requireFlagStore(featureFlags).clearOverride(name, subject);
|
|
10
|
+
return { success: true };
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=flag-clear-override.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-clear-override.function.js","sourceRoot":"","sources":["../../../src/functions/flag-clear-override.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAE/D,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAGxC;IACA,KAAK,EAAE,+BAA+B;IACtC,WAAW,EACT,oKAAoK;IACtK,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,CAAC,oBAAoB,CAAC;IAC9B,IAAI,EAAE,KAAK,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;QAClD,MAAM,gBAAgB,CAAC,YAAY,CAAC,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QACjE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC1B,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type FlagListRow } from '../lib/flag-rows.js';
|
|
2
|
+
export declare const flagList: import("#pikku/addon/function").PikkuFunctionConfig<null, {
|
|
3
|
+
flags: FlagListRow[];
|
|
4
|
+
writable: boolean;
|
|
5
|
+
}, "rpc" | "session", import("#pikku/addon/function").PikkuFunction<null, {
|
|
6
|
+
flags: FlagListRow[];
|
|
7
|
+
writable: boolean;
|
|
8
|
+
}, "rpc" | "session", import("#pikku/addon/function").WiredServices> | import("#pikku/addon/function").PikkuFunctionSessionless<null, {
|
|
9
|
+
flags: FlagListRow[];
|
|
10
|
+
writable: boolean;
|
|
11
|
+
}, "rpc" | "session", import("#pikku/addon/function").WiredServices, unknown>, undefined, undefined>;
|
|
12
|
+
//# sourceMappingURL=flag-list.function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-list.function.d.ts","sourceRoot":"","sources":["../../../src/functions/flag-list.function.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,qBAAqB,CAAA;AAE5B,eAAO,MAAM,QAAQ;WAEV,WAAW,EAAE;cAAY,OAAO;;;;;;;oGAgCzC,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { pikkuFunc } from '#pikku/addon/function';
|
|
2
|
+
import { asFlagStore } from '../lib/flag-store.js';
|
|
3
|
+
import { flagRowsFromSource, sortFlagRows, } from '../lib/flag-rows.js';
|
|
4
|
+
export const flagList = pikkuFunc({
|
|
5
|
+
title: 'List Feature Flags',
|
|
6
|
+
description: 'Lists every declared feature flag with its rollout, whether it is still declared in code, and whether the backing store holds a row for it.',
|
|
7
|
+
expose: true,
|
|
8
|
+
scopes: ['admin:flags:read'],
|
|
9
|
+
func: async ({ featureFlags }) => {
|
|
10
|
+
const store = asFlagStore(featureFlags);
|
|
11
|
+
if (store) {
|
|
12
|
+
const flags = await store.listFlags();
|
|
13
|
+
return {
|
|
14
|
+
flags: sortFlagRows(flags.map((flag) => ({ ...flag, backed: true }))),
|
|
15
|
+
writable: true,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
if (!featureFlags) {
|
|
19
|
+
return { flags: [], writable: false };
|
|
20
|
+
}
|
|
21
|
+
// A provider-backed source: read-only rather than throwing, because its own
|
|
22
|
+
// UI is the operator surface and a console of switches that 500 is worse
|
|
23
|
+
// than a tab that reads.
|
|
24
|
+
return {
|
|
25
|
+
flags: flagRowsFromSource(featureFlags.declaredFlags?.() ?? [], await featureFlags.snapshot()),
|
|
26
|
+
writable: false,
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=flag-list.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-list.function.js","sourceRoot":"","sources":["../../../src/functions/flag-list.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EACL,kBAAkB,EAClB,YAAY,GAEb,MAAM,qBAAqB,CAAA;AAE5B,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,CAG/B;IACA,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EACT,6IAA6I;IAC/I,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,CAAC,kBAAkB,CAAC;IAC5B,IAAI,EAAE,KAAK,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE;QAC/B,MAAM,KAAK,GAAG,WAAW,CAAC,YAAY,CAAC,CAAA;QACvC,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,SAAS,EAAE,CAAA;YACrC,OAAO;gBACL,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;gBACrE,QAAQ,EAAE,IAAI;aACf,CAAA;QACH,CAAC;QAED,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAA;QACvC,CAAC;QAED,4EAA4E;QAC5E,yEAAyE;QACzE,yBAAyB;QACzB,OAAO;YACL,KAAK,EAAE,kBAAkB,CACvB,YAAY,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,EACpC,MAAM,YAAY,CAAC,QAAQ,EAAE,CAC9B;YACD,QAAQ,EAAE,KAAK;SAChB,CAAA;IACH,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FlagOverrideRow } from '@pikku/core/services';
|
|
2
|
+
export declare const flagOverrides: import("#pikku/addon/function").PikkuFunctionConfig<{
|
|
3
|
+
name: string;
|
|
4
|
+
}, {
|
|
5
|
+
overrides: FlagOverrideRow[];
|
|
6
|
+
supported: boolean;
|
|
7
|
+
}, "rpc" | "session", import("#pikku/addon/function").PikkuFunction<{
|
|
8
|
+
name: string;
|
|
9
|
+
}, {
|
|
10
|
+
overrides: FlagOverrideRow[];
|
|
11
|
+
supported: boolean;
|
|
12
|
+
}, "rpc" | "session", import("#pikku/addon/function").WiredServices> | import("#pikku/addon/function").PikkuFunctionSessionless<{
|
|
13
|
+
name: string;
|
|
14
|
+
}, {
|
|
15
|
+
overrides: FlagOverrideRow[];
|
|
16
|
+
supported: boolean;
|
|
17
|
+
}, "rpc" | "session", import("#pikku/addon/function").WiredServices, unknown>, undefined, undefined>;
|
|
18
|
+
//# sourceMappingURL=flag-overrides.function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-overrides.function.d.ts","sourceRoot":"","sources":["../../../src/functions/flag-overrides.function.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAG3D,eAAO,MAAM,aAAa;UAChB,MAAM;;eACD,eAAe,EAAE;eAAa,OAAO;;;;;;;;;;;oGAiBlD,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { pikkuFunc } from '#pikku/addon/function';
|
|
2
|
+
import { asFlagStore } from '../lib/flag-store.js';
|
|
3
|
+
export const flagOverrides = pikkuFunc({
|
|
4
|
+
title: 'List a Feature Flag’s Overrides',
|
|
5
|
+
description: 'Lists every organization and user pinned on or off for one flag, ahead of its rollout.',
|
|
6
|
+
expose: true,
|
|
7
|
+
scopes: ['admin:flags:read'],
|
|
8
|
+
func: async ({ featureFlags }, { name }) => {
|
|
9
|
+
const store = asFlagStore(featureFlags);
|
|
10
|
+
// A provider owns its own overrides and does not publish them through the
|
|
11
|
+
// read interface. Saying so beats an empty list, which a screen would
|
|
12
|
+
// render as "nobody is overridden" — the opposite of the truth.
|
|
13
|
+
if (!store) {
|
|
14
|
+
return { overrides: [], supported: false };
|
|
15
|
+
}
|
|
16
|
+
return { overrides: await store.listOverrides(name), supported: true };
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=flag-overrides.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-overrides.function.js","sourceRoot":"","sources":["../../../src/functions/flag-overrides.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElD,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAGpC;IACA,KAAK,EAAE,iCAAiC;IACxC,WAAW,EACT,wFAAwF;IAC1F,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,CAAC,kBAAkB,CAAC;IAC5B,IAAI,EAAE,KAAK,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACzC,MAAM,KAAK,GAAG,WAAW,CAAC,YAAY,CAAC,CAAA;QACvC,0EAA0E;QAC1E,sEAAsE;QACtE,gEAAgE;QAChE,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAA;QAC5C,CAAC;QACD,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAA;IACxE,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const flagPrune: import("#pikku/addon/function").PikkuFunctionConfig<null, {
|
|
2
|
+
pruned: string[];
|
|
3
|
+
}, "rpc" | "session", import("#pikku/addon/function").PikkuFunction<null, {
|
|
4
|
+
pruned: string[];
|
|
5
|
+
}, "rpc" | "session", import("#pikku/addon/function").WiredServices> | import("#pikku/addon/function").PikkuFunctionSessionless<null, {
|
|
6
|
+
pruned: string[];
|
|
7
|
+
}, "rpc" | "session", import("#pikku/addon/function").WiredServices, unknown>, undefined, undefined>;
|
|
8
|
+
//# sourceMappingURL=flag-prune.function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-prune.function.d.ts","sourceRoot":"","sources":["../../../src/functions/flag-prune.function.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS;YAA6B,MAAM,EAAE;;;;;oGASzD,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { pikkuFunc } from '#pikku/addon/function';
|
|
2
|
+
import { requireFlagStore } from '../lib/require-flag-store.js';
|
|
3
|
+
export const flagPrune = pikkuFunc({
|
|
4
|
+
title: 'Prune Undeclared Feature Flags',
|
|
5
|
+
description: 'Removes the flags whose declaration has gone from code, and every override on them. Reports what it deleted, which is never assumed from what was stale a moment earlier.',
|
|
6
|
+
expose: true,
|
|
7
|
+
scopes: ['admin:flags:manage'],
|
|
8
|
+
func: async ({ featureFlags }) => {
|
|
9
|
+
return { pruned: await requireFlagStore(featureFlags).pruneFlags() };
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=flag-prune.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-prune.function.js","sourceRoot":"","sources":["../../../src/functions/flag-prune.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAE/D,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAA6B;IAC7D,KAAK,EAAE,gCAAgC;IACvC,WAAW,EACT,2KAA2K;IAC7K,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,CAAC,oBAAoB,CAAC;IAC9B,IAAI,EAAE,KAAK,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE;QAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC,YAAY,CAAC,CAAC,UAAU,EAAE,EAAE,CAAA;IACtE,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const flagSetEnabled: import("#pikku/addon/function").PikkuFunctionConfig<{
|
|
2
|
+
name: string;
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
note?: string;
|
|
5
|
+
}, {
|
|
6
|
+
success: boolean;
|
|
7
|
+
}, "rpc" | "session", import("#pikku/addon/function").PikkuFunction<{
|
|
8
|
+
name: string;
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
note?: string;
|
|
11
|
+
}, {
|
|
12
|
+
success: boolean;
|
|
13
|
+
}, "rpc" | "session", import("#pikku/addon/function").WiredServices> | import("#pikku/addon/function").PikkuFunctionSessionless<{
|
|
14
|
+
name: string;
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
note?: string;
|
|
17
|
+
}, {
|
|
18
|
+
success: boolean;
|
|
19
|
+
}, "rpc" | "session", import("#pikku/addon/function").WiredServices, unknown>, undefined, undefined>;
|
|
20
|
+
//# sourceMappingURL=flag-set-enabled.function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-set-enabled.function.d.ts","sourceRoot":"","sources":["../../../src/functions/flag-set-enabled.function.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc;UACjB,MAAM;aAAW,OAAO;WAAS,MAAM;;aACpC,OAAO;;;;;;;;;;;;;oGAgBlB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { pikkuFunc } from '#pikku/addon/function';
|
|
2
|
+
import { requireFlagStore } from '../lib/require-flag-store.js';
|
|
3
|
+
export const flagSetEnabled = pikkuFunc({
|
|
4
|
+
title: 'Switch a Feature Flag',
|
|
5
|
+
description: 'Turns a feature off for everyone, or back on. Takes effect within the source cache TTL, without a deploy.',
|
|
6
|
+
expose: true,
|
|
7
|
+
scopes: ['admin:flags:manage'],
|
|
8
|
+
func: async ({ featureFlags }, { name, enabled, note }, { session }) => {
|
|
9
|
+
await requireFlagStore(featureFlags).setEnabled(name, enabled, session?.userId, note);
|
|
10
|
+
return { success: true };
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=flag-set-enabled.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-set-enabled.function.js","sourceRoot":"","sources":["../../../src/functions/flag-set-enabled.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAE/D,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAGrC;IACA,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EACT,2GAA2G;IAC7G,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,CAAC,oBAAoB,CAAC;IAC9B,IAAI,EAAE,KAAK,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACrE,MAAM,gBAAgB,CAAC,YAAY,CAAC,CAAC,UAAU,CAC7C,IAAI,EACJ,OAAO,EACP,OAAO,EAAE,MAAM,EACf,IAAI,CACL,CAAA;QACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC1B,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FlagSubject } from '@pikku/core/flag';
|
|
2
|
+
export declare const flagSetOverride: import("#pikku/addon/function").PikkuFunctionConfig<{
|
|
3
|
+
name: string;
|
|
4
|
+
subject: FlagSubject;
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
}, {
|
|
7
|
+
success: boolean;
|
|
8
|
+
}, "rpc" | "session", import("#pikku/addon/function").PikkuFunction<{
|
|
9
|
+
name: string;
|
|
10
|
+
subject: FlagSubject;
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
}, {
|
|
13
|
+
success: boolean;
|
|
14
|
+
}, "rpc" | "session", import("#pikku/addon/function").WiredServices> | import("#pikku/addon/function").PikkuFunctionSessionless<{
|
|
15
|
+
name: string;
|
|
16
|
+
subject: FlagSubject;
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
}, {
|
|
19
|
+
success: boolean;
|
|
20
|
+
}, "rpc" | "session", import("#pikku/addon/function").WiredServices, unknown>, undefined, undefined>;
|
|
21
|
+
//# sourceMappingURL=flag-set-override.function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-set-override.function.d.ts","sourceRoot":"","sources":["../../../src/functions/flag-set-override.function.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAGnD,eAAO,MAAM,eAAe;UAClB,MAAM;aAAW,WAAW;aAAW,OAAO;;aAC3C,OAAO;;;;;;;;;;;;;oGAgBlB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { pikkuFunc } from '#pikku/addon/function';
|
|
2
|
+
import { requireFlagStore } from '../lib/require-flag-store.js';
|
|
3
|
+
export const flagSetOverride = pikkuFunc({
|
|
4
|
+
title: 'Override a Feature Flag',
|
|
5
|
+
description: 'Forces a flag on or off for one organization or user, ahead of the rollout. This is how "off for everyone except these three" stays one row rather than a fan-out.',
|
|
6
|
+
expose: true,
|
|
7
|
+
scopes: ['admin:flags:manage'],
|
|
8
|
+
func: async ({ featureFlags }, { name, subject, enabled }, { session }) => {
|
|
9
|
+
await requireFlagStore(featureFlags).setOverride(name, subject, enabled, session?.userId);
|
|
10
|
+
return { success: true };
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=flag-set-override.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-set-override.function.js","sourceRoot":"","sources":["../../../src/functions/flag-set-override.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAE/D,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAGtC;IACA,KAAK,EAAE,yBAAyB;IAChC,WAAW,EACT,oKAAoK;IACtK,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,CAAC,oBAAoB,CAAC;IAC9B,IAAI,EAAE,KAAK,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACxE,MAAM,gBAAgB,CAAC,YAAY,CAAC,CAAC,WAAW,CAC9C,IAAI,EACJ,OAAO,EACP,OAAO,EACP,OAAO,EAAE,MAAM,CAChB,CAAA;QACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC1B,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const flagSetRollout: import("#pikku/addon/function").PikkuFunctionConfig<{
|
|
2
|
+
name: string;
|
|
3
|
+
percent: number | null;
|
|
4
|
+
}, {
|
|
5
|
+
success: boolean;
|
|
6
|
+
}, "rpc" | "session", import("#pikku/addon/function").PikkuFunction<{
|
|
7
|
+
name: string;
|
|
8
|
+
percent: number | null;
|
|
9
|
+
}, {
|
|
10
|
+
success: boolean;
|
|
11
|
+
}, "rpc" | "session", import("#pikku/addon/function").WiredServices> | import("#pikku/addon/function").PikkuFunctionSessionless<{
|
|
12
|
+
name: string;
|
|
13
|
+
percent: number | null;
|
|
14
|
+
}, {
|
|
15
|
+
success: boolean;
|
|
16
|
+
}, "rpc" | "session", import("#pikku/addon/function").WiredServices, unknown>, undefined, undefined>;
|
|
17
|
+
//# sourceMappingURL=flag-set-rollout.function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-set-rollout.function.d.ts","sourceRoot":"","sources":["../../../src/functions/flag-set-rollout.function.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc;UACjB,MAAM;aAAW,MAAM,GAAG,IAAI;;aAC3B,OAAO;;;;;;;;;;;oGAkBlB,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { pikkuFunc } from '#pikku/addon/function';
|
|
2
|
+
import { requireFlagStore } from '../lib/require-flag-store.js';
|
|
3
|
+
export const flagSetRollout = pikkuFunc({
|
|
4
|
+
title: 'Set a Feature Flag Rollout',
|
|
5
|
+
description: 'Admits a percentage of subjects to a flag, or null to drop the constraint. A subject stays in or out across requests — the bucket is hashed from the flag and the subject, never sampled.',
|
|
6
|
+
expose: true,
|
|
7
|
+
scopes: ['admin:flags:manage'],
|
|
8
|
+
func: async ({ featureFlags }, { name, percent }, { session }) => {
|
|
9
|
+
if (percent !== null && (percent < 0 || percent > 100)) {
|
|
10
|
+
throw new Error('A rollout percentage is 0–100, or null for no rollout');
|
|
11
|
+
}
|
|
12
|
+
await requireFlagStore(featureFlags).setRollout(name, percent, session?.userId);
|
|
13
|
+
return { success: true };
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=flag-set-rollout.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-set-rollout.function.js","sourceRoot":"","sources":["../../../src/functions/flag-set-rollout.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAE/D,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAGrC;IACA,KAAK,EAAE,4BAA4B;IACnC,WAAW,EACT,2LAA2L;IAC7L,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,CAAC,oBAAoB,CAAC;IAC9B,IAAI,EAAE,KAAK,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAC/D,IAAI,OAAO,KAAK,IAAI,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,OAAO,GAAG,GAAG,CAAC,EAAE,CAAC;YACvD,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAA;QAC1E,CAAC;QACD,MAAM,gBAAgB,CAAC,YAAY,CAAC,CAAC,UAAU,CAC7C,IAAI,EACJ,OAAO,EACP,OAAO,EAAE,MAAM,CAChB,CAAA;QACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC1B,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const flagSync: import("#pikku/addon/function").PikkuFunctionConfig<null, {
|
|
2
|
+
synced: number;
|
|
3
|
+
}, "rpc" | "session", import("#pikku/addon/function").PikkuFunction<null, {
|
|
4
|
+
synced: number;
|
|
5
|
+
}, "rpc" | "session", import("#pikku/addon/function").WiredServices> | import("#pikku/addon/function").PikkuFunctionSessionless<null, {
|
|
6
|
+
synced: number;
|
|
7
|
+
}, "rpc" | "session", import("#pikku/addon/function").WiredServices, unknown>, undefined, undefined>;
|
|
8
|
+
//# sourceMappingURL=flag-sync.function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-sync.function.d.ts","sourceRoot":"","sources":["../../../src/functions/flag-sync.function.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ;YAA6B,MAAM;;;;;oGAkBtD,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { pikkuFunc } from '#pikku/addon/function';
|
|
2
|
+
import { requireFlagStore } from '../lib/require-flag-store.js';
|
|
3
|
+
export const flagSync = pikkuFunc({
|
|
4
|
+
title: 'Create Rows for Declared Feature Flags',
|
|
5
|
+
description: 'Registers every flag the running app declares that the store has never heard of. An unbacked flag resolves as available for everyone, so this is how a dark launch is actually held dark.',
|
|
6
|
+
expose: true,
|
|
7
|
+
scopes: ['admin:flags:manage'],
|
|
8
|
+
func: async ({ featureFlags }) => {
|
|
9
|
+
const store = requireFlagStore(featureFlags);
|
|
10
|
+
// The running app's own declarations, not a list from the caller: a client
|
|
11
|
+
// that could name the flags to create could create one nothing declares,
|
|
12
|
+
// which is the drift this exists to clear.
|
|
13
|
+
const declared = store.declaredFlags?.() ?? [];
|
|
14
|
+
if (declared.length === 0) {
|
|
15
|
+
return { synced: 0 };
|
|
16
|
+
}
|
|
17
|
+
await store.syncFlags([...declared]);
|
|
18
|
+
return { synced: declared.length };
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=flag-sync.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-sync.function.js","sourceRoot":"","sources":["../../../src/functions/flag-sync.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAE/D,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,CAA2B;IAC1D,KAAK,EAAE,wCAAwC;IAC/C,WAAW,EACT,2LAA2L;IAC7L,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,CAAC,oBAAoB,CAAC;IAC9B,IAAI,EAAE,KAAK,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE;QAC/B,MAAM,KAAK,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAA;QAC5C,2EAA2E;QAC3E,yEAAyE;QACzE,2CAA2C;QAC3C,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,CAAA;QAC9C,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC1B,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,CAAA;QACtB,CAAC;QACD,MAAM,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAA;QACpC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAA;IACpC,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Answers "am I wired?" and nothing else.
|
|
3
|
+
*
|
|
4
|
+
* The console UI ships with screens for users, roles and scopes, credentials
|
|
5
|
+
* and the audit trail, but the app serving it may never have wired this addon.
|
|
6
|
+
* Those screens probe for this function so they can say the addon is not
|
|
7
|
+
* enabled, instead of failing one request at a time.
|
|
8
|
+
*
|
|
9
|
+
* The probe discriminates on `RPCNotFoundError` (404), not on success: name
|
|
10
|
+
* resolution runs before the session check, so an unwired addon 404s even for
|
|
11
|
+
* an anonymous caller, while a wired one answers 200 — or 401/403 if the host
|
|
12
|
+
* gated it with `wireAddon({ auth: true })` or the caller lacks a role. Every
|
|
13
|
+
* one of those means *wired*, which is the only thing the screens need to know.
|
|
14
|
+
*
|
|
15
|
+
* It carries no scopes for the same reason: narrowing who may learn a fact the
|
|
16
|
+
* served UI already implies would only turn a clear answer into a 403.
|
|
17
|
+
*/
|
|
18
|
+
export declare const ping: import("#pikku/addon/function").PikkuFunctionConfig<null, {
|
|
19
|
+
pong: true;
|
|
20
|
+
}, "rpc" | "session", import("#pikku/addon/function").PikkuFunction<null, {
|
|
21
|
+
pong: true;
|
|
22
|
+
}, "rpc" | "session", import("#pikku/addon/function").WiredServices> | import("#pikku/addon/function").PikkuFunctionSessionless<null, {
|
|
23
|
+
pong: true;
|
|
24
|
+
}, "rpc" | "session", import("#pikku/addon/function").WiredServices, unknown>, undefined, undefined>;
|
|
25
|
+
//# sourceMappingURL=ping.function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ping.function.d.ts","sourceRoot":"","sources":["../../../src/functions/ping.function.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,IAAI;UAA2B,IAAI;;;;;oGAQ9C,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { pikkuFunc } from '#pikku/addon/function';
|
|
2
|
+
/**
|
|
3
|
+
* Answers "am I wired?" and nothing else.
|
|
4
|
+
*
|
|
5
|
+
* The console UI ships with screens for users, roles and scopes, credentials
|
|
6
|
+
* and the audit trail, but the app serving it may never have wired this addon.
|
|
7
|
+
* Those screens probe for this function so they can say the addon is not
|
|
8
|
+
* enabled, instead of failing one request at a time.
|
|
9
|
+
*
|
|
10
|
+
* The probe discriminates on `RPCNotFoundError` (404), not on success: name
|
|
11
|
+
* resolution runs before the session check, so an unwired addon 404s even for
|
|
12
|
+
* an anonymous caller, while a wired one answers 200 — or 401/403 if the host
|
|
13
|
+
* gated it with `wireAddon({ auth: true })` or the caller lacks a role. Every
|
|
14
|
+
* one of those means *wired*, which is the only thing the screens need to know.
|
|
15
|
+
*
|
|
16
|
+
* It carries no scopes for the same reason: narrowing who may learn a fact the
|
|
17
|
+
* served UI already implies would only turn a clear answer into a 403.
|
|
18
|
+
*/
|
|
19
|
+
export const ping = pikkuFunc({
|
|
20
|
+
title: 'Ping',
|
|
21
|
+
description: 'Health check for the Pikku Admin addon. The console UI probes it to tell "addon not installed" apart from a real failure.',
|
|
22
|
+
expose: true,
|
|
23
|
+
func: async () => {
|
|
24
|
+
return { pong: true };
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=ping.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ping.function.js","sourceRoot":"","sources":["../../../src/functions/ping.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,SAAS,CAAuB;IAClD,KAAK,EAAE,MAAM;IACb,WAAW,EACT,2HAA2H;IAC7H,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,KAAK,IAAI,EAAE;QACf,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;IACvB,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-add-scope-to-user.function.d.ts","sourceRoot":"","sources":["../../../src/functions/scope-add-scope-to-user.function.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB;YACpB,MAAM;WAAS,MAAM;;aACpB,OAAO
|
|
1
|
+
{"version":3,"file":"scope-add-scope-to-user.function.d.ts","sourceRoot":"","sources":["../../../src/functions/scope-add-scope-to-user.function.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB;YACpB,MAAM;WAAS,MAAM;;aACpB,OAAO;;;;;;;;;;;oGAWlB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-add-user-to-role.function.d.ts","sourceRoot":"","sources":["../../../src/functions/scope-add-user-to-role.function.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;YACnB,MAAM;UAAQ,MAAM;;aACnB,OAAO
|
|
1
|
+
{"version":3,"file":"scope-add-user-to-role.function.d.ts","sourceRoot":"","sources":["../../../src/functions/scope-add-user-to-role.function.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;YACnB,MAAM;UAAQ,MAAM;;aACnB,OAAO;;;;;;;;;;;oGAWlB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-create-role.function.d.ts","sourceRoot":"","sources":["../../../src/functions/scope-create-role.function.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;UAClB,MAAM;kBAAgB,MAAM;YAAU,MAAM,EAAE;;aAC3C,OAAO
|
|
1
|
+
{"version":3,"file":"scope-create-role.function.d.ts","sourceRoot":"","sources":["../../../src/functions/scope-create-role.function.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;UAClB,MAAM;kBAAgB,MAAM;YAAU,MAAM,EAAE;;aAC3C,OAAO;;;;;;;;;;;;;oGAYlB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-delete-role.function.d.ts","sourceRoot":"","sources":["../../../src/functions/scope-delete-role.function.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;UAClB,MAAM;;aACH,OAAO
|
|
1
|
+
{"version":3,"file":"scope-delete-role.function.d.ts","sourceRoot":"","sources":["../../../src/functions/scope-delete-role.function.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;UAClB,MAAM;;aACH,OAAO;;;;;;;;;oGAUlB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-list-declared.function.d.ts","sourceRoot":"","sources":["../../../src/functions/scope-list-declared.function.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,iBAAiB;YAElB,kBAAkB,EAAE
|
|
1
|
+
{"version":3,"file":"scope-list-declared.function.d.ts","sourceRoot":"","sources":["../../../src/functions/scope-list-declared.function.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,iBAAiB;YAElB,kBAAkB,EAAE;;;;;oGAe9B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-list-roles.function.d.ts","sourceRoot":"","sources":["../../../src/functions/scope-list-roles.function.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAEhD,eAAO,MAAM,cAAc;WAA4B,IAAI,EAAE
|
|
1
|
+
{"version":3,"file":"scope-list-roles.function.d.ts","sourceRoot":"","sources":["../../../src/functions/scope-list-roles.function.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAEhD,eAAO,MAAM,cAAc;WAA4B,IAAI,EAAE;;;;;oGAW3D,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-list-user-roles.function.d.ts","sourceRoot":"","sources":["../../../src/functions/scope-list-user-roles.function.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;YACnB,MAAM;;WACP,MAAM,EAAE;YAAU,MAAM,EAAE;kBAAgB,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"scope-list-user-roles.function.d.ts","sourceRoot":"","sources":["../../../src/functions/scope-list-user-roles.function.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;YACnB,MAAM;;WACP,MAAM,EAAE;YAAU,MAAM,EAAE;kBAAgB,MAAM,EAAE;;;;;;;;;;;;;oGAwB3D,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-remove-scope-from-user.function.d.ts","sourceRoot":"","sources":["../../../src/functions/scope-remove-scope-from-user.function.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB;YACzB,MAAM;WAAS,MAAM;;aACpB,OAAO
|
|
1
|
+
{"version":3,"file":"scope-remove-scope-from-user.function.d.ts","sourceRoot":"","sources":["../../../src/functions/scope-remove-scope-from-user.function.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB;YACzB,MAAM;WAAS,MAAM;;aACpB,OAAO;;;;;;;;;;;oGAWlB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-remove-user-from-role.function.d.ts","sourceRoot":"","sources":["../../../src/functions/scope-remove-user-from-role.function.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB;YACxB,MAAM;UAAQ,MAAM;;aACnB,OAAO
|
|
1
|
+
{"version":3,"file":"scope-remove-user-from-role.function.d.ts","sourceRoot":"","sources":["../../../src/functions/scope-remove-user-from-role.function.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB;YACxB,MAAM;UAAQ,MAAM;;aACnB,OAAO;;;;;;;;;;;oGAWlB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-set-role-scopes.function.d.ts","sourceRoot":"","sources":["../../../src/functions/scope-set-role-scopes.function.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;UACrB,MAAM;YAAU,MAAM,EAAE;;aACrB,OAAO
|
|
1
|
+
{"version":3,"file":"scope-set-role-scopes.function.d.ts","sourceRoot":"","sources":["../../../src/functions/scope-set-role-scopes.function.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;UACrB,MAAM;YAAU,MAAM,EAAE;;aACrB,OAAO;;;;;;;;;;;oGAWlB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const sendSignInLink: import("#pikku/addon/function").PikkuFunctionConfig<{
|
|
2
|
+
email: string;
|
|
3
|
+
callbackURL?: string | undefined;
|
|
4
|
+
}, {
|
|
5
|
+
success: boolean;
|
|
6
|
+
}, "rpc" | "session", import("#pikku/addon/function").PikkuFunction<{
|
|
7
|
+
email: string;
|
|
8
|
+
callbackURL?: string | undefined;
|
|
9
|
+
}, {
|
|
10
|
+
success: boolean;
|
|
11
|
+
}, "rpc" | "session", import("#pikku/addon/function").WiredServices> | import("#pikku/addon/function").PikkuFunctionSessionless<{
|
|
12
|
+
email: string;
|
|
13
|
+
callbackURL?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
success: boolean;
|
|
16
|
+
}, "rpc" | "session", import("#pikku/addon/function").WiredServices, unknown>, undefined, undefined>;
|
|
17
|
+
//# sourceMappingURL=send-sign-in-link.function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-sign-in-link.function.d.ts","sourceRoot":"","sources":["../../../src/functions/send-sign-in-link.function.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;oGAiBzB,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { pikkuFunc } from '#pikku/addon/function';
|
|
2
|
+
import { sendAuthUserSignInLink } from '@pikku/better-auth';
|
|
3
|
+
import { SendSignInLinkInput, Success } from '../lib/user.schemas.js';
|
|
4
|
+
export const sendSignInLink = pikkuFunc({
|
|
5
|
+
title: 'Send Sign-In Link',
|
|
6
|
+
description: 'Mails a user a magic link they can sign in with. With magicLink({ disableSignUp: true }) a link only admits an email that already has a user row, which makes this the invitation for an account created without a password. Requires the magicLink plugin.',
|
|
7
|
+
expose: true,
|
|
8
|
+
// `admin:users:create` rather than a scope of its own: the link is the second
|
|
9
|
+
// half of provisioning an account out of band, and it is strictly weaker than
|
|
10
|
+
// `admin:users:password` — it goes to the user's own inbox, so it hands the
|
|
11
|
+
// caller nothing. A separate leaf would also have to be mirrored byte-for-byte
|
|
12
|
+
// in `@pikku/better-auth`'s tree, making an addon bump un-upgradable on its own.
|
|
13
|
+
scopes: ['admin:users:create'],
|
|
14
|
+
input: SendSignInLinkInput,
|
|
15
|
+
output: Success,
|
|
16
|
+
func: async ({ auth }, { email, callbackURL }) => {
|
|
17
|
+
await sendAuthUserSignInLink(auth, { email, callbackURL });
|
|
18
|
+
return { success: true };
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=send-sign-in-link.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-sign-in-link.function.js","sourceRoot":"","sources":["../../../src/functions/send-sign-in-link.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAErE,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC;IACtC,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EACT,6PAA6P;IAC/P,MAAM,EAAE,IAAI;IACZ,8EAA8E;IAC9E,8EAA8E;IAC9E,4EAA4E;IAC5E,+EAA+E;IAC/E,iFAAiF;IACjF,MAAM,EAAE,CAAC,oBAAoB,CAAC;IAC9B,KAAK,EAAE,mBAAmB;IAC1B,MAAM,EAAE,OAAO;IACf,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE;QAC/C,MAAM,sBAAsB,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAA;QAC1D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC1B,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { DeclaredFlag, FlagConfigSnapshot } from '@pikku/core/flag';
|
|
2
|
+
import type { FlagRow } from '@pikku/core/services';
|
|
3
|
+
/**
|
|
4
|
+
* `backed` is false for a flag declared in code that the backing store has
|
|
5
|
+
* never heard of. It resolves as available for everyone — an absent row fails
|
|
6
|
+
* open — so a dark launch nobody created in the provider is already live, and
|
|
7
|
+
* this is the only place that says so.
|
|
8
|
+
*/
|
|
9
|
+
export type FlagListRow = FlagRow & {
|
|
10
|
+
backed: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const sortFlagRows: (rows: FlagListRow[]) => FlagListRow[];
|
|
13
|
+
/**
|
|
14
|
+
* The declared set joined onto a provider's snapshot.
|
|
15
|
+
*
|
|
16
|
+
* The declaration leads rather than the snapshot: a flag the provider holds and
|
|
17
|
+
* code does not declare can never be read — no `featureFlag:` names it and the
|
|
18
|
+
* client map is built from the declarations — so listing it would offer an
|
|
19
|
+
* operator a switch that changes nothing.
|
|
20
|
+
*/
|
|
21
|
+
export declare const flagRowsFromSource: (declared: readonly DeclaredFlag[], snapshot: FlagConfigSnapshot) => FlagListRow[];
|
|
22
|
+
//# sourceMappingURL=flag-rows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-rows.d.ts","sourceRoot":"","sources":["../../../src/lib/flag-rows.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACxE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,CAAA;AAIvD,eAAO,MAAM,YAAY,SAAU,WAAW,EAAE,KAAG,WAAW,EAC3C,CAAA;AAEnB;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,aACnB,SAAS,YAAY,EAAE,YACvB,kBAAkB,KAC3B,WAAW,EAYX,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const byName = (a, b) => a.name.localeCompare(b.name);
|
|
2
|
+
export const sortFlagRows = (rows) => rows.sort(byName);
|
|
3
|
+
/**
|
|
4
|
+
* The declared set joined onto a provider's snapshot.
|
|
5
|
+
*
|
|
6
|
+
* The declaration leads rather than the snapshot: a flag the provider holds and
|
|
7
|
+
* code does not declare can never be read — no `featureFlag:` names it and the
|
|
8
|
+
* client map is built from the declarations — so listing it would offer an
|
|
9
|
+
* operator a switch that changes nothing.
|
|
10
|
+
*/
|
|
11
|
+
export const flagRowsFromSource = (declared, snapshot) => sortFlagRows(declared.map((flag) => {
|
|
12
|
+
const row = snapshot[flag.name];
|
|
13
|
+
return {
|
|
14
|
+
...flag,
|
|
15
|
+
enabled: row?.enabled ?? true,
|
|
16
|
+
rolloutPercent: row?.rolloutPercent ?? null,
|
|
17
|
+
declared: true,
|
|
18
|
+
backed: row !== undefined,
|
|
19
|
+
};
|
|
20
|
+
}));
|
|
21
|
+
//# sourceMappingURL=flag-rows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-rows.js","sourceRoot":"","sources":["../../../src/lib/flag-rows.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,GAAG,CAAC,CAAc,EAAE,CAAc,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAE/E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAmB,EAAiB,EAAE,CACjE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAEnB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,QAAiC,EACjC,QAA4B,EACb,EAAE,CACjB,YAAY,CACV,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;IACpB,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC/B,OAAO;QACL,GAAG,IAAI;QACP,OAAO,EAAE,GAAG,EAAE,OAAO,IAAI,IAAI;QAC7B,cAAc,EAAE,GAAG,EAAE,cAAc,IAAI,IAAI;QAC3C,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,GAAG,KAAK,SAAS;KAC1B,CAAA;AACH,CAAC,CAAC,CACH,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-rows.test.d.ts","sourceRoot":"","sources":["../../../src/lib/flag-rows.test.ts"],"names":[],"mappings":""}
|