@nubitio/hydra 0.5.15 → 0.5.19

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
@@ -409,6 +409,7 @@ function parseHydraDoc(doc, entrypointHrefs) {
409
409
  apiUrl: urlMap[className] ?? `/api/${pluralize(toDashCase(className))}`,
410
410
  fields,
411
411
  formLayout: cls["x-crud-layout"],
412
+ workflow: cls["x-workflow"],
412
413
  searchMappings: extractSearchMappings(cls),
413
414
  supportedOperations: Array.from(new Set([...collectionOperationsMap[className] ?? [], ...extractSupportedOperations(cls)]))
414
415
  };
@@ -906,7 +907,8 @@ function useResourceSchema(apiUrl) {
906
907
  isLoading: false,
907
908
  error: void 0,
908
909
  supportedOperations: resourceSchema.supportedOperations ?? [],
909
- formLayout: resourceSchema.formLayout
910
+ formLayout: resourceSchema.formLayout,
911
+ workflow: resourceSchema.workflow
910
912
  };
911
913
  }, [
912
914
  data,
package/dist/index.d.cts CHANGED
@@ -122,11 +122,24 @@ interface HydraSupportedOperation {
122
122
  'hydra:method'?: string;
123
123
  method?: string;
124
124
  }
125
+ interface WorkflowTransitionSchema {
126
+ name: string;
127
+ from: string[];
128
+ to: string;
129
+ label?: string;
130
+ roles?: string[];
131
+ }
132
+ interface WorkflowSchema {
133
+ field: string;
134
+ transitions: WorkflowTransitionSchema[];
135
+ }
125
136
  interface HydraClass {
126
137
  '@id': string;
127
138
  '@type': string;
128
139
  title: string;
129
140
  supportedProperty: HydraSupportedProperty[];
141
+ /** State machine metadata from nubitio/workflow-bundle. */
142
+ 'x-workflow'?: WorkflowSchema;
130
143
  /**
131
144
  * Class-level UI hints injected by TranslatedDocumentationNormalizer from
132
145
  * the ApiResource's extraProperties['x-crud']['formLayout']. Mirrors
@@ -219,6 +232,8 @@ interface HydraResourceSchema {
219
232
  * Empty array means no operation info was found (fall back to platform defaults).
220
233
  */
221
234
  supportedOperations?: string[];
235
+ /** Workflow transitions for auto row actions (nubitio/workflow-bundle). */
236
+ workflow?: WorkflowSchema;
222
237
  }
223
238
  interface OpenApiProperty {
224
239
  type?: string;
@@ -369,4 +384,4 @@ interface UseSchemaContextResult {
369
384
  */
370
385
  declare function useSchemaContext(): UseSchemaContextResult;
371
386
  //#endregion
372
- export { API_DOC_QUERY_KEY, type ApiDoc, type HydraApiDoc, HydraRemoteDataSource, HydraResourceSchemaProvider, type HydraResourceSchemaProviderProps, HydraResourceStoreProvider, type HydraResourceStoreProviderProps, type OpenApiDoc, type RemoteDataSourceOptions, type RemoteFilterDescriptor, type RemoteLoadOptions, type RemoteSortDescriptor, SchemaProvider, type UseSchemaContextResult, createHydraResourceStore, mapHydraSchemaToFields, parseHydraDoc, parseOpenApiDoc, resolveRangeTag, useHydraMetadata, useResourceSchema, useSchemaContext };
387
+ export { API_DOC_QUERY_KEY, type ApiDoc, type HydraApiDoc, HydraRemoteDataSource, HydraResourceSchemaProvider, type HydraResourceSchemaProviderProps, HydraResourceStoreProvider, type HydraResourceStoreProviderProps, type OpenApiDoc, type RemoteDataSourceOptions, type RemoteFilterDescriptor, type RemoteLoadOptions, type RemoteSortDescriptor, SchemaProvider, type UseSchemaContextResult, type WorkflowSchema, type WorkflowTransitionSchema, createHydraResourceStore, mapHydraSchemaToFields, parseHydraDoc, parseOpenApiDoc, resolveRangeTag, useHydraMetadata, useResourceSchema, useSchemaContext };
package/dist/index.d.mts CHANGED
@@ -122,11 +122,24 @@ interface HydraSupportedOperation {
122
122
  'hydra:method'?: string;
123
123
  method?: string;
124
124
  }
125
+ interface WorkflowTransitionSchema {
126
+ name: string;
127
+ from: string[];
128
+ to: string;
129
+ label?: string;
130
+ roles?: string[];
131
+ }
132
+ interface WorkflowSchema {
133
+ field: string;
134
+ transitions: WorkflowTransitionSchema[];
135
+ }
125
136
  interface HydraClass {
126
137
  '@id': string;
127
138
  '@type': string;
128
139
  title: string;
129
140
  supportedProperty: HydraSupportedProperty[];
141
+ /** State machine metadata from nubitio/workflow-bundle. */
142
+ 'x-workflow'?: WorkflowSchema;
130
143
  /**
131
144
  * Class-level UI hints injected by TranslatedDocumentationNormalizer from
132
145
  * the ApiResource's extraProperties['x-crud']['formLayout']. Mirrors
@@ -219,6 +232,8 @@ interface HydraResourceSchema {
219
232
  * Empty array means no operation info was found (fall back to platform defaults).
220
233
  */
221
234
  supportedOperations?: string[];
235
+ /** Workflow transitions for auto row actions (nubitio/workflow-bundle). */
236
+ workflow?: WorkflowSchema;
222
237
  }
223
238
  interface OpenApiProperty {
224
239
  type?: string;
@@ -369,4 +384,4 @@ interface UseSchemaContextResult {
369
384
  */
370
385
  declare function useSchemaContext(): UseSchemaContextResult;
371
386
  //#endregion
372
- export { API_DOC_QUERY_KEY, type ApiDoc, type HydraApiDoc, HydraRemoteDataSource, HydraResourceSchemaProvider, type HydraResourceSchemaProviderProps, HydraResourceStoreProvider, type HydraResourceStoreProviderProps, type OpenApiDoc, type RemoteDataSourceOptions, type RemoteFilterDescriptor, type RemoteLoadOptions, type RemoteSortDescriptor, SchemaProvider, type UseSchemaContextResult, createHydraResourceStore, mapHydraSchemaToFields, parseHydraDoc, parseOpenApiDoc, resolveRangeTag, useHydraMetadata, useResourceSchema, useSchemaContext };
387
+ export { API_DOC_QUERY_KEY, type ApiDoc, type HydraApiDoc, HydraRemoteDataSource, HydraResourceSchemaProvider, type HydraResourceSchemaProviderProps, HydraResourceStoreProvider, type HydraResourceStoreProviderProps, type OpenApiDoc, type RemoteDataSourceOptions, type RemoteFilterDescriptor, type RemoteLoadOptions, type RemoteSortDescriptor, SchemaProvider, type UseSchemaContextResult, type WorkflowSchema, type WorkflowTransitionSchema, createHydraResourceStore, mapHydraSchemaToFields, parseHydraDoc, parseOpenApiDoc, resolveRangeTag, useHydraMetadata, useResourceSchema, useSchemaContext };
package/dist/index.mjs CHANGED
@@ -385,6 +385,7 @@ function parseHydraDoc(doc, entrypointHrefs) {
385
385
  apiUrl: urlMap[className] ?? `/api/${pluralize(toDashCase(className))}`,
386
386
  fields,
387
387
  formLayout: cls["x-crud-layout"],
388
+ workflow: cls["x-workflow"],
388
389
  searchMappings: extractSearchMappings(cls),
389
390
  supportedOperations: Array.from(new Set([...collectionOperationsMap[className] ?? [], ...extractSupportedOperations(cls)]))
390
391
  };
@@ -882,7 +883,8 @@ function useResourceSchema(apiUrl) {
882
883
  isLoading: false,
883
884
  error: void 0,
884
885
  supportedOperations: resourceSchema.supportedOperations ?? [],
885
- formLayout: resourceSchema.formLayout
886
+ formLayout: resourceSchema.formLayout,
887
+ workflow: resourceSchema.workflow
886
888
  };
887
889
  }, [
888
890
  data,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nubitio/hydra",
3
- "version": "0.5.15",
3
+ "version": "0.5.19",
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",
@@ -50,7 +50,7 @@
50
50
  "react": "^19.0.0",
51
51
  "react-dom": "^19.0.0",
52
52
  "react-i18next": "^14.0.0",
53
- "@nubitio/core": "^0.5.15",
54
- "@nubitio/crud": "^0.5.15"
53
+ "@nubitio/core": "^0.5.19",
54
+ "@nubitio/crud": "^0.5.19"
55
55
  }
56
56
  }