@norbix.ai/react-redux 1.8.1 → 1.9.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
@@ -211,6 +211,7 @@ Every `hub.database` method (73) and every `api.database` method (22) of `@norbi
211
211
  | `useApplyDatabaseSchemaBundleMutation` | `hub.database.applyDatabaseSchemaBundle` | invalidates `DatabaseSchemas` + taxonomies + terms |
212
212
  | `useUpdateDatabaseSchemaEmbedMutation` | `hub.database.updateDatabaseSchemaEmbed` | invalidates `DatabaseSchemas` |
213
213
  | `useGetDatabaseSchemaListSettingsQuery` | `hub.database.getDatabaseSchemaListSettings` | provides `DatabaseSchemas` |
214
+ | `useGetDatabaseSchemaIndexStatusQuery` | `hub.database.getDatabaseSchemaIndexStatus` | provides `DatabaseSchemas/<id>` — the last schema-index run (building / ready / refused / partial) |
214
215
  | `useUpdateDatabaseSchemaListSettingsMutation` | `hub.database.updateDatabaseSchemaListSettings` | invalidates `DatabaseSchemas` |
215
216
  | `useGetCollectionImportsQuery` | `hub.database.getCollectionImports` | provides `DatabaseImports` |
216
217
  | `useGetCollectionImportQuery` | `hub.database.getCollectionImport` | provides `DatabaseImports` |
@@ -238,6 +239,17 @@ The module enable / disable hooks were always mutations, so nothing changes in y
238
239
 
239
240
  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
 
242
+ ### Bulk record writes (core SDK 4.11.0)
243
+
244
+ `useUpdateManyRecordsMutation` / `useDeleteManyRecordsMutation` (Hub) and `useUpdateManyMutation` / `useDeleteManyMutation` (Api) take a new optional `allRecords` argument. An empty filter (`{}`, or no filter on update) matches the whole collection and the gateway refuses it with `CM-ERRORS-DATABASE-037` unless you pass `allRecords: true`:
245
+
246
+ ```ts
247
+ const [deleteMany] = useDeleteManyRecordsMutation();
248
+ await deleteMany({ collectionName: 'orders', filter: '{}', allRecords: true });
249
+ ```
250
+
251
+ Other gateway rules that now show up as errors from these hooks: an update body with `$` operators (`$inc`, `$set`, …) is refused with `CM-ERRORS-DATABASE-035` (send the plain fields to set); a broken insert or replace document answers `CM-ERRORS-DATABASE-036`; soft-deleted records are "not found" for update, replace and change-owner, and a bulk update skips them. A caller with only own-record rights may now use the bulk hooks; they touch only that caller's records.
252
+
241
253
  ### Schemas per environment
242
254
 
243
255
  `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.
package/dist/index.cjs CHANGED
@@ -1225,6 +1225,15 @@ var hubDatabase = (b) => ({
1225
1225
  query: (args) => (norbix) => norbix.hub.database.getDatabaseSchemaListSettings(args),
1226
1226
  providesTags: ["DatabaseSchemas"]
1227
1227
  }),
1228
+ // The last schema-index run (campaign 24 mongo-indexes): building | ready |
1229
+ // refused | partial, one entry per database. Cached per schema so a List
1230
+ // tab polling one schema never refetches the others.
1231
+ getDatabaseSchemaIndexStatus: b.query({
1232
+ query: (args) => (norbix) => norbix.hub.database.getDatabaseSchemaIndexStatus(args),
1233
+ providesTags: (_res, _err, arg) => [
1234
+ { type: "DatabaseSchemas", id: arg?.id ?? "ANY" }
1235
+ ]
1236
+ }),
1228
1237
  updateDatabaseSchemaListSettings: b.mutation({
1229
1238
  query: (args) => (norbix) => norbix.hub.database.updateDatabaseSchemaListSettings(args),
1230
1239
  invalidatesTags: ["DatabaseSchemas"]