@norbix.ai/react-redux 1.8.0 → 1.8.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 +34 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -221,6 +221,40 @@ Every `hub.database` method (73) and every `api.database` method (22) of `@norbi
|
|
|
221
221
|
| `useFindOwnQuery` | `api.database.findOwn` | provides `DatabaseCollections/<collectionName>` |
|
|
222
222
|
| `useFindMergedTermTreeQuery` | `api.database.findMergedTermTree` | provides `DatabaseTaxonomyTerms/<taxonomyName>` |
|
|
223
223
|
|
|
224
|
+
### Module switches send `PUT` (core SDK 4.10.0)
|
|
225
|
+
|
|
226
|
+
The module enable / disable hooks were always mutations, so nothing changes in your code. From `@norbix.ai/ts` 4.10.0 they send `PUT` instead of `GET` on the wire, matching the gateway:
|
|
227
|
+
|
|
228
|
+
| Hooks | Route | Cache |
|
|
229
|
+
| ------------------------------------------------------------- | ---------------------------------------------------- | ------------------------ |
|
|
230
|
+
| `useEnableDatabaseMutation`, `useDisableDatabaseMutation` | `PUT /{version}/database/enable\|disable` | invalidates `Database` |
|
|
231
|
+
| `useEnableFilesMutation`, `useDisableFilesMutation` | `PUT /{version}/files/enable\|disable` | invalidates `Files` |
|
|
232
|
+
| `useEnableLoggingMutation`, `useDisableLoggingMutation` | `PUT /{version}/logs/enable\|disable` | invalidates `Logs` |
|
|
233
|
+
| `useEnablePaymentsMutation`, `useDisablePaymentsMutation` | `PUT /{version}/payments/enable\|disable` | invalidates `Payments` |
|
|
234
|
+
| `useEnableMembershipMutation`, `useDisableMembershipMutation` | `PUT /{version}/membership/enable\|disable` | invalidates `Membership` |
|
|
235
|
+
| `useEnableEmailMutation`, `useDisableEmailMutation` | `PUT /{version}/notifications/email/enable\|disable` | invalidates `Emails` |
|
|
236
|
+
| `useEnableSmsMutation`, `useDisableSmsMutation` | `PUT /{version}/notifications/sms/enable\|disable` | invalidates `Sms` |
|
|
237
|
+
| `useEnablePushMutation`, `useDisablePushMutation` | `PUT /{version}/notifications/push/enable\|disable` | invalidates `Push` |
|
|
238
|
+
|
|
239
|
+
The gateway still answers the old `GET` on these paths for now (it logs a deprecation warning) and will drop it after gateway 0.2, so upgrade the core SDK before then. The scheduler switch moved to `PUT` earlier (core SDK 4.6.0). The code module (`hub.code`) has no hooks in this package yet; call `useNorbix().hub.code.enableCode(...)` directly.
|
|
240
|
+
|
|
241
|
+
### Schemas per environment
|
|
242
|
+
|
|
243
|
+
`useGetDatabaseSchemasQuery` returns only the schemas of the environment the request targets: the `env` argument, or else the client's environment (`norbix.setEnvironment(...)`, sent as the `norbix-env` header), or `PROD` when neither is set. Each row carries `env`. The schema list settings (`useGetDatabaseSchemaListSettingsQuery` / `useUpdateDatabaseSchemaListSettingsMutation`) are stored per environment too.
|
|
244
|
+
|
|
245
|
+
RTK Query keys its cache by endpoint + arguments, and the client's environment is not an argument. So either pass `env` in the arguments — each environment then has its own cache entry — or reset the cache when you switch:
|
|
246
|
+
|
|
247
|
+
```tsx
|
|
248
|
+
// Per call: TEST and PROD cache apart.
|
|
249
|
+
const { data } = useGetDatabaseSchemasQuery({ env: 'TEST' });
|
|
250
|
+
|
|
251
|
+
// Or switch the whole client and drop what was cached for the old environment.
|
|
252
|
+
norbix.setEnvironment('TEST');
|
|
253
|
+
dispatch(norbixApi.util.invalidateTags(['DatabaseSchemas']));
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
The paging cursors of the schema list (`startingAfter` / `endingBefore`) are schema view ids (`sch_…`). A cursor saved against an older gateway will not match; start the list again from the first page.
|
|
257
|
+
|
|
224
258
|
### End-user AI chat — `norbix.api.ai`
|
|
225
259
|
|
|
226
260
|
For a signed-in project user. `useStartEndUserChatTurnMutation` answers at once with a `turnId`; the answer streams on the user's SSE channel `ai-chat:{projectId}:{authId}` — open it with `norbix.aiChat({ authId })` from `@norbix.ai/ts` (a foreign channel is refused with 403 `AiChatChannelRefused`, no retry). Needs `@norbix.ai/ts` >= 4.3.0.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@norbix.ai/react-redux",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "Official Norbix bindings for React + Redux Toolkit. RTK Query helpers (cache, dedup, refetch, invalidation) over the typed Norbix SDK.",
|
|
5
5
|
"author": "UAB Isidos",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"prepublishOnly": "npm run build"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"@norbix.ai/ts": ">=4.
|
|
62
|
+
"@norbix.ai/ts": ">=4.10.0",
|
|
63
63
|
"@reduxjs/toolkit": ">=2.0.0",
|
|
64
64
|
"react": ">=18.0.0",
|
|
65
65
|
"react-redux": ">=9.0.0"
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@commitlint/cli": "^21.2.2",
|
|
69
69
|
"@commitlint/config-conventional": "^21.2.2",
|
|
70
70
|
"@eslint/js": "^10.0.1",
|
|
71
|
-
"@norbix.ai/ts": "^4.
|
|
71
|
+
"@norbix.ai/ts": "^4.10.0",
|
|
72
72
|
"@reduxjs/toolkit": "^2.12.0",
|
|
73
73
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
74
74
|
"@semantic-release/github": "^12.0.9",
|