@calimero-network/mero-react 3.0.2 → 4.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/README.md CHANGED
@@ -91,6 +91,8 @@ Props (`MeroProviderConfig & { children }`):
91
91
  | `packageVersion` | `string` | No | Specific version (defaults to latest) |
92
92
  | `registryUrl` | `string` | No | Registry URL override |
93
93
  | `timeoutMs` | `number` | No | HTTP request timeout (default 30000) |
94
+ | `allowedNodeUrls` | `string[]` | No | Origins the OAuth callback may authenticate against. The initiated node is always trusted; this allowlist additionally permits direct-callback entry. A callback `node_url` matching neither is rejected. |
95
+ | `tokenStore` | `TokenStore` | No | Pluggable access/refresh token store. Defaults to localStorage. Pass a `MemoryTokenStore` or cookie-backed store for sensitive deployments (localStorage tokens are XSS-readable). |
94
96
 
95
97
  Modes and their permissions:
96
98
 
@@ -100,7 +102,7 @@ Modes and their permissions:
100
102
  | `MultiContext` | `context:create`, `context:list`, `context:execute` | Apps managing multiple contexts |
101
103
  | `Admin` | `admin` | Admin dashboards, dev tools |
102
104
 
103
- Auth flow: when `connectToNode(url)` is called, the provider redirects to the node's auth page. After login, the node redirects back with tokens in the URL hash. The provider processes these once (StrictMode-safe via ref) and sets `isAuthenticated = true`.
105
+ Auth flow: when `connectToNode(url)` is called, the provider redirects to the node's auth page. After login, the node redirects back with tokens in the URL hash. The provider processes these once (StrictMode-safe via ref) and sets `isAuthenticated = true`. The callback's `node_url` is validated against the node login was initiated with (or `allowedNodeUrls`); a `node_url` matching neither is rejected.
104
106
 
105
107
  Online detection: the provider opens an SSE connection to the node after auth. `isOnline` reflects the SSE connection state — no polling.
106
108
 
@@ -348,7 +350,7 @@ useContexts, useApplicationContexts, useContextGroup, useContextDiscovery
348
350
  useCreateContext, useDeleteContext, useJoinContext
349
351
  useGroupInfo, useGroupMembers, useGroupContexts, useGroupInvitations, useGroupCapabilities
350
352
  useJoinGroup, useDeleteGroup, useAddGroupMembers, useRemoveGroupMembers
351
- useSyncGroup, useNestGroup, useUnnestGroup, useSubgroups
353
+ useSyncGroup, useReparentGroup, useSubgroups
352
354
  useUpgradeGroup, useGroupUpgradeStatus, useRetryGroupUpgrade
353
355
  useRegisterGroupSigningKey, useUpdateGroupSettings
354
356
  useSetGroupMetadata, useSetMemberMetadata, useSetContextMetadata
package/dist/index.cjs CHANGED
@@ -2273,29 +2273,17 @@ function useRetryGroupUpgrade() {
2273
2273
  );
2274
2274
  return { retryGroupUpgrade, loading, error };
2275
2275
  }
2276
- function useNestGroup() {
2276
+ function useReparentGroup() {
2277
2277
  const { mero } = useMero();
2278
2278
  const { loading, error, run } = useAsyncMutation();
2279
- const nestGroup = react.useCallback(
2280
- async (parentGroupId, request) => {
2279
+ const reparentGroup = react.useCallback(
2280
+ async (childGroupId, request) => {
2281
2281
  if (!mero) return null;
2282
- return run(() => mero.admin.nestGroup(parentGroupId, request));
2282
+ return run(() => mero.admin.reparentGroup(childGroupId, request));
2283
2283
  },
2284
2284
  [mero, run]
2285
2285
  );
2286
- return { nestGroup, loading, error };
2287
- }
2288
- function useUnnestGroup() {
2289
- const { mero } = useMero();
2290
- const { loading, error, run } = useAsyncMutation();
2291
- const unnestGroup = react.useCallback(
2292
- async (parentGroupId, request) => {
2293
- if (!mero) return null;
2294
- return run(() => mero.admin.unnestGroup(parentGroupId, request));
2295
- },
2296
- [mero, run]
2297
- );
2298
- return { unnestGroup, loading, error };
2286
+ return { reparentGroup, loading, error };
2299
2287
  }
2300
2288
  function useSubgroups(groupId) {
2301
2289
  const { mero } = useMero();
@@ -2743,9 +2731,9 @@ exports.useNamespaceGroups = useNamespaceGroups;
2743
2731
  exports.useNamespaceIdentity = useNamespaceIdentity;
2744
2732
  exports.useNamespaces = useNamespaces;
2745
2733
  exports.useNamespacesForApplication = useNamespacesForApplication;
2746
- exports.useNestGroup = useNestGroup;
2747
2734
  exports.useRegisterGroupSigningKey = useRegisterGroupSigningKey;
2748
2735
  exports.useRemoveGroupMembers = useRemoveGroupMembers;
2736
+ exports.useReparentGroup = useReparentGroup;
2749
2737
  exports.useResyncContext = useResyncContext;
2750
2738
  exports.useRetryGroupUpgrade = useRetryGroupUpgrade;
2751
2739
  exports.useSetContextMetadata = useSetContextMetadata;
@@ -2758,7 +2746,6 @@ exports.useSubgroupVisibility = useSubgroupVisibility;
2758
2746
  exports.useSubgroups = useSubgroups;
2759
2747
  exports.useSubscription = useSubscription;
2760
2748
  exports.useSyncGroup = useSyncGroup;
2761
- exports.useUnnestGroup = useUnnestGroup;
2762
2749
  exports.useUpdateGroupSettings = useUpdateGroupSettings;
2763
2750
  exports.useUpdateMemberRole = useUpdateMemberRole;
2764
2751
  exports.useUpgradeGroup = useUpgradeGroup;