@nubitio/hydra 0.9.10 → 0.10.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/dist/index.cjs CHANGED
@@ -1205,11 +1205,13 @@ function useResourceSchema(apiUrl, options) {
1205
1205
  error,
1206
1206
  supportedOperations: []
1207
1207
  };
1208
- const resolved = getSchemaResolver(data).resolveResource(apiUrl);
1208
+ const resolver = getSchemaResolver(data);
1209
+ const resolved = resolver.resolveResource(apiUrl);
1209
1210
  return {
1210
1211
  ...resolved,
1211
1212
  error: resolved.error,
1212
- isLoading: false
1213
+ isLoading: false,
1214
+ resolveFormDetail: (formDetail) => resolver.resolveFormDetail(apiUrl, formDetail, resolved.embeddedLines)
1213
1215
  };
1214
1216
  }, [
1215
1217
  data,
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { DataRecord, GridData } from "@nubitio/core";
2
- import { DataRecord as DataRecord$1, Field, FormLayout, ResourceFilterDescriptor, ResourceFilterRule, ResourceFormDetail, ResourceLoadOptions, ResourceSchemaResolution, ResourceSortDescriptor, ResourceStore, ResourceStoreFactory, ResourceStoreOptions, SummaryItem } from "@nubitio/crud";
2
+ import { DataRecord as DataRecord$1, EmbeddedLinesSchema, EmbeddedLinesSchema as EmbeddedLinesSchema$1, Field, FormLayout, ResourceFilterDescriptor, ResourceFilterRule, ResourceFormDetail, ResourceLoadOptions, ResourceSchemaResolution, ResourceSortDescriptor, ResourceStore, ResourceStoreFactory, ResourceStoreOptions, SummaryItem, WorkflowSchema, WorkflowSchema as WorkflowSchema$1, WorkflowTransitionSchema } from "@nubitio/crud";
3
3
  import React, { ReactNode } from "react";
4
4
 
5
5
  //#region packages/hydra/HydraRemoteDataSource.d.ts
@@ -165,17 +165,6 @@ interface HydraSupportedOperation {
165
165
  'hydra:method'?: string;
166
166
  method?: string;
167
167
  }
168
- interface WorkflowTransitionSchema {
169
- name: string;
170
- from: string[];
171
- to: string;
172
- label?: string;
173
- roles?: string[];
174
- }
175
- interface WorkflowSchema {
176
- field: string;
177
- transitions: WorkflowTransitionSchema[];
178
- }
179
168
  interface SequenceSchema {
180
169
  field: string;
181
170
  name?: string;
@@ -184,21 +173,13 @@ interface SequenceSchema {
184
173
  scope?: string[];
185
174
  }
186
175
  /** Master-detail line metadata from nubitio/admin-bundle EmbeddedLinesDocumentationNormalizer. */
187
- interface EmbeddedLinesSchema {
188
- propertyName: string;
189
- lineClass: string;
190
- lineEntityClass?: string;
191
- routePath: string;
192
- parentQueryParam: string;
193
- reloadUrl: string;
194
- }
195
176
  interface HydraClass {
196
177
  '@id': string;
197
178
  '@type': string;
198
179
  title: string;
199
180
  supportedProperty: HydraSupportedProperty[];
200
181
  /** State machine metadata from nubitio/workflow-bundle. */
201
- 'x-workflow'?: WorkflowSchema;
182
+ 'x-workflow'?: WorkflowSchema$1;
202
183
  /** Auto-numbering metadata from nubitio/sequence-bundle. */
203
184
  'x-sequence'?: SequenceSchema;
204
185
  /**
@@ -208,7 +189,7 @@ interface HydraClass {
208
189
  */
209
190
  'x-crud-layout'?: FormLayout;
210
191
  /** Embedded line collections declared on parent document resources. */
211
- 'x-embedded-lines'?: EmbeddedLinesSchema[];
192
+ 'x-embedded-lines'?: EmbeddedLinesSchema$1[];
212
193
  /**
213
194
  * Hydra search template describing server-side filterable query params.
214
195
  * Present on collection operations in API Platform JSON-LD responses.
@@ -309,11 +290,11 @@ interface HydraResourceSchema {
309
290
  */
310
291
  supportedOperations?: string[];
311
292
  /** Workflow transitions for auto row actions (nubitio/workflow-bundle). */
312
- workflow?: WorkflowSchema;
293
+ workflow?: WorkflowSchema$1;
313
294
  /** Server-allocated sequence field (nubitio/sequence-bundle). */
314
295
  sequence?: SequenceSchema;
315
296
  /** Embedded line collections (nubitio/admin-bundle). */
316
- embeddedLines?: EmbeddedLinesSchema[];
297
+ embeddedLines?: EmbeddedLinesSchema$1[];
317
298
  }
318
299
  interface OpenApiProperty {
319
300
  type?: string;
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DataRecord, GridData } from "@nubitio/core";
2
2
  import React, { ReactNode } from "react";
3
- import { DataRecord as DataRecord$1, Field, FormLayout, ResourceFilterDescriptor, ResourceFilterRule, ResourceFormDetail, ResourceLoadOptions, ResourceSchemaResolution, ResourceSortDescriptor, ResourceStore, ResourceStoreFactory, ResourceStoreOptions, SummaryItem } from "@nubitio/crud";
3
+ import { DataRecord as DataRecord$1, EmbeddedLinesSchema, EmbeddedLinesSchema as EmbeddedLinesSchema$1, Field, FormLayout, ResourceFilterDescriptor, ResourceFilterRule, ResourceFormDetail, ResourceLoadOptions, ResourceSchemaResolution, ResourceSortDescriptor, ResourceStore, ResourceStoreFactory, ResourceStoreOptions, SummaryItem, WorkflowSchema, WorkflowSchema as WorkflowSchema$1, WorkflowTransitionSchema } from "@nubitio/crud";
4
4
 
5
5
  //#region packages/hydra/HydraRemoteDataSource.d.ts
6
6
  type RemoteFilterDescriptor = ResourceFilterDescriptor;
@@ -165,17 +165,6 @@ interface HydraSupportedOperation {
165
165
  'hydra:method'?: string;
166
166
  method?: string;
167
167
  }
168
- interface WorkflowTransitionSchema {
169
- name: string;
170
- from: string[];
171
- to: string;
172
- label?: string;
173
- roles?: string[];
174
- }
175
- interface WorkflowSchema {
176
- field: string;
177
- transitions: WorkflowTransitionSchema[];
178
- }
179
168
  interface SequenceSchema {
180
169
  field: string;
181
170
  name?: string;
@@ -184,21 +173,13 @@ interface SequenceSchema {
184
173
  scope?: string[];
185
174
  }
186
175
  /** Master-detail line metadata from nubitio/admin-bundle EmbeddedLinesDocumentationNormalizer. */
187
- interface EmbeddedLinesSchema {
188
- propertyName: string;
189
- lineClass: string;
190
- lineEntityClass?: string;
191
- routePath: string;
192
- parentQueryParam: string;
193
- reloadUrl: string;
194
- }
195
176
  interface HydraClass {
196
177
  '@id': string;
197
178
  '@type': string;
198
179
  title: string;
199
180
  supportedProperty: HydraSupportedProperty[];
200
181
  /** State machine metadata from nubitio/workflow-bundle. */
201
- 'x-workflow'?: WorkflowSchema;
182
+ 'x-workflow'?: WorkflowSchema$1;
202
183
  /** Auto-numbering metadata from nubitio/sequence-bundle. */
203
184
  'x-sequence'?: SequenceSchema;
204
185
  /**
@@ -208,7 +189,7 @@ interface HydraClass {
208
189
  */
209
190
  'x-crud-layout'?: FormLayout;
210
191
  /** Embedded line collections declared on parent document resources. */
211
- 'x-embedded-lines'?: EmbeddedLinesSchema[];
192
+ 'x-embedded-lines'?: EmbeddedLinesSchema$1[];
212
193
  /**
213
194
  * Hydra search template describing server-side filterable query params.
214
195
  * Present on collection operations in API Platform JSON-LD responses.
@@ -309,11 +290,11 @@ interface HydraResourceSchema {
309
290
  */
310
291
  supportedOperations?: string[];
311
292
  /** Workflow transitions for auto row actions (nubitio/workflow-bundle). */
312
- workflow?: WorkflowSchema;
293
+ workflow?: WorkflowSchema$1;
313
294
  /** Server-allocated sequence field (nubitio/sequence-bundle). */
314
295
  sequence?: SequenceSchema;
315
296
  /** Embedded line collections (nubitio/admin-bundle). */
316
- embeddedLines?: EmbeddedLinesSchema[];
297
+ embeddedLines?: EmbeddedLinesSchema$1[];
317
298
  }
318
299
  interface OpenApiProperty {
319
300
  type?: string;
package/dist/index.mjs CHANGED
@@ -1181,11 +1181,13 @@ function useResourceSchema(apiUrl, options) {
1181
1181
  error,
1182
1182
  supportedOperations: []
1183
1183
  };
1184
- const resolved = getSchemaResolver(data).resolveResource(apiUrl);
1184
+ const resolver = getSchemaResolver(data);
1185
+ const resolved = resolver.resolveResource(apiUrl);
1185
1186
  return {
1186
1187
  ...resolved,
1187
1188
  error: resolved.error,
1188
- isLoading: false
1189
+ isLoading: false,
1190
+ resolveFormDetail: (formDetail) => resolver.resolveFormDetail(apiUrl, formDetail, resolved.embeddedLines)
1189
1191
  };
1190
1192
  }, [
1191
1193
  data,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nubitio/hydra",
3
- "version": "0.9.10",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "description": "Hydra / OpenAPI adapter for @nubitio/crud — automatic schema discovery and data source from API Platform docs.",
6
6
  "license": "MIT",
@@ -38,6 +38,7 @@
38
38
  "files": [
39
39
  "dist"
40
40
  ],
41
+ "sideEffects": false,
41
42
  "engines": {
42
43
  "node": ">=18.0.0"
43
44
  },
@@ -50,7 +51,7 @@
50
51
  "react": "^18.2.0 || ^19.0.0",
51
52
  "react-dom": "^18.2.0 || ^19.0.0",
52
53
  "react-i18next": "^14.0.0",
53
- "@nubitio/core": "^0.9.10",
54
- "@nubitio/crud": "^0.9.10"
54
+ "@nubitio/core": "^0.10.0",
55
+ "@nubitio/crud": "^0.10.0"
55
56
  }
56
57
  }