@palbase/web 2.0.0 → 2.0.1
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/{analytics-facade-ovP0pF2P.d.cts → analytics-facade-ChlBRcLZ.d.cts} +13 -4
- package/dist/{analytics-facade-DMtGDGfd.d.ts → analytics-facade-G0il4NrT.d.ts} +13 -4
- package/dist/{chunk-V6VTX65P.js → chunk-AIPUO4QX.js} +52 -24
- package/dist/chunk-AIPUO4QX.js.map +1 -0
- package/dist/gen/cli.cjs +4 -5
- package/dist/gen/cli.cjs.map +1 -1
- package/dist/gen/cli.js +4 -5
- package/dist/gen/cli.js.map +1 -1
- package/dist/index.cjs +51 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/internal.cjs +51 -23
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +4 -4
- package/dist/internal.d.ts +4 -4
- package/dist/internal.js +1 -1
- package/dist/next/client.cjs +51 -23
- package/dist/next/client.cjs.map +1 -1
- package/dist/next/client.js +1 -1
- package/dist/next/index.cjs +51 -23
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.d.cts +3 -3
- package/dist/next/index.d.ts +3 -3
- package/dist/next/index.js +1 -1
- package/dist/{pb-DDM_mCQB.d.cts → pb-B_6o5p79.d.cts} +1 -1
- package/dist/{pb-CvpcQero.d.ts → pb-nPBhqhJr.d.ts} +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +2 -2
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-V6VTX65P.js.map +0 -1
package/dist/internal.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { P as PalbeConfig, d as PalbeRuntime } from './analytics-facade-
|
|
2
|
-
export { e as buildRuntime } from './analytics-facade-
|
|
1
|
+
import { P as PalbeConfig, d as PalbeRuntime } from './analytics-facade-ChlBRcLZ.cjs';
|
|
2
|
+
export { e as buildRuntime } from './analytics-facade-ChlBRcLZ.cjs';
|
|
3
3
|
import { B as BackendError } from './errors-fDoNdTrJ.cjs';
|
|
4
|
-
export { P as PB, c as createBoundClient } from './pb-
|
|
4
|
+
export { P as PB, c as createBoundClient } from './pb-B_6o5p79.cjs';
|
|
5
5
|
import 'livekit-client';
|
|
6
6
|
import './storage-BPaeSG8K.cjs';
|
|
7
|
-
import './pooled-flags-
|
|
7
|
+
import './pooled-flags-4GtDtsiu.js';
|
|
8
8
|
|
|
9
9
|
interface EndpointDescriptor {
|
|
10
10
|
method: string;
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { P as PalbeConfig, d as PalbeRuntime } from './analytics-facade-
|
|
2
|
-
export { e as buildRuntime } from './analytics-facade-
|
|
1
|
+
import { P as PalbeConfig, d as PalbeRuntime } from './analytics-facade-G0il4NrT.js';
|
|
2
|
+
export { e as buildRuntime } from './analytics-facade-G0il4NrT.js';
|
|
3
3
|
import { B as BackendError } from './errors-fDoNdTrJ.js';
|
|
4
|
-
export { P as PB, c as createBoundClient } from './pb-
|
|
4
|
+
export { P as PB, c as createBoundClient } from './pb-nPBhqhJr.js';
|
|
5
5
|
import 'livekit-client';
|
|
6
6
|
import './storage-BPaeSG8K.js';
|
|
7
|
-
import './pooled-flags-
|
|
7
|
+
import './pooled-flags-4GtDtsiu.js';
|
|
8
8
|
|
|
9
9
|
interface EndpointDescriptor {
|
|
10
10
|
method: string;
|
package/dist/internal.js
CHANGED
package/dist/next/client.cjs
CHANGED
|
@@ -1792,6 +1792,19 @@ var PalbeCalls = class {
|
|
|
1792
1792
|
|
|
1793
1793
|
// ../modules/flags/dist/index.js
|
|
1794
1794
|
var FLAG_NAME_RE = /^[a-zA-Z0-9_-]+$/;
|
|
1795
|
+
function flagEnabled(value) {
|
|
1796
|
+
if (typeof value === "boolean") return value;
|
|
1797
|
+
return value != null && value !== 0 && value !== "";
|
|
1798
|
+
}
|
|
1799
|
+
function flagVariant(value) {
|
|
1800
|
+
return typeof value === "string" ? { name: value } : null;
|
|
1801
|
+
}
|
|
1802
|
+
function mapResponse(res, fn) {
|
|
1803
|
+
if (res.error || res.data == null) {
|
|
1804
|
+
return { ...res, data: null };
|
|
1805
|
+
}
|
|
1806
|
+
return { ...res, data: fn(res.data) };
|
|
1807
|
+
}
|
|
1795
1808
|
var FlagsClient = class {
|
|
1796
1809
|
httpClient;
|
|
1797
1810
|
getCurrentUserId;
|
|
@@ -1811,10 +1824,11 @@ var FlagsClient = class {
|
|
|
1811
1824
|
`Invalid flag name: "${flagName}". Flag names must match ${FLAG_NAME_RE.source}`
|
|
1812
1825
|
);
|
|
1813
1826
|
}
|
|
1814
|
-
const
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1827
|
+
const res = await this.httpClient.request(
|
|
1828
|
+
"GET",
|
|
1829
|
+
this.mergedPath(context)
|
|
1830
|
+
);
|
|
1831
|
+
return mapResponse(res, (snap) => flagEnabled(snap.values?.[flagName]));
|
|
1818
1832
|
}
|
|
1819
1833
|
async getVariant(flagName, context) {
|
|
1820
1834
|
if (!FLAG_NAME_RE.test(flagName)) {
|
|
@@ -1822,16 +1836,29 @@ var FlagsClient = class {
|
|
|
1822
1836
|
`Invalid flag name: "${flagName}". Flag names must match ${FLAG_NAME_RE.source}`
|
|
1823
1837
|
);
|
|
1824
1838
|
}
|
|
1825
|
-
const
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1839
|
+
const res = await this.httpClient.request(
|
|
1840
|
+
"GET",
|
|
1841
|
+
this.mergedPath(context)
|
|
1842
|
+
);
|
|
1843
|
+
if (res.error || res.data == null) {
|
|
1844
|
+
return { ...res, data: null };
|
|
1845
|
+
}
|
|
1846
|
+
return { ...res, data: flagVariant(res.data.values?.[flagName]) };
|
|
1829
1847
|
}
|
|
1830
1848
|
async getAll(context) {
|
|
1831
|
-
const
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1849
|
+
const res = await this.httpClient.request(
|
|
1850
|
+
"GET",
|
|
1851
|
+
this.mergedPath(context)
|
|
1852
|
+
);
|
|
1853
|
+
return mapResponse(res, (snap) => {
|
|
1854
|
+
const values = snap.values ?? {};
|
|
1855
|
+
return Object.keys(values).map((name) => {
|
|
1856
|
+
const value = values[name];
|
|
1857
|
+
const flag = { name, enabled: flagEnabled(value) };
|
|
1858
|
+
if (typeof value === "string") flag.variant = { name: value };
|
|
1859
|
+
return flag;
|
|
1860
|
+
});
|
|
1861
|
+
});
|
|
1835
1862
|
}
|
|
1836
1863
|
/**
|
|
1837
1864
|
* Cold-start read: the full merged flag set for the current auth identity.
|
|
@@ -1930,15 +1957,16 @@ var FlagsClient = class {
|
|
|
1930
1957
|
}
|
|
1931
1958
|
};
|
|
1932
1959
|
}
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1960
|
+
/**
|
|
1961
|
+
* Resolve the merged-read path for a context. With `context.userId` present the
|
|
1962
|
+
* read targets that specific user's merged view (`/v1/user-flags/users/{id}`, a
|
|
1963
|
+
* privileged cross-user read); otherwise the current auth user's view
|
|
1964
|
+
* (`/v1/user-flags`). `context.properties` has no server-side targeting support
|
|
1965
|
+
* in the user-flags module and is ignored.
|
|
1966
|
+
*/
|
|
1967
|
+
mergedPath(context) {
|
|
1968
|
+
const uid = context?.userId;
|
|
1969
|
+
return uid ? `/v1/user-flags/users/${encodeURIComponent(uid)}` : "/v1/user-flags";
|
|
1942
1970
|
}
|
|
1943
1971
|
};
|
|
1944
1972
|
var DEFAULT_POLL_MS = 3e4;
|
|
@@ -2400,7 +2428,7 @@ var PalbeFlags = class {
|
|
|
2400
2428
|
*
|
|
2401
2429
|
* DEVIATION from iOS sync-cache parity: the platform does not propagate
|
|
2402
2430
|
* variant metadata into the user-flags snapshot/delta cache, so this is an
|
|
2403
|
-
* ASYNC transport read (`GET /v1/flags
|
|
2431
|
+
* ASYNC transport read (derived from `GET /v1/user-flags`), not a cache lookup.
|
|
2404
2432
|
*/
|
|
2405
2433
|
async getVariant(key) {
|
|
2406
2434
|
let res;
|
|
@@ -8740,7 +8768,7 @@ function defaultSessionStorage(key) {
|
|
|
8740
8768
|
}
|
|
8741
8769
|
|
|
8742
8770
|
// src/version.ts
|
|
8743
|
-
var VERSION = "2.0.
|
|
8771
|
+
var VERSION = "2.0.1";
|
|
8744
8772
|
|
|
8745
8773
|
// src/runtime.ts
|
|
8746
8774
|
function buildRuntime(config) {
|