@getpara/shared 1.17.0 → 1.18.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/dist/cjs/types/index.js +1 -0
- package/dist/cjs/types/modal.js +18 -0
- package/dist/cjs/utils/deepEqual.js +46 -0
- package/dist/cjs/utils/index.js +2 -0
- package/dist/cjs/utils/partnerConfig.js +71 -0
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/types/modal.js +15 -0
- package/dist/esm/utils/deepEqual.js +43 -0
- package/dist/esm/utils/index.js +2 -0
- package/dist/esm/utils/partnerConfig.js +68 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/types/modal.d.ts +16 -0
- package/dist/types/types/modal.d.ts.map +1 -0
- package/dist/types/types/partner.d.ts +2 -1
- package/dist/types/types/partner.d.ts.map +1 -1
- package/dist/types/types/partnerAppConfig.d.ts +95 -9
- package/dist/types/types/partnerAppConfig.d.ts.map +1 -1
- package/dist/types/utils/deepEqual.d.ts +15 -0
- package/dist/types/utils/deepEqual.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/partnerConfig.d.ts +28 -0
- package/dist/types/utils/partnerConfig.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/cjs/types/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./assets.js"), exports);
|
|
18
18
|
__exportStar(require("./auth.js"), exports);
|
|
19
|
+
__exportStar(require("./modal.js"), exports);
|
|
19
20
|
__exportStar(require("./otp.js"), exports);
|
|
20
21
|
__exportStar(require("./params.js"), exports);
|
|
21
22
|
__exportStar(require("./partner.js"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthLayout = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Modal layout primitives. Lives in @getpara/shared so both the SDK
|
|
6
|
+
* (modal rendering) and the partner config (`ModalConfig.authLayout`
|
|
7
|
+
* persisted in the developer portal) reference the same enum.
|
|
8
|
+
*
|
|
9
|
+
* The string values are the wire format — they appear in JSONB blobs
|
|
10
|
+
* stored on the partner record. Don't change them without a migration.
|
|
11
|
+
*/
|
|
12
|
+
var AuthLayout;
|
|
13
|
+
(function (AuthLayout) {
|
|
14
|
+
AuthLayout["AUTH_FULL"] = "AUTH:FULL";
|
|
15
|
+
AuthLayout["AUTH_CONDENSED"] = "AUTH:CONDENSED";
|
|
16
|
+
AuthLayout["EXTERNAL_FULL"] = "EXTERNAL:FULL";
|
|
17
|
+
AuthLayout["EXTERNAL_CONDENSED"] = "EXTERNAL:CONDENSED";
|
|
18
|
+
})(AuthLayout || (exports.AuthLayout = AuthLayout = {}));
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deepEqual = deepEqual;
|
|
4
|
+
/**
|
|
5
|
+
* Minimal deep-equality check for plain-data structures (objects, arrays,
|
|
6
|
+
* primitives). Intended for guarding effects against re-set thrash from
|
|
7
|
+
* inline-object props (e.g. `<ParaProvider configOverrides={{ ... }} />`
|
|
8
|
+
* produces a fresh identity every render but typically stable values).
|
|
9
|
+
*
|
|
10
|
+
* Lives in @getpara/shared so frontend (react-sdk-lite provider effects)
|
|
11
|
+
* and any future server-side consumer share one implementation.
|
|
12
|
+
*
|
|
13
|
+
* Not intended for general-purpose use: doesn't handle Maps, Sets, Dates,
|
|
14
|
+
* RegExp, functions, or symbol-keyed properties. Caller must guarantee
|
|
15
|
+
* inputs are JSON-shaped.
|
|
16
|
+
*/
|
|
17
|
+
function deepEqual(a, b) {
|
|
18
|
+
if (a === b)
|
|
19
|
+
return true;
|
|
20
|
+
if (a == null || b == null)
|
|
21
|
+
return a === b;
|
|
22
|
+
if (typeof a !== 'object' || typeof b !== 'object')
|
|
23
|
+
return false;
|
|
24
|
+
if (Array.isArray(a)) {
|
|
25
|
+
if (!Array.isArray(b) || a.length !== b.length)
|
|
26
|
+
return false;
|
|
27
|
+
for (let i = 0; i < a.length; i++) {
|
|
28
|
+
if (!deepEqual(a[i], b[i]))
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
if (Array.isArray(b))
|
|
34
|
+
return false;
|
|
35
|
+
const aKeys = Object.keys(a);
|
|
36
|
+
const bKeys = Object.keys(b);
|
|
37
|
+
if (aKeys.length !== bKeys.length)
|
|
38
|
+
return false;
|
|
39
|
+
for (const key of aKeys) {
|
|
40
|
+
if (!Object.prototype.hasOwnProperty.call(b, key))
|
|
41
|
+
return false;
|
|
42
|
+
if (!deepEqual(a[key], b[key]))
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
}
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -458,4 +458,6 @@ function getNetworkFromChainId(chainId) {
|
|
|
458
458
|
return chainId ? exports.NETWORK_METADATA.find(({ evmChainId: c }) => c?.toString() === chainId)?.internalId : undefined;
|
|
459
459
|
}
|
|
460
460
|
__exportStar(require("./assets.js"), exports);
|
|
461
|
+
__exportStar(require("./deepEqual.js"), exports);
|
|
461
462
|
__exportStar(require("./networks.js"), exports);
|
|
463
|
+
__exportStar(require("./partnerConfig.js"), exports);
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mergePartnerAppConfig = mergePartnerAppConfig;
|
|
4
|
+
/**
|
|
5
|
+
* Deep-merge N `Partial<PartnerAppConfig>` layers left-to-right.
|
|
6
|
+
* Later layers override earlier. Null/undefined values in later layers
|
|
7
|
+
* are treated as absent (do not clobber prior values).
|
|
8
|
+
*
|
|
9
|
+
* Arrays are replaced wholesale (not concatenated) — the later layer's
|
|
10
|
+
* array is the intended value, not an addition.
|
|
11
|
+
*
|
|
12
|
+
* Ordered to accept future ecosystem layer without signature changes:
|
|
13
|
+
* mergePartnerAppConfig(defaults, organizationConfig, partnerConfig, sdkOverrides)
|
|
14
|
+
*
|
|
15
|
+
* Lives in @getpara/shared so server (`partnerConfigResolver`) and SDK
|
|
16
|
+
* (`core-sdk/utils/partnerConfig`) consume the same implementation —
|
|
17
|
+
* eliminates the prior duplication where the two sides could drift.
|
|
18
|
+
*
|
|
19
|
+
* FUTURE — ecosystem locking primitive (see integration plan §6).
|
|
20
|
+
* When the ecosystem layer ships, orgs will need to optionally force specific
|
|
21
|
+
* fields (e.g. enforce a brand color across all partners under an org).
|
|
22
|
+
* Intended evolution without reshaping callers:
|
|
23
|
+
* - Change signature to accept `ConfigLayer = { values, locked?: string[] }` per layer.
|
|
24
|
+
* - After the normal merge, do a second pass reapplying locked values in
|
|
25
|
+
* layer order so an earlier (org) lock beats a later (partner) write.
|
|
26
|
+
* - Add a `locked_fields` storage column (or equivalent) on organizations then.
|
|
27
|
+
* Deliberately not implemented yet — no storage, no UX spec, no callers exercise it.
|
|
28
|
+
*/
|
|
29
|
+
function mergePartnerAppConfig(...layers) {
|
|
30
|
+
const result = {};
|
|
31
|
+
for (const layer of layers) {
|
|
32
|
+
if (!layer)
|
|
33
|
+
continue;
|
|
34
|
+
deepMergeInto(result, layer);
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
function deepMergeInto(target, source) {
|
|
39
|
+
for (const key of Object.keys(source)) {
|
|
40
|
+
const nextValue = source[key];
|
|
41
|
+
if (nextValue === undefined || nextValue === null)
|
|
42
|
+
continue;
|
|
43
|
+
if (isPlainObject(nextValue)) {
|
|
44
|
+
// Recurse into a fresh target object rather than spreading `nextValue`.
|
|
45
|
+
// A spread would share references for any 2nd-level nested objects
|
|
46
|
+
// (e.g. themeConfig.cssOverrides), and a later merge step would mutate
|
|
47
|
+
// the upstream input layer through that shared reference.
|
|
48
|
+
if (!isPlainObject(target[key])) {
|
|
49
|
+
target[key] = {};
|
|
50
|
+
}
|
|
51
|
+
deepMergeInto(target[key], nextValue);
|
|
52
|
+
}
|
|
53
|
+
else if (Array.isArray(nextValue)) {
|
|
54
|
+
// Clone the array so the result and input layers don't share a reference —
|
|
55
|
+
// mutating result.externalWalletConfig.wallets must not bleed into the upstream layer.
|
|
56
|
+
// Replaces wholesale (not concatenated) — see mergePartnerAppConfig docblock.
|
|
57
|
+
target[key] = [...nextValue];
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
target[key] = nextValue;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function isPlainObject(value) {
|
|
65
|
+
if (value === null || typeof value !== 'object')
|
|
66
|
+
return false;
|
|
67
|
+
if (Array.isArray(value))
|
|
68
|
+
return false;
|
|
69
|
+
const proto = Object.getPrototypeOf(value);
|
|
70
|
+
return proto === Object.prototype || proto === null;
|
|
71
|
+
}
|
package/dist/esm/types/index.js
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modal layout primitives. Lives in @getpara/shared so both the SDK
|
|
3
|
+
* (modal rendering) and the partner config (`ModalConfig.authLayout`
|
|
4
|
+
* persisted in the developer portal) reference the same enum.
|
|
5
|
+
*
|
|
6
|
+
* The string values are the wire format — they appear in JSONB blobs
|
|
7
|
+
* stored on the partner record. Don't change them without a migration.
|
|
8
|
+
*/
|
|
9
|
+
export var AuthLayout;
|
|
10
|
+
(function (AuthLayout) {
|
|
11
|
+
AuthLayout["AUTH_FULL"] = "AUTH:FULL";
|
|
12
|
+
AuthLayout["AUTH_CONDENSED"] = "AUTH:CONDENSED";
|
|
13
|
+
AuthLayout["EXTERNAL_FULL"] = "EXTERNAL:FULL";
|
|
14
|
+
AuthLayout["EXTERNAL_CONDENSED"] = "EXTERNAL:CONDENSED";
|
|
15
|
+
})(AuthLayout || (AuthLayout = {}));
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal deep-equality check for plain-data structures (objects, arrays,
|
|
3
|
+
* primitives). Intended for guarding effects against re-set thrash from
|
|
4
|
+
* inline-object props (e.g. `<ParaProvider configOverrides={{ ... }} />`
|
|
5
|
+
* produces a fresh identity every render but typically stable values).
|
|
6
|
+
*
|
|
7
|
+
* Lives in @getpara/shared so frontend (react-sdk-lite provider effects)
|
|
8
|
+
* and any future server-side consumer share one implementation.
|
|
9
|
+
*
|
|
10
|
+
* Not intended for general-purpose use: doesn't handle Maps, Sets, Dates,
|
|
11
|
+
* RegExp, functions, or symbol-keyed properties. Caller must guarantee
|
|
12
|
+
* inputs are JSON-shaped.
|
|
13
|
+
*/
|
|
14
|
+
export function deepEqual(a, b) {
|
|
15
|
+
if (a === b)
|
|
16
|
+
return true;
|
|
17
|
+
if (a == null || b == null)
|
|
18
|
+
return a === b;
|
|
19
|
+
if (typeof a !== 'object' || typeof b !== 'object')
|
|
20
|
+
return false;
|
|
21
|
+
if (Array.isArray(a)) {
|
|
22
|
+
if (!Array.isArray(b) || a.length !== b.length)
|
|
23
|
+
return false;
|
|
24
|
+
for (let i = 0; i < a.length; i++) {
|
|
25
|
+
if (!deepEqual(a[i], b[i]))
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
if (Array.isArray(b))
|
|
31
|
+
return false;
|
|
32
|
+
const aKeys = Object.keys(a);
|
|
33
|
+
const bKeys = Object.keys(b);
|
|
34
|
+
if (aKeys.length !== bKeys.length)
|
|
35
|
+
return false;
|
|
36
|
+
for (const key of aKeys) {
|
|
37
|
+
if (!Object.prototype.hasOwnProperty.call(b, key))
|
|
38
|
+
return false;
|
|
39
|
+
if (!deepEqual(a[key], b[key]))
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
return true;
|
|
43
|
+
}
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -439,4 +439,6 @@ export function getNetworkFromChainId(chainId) {
|
|
|
439
439
|
return chainId ? NETWORK_METADATA.find(({ evmChainId: c }) => c?.toString() === chainId)?.internalId : undefined;
|
|
440
440
|
}
|
|
441
441
|
export * from './assets.js';
|
|
442
|
+
export * from './deepEqual.js';
|
|
442
443
|
export * from './networks.js';
|
|
444
|
+
export * from './partnerConfig.js';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deep-merge N `Partial<PartnerAppConfig>` layers left-to-right.
|
|
3
|
+
* Later layers override earlier. Null/undefined values in later layers
|
|
4
|
+
* are treated as absent (do not clobber prior values).
|
|
5
|
+
*
|
|
6
|
+
* Arrays are replaced wholesale (not concatenated) — the later layer's
|
|
7
|
+
* array is the intended value, not an addition.
|
|
8
|
+
*
|
|
9
|
+
* Ordered to accept future ecosystem layer without signature changes:
|
|
10
|
+
* mergePartnerAppConfig(defaults, organizationConfig, partnerConfig, sdkOverrides)
|
|
11
|
+
*
|
|
12
|
+
* Lives in @getpara/shared so server (`partnerConfigResolver`) and SDK
|
|
13
|
+
* (`core-sdk/utils/partnerConfig`) consume the same implementation —
|
|
14
|
+
* eliminates the prior duplication where the two sides could drift.
|
|
15
|
+
*
|
|
16
|
+
* FUTURE — ecosystem locking primitive (see integration plan §6).
|
|
17
|
+
* When the ecosystem layer ships, orgs will need to optionally force specific
|
|
18
|
+
* fields (e.g. enforce a brand color across all partners under an org).
|
|
19
|
+
* Intended evolution without reshaping callers:
|
|
20
|
+
* - Change signature to accept `ConfigLayer = { values, locked?: string[] }` per layer.
|
|
21
|
+
* - After the normal merge, do a second pass reapplying locked values in
|
|
22
|
+
* layer order so an earlier (org) lock beats a later (partner) write.
|
|
23
|
+
* - Add a `locked_fields` storage column (or equivalent) on organizations then.
|
|
24
|
+
* Deliberately not implemented yet — no storage, no UX spec, no callers exercise it.
|
|
25
|
+
*/
|
|
26
|
+
export function mergePartnerAppConfig(...layers) {
|
|
27
|
+
const result = {};
|
|
28
|
+
for (const layer of layers) {
|
|
29
|
+
if (!layer)
|
|
30
|
+
continue;
|
|
31
|
+
deepMergeInto(result, layer);
|
|
32
|
+
}
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
function deepMergeInto(target, source) {
|
|
36
|
+
for (const key of Object.keys(source)) {
|
|
37
|
+
const nextValue = source[key];
|
|
38
|
+
if (nextValue === undefined || nextValue === null)
|
|
39
|
+
continue;
|
|
40
|
+
if (isPlainObject(nextValue)) {
|
|
41
|
+
// Recurse into a fresh target object rather than spreading `nextValue`.
|
|
42
|
+
// A spread would share references for any 2nd-level nested objects
|
|
43
|
+
// (e.g. themeConfig.cssOverrides), and a later merge step would mutate
|
|
44
|
+
// the upstream input layer through that shared reference.
|
|
45
|
+
if (!isPlainObject(target[key])) {
|
|
46
|
+
target[key] = {};
|
|
47
|
+
}
|
|
48
|
+
deepMergeInto(target[key], nextValue);
|
|
49
|
+
}
|
|
50
|
+
else if (Array.isArray(nextValue)) {
|
|
51
|
+
// Clone the array so the result and input layers don't share a reference —
|
|
52
|
+
// mutating result.externalWalletConfig.wallets must not bleed into the upstream layer.
|
|
53
|
+
// Replaces wholesale (not concatenated) — see mergePartnerAppConfig docblock.
|
|
54
|
+
target[key] = [...nextValue];
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
target[key] = nextValue;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function isPlainObject(value) {
|
|
62
|
+
if (value === null || typeof value !== 'object')
|
|
63
|
+
return false;
|
|
64
|
+
if (Array.isArray(value))
|
|
65
|
+
return false;
|
|
66
|
+
const proto = Object.getPrototypeOf(value);
|
|
67
|
+
return proto === Object.prototype || proto === null;
|
|
68
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modal layout primitives. Lives in @getpara/shared so both the SDK
|
|
3
|
+
* (modal rendering) and the partner config (`ModalConfig.authLayout`
|
|
4
|
+
* persisted in the developer portal) reference the same enum.
|
|
5
|
+
*
|
|
6
|
+
* The string values are the wire format — they appear in JSONB blobs
|
|
7
|
+
* stored on the partner record. Don't change them without a migration.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum AuthLayout {
|
|
10
|
+
AUTH_FULL = "AUTH:FULL",
|
|
11
|
+
AUTH_CONDENSED = "AUTH:CONDENSED",
|
|
12
|
+
EXTERNAL_FULL = "EXTERNAL:FULL",
|
|
13
|
+
EXTERNAL_CONDENSED = "EXTERNAL:CONDENSED"
|
|
14
|
+
}
|
|
15
|
+
export type TAuthLayout = `${AuthLayout}`;
|
|
16
|
+
//# sourceMappingURL=modal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/types/modal.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,oBAAY,UAAU;IACpB,SAAS,cAAc;IACvB,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;IAC/B,kBAAkB,uBAAuB;CAC1C;AAED,MAAM,MAAM,WAAW,GAAG,GAAG,UAAU,EAAE,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { BalancesConfig, OnRampAssets, OnRampProvider } from './assets';
|
|
|
2
2
|
import { AuthMethod, SupportedAccountLinks } from './auth';
|
|
3
3
|
import { DeliveryChannel } from './otp';
|
|
4
4
|
import { SupportedWalletTypes } from './wallet';
|
|
5
|
-
import { FarcasterConfig, ModalConfig, PartnerExternalWalletConfig, PartnerLinks, PartnerThemeConfig } from './partnerAppConfig';
|
|
5
|
+
import { AuthConfig, FarcasterConfig, ModalConfig, PartnerExternalWalletConfig, PartnerLinks, PartnerThemeConfig } from './partnerAppConfig';
|
|
6
6
|
export declare enum ThemeMode {
|
|
7
7
|
LIGHT = "LIGHT",
|
|
8
8
|
DARK = "DARK"
|
|
@@ -47,6 +47,7 @@ export interface IPartnerEntity {
|
|
|
47
47
|
internationalPrimaryChannel?: DeliveryChannel;
|
|
48
48
|
smsFallbackEnabled?: boolean;
|
|
49
49
|
themeConfig?: PartnerThemeConfig | null;
|
|
50
|
+
authConfig?: AuthConfig | null;
|
|
50
51
|
modalConfig?: ModalConfig | null;
|
|
51
52
|
partnerLinks?: PartnerLinks | null;
|
|
52
53
|
externalWalletConfig?: PartnerExternalWalletConfig | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partner.d.ts","sourceRoot":"","sources":["../../../src/types/partner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAA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MAAM,mBAAmB,GAAG,UAAU,CAAC;AAE7C,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AuthMethod, SupportedAccountLinks } from './auth.js';
|
|
2
|
+
import { BalancesConfig } from './assets.js';
|
|
3
|
+
import { TAuthLayout } from './modal.js';
|
|
4
|
+
import { SupportedWalletTypes } from './wallet.js';
|
|
2
5
|
/**
|
|
3
6
|
* New theme shape introduced alongside existing `Theme`.
|
|
4
7
|
* `Theme` (with CustomPalette, dark*Color, overlayBackground) stays available for consumers
|
|
@@ -12,22 +15,63 @@ export interface PartnerThemeConfig {
|
|
|
12
15
|
foregroundMixRatio?: number;
|
|
13
16
|
mode?: 'light' | 'dark';
|
|
14
17
|
font?: string;
|
|
15
|
-
borderRadius?:
|
|
18
|
+
borderRadius?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
16
19
|
cssOverrides?: Record<string, string>;
|
|
17
20
|
}
|
|
18
21
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
22
|
+
* Auth-flow configuration. Partner-driven; consumed by both the modal UI
|
|
23
|
+
* and direct SDK auth calls. Backed by the `partners.auth_config` JSONB
|
|
24
|
+
* column (added in Phase 3 by `splitModalConfigAddAuthConfig` migration —
|
|
25
|
+
* Phase 1 originally lumped these fields into `modal_config`).
|
|
26
|
+
*
|
|
27
|
+
* `supportedAuthMethods` is BW-compat: also persisted on the legacy
|
|
28
|
+
* `partners.supported_auth_methods` text[] column. Resolver synthesizes
|
|
29
|
+
* this field from the legacy column when the JSONB doesn't carry it.
|
|
30
|
+
* Mirrors how `theme_config` synthesizes from legacy color columns.
|
|
31
|
+
* Phase 7 drops the legacy column once all writers have migrated.
|
|
23
32
|
*/
|
|
24
|
-
export interface
|
|
25
|
-
twoFactorAuthEnabled?: boolean;
|
|
26
|
-
isGuestModeEnabled?: boolean;
|
|
33
|
+
export interface AuthConfig {
|
|
27
34
|
oAuthMethods?: string[];
|
|
28
35
|
disableEmailLogin?: boolean;
|
|
29
36
|
disablePhoneLogin?: boolean;
|
|
37
|
+
twoFactorAuthEnabled?: boolean;
|
|
38
|
+
isGuestModeEnabled?: boolean;
|
|
39
|
+
supportedAuthMethods?: AuthMethod[];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Modal-UI configuration. Narrowly scoped to behavior of the modal itself;
|
|
43
|
+
* auth-flow knobs live on `AuthConfig` (see comment above).
|
|
44
|
+
*
|
|
45
|
+
* `hideWallets` and `authLayout` are partner-level UX choices — one project =
|
|
46
|
+
* one wallet-terminology stance, one layout. They moved here from the legacy
|
|
47
|
+
* `ParaModalProps` React surface so partners can configure them in the
|
|
48
|
+
* developer portal (with future ecosystem-default support) instead of
|
|
49
|
+
* code-deploying.
|
|
50
|
+
*
|
|
51
|
+
* Phase 3 note: `hideWallets` and `authLayout` persist correctly today but the
|
|
52
|
+
* modal still renders from the legacy `ParaModalProps.{hideWallets, authLayout}`
|
|
53
|
+
* — these fields are dormant in 3.x. Phase 4 (ENG-6725) wires the modal to
|
|
54
|
+
* read from `paraCore.config.modalConfig` and lights them up.
|
|
55
|
+
*/
|
|
56
|
+
export interface ModalConfig {
|
|
30
57
|
disableAddFundsPrompt?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Whether to suppress wallet-related terminology and on-chain wallet
|
|
60
|
+
* displays in the modal. Partners with non-crypto-feeling UX flip this on.
|
|
61
|
+
*
|
|
62
|
+
* Dormant in 3.x — modal reads from `ParaModalProps.hideWallets` until
|
|
63
|
+
* Phase 4 wires consumption from `paraCore.config.modalConfig`.
|
|
64
|
+
*/
|
|
65
|
+
hideWallets?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* How the modal orders the components on the main auth screen. Only the
|
|
68
|
+
* first method of each type (auth or external) is used.
|
|
69
|
+
* Default: `[AuthLayout.AUTH_FULL, AuthLayout.EXTERNAL_FULL]`
|
|
70
|
+
*
|
|
71
|
+
* Dormant in 3.x — modal reads from `ParaModalProps.authLayout` until
|
|
72
|
+
* Phase 4 wires consumption from `paraCore.config.modalConfig`.
|
|
73
|
+
*/
|
|
74
|
+
authLayout?: TAuthLayout[];
|
|
31
75
|
}
|
|
32
76
|
export interface PartnerLinks {
|
|
33
77
|
xUrl?: string;
|
|
@@ -59,11 +103,53 @@ export interface FarcasterConfig {
|
|
|
59
103
|
*/
|
|
60
104
|
export interface PartnerAppConfig {
|
|
61
105
|
themeConfig?: PartnerThemeConfig | null;
|
|
106
|
+
authConfig?: AuthConfig | null;
|
|
62
107
|
modalConfig?: ModalConfig | null;
|
|
63
108
|
partnerLinks?: PartnerLinks | null;
|
|
64
109
|
externalWalletConfig?: PartnerExternalWalletConfig | null;
|
|
65
110
|
farcasterConfig?: FarcasterConfig | null;
|
|
66
111
|
rpcUrl?: string | null;
|
|
67
112
|
appName?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Phase 3 — partner-authoritative posture/policy fields, lifted onto
|
|
115
|
+
* `PartnerAppConfig` so the SDK can read them via `paraCore.config`.
|
|
116
|
+
* Excluded from `SdkOverridableAppConfig`: SDK callers cannot override
|
|
117
|
+
* these at compile time (they're security/policy boundaries owned by
|
|
118
|
+
* the partner record). `supportedAuthMethods` lives on `AuthConfig`.
|
|
119
|
+
*/
|
|
120
|
+
supportedWalletTypes?: SupportedWalletTypes;
|
|
121
|
+
supportedAccountLinks?: SupportedAccountLinks;
|
|
122
|
+
balancesConfig?: BalancesConfig;
|
|
68
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Subset of `PartnerAppConfig` that SDK callers may override via
|
|
126
|
+
* `ConstructorOpts` or the React provider's `configOverrides` prop.
|
|
127
|
+
*
|
|
128
|
+
* Exclusions enforced at compile time. Each excluded field falls into one
|
|
129
|
+
* of three buckets:
|
|
130
|
+
*
|
|
131
|
+
* 1. Partner-authoritative (security/policy boundary the SDK cannot weaken):
|
|
132
|
+
* - `supportedWalletTypes`, `supportedAccountLinks`, `balancesConfig`
|
|
133
|
+
* - `authConfig.twoFactorAuthEnabled`, `authConfig.supportedAuthMethods`
|
|
134
|
+
* - `externalWalletConfig.walletConnectProjectId`
|
|
135
|
+
*
|
|
136
|
+
* 2. 1:1 with the apikey/project — no per-instance override use case.
|
|
137
|
+
* One project = one of these:
|
|
138
|
+
* - `appName` — partner display name
|
|
139
|
+
* - `partnerLinks.*` — homepage / social URLs (whole namespace)
|
|
140
|
+
*
|
|
141
|
+
* 3. Server-only consumer — only read by user-management (email
|
|
142
|
+
* templates), SDK override would be a no-op:
|
|
143
|
+
* - `farcasterConfig.*` — partner-side mini-app metadata
|
|
144
|
+
*
|
|
145
|
+
* (`themeConfig` is intentionally overridable: the modal can be embedded
|
|
146
|
+
* in different brand contexts under one apikey, so per-instance theme
|
|
147
|
+
* override is a legitimate use case. `rpcUrl` is also intentionally
|
|
148
|
+
* overridable for local-dev — pointing at Anvil/Foundry without
|
|
149
|
+
* polluting the partner record.)
|
|
150
|
+
*/
|
|
151
|
+
export type SdkOverridableAppConfig = Omit<PartnerAppConfig, 'supportedWalletTypes' | 'supportedAccountLinks' | 'balancesConfig' | 'farcasterConfig' | 'partnerLinks' | 'appName'> & {
|
|
152
|
+
authConfig?: Omit<AuthConfig, 'twoFactorAuthEnabled' | 'supportedAuthMethods'> | null;
|
|
153
|
+
externalWalletConfig?: Omit<PartnerExternalWalletConfig, 'walletConnectProjectId'> | null;
|
|
154
|
+
};
|
|
69
155
|
//# sourceMappingURL=partnerAppConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partnerAppConfig.d.ts","sourceRoot":"","sources":["../../../src/types/partnerAppConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"partnerAppConfig.d.ts","sourceRoot":"","sources":["../../../src/types/partnerAppConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,qBAA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gBAAgB,GAAG,iBAAiB,GAAG,cAAc,GAAG,SAAS,CACrH,GAAG;IACF,UAAU,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,sBAAsB,GAAG,sBAAsB,CAAC,GAAG,IAAI,CAAC;IACtF,oBAAoB,CAAC,EAAE,IAAI,CAAC,2BAA2B,EAAE,wBAAwB,CAAC,GAAG,IAAI,CAAC;CAC3F,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal deep-equality check for plain-data structures (objects, arrays,
|
|
3
|
+
* primitives). Intended for guarding effects against re-set thrash from
|
|
4
|
+
* inline-object props (e.g. `<ParaProvider configOverrides={{ ... }} />`
|
|
5
|
+
* produces a fresh identity every render but typically stable values).
|
|
6
|
+
*
|
|
7
|
+
* Lives in @getpara/shared so frontend (react-sdk-lite provider effects)
|
|
8
|
+
* and any future server-side consumer share one implementation.
|
|
9
|
+
*
|
|
10
|
+
* Not intended for general-purpose use: doesn't handle Maps, Sets, Dates,
|
|
11
|
+
* RegExp, functions, or symbol-keyed properties. Caller must guarantee
|
|
12
|
+
* inputs are JSON-shaped.
|
|
13
|
+
*/
|
|
14
|
+
export declare function deepEqual(a: unknown, b: unknown): boolean;
|
|
15
|
+
//# sourceMappingURL=deepEqual.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deepEqual.d.ts","sourceRoot":"","sources":["../../../src/utils/deepEqual.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAsBzD"}
|
|
@@ -6,5 +6,7 @@ export declare const NETWORK_METADATA: (NetworkMetadata & {
|
|
|
6
6
|
export declare function getChainId(network: TNetwork): `${number}` | undefined;
|
|
7
7
|
export declare function getNetworkFromChainId(chainId?: string | undefined): TNetwork | undefined;
|
|
8
8
|
export * from './assets.js';
|
|
9
|
+
export * from './deepEqual.js';
|
|
9
10
|
export * from './networks.js';
|
|
11
|
+
export * from './partnerConfig.js';
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE3E,eAAO,MAAM,gBAAgB,EAAE,CAAC,eAAe,GAAG;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EAib7F,CAAC;AAEF,wBAAgB,UAAU,CAAC,OAAO,EAAE,QAAQ,GAAG,GAAG,MAAM,EAAE,GAAG,SAAS,CAErE;AAED,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAExF;AAED,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE3E,eAAO,MAAM,gBAAgB,EAAE,CAAC,eAAe,GAAG;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EAib7F,CAAC;AAEF,wBAAgB,UAAU,CAAC,OAAO,EAAE,QAAQ,GAAG,GAAG,MAAM,EAAE,GAAG,SAAS,CAErE;AAED,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAExF;AAED,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { PartnerAppConfig } from '../types/partnerAppConfig.js';
|
|
2
|
+
/**
|
|
3
|
+
* Deep-merge N `Partial<PartnerAppConfig>` layers left-to-right.
|
|
4
|
+
* Later layers override earlier. Null/undefined values in later layers
|
|
5
|
+
* are treated as absent (do not clobber prior values).
|
|
6
|
+
*
|
|
7
|
+
* Arrays are replaced wholesale (not concatenated) — the later layer's
|
|
8
|
+
* array is the intended value, not an addition.
|
|
9
|
+
*
|
|
10
|
+
* Ordered to accept future ecosystem layer without signature changes:
|
|
11
|
+
* mergePartnerAppConfig(defaults, organizationConfig, partnerConfig, sdkOverrides)
|
|
12
|
+
*
|
|
13
|
+
* Lives in @getpara/shared so server (`partnerConfigResolver`) and SDK
|
|
14
|
+
* (`core-sdk/utils/partnerConfig`) consume the same implementation —
|
|
15
|
+
* eliminates the prior duplication where the two sides could drift.
|
|
16
|
+
*
|
|
17
|
+
* FUTURE — ecosystem locking primitive (see integration plan §6).
|
|
18
|
+
* When the ecosystem layer ships, orgs will need to optionally force specific
|
|
19
|
+
* fields (e.g. enforce a brand color across all partners under an org).
|
|
20
|
+
* Intended evolution without reshaping callers:
|
|
21
|
+
* - Change signature to accept `ConfigLayer = { values, locked?: string[] }` per layer.
|
|
22
|
+
* - After the normal merge, do a second pass reapplying locked values in
|
|
23
|
+
* layer order so an earlier (org) lock beats a later (partner) write.
|
|
24
|
+
* - Add a `locked_fields` storage column (or equivalent) on organizations then.
|
|
25
|
+
* Deliberately not implemented yet — no storage, no UX spec, no callers exercise it.
|
|
26
|
+
*/
|
|
27
|
+
export declare function mergePartnerAppConfig(...layers: Array<Partial<PartnerAppConfig> | null | undefined>): PartnerAppConfig;
|
|
28
|
+
//# sourceMappingURL=partnerConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partnerConfig.d.ts","sourceRoot":"","sources":["../../../src/utils/partnerConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC,GAAG,gBAAgB,CAOtH"}
|