@norbix.ai/react-redux 1.4.0 → 1.5.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 CHANGED
@@ -155,13 +155,13 @@ A _curated_ set of hooks for the most common endpoints. Every hook is end-to-end
155
155
 
156
156
  | Hook | Wraps | Cache tags |
157
157
  | ---------------------------------- | --------------------------------------- | ---------------------------------------------- |
158
- | `useGetAccountProfileQuery` | `hub.account.getAccountProfile` | provides `AccountProfile/CURRENT` |
159
- | `useGetAccountStatusQuery` | `hub.account.getAccountStatus` | provides `AccountProfile/STATUS` |
160
- | `useUpdateAccountProfileMutation` | `hub.account.updateAccountProfile` | invalidates `AccountProfile/CURRENT` |
161
- | `useGetProjectsQuery` | `hub.account.getProjects` | provides `AccountProfile/PROJECTS` |
162
- | `useGetProjectQuery` | `hub.account.getProject` | provides `AccountProfile/PROJECT/<id>` |
163
- | `useCreateProjectMutation` | `hub.account.createProject` | invalidates `AccountProfile/PROJECTS` |
164
- | `useDeleteProjectMutation` | `hub.account.deleteProject` | invalidates `AccountProfile/PROJECTS` |
158
+ | `useGetAccountProfileQuery` | `hub.account.getAccountProfile` | provides `Account` |
159
+ | `useGetAccountStatusQuery` | `hub.account.getAccountStatus` | provides `Account` |
160
+ | `useUpdateAccountProfileMutation` | `hub.account.updateAccountProfile` | invalidates `Account` |
161
+ | `useGetProjectsQuery` | `hub.account.getProjects` | provides `Projects` |
162
+ | `useGetProjectQuery` | `hub.account.getProject` | provides `Projects` |
163
+ | `useCreateProjectMutation` | `hub.account.createProject` | invalidates `Projects` |
164
+ | `useDeleteProjectMutation` | `hub.account.deleteProject` | invalidates `Projects` |
165
165
  | `useListRegionsQuery` | `hub.regions.list` | provides `Regions` |
166
166
  | `useUpdateProjectRegionsMutation` | `hub.regions.updateProjectRegions` | invalidates `Regions` + `Projects` |
167
167
  | `useGetDatabaseSchemasQuery` | `hub.database.getDatabaseSchemas` | provides `Schema/LIST` |
@@ -224,6 +224,57 @@ For a signed-in project user. `useStartEndUserChatTurnMutation` answers at once
224
224
  | `useTestEmbeddingIntegrationMutation` | `hub.ai.testEmbeddingIntegration` | invalidates `Ai` |
225
225
  | `useSetLlmIntegrationAsDefaultMutation` | `hub.ai.setLlmIntegrationAsDefault` | invalidates `Ai` |
226
226
 
227
+ ### Project settings, CORS, languages, admin portal, legal, AI service users — `norbix.hub.account`
228
+
229
+ Every call takes the `projectId` (or the `norbix-project-id` header your client sets) plus the field it changes. Queries provide `Projects`; mutations invalidate `Projects`, so an open `useGetProjectQuery` refetches after a change. AI settings, assistants and usage are in the table above; LLM / MCP integrations are `hub.ai` (`useGetLlmIntegrationsQuery`, `useSaveLlmIntegrationMutation`, `useSetLlmIntegrationAsDefaultMutation`, …). Regions: `useUpdateProjectRegionsMutation` is served by `hub.regions` (it is spread after `hub.account`).
230
+
231
+ | Hook | SDK method | Cache |
232
+ | ----------------------------------------- | ------------------------------------------ | ---------------------- |
233
+ | `useGetProjectsQuery` | `hub.account.getProjects` | provides `Projects` |
234
+ | `useGetProjectQuery` | `hub.account.getProject` | provides `Projects` |
235
+ | `useGetProjectTokensQuery` | `hub.account.getProjectTokens` | provides `Projects` |
236
+ | `useCreateProjectMutation` | `hub.account.createProject` | invalidates `Projects` |
237
+ | `useEnableProjectMutation` | `hub.account.enableProject` | invalidates `Projects` |
238
+ | `useDisableProjectMutation` | `hub.account.disableProject` | invalidates `Projects` |
239
+ | `useDeleteProjectMutation` | `hub.account.deleteProject` | invalidates `Projects` |
240
+ | `useUpdateProjectNameMutation` | `hub.account.updateProjectName` | invalidates `Projects` |
241
+ | `useUpdateProjectDescriptionMutation` | `hub.account.updateProjectDescription` | invalidates `Projects` |
242
+ | `useUpdateProjectUrlMutation` | `hub.account.updateProjectUrl` | invalidates `Projects` |
243
+ | `useUpdateProjectLogoMutation` | `hub.account.updateProjectLogo` | invalidates `Projects` |
244
+ | `useUpdateProjectIconMutation` | `hub.account.updateProjectIcon` | invalidates `Projects` |
245
+ | `useUpdateProjectMainColorMutation` | `hub.account.updateProjectMainColor` | invalidates `Projects` |
246
+ | `useUpdateProjectAccentColorMutation` | `hub.account.updateProjectAccentColor` | invalidates `Projects` |
247
+ | `useUpdateProjectAllowedOriginsMutation` | `hub.account.updateProjectAllowedOrigins` | invalidates `Projects` |
248
+ | `useUpdateProjectLanguagesMutation` | `hub.account.updateProjectLanguages` | invalidates `Projects` |
249
+ | `useUpdateProjectDefaultLanguageMutation` | `hub.account.updateProjectDefaultLanguage` | invalidates `Projects` |
250
+ | `useUpdateProjectAdminUrlMutation` | `hub.account.updateProjectAdminUrl` | invalidates `Projects` |
251
+ | `useUpdateProjectLegalDocumentsMutation` | `hub.account.updateProjectLegalDocuments` | invalidates `Projects` |
252
+ | `useUpdateProjectExposeLegalMutation` | `hub.account.updateProjectExposeLegal` | invalidates `Projects` |
253
+ | `useGetAdminPortalStructureQuery` | `hub.account.getAdminPortalStructure` | provides `Projects` |
254
+ | `useAssignAdminPortalServiceUserMutation` | `hub.account.assignAdminPortalServiceUser` | invalidates `Projects` |
255
+ | `useCreateAiServiceUserMutation` | `hub.account.createAiServiceUser` | invalidates `Projects` |
256
+ | `useListAiServiceUsersQuery` | `hub.account.listAiServiceUsers` | provides `Projects` |
257
+ | `useDeleteAiServiceUserMutation` | `hub.account.deleteAiServiceUser` | invalidates `Projects` |
258
+ | `useRotateAiServiceUserKeyMutation` | `hub.account.rotateAiServiceUserKey` | invalidates `Projects` |
259
+ | `useRevokeAiServiceUserKeyMutation` | `hub.account.revokeAiServiceUserKey` | invalidates `Projects` |
260
+
261
+ `useCreateAiServiceUserMutation` and `useRotateAiServiceUserKeyMutation` return the new key **once** — show it, then drop it from state. The developer MCP endpoint (`hub.account.mcp`, `/account/mcp`) is a JSON-RPC stream for MCP clients and has no hook; call it with `useNorbix()` if you need it.
262
+
263
+ ```tsx
264
+ const { data: project } = useGetProjectQuery({ projectId });
265
+ const [setOrigins] = useUpdateProjectAllowedOriginsMutation();
266
+ await setOrigins({ projectId, origins: ['https://app.example.com'] }).unwrap();
267
+ ```
268
+
269
+ ### Public project config and legal — `norbix.api.public` (no sign-in)
270
+
271
+ | Hook | SDK method | Cache |
272
+ | -------------------------------- | ----------------------------------- | ------------------------------ |
273
+ | `useGetPublicProjectConfigQuery` | `api.public.getPublicProjectConfig` | provides `Config/PUBLIC` |
274
+ | `useGetPublicProjectLegalQuery` | `api.public.getPublicProjectLegal` | provides `Config/LEGAL:<kind>` |
275
+
276
+ The legal document is served only when the project exposes it (`useUpdateProjectExposeLegalMutation`).
277
+
227
278
  ## Public file links
228
279
 
229
280
  A file, or a whole folder prefix, can be made readable by anyone holding its
@@ -285,13 +336,13 @@ Every SMS Hub endpoint (35) has a hook, 1:1 with `norbix.hub.notifications`.
285
336
  Queries provide a tag, mutations invalidate it, so a list re-reads after a
286
337
  write without any manual refetch:
287
338
 
288
- | Area | Hooks | Cache tag |
289
- |---|---|---|
290
- | Module switch | `useEnableSmsMutation`, `useDisableSmsMutation`, `useGetSmsDisableDependenciesQuery` (what a switch-off would affect — read it before disabling), `useGetSmsSettingsQuery` | `Sms`, `SmsSettings` |
291
- | Integrations (providers) | `useGetSmsIntegrationsQuery`, `useGetSmsIntegrationQuery`, `useSaveSmsIntegrationMutation`, `useTestSmsIntegrationMutation`, `useConfirmSmsIntegrationHumanDeliveryMutation`, `useDeleteSmsIntegrationMutation`, `useSetSmsIntegrationAsDefaultMutation`, `useEnableSmsIntegrationMutation`, `useDisableSmsIntegrationMutation` | `SmsIntegrations` |
292
- | Templates | `useGetSmsTemplatesQuery`, `useGetSmsTemplateQuery`, `useCreateSmsTemplateMutation`, `useUpdateSmsTemplateMutation`, `useDeleteSmsTemplateMutation`, `useArchiveSmsTemplateMutation`, `useUnArchiveSmsTemplateMutation`, `useCloneSmsTemplateMutation`, `useGetSmsMessageContentTokensQuery`, `useRenderSmsMutation` | `SmsTemplates`, `Sms` |
293
- | Campaigns | `useGetSmsCampaignsQuery`, `useCreateSmsCampaignMutation`, `useGetSmsCampaignQuery`, `useDeleteSmsCampaignMutation`, `useStopSmsCampaignMutation`, `useGetSmsCampaignStatisticsQuery`, `useGetSmsCampaignBatchesQuery`, `useGetSmsCampaignBatchNotificationsQuery`, `useGetSmsCampaignBatchNotificationQuery`, `useGetSmsCampaignMessagesQuery`, `useGetSmsCampaignMessageQuery` | `SmsCampaigns` |
294
- | Preview | `usePreviewSmsNotificationQuery` (opens with the signed link `hash`, no sign-in — see above) | `Sms` |
339
+ | Area | Hooks | Cache tag |
340
+ | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
341
+ | Module switch | `useEnableSmsMutation`, `useDisableSmsMutation`, `useGetSmsDisableDependenciesQuery` (what a switch-off would affect — read it before disabling), `useGetSmsSettingsQuery` | `Sms`, `SmsSettings` |
342
+ | Integrations (providers) | `useGetSmsIntegrationsQuery`, `useGetSmsIntegrationQuery`, `useSaveSmsIntegrationMutation`, `useTestSmsIntegrationMutation`, `useConfirmSmsIntegrationHumanDeliveryMutation`, `useDeleteSmsIntegrationMutation`, `useSetSmsIntegrationAsDefaultMutation`, `useEnableSmsIntegrationMutation`, `useDisableSmsIntegrationMutation` | `SmsIntegrations` |
343
+ | Templates | `useGetSmsTemplatesQuery`, `useGetSmsTemplateQuery`, `useCreateSmsTemplateMutation`, `useUpdateSmsTemplateMutation`, `useDeleteSmsTemplateMutation`, `useArchiveSmsTemplateMutation`, `useUnArchiveSmsTemplateMutation`, `useCloneSmsTemplateMutation`, `useGetSmsMessageContentTokensQuery`, `useRenderSmsMutation` | `SmsTemplates`, `Sms` |
344
+ | Campaigns | `useGetSmsCampaignsQuery`, `useCreateSmsCampaignMutation`, `useGetSmsCampaignQuery`, `useDeleteSmsCampaignMutation`, `useStopSmsCampaignMutation`, `useGetSmsCampaignStatisticsQuery`, `useGetSmsCampaignBatchesQuery`, `useGetSmsCampaignBatchNotificationsQuery`, `useGetSmsCampaignBatchNotificationQuery`, `useGetSmsCampaignMessagesQuery`, `useGetSmsCampaignMessageQuery` | `SmsCampaigns` |
345
+ | Preview | `usePreviewSmsNotificationQuery` (opens with the signed link `hash`, no sign-in — see above) | `Sms` |
295
346
 
296
347
  ```tsx
297
348
  const [stop, { isLoading }] = useStopSmsCampaignMutation();
package/dist/index.cjs CHANGED
@@ -719,6 +719,46 @@ var hubAccount = (b) => ({
719
719
  setAdminPortalEnabled: b.mutation({
720
720
  query: (args) => (norbix) => norbix.hub.account.setAdminPortalEnabled(args),
721
721
  invalidatesTags: ["Projects"]
722
+ }),
723
+ updateProjectAdminUrl: b.mutation({
724
+ query: (args) => (norbix) => norbix.hub.account.updateProjectAdminUrl(args),
725
+ invalidatesTags: ["Projects"]
726
+ }),
727
+ updateProjectLegalDocuments: b.mutation({
728
+ query: (args) => (norbix) => norbix.hub.account.updateProjectLegalDocuments(args),
729
+ invalidatesTags: ["Projects"]
730
+ }),
731
+ updateProjectExposeLegal: b.mutation({
732
+ query: (args) => (norbix) => norbix.hub.account.updateProjectExposeLegal(args),
733
+ invalidatesTags: ["Projects"]
734
+ }),
735
+ getAdminPortalStructure: b.query({
736
+ query: (args) => (norbix) => norbix.hub.account.getAdminPortalStructure(args),
737
+ providesTags: ["Projects"]
738
+ }),
739
+ assignAdminPortalServiceUser: b.mutation({
740
+ query: (args) => (norbix) => norbix.hub.account.assignAdminPortalServiceUser(args),
741
+ invalidatesTags: ["Projects"]
742
+ }),
743
+ createAiServiceUser: b.mutation({
744
+ query: (args) => (norbix) => norbix.hub.account.createAiServiceUser(args),
745
+ invalidatesTags: ["Projects"]
746
+ }),
747
+ listAiServiceUsers: b.query({
748
+ query: (args) => (norbix) => norbix.hub.account.listAiServiceUsers(args),
749
+ providesTags: ["Projects"]
750
+ }),
751
+ deleteAiServiceUser: b.mutation({
752
+ query: (args) => (norbix) => norbix.hub.account.deleteAiServiceUser(args),
753
+ invalidatesTags: ["Projects"]
754
+ }),
755
+ rotateAiServiceUserKey: b.mutation({
756
+ query: (args) => (norbix) => norbix.hub.account.rotateAiServiceUserKey(args),
757
+ invalidatesTags: ["Projects"]
758
+ }),
759
+ revokeAiServiceUserKey: b.mutation({
760
+ query: (args) => (norbix) => norbix.hub.account.revokeAiServiceUserKey(args),
761
+ invalidatesTags: ["Projects"]
722
762
  })
723
763
  });
724
764