@norbix.ai/react-redux 1.11.0 → 1.13.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/README.md +36 -4
- package/dist/index.cjs +117 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +117 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -515,11 +515,11 @@ may call — list, aliases / versions, a call by hand, a sample envelope for a
|
|
|
515
515
|
local run, and the last runs of a trigger or task. The five function hooks
|
|
516
516
|
need `@norbix.ai/ts` 4.19.0.
|
|
517
517
|
|
|
518
|
-
| Area | Hooks
|
|
519
|
-
| --------------- |
|
|
520
|
-
| Module switch | `useEnableCodeModuleMutation`, `useDisableCodeModuleMutation`
|
|
518
|
+
| Area | Hooks | Cache tag |
|
|
519
|
+
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
|
|
520
|
+
| Module switch | `useEnableCodeModuleMutation`, `useDisableCodeModuleMutation` | invalidates `Account`, `Projects`, `Code` |
|
|
521
521
|
| Integrations | `useGetCodeIntegrationsQuery`, `useGetCodeIntegrationQuery`, `useSaveCodeIntegrationMutation`, `useDeleteCodeIntegrationMutation`, `useEnableCodeIntegrationMutation`, `useDisableCodeIntegrationMutation`, `useTestCodeIntegrationMutation` | provides / invalidates `CodeIntegrations/LIST` and `CodeIntegrations/<id>`; `test` touches nothing |
|
|
522
|
-
| Cloud functions | `useGetCodeFunctionsQuery`, `useGetCodeFunctionQualifiersQuery`, `useGetCodeFunctionEventSampleQuery`, `useGetCodeFunctionRunsQuery`, `useInvokeCodeFunctionMutation`
|
|
522
|
+
| Cloud functions | `useGetCodeFunctionsQuery`, `useGetCodeFunctionQualifiersQuery`, `useGetCodeFunctionEventSampleQuery`, `useGetCodeFunctionRunsQuery`, `useInvokeCodeFunctionMutation` | provides `CodeFunctions/LIST`, `CodeFunctions/SAMPLE`, `CodeFunctions/RUNS`; `invoke` touches nothing |
|
|
523
523
|
|
|
524
524
|
```tsx
|
|
525
525
|
const integrationId = 'int_6rBACnEaxQ0x1jTiHtAuWV';
|
|
@@ -544,6 +544,38 @@ The function side — parsing the envelope your function receives — is
|
|
|
544
544
|
`parseFunctionEvent` in the core SDK (`docs/code-functions.md`), not a hook.
|
|
545
545
|
Full method reference: the core SDK's `docs/hub/code.md`.
|
|
546
546
|
|
|
547
|
+
## Code — marketplace
|
|
548
|
+
|
|
549
|
+
The marketplace methods of `hub.code` have hooks too, 1:1 with
|
|
550
|
+
`norbix.hub.code` (gateway contract `Code.Marketplace.md` §14): the catalog of
|
|
551
|
+
listings, the installed connections (`int_…`) with their secrets, token
|
|
552
|
+
mappings and validation test, the vendor function catalog, and the functions
|
|
553
|
+
added on a connection (`func_…`). Every tag is of type `CodeMarketplace`.
|
|
554
|
+
|
|
555
|
+
| Area | Hooks | Cache tag (`CodeMarketplace/…`) |
|
|
556
|
+
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------- |
|
|
557
|
+
| Catalog | `useGetMarketplaceListingsQuery`, `useGetMarketplaceListingQuery`, `useGetMarketplaceListingFunctionTokensQuery` | provides `LISTINGS` |
|
|
558
|
+
| Connections | `useGetMarketplaceIntegrationsQuery`, `useGetMarketplaceIntegrationQuery`, `useSaveMarketplaceIntegrationMutation`, `useDeleteMarketplaceIntegrationMutation`, `useEnableMarketplaceIntegrationMutation`, `useDisableMarketplaceIntegrationMutation`, `useReplaceMarketplaceIntegrationSecretsMutation`, `useRevealMarketplaceIntegrationSecretsMutation`, `useSetMarketplaceIntegrationTokenMappingsMutation`, `useTestMarketplaceIntegrationMutation`, `useGetMarketplaceFunctionCatalogQuery` | `INTEGRATIONS`, `<integrationViewId>`, `CATALOG:<integrationViewId>`; reveal touches nothing |
|
|
559
|
+
| Functions | `useGetMarketplaceFunctionsQuery`, `useGetMarketplaceFunctionQuery`, `useSaveMarketplaceFunctionMutation`, `useDeleteMarketplaceFunctionMutation`, `useEnableMarketplaceFunctionMutation`, `useDisableMarketplaceFunctionMutation`, `useGetMarketplaceFunctionTokensQuery`, `useInvokeMarketplaceFunctionMutation`, `useGetMarketplaceFunctionRunsQuery` | `FUNCTIONS:<integrationViewId>`, `<functionViewId>`, `RUNS`; invoke touches nothing |
|
|
560
|
+
|
|
561
|
+
Revealing secrets is a mutation on purpose: a query would keep the clear values
|
|
562
|
+
in the store's cache.
|
|
563
|
+
|
|
564
|
+
```tsx
|
|
565
|
+
const { data: listings } = useGetMarketplaceListingsQuery({ search: 'slack' });
|
|
566
|
+
const [invoke] = useInvokeMarketplaceFunctionMutation();
|
|
567
|
+
await invoke({ functionViewId: 'func_4hT2b9QkLm3XcT1yRfGh7a', payload: { text: 'Order shipped' } });
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
`useGetMarketplaceFunctionRunsQuery` takes exactly one of `functionId` (a function's own runs from every source — invoke, trigger, scheduler — newest first, up to 50), `triggerId` or `taskId`. A row carries `status` (`ok` / `failed` / `skipped`), `durationMs`, `source`, `correlationId` and `hasDetails`; when `hasDetails` is true, the run's input, steps and response are in the project log — read them with `norbix.hub.code.getMarketplaceFunctionRunDetails(row.correlationId)` from `@norbix.ai/ts` 4.22.0.
|
|
571
|
+
|
|
572
|
+
```tsx
|
|
573
|
+
const { data } = useGetMarketplaceFunctionRunsQuery({
|
|
574
|
+
functionId: 'func_4hT2b9QkLm3XcT1yRfGh7a',
|
|
575
|
+
limit: 20,
|
|
576
|
+
});
|
|
577
|
+
```
|
|
578
|
+
|
|
547
579
|
## Working with terms
|
|
548
580
|
|
|
549
581
|
A **taxonomy** is a named tree of **terms** (labels). A term can have one parent (a clean hierarchy) or several parents (the same item under many categories). There is one read hook per scenario — pick the one that matches what you want:
|
package/dist/index.cjs
CHANGED
|
@@ -1523,6 +1523,122 @@ var hubLogs = (b) => ({
|
|
|
1523
1523
|
})
|
|
1524
1524
|
});
|
|
1525
1525
|
|
|
1526
|
+
// src/hooks/hub/marketplace.ts
|
|
1527
|
+
var hubCodeMarketplace = (b) => {
|
|
1528
|
+
const callHC = (norbix) => norbix.hub.code;
|
|
1529
|
+
const T = "CodeMarketplace";
|
|
1530
|
+
const integrationId = (arg) => arg?.integrationViewId ?? arg?.IntegrationViewId ?? "CURRENT";
|
|
1531
|
+
const functionId = (arg) => arg?.functionViewId ?? arg?.FunctionViewId ?? "CURRENT";
|
|
1532
|
+
const listings = [{ type: T, id: "LISTINGS" }];
|
|
1533
|
+
const integration = (arg) => [
|
|
1534
|
+
{ type: T, id: "INTEGRATIONS" },
|
|
1535
|
+
{ type: T, id: integrationId(arg) }
|
|
1536
|
+
];
|
|
1537
|
+
const functions = (arg) => [
|
|
1538
|
+
{ type: T, id: `FUNCTIONS:${integrationId(arg)}` },
|
|
1539
|
+
{ type: T, id: functionId(arg) }
|
|
1540
|
+
];
|
|
1541
|
+
return {
|
|
1542
|
+
// ---- Catalog ----
|
|
1543
|
+
getMarketplaceListings: b.query({
|
|
1544
|
+
query: (args) => (norbix) => callHC(norbix).getMarketplaceListings(args),
|
|
1545
|
+
providesTags: listings
|
|
1546
|
+
}),
|
|
1547
|
+
getMarketplaceListing: b.query({
|
|
1548
|
+
query: (args) => (norbix) => callHC(norbix).getMarketplaceListing(args),
|
|
1549
|
+
providesTags: listings
|
|
1550
|
+
}),
|
|
1551
|
+
getMarketplaceListingFunctionTokens: b.query({
|
|
1552
|
+
query: (args) => (norbix) => callHC(norbix).getMarketplaceListingFunctionTokens(args),
|
|
1553
|
+
providesTags: listings
|
|
1554
|
+
}),
|
|
1555
|
+
// ---- Connections ----
|
|
1556
|
+
getMarketplaceIntegrations: b.query({
|
|
1557
|
+
query: (args) => (norbix) => callHC(norbix).getMarketplaceIntegrations(args),
|
|
1558
|
+
providesTags: [{ type: T, id: "INTEGRATIONS" }]
|
|
1559
|
+
}),
|
|
1560
|
+
getMarketplaceIntegration: b.query({
|
|
1561
|
+
query: (args) => (norbix) => callHC(norbix).getMarketplaceIntegration(args),
|
|
1562
|
+
providesTags: (_res, _err, arg) => [{ type: T, id: integrationId(arg) }]
|
|
1563
|
+
}),
|
|
1564
|
+
saveMarketplaceIntegration: b.mutation({
|
|
1565
|
+
query: (args) => (norbix) => callHC(norbix).saveMarketplaceIntegration(args),
|
|
1566
|
+
invalidatesTags: [{ type: T, id: "INTEGRATIONS" }]
|
|
1567
|
+
}),
|
|
1568
|
+
deleteMarketplaceIntegration: b.mutation({
|
|
1569
|
+
query: (args) => (norbix) => callHC(norbix).deleteMarketplaceIntegration(args),
|
|
1570
|
+
invalidatesTags: (_res, _err, arg) => [
|
|
1571
|
+
...integration(arg),
|
|
1572
|
+
{ type: T, id: `FUNCTIONS:${integrationId(arg)}` }
|
|
1573
|
+
]
|
|
1574
|
+
}),
|
|
1575
|
+
enableMarketplaceIntegration: b.mutation({
|
|
1576
|
+
query: (args) => (norbix) => callHC(norbix).enableMarketplaceIntegration(args),
|
|
1577
|
+
invalidatesTags: (_res, _err, arg) => integration(arg)
|
|
1578
|
+
}),
|
|
1579
|
+
disableMarketplaceIntegration: b.mutation({
|
|
1580
|
+
query: (args) => (norbix) => callHC(norbix).disableMarketplaceIntegration(args),
|
|
1581
|
+
invalidatesTags: (_res, _err, arg) => integration(arg)
|
|
1582
|
+
}),
|
|
1583
|
+
replaceMarketplaceIntegrationSecrets: b.mutation({
|
|
1584
|
+
query: (args) => (norbix) => callHC(norbix).replaceMarketplaceIntegrationSecrets(args),
|
|
1585
|
+
invalidatesTags: (_res, _err, arg) => [{ type: T, id: integrationId(arg) }]
|
|
1586
|
+
}),
|
|
1587
|
+
revealMarketplaceIntegrationSecrets: b.mutation({
|
|
1588
|
+
query: (args) => (norbix) => callHC(norbix).revealMarketplaceIntegrationSecrets(args)
|
|
1589
|
+
}),
|
|
1590
|
+
setMarketplaceIntegrationTokenMappings: b.mutation({
|
|
1591
|
+
query: (args) => (norbix) => callHC(norbix).setMarketplaceIntegrationTokenMappings(args),
|
|
1592
|
+
invalidatesTags: (_res, _err, arg) => [{ type: T, id: integrationId(arg) }]
|
|
1593
|
+
}),
|
|
1594
|
+
testMarketplaceIntegration: b.mutation({
|
|
1595
|
+
query: (args) => (norbix) => callHC(norbix).testMarketplaceIntegration(args),
|
|
1596
|
+
invalidatesTags: (_res, _err, arg) => [{ type: T, id: integrationId(arg) }]
|
|
1597
|
+
}),
|
|
1598
|
+
getMarketplaceFunctionCatalog: b.query({
|
|
1599
|
+
query: (args) => (norbix) => callHC(norbix).getMarketplaceFunctionCatalog(args),
|
|
1600
|
+
providesTags: (_res, _err, arg) => [{ type: T, id: `CATALOG:${integrationId(arg)}` }]
|
|
1601
|
+
}),
|
|
1602
|
+
// ---- Functions on a connection ----
|
|
1603
|
+
getMarketplaceFunctions: b.query({
|
|
1604
|
+
query: (args) => (norbix) => callHC(norbix).getMarketplaceFunctions(args),
|
|
1605
|
+
providesTags: (_res, _err, arg) => [{ type: T, id: `FUNCTIONS:${integrationId(arg)}` }]
|
|
1606
|
+
}),
|
|
1607
|
+
getMarketplaceFunction: b.query({
|
|
1608
|
+
query: (args) => (norbix) => callHC(norbix).getMarketplaceFunction(args),
|
|
1609
|
+
providesTags: (_res, _err, arg) => [{ type: T, id: functionId(arg) }]
|
|
1610
|
+
}),
|
|
1611
|
+
saveMarketplaceFunction: b.mutation({
|
|
1612
|
+
query: (args) => (norbix) => callHC(norbix).saveMarketplaceFunction(args),
|
|
1613
|
+
invalidatesTags: (_res, _err, arg) => functions(arg)
|
|
1614
|
+
}),
|
|
1615
|
+
deleteMarketplaceFunction: b.mutation({
|
|
1616
|
+
query: (args) => (norbix) => callHC(norbix).deleteMarketplaceFunction(args),
|
|
1617
|
+
invalidatesTags: (_res, _err, arg) => functions(arg)
|
|
1618
|
+
}),
|
|
1619
|
+
enableMarketplaceFunction: b.mutation({
|
|
1620
|
+
query: (args) => (norbix) => callHC(norbix).enableMarketplaceFunction(args),
|
|
1621
|
+
invalidatesTags: (_res, _err, arg) => functions(arg)
|
|
1622
|
+
}),
|
|
1623
|
+
disableMarketplaceFunction: b.mutation({
|
|
1624
|
+
query: (args) => (norbix) => callHC(norbix).disableMarketplaceFunction(args),
|
|
1625
|
+
invalidatesTags: (_res, _err, arg) => functions(arg)
|
|
1626
|
+
}),
|
|
1627
|
+
getMarketplaceFunctionTokens: b.query({
|
|
1628
|
+
query: (args) => (norbix) => callHC(norbix).getMarketplaceFunctionTokens(args),
|
|
1629
|
+
providesTags: (_res, _err, arg) => [{ type: T, id: functionId(arg) }]
|
|
1630
|
+
}),
|
|
1631
|
+
invokeMarketplaceFunction: b.mutation({
|
|
1632
|
+
query: (args) => (norbix) => callHC(norbix).invokeMarketplaceFunction(args)
|
|
1633
|
+
}),
|
|
1634
|
+
// ---- Last runs (core SDK 4.21.0) ----
|
|
1635
|
+
getMarketplaceFunctionRuns: b.query({
|
|
1636
|
+
query: (args) => (norbix) => callHC(norbix).getMarketplaceFunctionRuns(args),
|
|
1637
|
+
providesTags: [{ type: T, id: "RUNS" }]
|
|
1638
|
+
})
|
|
1639
|
+
};
|
|
1640
|
+
};
|
|
1641
|
+
|
|
1526
1642
|
// src/hooks/hub/membership.ts
|
|
1527
1643
|
var hubMembership = (b) => ({
|
|
1528
1644
|
disableMembership: b.mutation({
|
|
@@ -2337,6 +2453,7 @@ function buildEndpoints(builder) {
|
|
|
2337
2453
|
...hubAi(builder),
|
|
2338
2454
|
...hubApikeys(builder),
|
|
2339
2455
|
...hubCode(builder),
|
|
2456
|
+
...hubCodeMarketplace(builder),
|
|
2340
2457
|
...hubMembership(builder),
|
|
2341
2458
|
...hubDatabase(builder),
|
|
2342
2459
|
...hubFiles(builder),
|