@managemint-solutions/entities 1.17.0 → 1.19.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.
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ConfigEntity } from '../configs';
|
|
2
|
+
/**
|
|
3
|
+
* The row of `public.configs` that holds the portal's feature flags. Scott creates and edits
|
|
4
|
+
* it in Supabase Studio; the api reads it by this name and caches the value for a day.
|
|
5
|
+
*/
|
|
6
|
+
export declare const FEATURE_FLAGS_CONFIG_NAME = "portal_feature_flags";
|
|
7
|
+
/**
|
|
8
|
+
* The Redis entry the api writes the flags to, and the portal reads first - the same
|
|
9
|
+
* entry, so one write serves both. Bump the version when the wire shape changes; old
|
|
10
|
+
* entries simply stop matching.
|
|
11
|
+
*/
|
|
12
|
+
export declare const FEATURE_FLAGS_CACHE_VERSION = "v1";
|
|
13
|
+
export declare const FEATURE_FLAGS_CACHE_KEY = "config:v1:portal_feature_flags";
|
|
14
|
+
/**
|
|
15
|
+
* One flag's rule: `true` for everyone, `false` for no one, or on only for the listed
|
|
16
|
+
* emails. Anything else - a missing flag, a malformed rule - is read as off by the portal.
|
|
17
|
+
*/
|
|
18
|
+
export type FeatureFlagRule = boolean | {
|
|
19
|
+
emails: string[];
|
|
20
|
+
};
|
|
21
|
+
/** The `value` of the flags row: one rule per flag, keyed by the flag's name. */
|
|
22
|
+
export type FeatureFlags = Record<string, FeatureFlagRule>;
|
|
23
|
+
/** The flags row itself: a config whose name is fixed and whose value is the flag map. */
|
|
24
|
+
export interface FeatureFlagsConfig extends ConfigEntity {
|
|
25
|
+
name: typeof FEATURE_FLAGS_CONFIG_NAME;
|
|
26
|
+
value: FeatureFlags;
|
|
27
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FEATURE_FLAGS_CACHE_KEY = exports.FEATURE_FLAGS_CACHE_VERSION = exports.FEATURE_FLAGS_CONFIG_NAME = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The row of `public.configs` that holds the portal's feature flags. Scott creates and edits
|
|
6
|
+
* it in Supabase Studio; the api reads it by this name and caches the value for a day.
|
|
7
|
+
*/
|
|
8
|
+
exports.FEATURE_FLAGS_CONFIG_NAME = 'portal_feature_flags';
|
|
9
|
+
/**
|
|
10
|
+
* The Redis entry the api writes the flags to, and the portal reads first - the same
|
|
11
|
+
* entry, so one write serves both. Bump the version when the wire shape changes; old
|
|
12
|
+
* entries simply stop matching.
|
|
13
|
+
*/
|
|
14
|
+
exports.FEATURE_FLAGS_CACHE_VERSION = 'v1';
|
|
15
|
+
exports.FEATURE_FLAGS_CACHE_KEY = `config:${exports.FEATURE_FLAGS_CACHE_VERSION}:${exports.FEATURE_FLAGS_CONFIG_NAME}`;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The contract for the portal's edge cache of each member's own `GET /users/me`.
|
|
3
3
|
*
|
|
4
|
-
* The portal owns the cache (
|
|
5
|
-
* miss); the api never reads it and only
|
|
4
|
+
* The portal owns the cache (Upstash Redis through the sdk cache subpath, one entry per
|
|
5
|
+
* member, written on a miss); the api never reads it and only invalidates tags after a write. Both sides import
|
|
6
6
|
* these so a change to the shape or the tagging is one edit.
|
|
7
7
|
*/
|
|
8
8
|
/** Bump when the LoggedInUser wire shape changes; old entries simply stop matching. */
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* The contract for the portal's edge cache of each member's own `GET /users/me`.
|
|
4
4
|
*
|
|
5
|
-
* The portal owns the cache (
|
|
6
|
-
* miss); the api never reads it and only
|
|
5
|
+
* The portal owns the cache (Upstash Redis through the sdk cache subpath, one entry per
|
|
6
|
+
* member, written on a miss); the api never reads it and only invalidates tags after a write. Both sides import
|
|
7
7
|
* these so a change to the shape or the tagging is one edit.
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
package/package.json
CHANGED