@nebulr-group/bridge-auth-core 0.7.0-beta.1 → 0.7.0-beta.2

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.
@@ -6,6 +6,23 @@ export declare class FlagManagementService {
6
6
  list(): Promise<FlagResponse[]>;
7
7
  create(data: CreateFlagInput): Promise<FlagResponse>;
8
8
  update(flagId: string, data: UpdateFlagInput): Promise<FlagResponse>;
9
+ /**
10
+ * Quick on/off switch: `true` sets `state: "on"`, `false` sets `state: "off"`.
11
+ *
12
+ * TBP-548. This used to PUT `{ enabled }`, the Feature Flags 1.0 boolean.
13
+ * FF 2.0 dropped that field from the flag document entirely and decides
14
+ * every evaluation on `state` alone, and the server's write DTO strips
15
+ * anything it does not declare — so the old payload arrived as `{}`. The
16
+ * request returned 200 with the untouched flag, and the caller was told the
17
+ * toggle had worked while the flag kept serving exactly as before. Writing
18
+ * `state` is the same mapping the MCP `toggle_feature_flag` tool settled on
19
+ * (TBP-587), so both surfaces move a flag the same way.
20
+ *
21
+ * Callers that may be toggling a `state: "on-with-rule"` flag ON should
22
+ * check first: `"on"` returns `onValue` to everyone and stops the rule being
23
+ * consulted, which widens the audience rather than flipping a switch. The
24
+ * rule document survives either way, so toggling OFF is reversible.
25
+ */
9
26
  toggle(flagId: string, enabled: boolean): Promise<FlagResponse>;
10
27
  delete(flagId: string): Promise<void>;
11
28
  listSegments(): Promise<SegmentResponse[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"flag.service.d.ts","sourceRoot":"","sources":["../../src/management/flag.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EACV,YAAY,EAAE,eAAe,EAAE,eAAe,EAC9C,eAAe,EAAE,YAAY,EAC9B,MAAM,wBAAwB,CAAC;AAEhC,qBAAa,qBAAqB;IACpB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE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IACG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC;IAM/D,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrC,YAAY,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAI1C,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC;IAI3D,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC;IAI9E,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGtD"}
@@ -12,8 +12,27 @@ export class FlagManagementService {
12
12
  async update(flagId, data) {
13
13
  return this.http.put(`/v1/admin/flags/flag/${flagId}`, data);
14
14
  }
15
+ /**
16
+ * Quick on/off switch: `true` sets `state: "on"`, `false` sets `state: "off"`.
17
+ *
18
+ * TBP-548. This used to PUT `{ enabled }`, the Feature Flags 1.0 boolean.
19
+ * FF 2.0 dropped that field from the flag document entirely and decides
20
+ * every evaluation on `state` alone, and the server's write DTO strips
21
+ * anything it does not declare — so the old payload arrived as `{}`. The
22
+ * request returned 200 with the untouched flag, and the caller was told the
23
+ * toggle had worked while the flag kept serving exactly as before. Writing
24
+ * `state` is the same mapping the MCP `toggle_feature_flag` tool settled on
25
+ * (TBP-587), so both surfaces move a flag the same way.
26
+ *
27
+ * Callers that may be toggling a `state: "on-with-rule"` flag ON should
28
+ * check first: `"on"` returns `onValue` to everyone and stops the rule being
29
+ * consulted, which widens the audience rather than flipping a switch. The
30
+ * rule document survives either way, so toggling OFF is reversible.
31
+ */
15
32
  async toggle(flagId, enabled) {
16
- return this.http.put(`/v1/admin/flags/flag/${flagId}`, { enabled });
33
+ return this.http.put(`/v1/admin/flags/flag/${flagId}`, {
34
+ state: enabled ? 'on' : 'off',
35
+ });
17
36
  }
18
37
  async delete(flagId) {
19
38
  return this.http.delete(`/v1/admin/flags/flag/${flagId}`);
@@ -1 +1 @@
1
- {"version":3,"file":"flag.service.js","sourceRoot":"","sources":["../../src/management/flag.service.ts"],"names":[],"mappings":"AAMA,MAAM,OAAO,qBAAqB;IACH;IAA7B,YAA6B,IAA0B;QAA1B,SAAI,GAAJ,IAAI,CAAsB;IAAG,CAAC;IAE3D,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAiB,uBAAuB,CAAC,CAAC;IAChE,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAAqB;QAChC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAe,sBAAsB,EAAE,IAAI,CAAC,CAAC;IACpE,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAAc,EAAE,IAAqB;QAChD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAe,wBAAwB,MAAM,EAAE,EAAE,IAAI,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAAc,EAAE,OAAgB;QAC3C,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAe,wBAAwB,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACpF,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAAc;QACzB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAO,wBAAwB,MAAM,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAoB,0BAA0B,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,IAAkB;QACpC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAkB,yBAAyB,EAAE,IAAI,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,SAAiB,EAAE,IAAkB;QACvD,OAAO,IAAI,CAAC,IAAI,CAAC,GA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,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,IAAkB;QACpC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAkB,yBAAyB,EAAE,IAAI,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,SAAiB,EAAE,IAAkB;QACvD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAkB,2BAA2B,SAAS,EAAE,EAAE,IAAI,CAAC,CAAC;IACtF,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,SAAiB;QACnC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAO,2BAA2B,SAAS,EAAE,CAAC,CAAC;IACxE,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nebulr-group/bridge-auth-core",
3
- "version": "0.7.0-beta.1",
3
+ "version": "0.7.0-beta.2",
4
4
  "description": "Framework-agnostic auth core for Bridge platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",