@norbix.ai/react-redux 1.6.0 → 1.7.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
@@ -332,17 +332,17 @@ integration.
332
332
 
333
333
  ## SMS
334
334
 
335
- Every SMS Hub endpoint (35) has a hook, 1:1 with `norbix.hub.notifications`.
335
+ Every SMS Hub endpoint (34) has a hook, 1:1 with `norbix.hub.notifications`.
336
336
  Queries provide a tag, mutations invalidate it, so a list re-reads after a
337
337
  write without any manual refetch:
338
338
 
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` |
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` | `SmsCampaigns` |
345
+ | Preview | `usePreviewSmsNotificationQuery` (opens with the signed link `hash`, no sign-in — see above) | `Sms` |
346
346
 
347
347
  ```tsx
348
348
  const [stop, { isLoading }] = useStopSmsCampaignMutation();
@@ -366,6 +366,30 @@ it is a mutation only so a render is never served from the cache. The
366
366
  integration hooks can also be produced by `buildIntegrationsEndpoints` (next
367
367
  section) — the shipped ones above are the typed variants.
368
368
 
369
+ ### Your own profile and phone — `norbix.hub.account` (core SDK 4.8.0)
370
+
371
+ An "Account users" SMS campaign (`accountUsers` on `useCreateSmsCampaignMutation`,
372
+ the ids of the account owner / team members) sends to each member's own phone.
373
+ A member reads and sets it with two hooks; members without a phone are skipped.
374
+
375
+ | Hook | SDK method | Wire | Cache |
376
+ | ------------------------------------- | -------------------------------------- | ----------------------- | --------------------- |
377
+ | `useGetMyAccountUserProfileQuery` | `hub.account.getMyAccountUserProfile` | `GET /account/me` | provides `Account` |
378
+ | `useUpdateMyAccountUserPhoneMutation` | `hub.account.updateMyAccountUserPhone` | `PUT /account/me/phone` | invalidates `Account` |
379
+
380
+ ```tsx
381
+ const { data } = useGetMyAccountUserProfileQuery();
382
+ const [setPhone] = useUpdateMyAccountUserPhoneMutation();
383
+
384
+ // E.164: + and the country code, then digits. An empty string clears it.
385
+ await setPhone({ phone: '+37060000000' }).unwrap();
386
+ ```
387
+
388
+ The team list (`useGetAccountCollaboratorsQuery`) also provides `Account`, so it
389
+ re-reads after a phone change. It now pages with flat `startingAfter`,
390
+ `endingBefore` and `pageSize` (default 20), and `projectId` without
391
+ `includeAccountOwner` lists only that project's collaborators.
392
+
369
393
  ## Scheduler
370
394
 
371
395
  Every scheduler Hub endpoint (8) has a hook, 1:1 with `norbix.hub.scheduler`.
package/dist/index.cjs CHANGED
@@ -684,6 +684,20 @@ var hubAccount = (b) => ({
684
684
  query: (args) => (norbix) => norbix.hub.account.getAccountCollaborators(args),
685
685
  providesTags: ["Account"]
686
686
  }),
687
+ /** `GET /account/me` — the signed-in owner or team member's own profile, phone included. */
688
+ getMyAccountUserProfile: b.query({
689
+ query: (args) => (norbix) => norbix.hub.account.getMyAccountUserProfile(args),
690
+ providesTags: ["Account"]
691
+ }),
692
+ /**
693
+ * `PUT /account/me/phone` — set (E.164, e.g. `+37060000000`) or clear (empty)
694
+ * your own phone. "Account users" SMS campaigns send to it, so the team list
695
+ * (`getAccountCollaborators`, also tagged `Account`) re-reads after a change.
696
+ */
697
+ updateMyAccountUserPhone: b.mutation({
698
+ query: (args) => (norbix) => norbix.hub.account.updateMyAccountUserPhone(args),
699
+ invalidatesTags: ["Account"]
700
+ }),
687
701
  sendInviteToTeamMember: b.mutation({
688
702
  query: (args) => (norbix) => norbix.hub.account.sendInviteToTeamMember(args),
689
703
  invalidatesTags: ["Account"]