@nubitio/hydra 1.3.1 → 2.0.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 +15 -29
- package/dist/index.d.cts +19 -43
- package/dist/index.d.mts +20 -44
- package/dist/index.mjs +13 -26
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// \0rolldown/runtime.js
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -20,14 +20,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
20
20
|
value: mod,
|
|
21
21
|
enumerable: true
|
|
22
22
|
}) : target, mod));
|
|
23
|
-
//#endregion
|
|
24
23
|
let _nubitio_core = require("@nubitio/core");
|
|
25
24
|
let react = require("react");
|
|
26
|
-
react = __toESM(react, 1);
|
|
27
25
|
let _nubitio_crud = require("@nubitio/crud");
|
|
28
26
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
29
27
|
let _tanstack_react_query = require("@tanstack/react-query");
|
|
30
|
-
|
|
28
|
+
react = __toESM(react, 1);
|
|
29
|
+
// packages/hydra/HydraRemoteDataSource.ts
|
|
31
30
|
const XLSX_MIME_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
32
31
|
const CONTENT_DISPOSITION_FILENAME_EXT = /filename\*\s*=\s*[^']*'[^']*'([^;]+)/i;
|
|
33
32
|
const CONTENT_DISPOSITION_FILENAME = /filename\s*=\s*"([^"]+)"|filename\s*=\s*([^;]+)/i;
|
|
@@ -301,16 +300,14 @@ var HydraRemoteDataSource = class {
|
|
|
301
300
|
}
|
|
302
301
|
};
|
|
303
302
|
const createHydraResourceStore = (options) => new HydraRemoteDataSource(options);
|
|
304
|
-
|
|
305
|
-
//#region packages/hydra/HydraResourceStoreProvider.tsx
|
|
303
|
+
// packages/hydra/HydraResourceStoreProvider.tsx
|
|
306
304
|
function HydraResourceStoreProvider({ children }) {
|
|
307
305
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_nubitio_crud.ResourceStoreProvider, {
|
|
308
306
|
factory: createHydraResourceStore,
|
|
309
307
|
children
|
|
310
308
|
});
|
|
311
309
|
}
|
|
312
|
-
|
|
313
|
-
//#region packages/hydra/openApiParser.ts
|
|
310
|
+
// packages/hydra/openApiParser.ts
|
|
314
311
|
/**
|
|
315
312
|
* Converts a camelCase or PascalCase name to dash-case.
|
|
316
313
|
* Mirrors API Platform's DashPathSegmentNameGenerator behaviour.
|
|
@@ -601,8 +598,7 @@ function parseOpenApiDoc(doc) {
|
|
|
601
598
|
}
|
|
602
599
|
return result;
|
|
603
600
|
}
|
|
604
|
-
|
|
605
|
-
//#region packages/hydra/crudHintDeprecations.ts
|
|
601
|
+
// packages/hydra/crudHintDeprecations.ts
|
|
606
602
|
const warned = /* @__PURE__ */ new Set();
|
|
607
603
|
function isDev$1() {
|
|
608
604
|
return typeof window !== "undefined" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname.endsWith(".localhost"));
|
|
@@ -625,8 +621,7 @@ function warnDeprecatedCrudHints(hints, fieldName) {
|
|
|
625
621
|
}
|
|
626
622
|
}
|
|
627
623
|
}
|
|
628
|
-
|
|
629
|
-
//#region packages/hydra/HydraToFieldMapper.ts
|
|
624
|
+
// packages/hydra/HydraToFieldMapper.ts
|
|
630
625
|
/**
|
|
631
626
|
* Returns true when the given `range` string declares an XSD integer type.
|
|
632
627
|
* Supports both short-form `xmls:` prefixes and full XSD IRIs.
|
|
@@ -1000,8 +995,7 @@ function mapHydraSchemaToFields(schema, urlLookup, schemaLookup) {
|
|
|
1000
995
|
applySequenceHints(fields, schema);
|
|
1001
996
|
return fields;
|
|
1002
997
|
}
|
|
1003
|
-
|
|
1004
|
-
//#region packages/hydra/buildEmbeddedFormDetail.ts
|
|
998
|
+
// packages/hydra/buildEmbeddedFormDetail.ts
|
|
1005
999
|
/**
|
|
1006
1000
|
* Builds a {@link ResourceFormDetail} from `x-embedded-lines` metadata and the
|
|
1007
1001
|
* line entity schema in the API doc.
|
|
@@ -1024,8 +1018,7 @@ function resolveEmbeddedBinding(schema, propertyName) {
|
|
|
1024
1018
|
if (!propertyName) return bindings[0];
|
|
1025
1019
|
return bindings.find((b) => b.propertyName === propertyName) ?? bindings[0];
|
|
1026
1020
|
}
|
|
1027
|
-
|
|
1028
|
-
//#region packages/hydra/buildSummaryFields.ts
|
|
1021
|
+
// packages/hydra/buildSummaryFields.ts
|
|
1029
1022
|
function buildSummaryFieldsFromSchema(schema) {
|
|
1030
1023
|
return schema.fields.filter((field) => field.crudHints?.summable).map((field) => ({
|
|
1031
1024
|
column: field.name,
|
|
@@ -1034,8 +1027,7 @@ function buildSummaryFieldsFromSchema(schema) {
|
|
|
1034
1027
|
label: field["hydra:title"] && field["hydra:title"] !== field.name ? field["hydra:title"] : void 0
|
|
1035
1028
|
}));
|
|
1036
1029
|
}
|
|
1037
|
-
|
|
1038
|
-
//#region packages/hydra/HydraSchemaResolver.ts
|
|
1030
|
+
// packages/hydra/HydraSchemaResolver.ts
|
|
1039
1031
|
/**
|
|
1040
1032
|
* Normalizes an API URL by stripping any leading slash and query string so that
|
|
1041
1033
|
* 'api/categories', '/api/categories', and '/api/categories?foo=bar' are treated as equal.
|
|
@@ -1145,8 +1137,7 @@ function getSchemaResolver(data) {
|
|
|
1145
1137
|
}
|
|
1146
1138
|
return resolver;
|
|
1147
1139
|
}
|
|
1148
|
-
|
|
1149
|
-
//#region packages/hydra/useHydraMetadata.ts
|
|
1140
|
+
// packages/hydra/useHydraMetadata.ts
|
|
1150
1141
|
const JSONLD_URL = "/api/docs.jsonld";
|
|
1151
1142
|
const JSON_URL = "/api/docs.json";
|
|
1152
1143
|
const ENTRYPOINT_URL = "/api";
|
|
@@ -1239,8 +1230,7 @@ function useHydraMetadata() {
|
|
|
1239
1230
|
error: error ?? void 0
|
|
1240
1231
|
};
|
|
1241
1232
|
}
|
|
1242
|
-
|
|
1243
|
-
//#region packages/hydra/SchemaContext.tsx
|
|
1233
|
+
// packages/hydra/SchemaContext.tsx
|
|
1244
1234
|
/**
|
|
1245
1235
|
* SchemaContext — shared parsed schema, no per-page re-fetch.
|
|
1246
1236
|
*
|
|
@@ -1297,8 +1287,7 @@ function useSchemaContext() {
|
|
|
1297
1287
|
error: ctx.error
|
|
1298
1288
|
};
|
|
1299
1289
|
}
|
|
1300
|
-
|
|
1301
|
-
//#region packages/hydra/useResourceSchema.ts
|
|
1290
|
+
// packages/hydra/useResourceSchema.ts
|
|
1302
1291
|
function useResourceSchema(apiUrl, options) {
|
|
1303
1292
|
const enabled = options?.enabled !== false;
|
|
1304
1293
|
const { data, isLoading, error } = useSchemaContext();
|
|
@@ -1331,8 +1320,7 @@ function useResourceSchema(apiUrl, options) {
|
|
|
1331
1320
|
apiUrl
|
|
1332
1321
|
]);
|
|
1333
1322
|
}
|
|
1334
|
-
|
|
1335
|
-
//#region packages/hydra/HydraResourceSchemaProvider.tsx
|
|
1323
|
+
// packages/hydra/HydraResourceSchemaProvider.tsx
|
|
1336
1324
|
function useHydraResourceSchema({ apiUrl, enabled }) {
|
|
1337
1325
|
return useResourceSchema(apiUrl, { enabled });
|
|
1338
1326
|
}
|
|
@@ -1343,8 +1331,7 @@ function HydraResourceSchemaProvider({ children }) {
|
|
|
1343
1331
|
children
|
|
1344
1332
|
});
|
|
1345
1333
|
}
|
|
1346
|
-
|
|
1347
|
-
//#region packages/hydra/resolveInferredFormDetail.ts
|
|
1334
|
+
// packages/hydra/resolveInferredFormDetail.ts
|
|
1348
1335
|
/**
|
|
1349
1336
|
* Builds or augments `formDetail` from `x-embedded-lines` when the parent
|
|
1350
1337
|
* resource publishes embedded line metadata. Thin entry point over
|
|
@@ -1355,7 +1342,6 @@ function resolveInferredFormDetail(apiUrl, formDetail, schemaData, embeddedLines
|
|
|
1355
1342
|
if (!schemaData) return formDetail;
|
|
1356
1343
|
return getSchemaResolver(schemaData).resolveFormDetail(apiUrl, formDetail, embeddedLines);
|
|
1357
1344
|
}
|
|
1358
|
-
//#endregion
|
|
1359
1345
|
exports.API_DOC_QUERY_KEY = API_DOC_QUERY_KEY;
|
|
1360
1346
|
exports.HydraRemoteDataSource = HydraRemoteDataSource;
|
|
1361
1347
|
exports.HydraResourceSchemaProvider = HydraResourceSchemaProvider;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { DataRecord, GridData } from "@nubitio/core";
|
|
2
2
|
import { DataRecord as DataRecord$1, EmbeddedLinesSchema, EmbeddedLinesSchema as EmbeddedLinesSchema$1, Field, FormLayout, ResourceExportResult, 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
|
-
//#region packages/hydra/HydraRemoteDataSource.d.ts
|
|
5
4
|
type RemoteFilterDescriptor = ResourceFilterDescriptor;
|
|
6
5
|
type RemoteSortDescriptor = ResourceSortDescriptor;
|
|
7
6
|
type RemoteLoadOptions = ResourceLoadOptions;
|
|
8
7
|
type RemoteDataSourceOptions = ResourceStoreOptions;
|
|
9
|
-
declare class HydraRemoteDataSource implements ResourceStore {
|
|
8
|
+
export declare class HydraRemoteDataSource implements ResourceStore {
|
|
10
9
|
private readonly config;
|
|
11
10
|
private readonly httpClient;
|
|
12
11
|
constructor(config: ResourceStoreOptions);
|
|
@@ -18,21 +17,15 @@ declare class HydraRemoteDataSource implements ResourceStore {
|
|
|
18
17
|
private fetchAll;
|
|
19
18
|
private fetchById;
|
|
20
19
|
}
|
|
21
|
-
declare const createHydraResourceStore: ResourceStoreFactory;
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region packages/hydra/HydraResourceStoreProvider.d.ts
|
|
20
|
+
export declare const createHydraResourceStore: ResourceStoreFactory;
|
|
24
21
|
interface HydraResourceStoreProviderProps {
|
|
25
22
|
children: React.ReactNode;
|
|
26
23
|
}
|
|
27
|
-
declare function HydraResourceStoreProvider({ children }: HydraResourceStoreProviderProps): React.JSX.Element;
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region packages/hydra/HydraResourceSchemaProvider.d.ts
|
|
24
|
+
export declare function HydraResourceStoreProvider({ children }: HydraResourceStoreProviderProps): React.JSX.Element;
|
|
30
25
|
interface HydraResourceSchemaProviderProps {
|
|
31
26
|
children: React.ReactNode;
|
|
32
27
|
}
|
|
33
|
-
declare function HydraResourceSchemaProvider({ children }: HydraResourceSchemaProviderProps): React.JSX.Element;
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region packages/hydra/types.d.ts
|
|
28
|
+
export declare function HydraResourceSchemaProvider({ children }: HydraResourceSchemaProviderProps): React.JSX.Element;
|
|
36
29
|
interface HydraProperty {
|
|
37
30
|
'@id': string;
|
|
38
31
|
'@type': string;
|
|
@@ -423,8 +416,6 @@ type ApiDoc = {
|
|
|
423
416
|
format: 'openapi';
|
|
424
417
|
doc: OpenApiDoc;
|
|
425
418
|
};
|
|
426
|
-
//#endregion
|
|
427
|
-
//#region packages/hydra/openApiParser.d.ts
|
|
428
419
|
/**
|
|
429
420
|
* Parse a raw `/api/docs.jsonld` Hydra JSON-LD response into a typed
|
|
430
421
|
* Record<className, HydraResourceSchema>.
|
|
@@ -439,15 +430,13 @@ type ApiDoc = {
|
|
|
439
430
|
*
|
|
440
431
|
* @throws Error if doc is not a valid Hydra ApiDocumentation.
|
|
441
432
|
*/
|
|
442
|
-
declare function parseHydraDoc(doc: HydraApiDoc, entrypointHrefs?: HydraEntrypointHrefs): Record<string, HydraResourceSchema>;
|
|
433
|
+
export declare function parseHydraDoc(doc: HydraApiDoc, entrypointHrefs?: HydraEntrypointHrefs): Record<string, HydraResourceSchema>;
|
|
443
434
|
/**
|
|
444
435
|
* Parse a raw `/api/docs.json` OpenAPI 3.1 response into the same
|
|
445
436
|
* Record<className, HydraResourceSchema> output shape so that
|
|
446
437
|
* `useResourceSchema` can consume it transparently.
|
|
447
438
|
*/
|
|
448
|
-
declare function parseOpenApiDoc(doc: OpenApiDoc): Record<string, HydraResourceSchema>;
|
|
449
|
-
//#endregion
|
|
450
|
-
//#region packages/hydra/HydraToFieldMapper.d.ts
|
|
439
|
+
export declare function parseOpenApiDoc(doc: OpenApiDoc): Record<string, HydraResourceSchema>;
|
|
451
440
|
/**
|
|
452
441
|
* Determine the FieldType bucket for a given `range` string.
|
|
453
442
|
*
|
|
@@ -460,7 +449,7 @@ declare function parseOpenApiDoc(doc: OpenApiDoc): Record<string, HydraResourceS
|
|
|
460
449
|
* directly (to keep this function pure / dependency-free of FieldBuilders).
|
|
461
450
|
*/
|
|
462
451
|
type RangeTag = 'boolean' | 'dateTime' | 'integer' | 'decimal' | 'entity' | 'text';
|
|
463
|
-
declare function resolveRangeTag(range: string | undefined, propertyType: string): RangeTag;
|
|
452
|
+
export declare function resolveRangeTag(range: string | undefined, propertyType: string): RangeTag;
|
|
464
453
|
/**
|
|
465
454
|
* Map a single HydraResourceSchema to an array of Field objects using the
|
|
466
455
|
* existing field builder utilities.
|
|
@@ -493,9 +482,7 @@ declare function resolveRangeTag(range: string | undefined, propertyType: string
|
|
|
493
482
|
*
|
|
494
483
|
* @pure — no React, no hooks, no side effects.
|
|
495
484
|
*/
|
|
496
|
-
declare function mapHydraSchemaToFields(schema: HydraResourceSchema, urlLookup?: (className: string) => string | undefined, schemaLookup?: (className: string) => HydraResourceSchema | undefined): Field[];
|
|
497
|
-
//#endregion
|
|
498
|
-
//#region packages/hydra/buildEmbeddedFormDetail.d.ts
|
|
485
|
+
export declare function mapHydraSchemaToFields(schema: HydraResourceSchema, urlLookup?: (className: string) => string | undefined, schemaLookup?: (className: string) => HydraResourceSchema | undefined): Field[];
|
|
499
486
|
interface BuildEmbeddedFormDetailOptions {
|
|
500
487
|
binding: EmbeddedLinesSchema;
|
|
501
488
|
lineSchema?: HydraResourceSchema;
|
|
@@ -506,10 +493,8 @@ interface BuildEmbeddedFormDetailOptions {
|
|
|
506
493
|
* Builds a {@link ResourceFormDetail} from `x-embedded-lines` metadata and the
|
|
507
494
|
* line entity schema in the API doc.
|
|
508
495
|
*/
|
|
509
|
-
declare function buildEmbeddedFormDetail({ binding, lineSchema, resourceMap, overrides }: BuildEmbeddedFormDetailOptions): ResourceFormDetail;
|
|
510
|
-
declare function resolveEmbeddedBinding(schema: HydraResourceSchema, propertyName?: string): EmbeddedLinesSchema | undefined;
|
|
511
|
-
//#endregion
|
|
512
|
-
//#region packages/hydra/HydraSchemaResolver.d.ts
|
|
496
|
+
export declare function buildEmbeddedFormDetail({ binding, lineSchema, resourceMap, overrides }: BuildEmbeddedFormDetailOptions): ResourceFormDetail;
|
|
497
|
+
export declare function resolveEmbeddedBinding(schema: HydraResourceSchema, propertyName?: string): EmbeddedLinesSchema | undefined;
|
|
513
498
|
/** Everything the doc knows about one resource, resolved to crud vocabulary. */
|
|
514
499
|
interface ResolvedResourceSchema {
|
|
515
500
|
fields: Field[];
|
|
@@ -528,7 +513,7 @@ interface ResolvedResourceSchema {
|
|
|
528
513
|
* `parse* → map → infer` themselves. Obtain instances via
|
|
529
514
|
* {@link getSchemaResolver}, which parses each doc exactly once.
|
|
530
515
|
*/
|
|
531
|
-
declare class HydraSchemaResolver {
|
|
516
|
+
export declare class HydraSchemaResolver {
|
|
532
517
|
/** Parsed resource schemas keyed by class name. */
|
|
533
518
|
readonly resourceMap: Record<string, HydraResourceSchema>;
|
|
534
519
|
constructor(data: ApiDoc);
|
|
@@ -553,38 +538,30 @@ declare class HydraSchemaResolver {
|
|
|
553
538
|
* consumer of the same discovery result (useResourceSchema, form-detail
|
|
554
539
|
* inference, SchemaCrudPage) shares one parse.
|
|
555
540
|
*/
|
|
556
|
-
declare function getSchemaResolver(data: ApiDoc): HydraSchemaResolver;
|
|
557
|
-
//#endregion
|
|
558
|
-
//#region packages/hydra/useHydraMetadata.d.ts
|
|
541
|
+
export declare function getSchemaResolver(data: ApiDoc): HydraSchemaResolver;
|
|
559
542
|
/**
|
|
560
543
|
* Stable query key used by useHydraMetadata.
|
|
561
544
|
* Export this so that consumers (e.g. SchemaCrudPage retry button) can
|
|
562
545
|
* invalidate exactly the right query without coupling to an internal string.
|
|
563
546
|
*/
|
|
564
|
-
declare const API_DOC_QUERY_KEY: readonly ["api-doc-discovery"];
|
|
547
|
+
export declare const API_DOC_QUERY_KEY: readonly ["api-doc-discovery"];
|
|
565
548
|
interface UseHydraMetadataResult {
|
|
566
549
|
data: ApiDoc | undefined;
|
|
567
550
|
isLoading: boolean;
|
|
568
551
|
error: Error | undefined;
|
|
569
552
|
}
|
|
570
|
-
declare function useHydraMetadata(): UseHydraMetadataResult;
|
|
571
|
-
//#endregion
|
|
572
|
-
//#region packages/hydra/resolveInferredFormDetail.d.ts
|
|
553
|
+
export declare function useHydraMetadata(): UseHydraMetadataResult;
|
|
573
554
|
/**
|
|
574
555
|
* Builds or augments `formDetail` from `x-embedded-lines` when the parent
|
|
575
556
|
* resource publishes embedded line metadata. Thin entry point over
|
|
576
557
|
* {@link HydraSchemaResolver.resolveFormDetail} for callers holding a raw
|
|
577
558
|
* discovery result.
|
|
578
559
|
*/
|
|
579
|
-
declare function resolveInferredFormDetail(apiUrl: string, formDetail: ResourceFormDetail | undefined, schemaData: UseHydraMetadataResult['data'], embeddedLines?: HydraResourceSchema['embeddedLines']): ResourceFormDetail | undefined;
|
|
580
|
-
//#endregion
|
|
581
|
-
//#region packages/hydra/useResourceSchema.d.ts
|
|
560
|
+
export declare function resolveInferredFormDetail(apiUrl: string, formDetail: ResourceFormDetail | undefined, schemaData: UseHydraMetadataResult['data'], embeddedLines?: HydraResourceSchema['embeddedLines']): ResourceFormDetail | undefined;
|
|
582
561
|
type UseResourceSchemaResult = ResourceSchemaResolution;
|
|
583
|
-
declare function useResourceSchema<T extends DataRecord$1 = DataRecord$1>(apiUrl: string, options?: {
|
|
562
|
+
export declare function useResourceSchema<T extends DataRecord$1 = DataRecord$1>(apiUrl: string, options?: {
|
|
584
563
|
enabled?: boolean;
|
|
585
564
|
}): UseResourceSchemaResult;
|
|
586
|
-
//#endregion
|
|
587
|
-
//#region packages/hydra/SchemaContext.d.ts
|
|
588
565
|
interface SchemaProviderProps {
|
|
589
566
|
children: ReactNode;
|
|
590
567
|
}
|
|
@@ -592,7 +569,7 @@ interface SchemaProviderProps {
|
|
|
592
569
|
* Wrap your app (or a subtree) with `SchemaProvider` to share a single
|
|
593
570
|
* `/api/docs.jsonld` fetch across all `SchemaCrudPage` instances.
|
|
594
571
|
*/
|
|
595
|
-
declare function SchemaProvider({ children }: SchemaProviderProps): React.JSX.Element;
|
|
572
|
+
export declare function SchemaProvider({ children }: SchemaProviderProps): React.JSX.Element;
|
|
596
573
|
interface UseSchemaContextResult {
|
|
597
574
|
data: UseHydraMetadataResult['data'];
|
|
598
575
|
isLoading: boolean;
|
|
@@ -606,6 +583,5 @@ interface UseSchemaContextResult {
|
|
|
606
583
|
*
|
|
607
584
|
* This makes `SchemaCrudPage` work standalone without requiring a provider.
|
|
608
585
|
*/
|
|
609
|
-
declare function useSchemaContext(): UseSchemaContextResult;
|
|
610
|
-
|
|
611
|
-
export { API_DOC_QUERY_KEY, type ApiDoc, type EmbeddedLinesSchema, type GridScaleSchema, type HydraApiDoc, HydraRemoteDataSource, HydraResourceSchemaProvider, type HydraResourceSchemaProviderProps, HydraResourceStoreProvider, type HydraResourceStoreProviderProps, HydraSchemaResolver, type ImportableSchema, type OpenApiDoc, type PrintableSchema, type RemoteDataSourceOptions, type RemoteFilterDescriptor, type RemoteLoadOptions, type RemoteSortDescriptor, type ResolvedResourceSchema, SchemaProvider, type SequenceSchema, type UseSchemaContextResult, type WorkflowSchema, type WorkflowTransitionSchema, buildEmbeddedFormDetail, createHydraResourceStore, getSchemaResolver, mapHydraSchemaToFields, parseHydraDoc, parseOpenApiDoc, resolveEmbeddedBinding, resolveInferredFormDetail, resolveRangeTag, useHydraMetadata, useResourceSchema, useSchemaContext };
|
|
586
|
+
export declare function useSchemaContext(): UseSchemaContextResult;
|
|
587
|
+
export type { ApiDoc, EmbeddedLinesSchema, GridScaleSchema, HydraApiDoc, HydraResourceSchemaProviderProps, HydraResourceStoreProviderProps, ImportableSchema, OpenApiDoc, PrintableSchema, RemoteDataSourceOptions, RemoteFilterDescriptor, RemoteLoadOptions, RemoteSortDescriptor, ResolvedResourceSchema, SequenceSchema, UseSchemaContextResult, WorkflowSchema, WorkflowTransitionSchema };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { DataRecord, GridData } from "@nubitio/core";
|
|
2
|
-
import React, { ReactNode } from "react";
|
|
3
2
|
import { DataRecord as DataRecord$1, EmbeddedLinesSchema, EmbeddedLinesSchema as EmbeddedLinesSchema$1, Field, FormLayout, ResourceExportResult, ResourceFilterDescriptor, ResourceFilterRule, ResourceFormDetail, ResourceLoadOptions, ResourceSchemaResolution, ResourceSortDescriptor, ResourceStore, ResourceStoreFactory, ResourceStoreOptions, SummaryItem, WorkflowSchema, WorkflowSchema as WorkflowSchema$1, WorkflowTransitionSchema } from "@nubitio/crud";
|
|
4
|
-
|
|
3
|
+
import React, { ReactNode } from "react";
|
|
5
4
|
type RemoteFilterDescriptor = ResourceFilterDescriptor;
|
|
6
5
|
type RemoteSortDescriptor = ResourceSortDescriptor;
|
|
7
6
|
type RemoteLoadOptions = ResourceLoadOptions;
|
|
8
7
|
type RemoteDataSourceOptions = ResourceStoreOptions;
|
|
9
|
-
declare class HydraRemoteDataSource implements ResourceStore {
|
|
8
|
+
export declare class HydraRemoteDataSource implements ResourceStore {
|
|
10
9
|
private readonly config;
|
|
11
10
|
private readonly httpClient;
|
|
12
11
|
constructor(config: ResourceStoreOptions);
|
|
@@ -18,21 +17,15 @@ declare class HydraRemoteDataSource implements ResourceStore {
|
|
|
18
17
|
private fetchAll;
|
|
19
18
|
private fetchById;
|
|
20
19
|
}
|
|
21
|
-
declare const createHydraResourceStore: ResourceStoreFactory;
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region packages/hydra/HydraResourceStoreProvider.d.ts
|
|
20
|
+
export declare const createHydraResourceStore: ResourceStoreFactory;
|
|
24
21
|
interface HydraResourceStoreProviderProps {
|
|
25
22
|
children: React.ReactNode;
|
|
26
23
|
}
|
|
27
|
-
declare function HydraResourceStoreProvider({ children }: HydraResourceStoreProviderProps): React.JSX.Element;
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region packages/hydra/HydraResourceSchemaProvider.d.ts
|
|
24
|
+
export declare function HydraResourceStoreProvider({ children }: HydraResourceStoreProviderProps): React.JSX.Element;
|
|
30
25
|
interface HydraResourceSchemaProviderProps {
|
|
31
26
|
children: React.ReactNode;
|
|
32
27
|
}
|
|
33
|
-
declare function HydraResourceSchemaProvider({ children }: HydraResourceSchemaProviderProps): React.JSX.Element;
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region packages/hydra/types.d.ts
|
|
28
|
+
export declare function HydraResourceSchemaProvider({ children }: HydraResourceSchemaProviderProps): React.JSX.Element;
|
|
36
29
|
interface HydraProperty {
|
|
37
30
|
'@id': string;
|
|
38
31
|
'@type': string;
|
|
@@ -423,8 +416,6 @@ type ApiDoc = {
|
|
|
423
416
|
format: 'openapi';
|
|
424
417
|
doc: OpenApiDoc;
|
|
425
418
|
};
|
|
426
|
-
//#endregion
|
|
427
|
-
//#region packages/hydra/openApiParser.d.ts
|
|
428
419
|
/**
|
|
429
420
|
* Parse a raw `/api/docs.jsonld` Hydra JSON-LD response into a typed
|
|
430
421
|
* Record<className, HydraResourceSchema>.
|
|
@@ -439,15 +430,13 @@ type ApiDoc = {
|
|
|
439
430
|
*
|
|
440
431
|
* @throws Error if doc is not a valid Hydra ApiDocumentation.
|
|
441
432
|
*/
|
|
442
|
-
declare function parseHydraDoc(doc: HydraApiDoc, entrypointHrefs?: HydraEntrypointHrefs): Record<string, HydraResourceSchema>;
|
|
433
|
+
export declare function parseHydraDoc(doc: HydraApiDoc, entrypointHrefs?: HydraEntrypointHrefs): Record<string, HydraResourceSchema>;
|
|
443
434
|
/**
|
|
444
435
|
* Parse a raw `/api/docs.json` OpenAPI 3.1 response into the same
|
|
445
436
|
* Record<className, HydraResourceSchema> output shape so that
|
|
446
437
|
* `useResourceSchema` can consume it transparently.
|
|
447
438
|
*/
|
|
448
|
-
declare function parseOpenApiDoc(doc: OpenApiDoc): Record<string, HydraResourceSchema>;
|
|
449
|
-
//#endregion
|
|
450
|
-
//#region packages/hydra/HydraToFieldMapper.d.ts
|
|
439
|
+
export declare function parseOpenApiDoc(doc: OpenApiDoc): Record<string, HydraResourceSchema>;
|
|
451
440
|
/**
|
|
452
441
|
* Determine the FieldType bucket for a given `range` string.
|
|
453
442
|
*
|
|
@@ -460,7 +449,7 @@ declare function parseOpenApiDoc(doc: OpenApiDoc): Record<string, HydraResourceS
|
|
|
460
449
|
* directly (to keep this function pure / dependency-free of FieldBuilders).
|
|
461
450
|
*/
|
|
462
451
|
type RangeTag = 'boolean' | 'dateTime' | 'integer' | 'decimal' | 'entity' | 'text';
|
|
463
|
-
declare function resolveRangeTag(range: string | undefined, propertyType: string): RangeTag;
|
|
452
|
+
export declare function resolveRangeTag(range: string | undefined, propertyType: string): RangeTag;
|
|
464
453
|
/**
|
|
465
454
|
* Map a single HydraResourceSchema to an array of Field objects using the
|
|
466
455
|
* existing field builder utilities.
|
|
@@ -493,9 +482,7 @@ declare function resolveRangeTag(range: string | undefined, propertyType: string
|
|
|
493
482
|
*
|
|
494
483
|
* @pure — no React, no hooks, no side effects.
|
|
495
484
|
*/
|
|
496
|
-
declare function mapHydraSchemaToFields(schema: HydraResourceSchema, urlLookup?: (className: string) => string | undefined, schemaLookup?: (className: string) => HydraResourceSchema | undefined): Field[];
|
|
497
|
-
//#endregion
|
|
498
|
-
//#region packages/hydra/buildEmbeddedFormDetail.d.ts
|
|
485
|
+
export declare function mapHydraSchemaToFields(schema: HydraResourceSchema, urlLookup?: (className: string) => string | undefined, schemaLookup?: (className: string) => HydraResourceSchema | undefined): Field[];
|
|
499
486
|
interface BuildEmbeddedFormDetailOptions {
|
|
500
487
|
binding: EmbeddedLinesSchema;
|
|
501
488
|
lineSchema?: HydraResourceSchema;
|
|
@@ -506,10 +493,8 @@ interface BuildEmbeddedFormDetailOptions {
|
|
|
506
493
|
* Builds a {@link ResourceFormDetail} from `x-embedded-lines` metadata and the
|
|
507
494
|
* line entity schema in the API doc.
|
|
508
495
|
*/
|
|
509
|
-
declare function buildEmbeddedFormDetail({ binding, lineSchema, resourceMap, overrides }: BuildEmbeddedFormDetailOptions): ResourceFormDetail;
|
|
510
|
-
declare function resolveEmbeddedBinding(schema: HydraResourceSchema, propertyName?: string): EmbeddedLinesSchema | undefined;
|
|
511
|
-
//#endregion
|
|
512
|
-
//#region packages/hydra/HydraSchemaResolver.d.ts
|
|
496
|
+
export declare function buildEmbeddedFormDetail({ binding, lineSchema, resourceMap, overrides }: BuildEmbeddedFormDetailOptions): ResourceFormDetail;
|
|
497
|
+
export declare function resolveEmbeddedBinding(schema: HydraResourceSchema, propertyName?: string): EmbeddedLinesSchema | undefined;
|
|
513
498
|
/** Everything the doc knows about one resource, resolved to crud vocabulary. */
|
|
514
499
|
interface ResolvedResourceSchema {
|
|
515
500
|
fields: Field[];
|
|
@@ -528,7 +513,7 @@ interface ResolvedResourceSchema {
|
|
|
528
513
|
* `parse* → map → infer` themselves. Obtain instances via
|
|
529
514
|
* {@link getSchemaResolver}, which parses each doc exactly once.
|
|
530
515
|
*/
|
|
531
|
-
declare class HydraSchemaResolver {
|
|
516
|
+
export declare class HydraSchemaResolver {
|
|
532
517
|
/** Parsed resource schemas keyed by class name. */
|
|
533
518
|
readonly resourceMap: Record<string, HydraResourceSchema>;
|
|
534
519
|
constructor(data: ApiDoc);
|
|
@@ -553,38 +538,30 @@ declare class HydraSchemaResolver {
|
|
|
553
538
|
* consumer of the same discovery result (useResourceSchema, form-detail
|
|
554
539
|
* inference, SchemaCrudPage) shares one parse.
|
|
555
540
|
*/
|
|
556
|
-
declare function getSchemaResolver(data: ApiDoc): HydraSchemaResolver;
|
|
557
|
-
//#endregion
|
|
558
|
-
//#region packages/hydra/useHydraMetadata.d.ts
|
|
541
|
+
export declare function getSchemaResolver(data: ApiDoc): HydraSchemaResolver;
|
|
559
542
|
/**
|
|
560
543
|
* Stable query key used by useHydraMetadata.
|
|
561
544
|
* Export this so that consumers (e.g. SchemaCrudPage retry button) can
|
|
562
545
|
* invalidate exactly the right query without coupling to an internal string.
|
|
563
546
|
*/
|
|
564
|
-
declare const API_DOC_QUERY_KEY: readonly ["api-doc-discovery"];
|
|
547
|
+
export declare const API_DOC_QUERY_KEY: readonly ["api-doc-discovery"];
|
|
565
548
|
interface UseHydraMetadataResult {
|
|
566
549
|
data: ApiDoc | undefined;
|
|
567
550
|
isLoading: boolean;
|
|
568
551
|
error: Error | undefined;
|
|
569
552
|
}
|
|
570
|
-
declare function useHydraMetadata(): UseHydraMetadataResult;
|
|
571
|
-
//#endregion
|
|
572
|
-
//#region packages/hydra/resolveInferredFormDetail.d.ts
|
|
553
|
+
export declare function useHydraMetadata(): UseHydraMetadataResult;
|
|
573
554
|
/**
|
|
574
555
|
* Builds or augments `formDetail` from `x-embedded-lines` when the parent
|
|
575
556
|
* resource publishes embedded line metadata. Thin entry point over
|
|
576
557
|
* {@link HydraSchemaResolver.resolveFormDetail} for callers holding a raw
|
|
577
558
|
* discovery result.
|
|
578
559
|
*/
|
|
579
|
-
declare function resolveInferredFormDetail(apiUrl: string, formDetail: ResourceFormDetail | undefined, schemaData: UseHydraMetadataResult['data'], embeddedLines?: HydraResourceSchema['embeddedLines']): ResourceFormDetail | undefined;
|
|
580
|
-
//#endregion
|
|
581
|
-
//#region packages/hydra/useResourceSchema.d.ts
|
|
560
|
+
export declare function resolveInferredFormDetail(apiUrl: string, formDetail: ResourceFormDetail | undefined, schemaData: UseHydraMetadataResult['data'], embeddedLines?: HydraResourceSchema['embeddedLines']): ResourceFormDetail | undefined;
|
|
582
561
|
type UseResourceSchemaResult = ResourceSchemaResolution;
|
|
583
|
-
declare function useResourceSchema<T extends DataRecord$1 = DataRecord$1>(apiUrl: string, options?: {
|
|
562
|
+
export declare function useResourceSchema<T extends DataRecord$1 = DataRecord$1>(apiUrl: string, options?: {
|
|
584
563
|
enabled?: boolean;
|
|
585
564
|
}): UseResourceSchemaResult;
|
|
586
|
-
//#endregion
|
|
587
|
-
//#region packages/hydra/SchemaContext.d.ts
|
|
588
565
|
interface SchemaProviderProps {
|
|
589
566
|
children: ReactNode;
|
|
590
567
|
}
|
|
@@ -592,7 +569,7 @@ interface SchemaProviderProps {
|
|
|
592
569
|
* Wrap your app (or a subtree) with `SchemaProvider` to share a single
|
|
593
570
|
* `/api/docs.jsonld` fetch across all `SchemaCrudPage` instances.
|
|
594
571
|
*/
|
|
595
|
-
declare function SchemaProvider({ children }: SchemaProviderProps): React.JSX.Element;
|
|
572
|
+
export declare function SchemaProvider({ children }: SchemaProviderProps): React.JSX.Element;
|
|
596
573
|
interface UseSchemaContextResult {
|
|
597
574
|
data: UseHydraMetadataResult['data'];
|
|
598
575
|
isLoading: boolean;
|
|
@@ -606,6 +583,5 @@ interface UseSchemaContextResult {
|
|
|
606
583
|
*
|
|
607
584
|
* This makes `SchemaCrudPage` work standalone without requiring a provider.
|
|
608
585
|
*/
|
|
609
|
-
declare function useSchemaContext(): UseSchemaContextResult;
|
|
610
|
-
|
|
611
|
-
export { API_DOC_QUERY_KEY, type ApiDoc, type EmbeddedLinesSchema, type GridScaleSchema, type HydraApiDoc, HydraRemoteDataSource, HydraResourceSchemaProvider, type HydraResourceSchemaProviderProps, HydraResourceStoreProvider, type HydraResourceStoreProviderProps, HydraSchemaResolver, type ImportableSchema, type OpenApiDoc, type PrintableSchema, type RemoteDataSourceOptions, type RemoteFilterDescriptor, type RemoteLoadOptions, type RemoteSortDescriptor, type ResolvedResourceSchema, SchemaProvider, type SequenceSchema, type UseSchemaContextResult, type WorkflowSchema, type WorkflowTransitionSchema, buildEmbeddedFormDetail, createHydraResourceStore, getSchemaResolver, mapHydraSchemaToFields, parseHydraDoc, parseOpenApiDoc, resolveEmbeddedBinding, resolveInferredFormDetail, resolveRangeTag, useHydraMetadata, useResourceSchema, useSchemaContext };
|
|
586
|
+
export declare function useSchemaContext(): UseSchemaContextResult;
|
|
587
|
+
export type { ApiDoc, EmbeddedLinesSchema, GridScaleSchema, HydraApiDoc, HydraResourceSchemaProviderProps, HydraResourceStoreProviderProps, ImportableSchema, OpenApiDoc, PrintableSchema, RemoteDataSourceOptions, RemoteFilterDescriptor, RemoteLoadOptions, RemoteSortDescriptor, ResolvedResourceSchema, SequenceSchema, UseSchemaContextResult, WorkflowSchema, WorkflowTransitionSchema };
|
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { createContext, useContext, useMemo } from "react";
|
|
|
3
3
|
import { ResourceSchemaProvider, ResourceStoreProvider, currencyField, datetimeField, embeddedLinesUrl, entityField, enumField, fileField, imageField, moneyField, noneField, numberField, switchField, tagsField, textField } from "@nubitio/crud";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { useQuery } from "@tanstack/react-query";
|
|
6
|
-
|
|
6
|
+
// packages/hydra/HydraRemoteDataSource.ts
|
|
7
7
|
const XLSX_MIME_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
8
8
|
const CONTENT_DISPOSITION_FILENAME_EXT = /filename\*\s*=\s*[^']*'[^']*'([^;]+)/i;
|
|
9
9
|
const CONTENT_DISPOSITION_FILENAME = /filename\s*=\s*"([^"]+)"|filename\s*=\s*([^;]+)/i;
|
|
@@ -277,16 +277,14 @@ var HydraRemoteDataSource = class {
|
|
|
277
277
|
}
|
|
278
278
|
};
|
|
279
279
|
const createHydraResourceStore = (options) => new HydraRemoteDataSource(options);
|
|
280
|
-
|
|
281
|
-
//#region packages/hydra/HydraResourceStoreProvider.tsx
|
|
280
|
+
// packages/hydra/HydraResourceStoreProvider.tsx
|
|
282
281
|
function HydraResourceStoreProvider({ children }) {
|
|
283
282
|
return /* @__PURE__ */ jsx(ResourceStoreProvider, {
|
|
284
283
|
factory: createHydraResourceStore,
|
|
285
284
|
children
|
|
286
285
|
});
|
|
287
286
|
}
|
|
288
|
-
|
|
289
|
-
//#region packages/hydra/openApiParser.ts
|
|
287
|
+
// packages/hydra/openApiParser.ts
|
|
290
288
|
/**
|
|
291
289
|
* Converts a camelCase or PascalCase name to dash-case.
|
|
292
290
|
* Mirrors API Platform's DashPathSegmentNameGenerator behaviour.
|
|
@@ -577,8 +575,7 @@ function parseOpenApiDoc(doc) {
|
|
|
577
575
|
}
|
|
578
576
|
return result;
|
|
579
577
|
}
|
|
580
|
-
|
|
581
|
-
//#region packages/hydra/crudHintDeprecations.ts
|
|
578
|
+
// packages/hydra/crudHintDeprecations.ts
|
|
582
579
|
const warned = /* @__PURE__ */ new Set();
|
|
583
580
|
function isDev$1() {
|
|
584
581
|
return typeof window !== "undefined" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname.endsWith(".localhost"));
|
|
@@ -601,8 +598,7 @@ function warnDeprecatedCrudHints(hints, fieldName) {
|
|
|
601
598
|
}
|
|
602
599
|
}
|
|
603
600
|
}
|
|
604
|
-
|
|
605
|
-
//#region packages/hydra/HydraToFieldMapper.ts
|
|
601
|
+
// packages/hydra/HydraToFieldMapper.ts
|
|
606
602
|
/**
|
|
607
603
|
* Returns true when the given `range` string declares an XSD integer type.
|
|
608
604
|
* Supports both short-form `xmls:` prefixes and full XSD IRIs.
|
|
@@ -976,8 +972,7 @@ function mapHydraSchemaToFields(schema, urlLookup, schemaLookup) {
|
|
|
976
972
|
applySequenceHints(fields, schema);
|
|
977
973
|
return fields;
|
|
978
974
|
}
|
|
979
|
-
|
|
980
|
-
//#region packages/hydra/buildEmbeddedFormDetail.ts
|
|
975
|
+
// packages/hydra/buildEmbeddedFormDetail.ts
|
|
981
976
|
/**
|
|
982
977
|
* Builds a {@link ResourceFormDetail} from `x-embedded-lines` metadata and the
|
|
983
978
|
* line entity schema in the API doc.
|
|
@@ -1000,8 +995,7 @@ function resolveEmbeddedBinding(schema, propertyName) {
|
|
|
1000
995
|
if (!propertyName) return bindings[0];
|
|
1001
996
|
return bindings.find((b) => b.propertyName === propertyName) ?? bindings[0];
|
|
1002
997
|
}
|
|
1003
|
-
|
|
1004
|
-
//#region packages/hydra/buildSummaryFields.ts
|
|
998
|
+
// packages/hydra/buildSummaryFields.ts
|
|
1005
999
|
function buildSummaryFieldsFromSchema(schema) {
|
|
1006
1000
|
return schema.fields.filter((field) => field.crudHints?.summable).map((field) => ({
|
|
1007
1001
|
column: field.name,
|
|
@@ -1010,8 +1004,7 @@ function buildSummaryFieldsFromSchema(schema) {
|
|
|
1010
1004
|
label: field["hydra:title"] && field["hydra:title"] !== field.name ? field["hydra:title"] : void 0
|
|
1011
1005
|
}));
|
|
1012
1006
|
}
|
|
1013
|
-
|
|
1014
|
-
//#region packages/hydra/HydraSchemaResolver.ts
|
|
1007
|
+
// packages/hydra/HydraSchemaResolver.ts
|
|
1015
1008
|
/**
|
|
1016
1009
|
* Normalizes an API URL by stripping any leading slash and query string so that
|
|
1017
1010
|
* 'api/categories', '/api/categories', and '/api/categories?foo=bar' are treated as equal.
|
|
@@ -1121,8 +1114,7 @@ function getSchemaResolver(data) {
|
|
|
1121
1114
|
}
|
|
1122
1115
|
return resolver;
|
|
1123
1116
|
}
|
|
1124
|
-
|
|
1125
|
-
//#region packages/hydra/useHydraMetadata.ts
|
|
1117
|
+
// packages/hydra/useHydraMetadata.ts
|
|
1126
1118
|
const JSONLD_URL = "/api/docs.jsonld";
|
|
1127
1119
|
const JSON_URL = "/api/docs.json";
|
|
1128
1120
|
const ENTRYPOINT_URL = "/api";
|
|
@@ -1215,8 +1207,7 @@ function useHydraMetadata() {
|
|
|
1215
1207
|
error: error ?? void 0
|
|
1216
1208
|
};
|
|
1217
1209
|
}
|
|
1218
|
-
|
|
1219
|
-
//#region packages/hydra/SchemaContext.tsx
|
|
1210
|
+
// packages/hydra/SchemaContext.tsx
|
|
1220
1211
|
/**
|
|
1221
1212
|
* SchemaContext — shared parsed schema, no per-page re-fetch.
|
|
1222
1213
|
*
|
|
@@ -1273,8 +1264,7 @@ function useSchemaContext() {
|
|
|
1273
1264
|
error: ctx.error
|
|
1274
1265
|
};
|
|
1275
1266
|
}
|
|
1276
|
-
|
|
1277
|
-
//#region packages/hydra/useResourceSchema.ts
|
|
1267
|
+
// packages/hydra/useResourceSchema.ts
|
|
1278
1268
|
function useResourceSchema(apiUrl, options) {
|
|
1279
1269
|
const enabled = options?.enabled !== false;
|
|
1280
1270
|
const { data, isLoading, error } = useSchemaContext();
|
|
@@ -1307,8 +1297,7 @@ function useResourceSchema(apiUrl, options) {
|
|
|
1307
1297
|
apiUrl
|
|
1308
1298
|
]);
|
|
1309
1299
|
}
|
|
1310
|
-
|
|
1311
|
-
//#region packages/hydra/HydraResourceSchemaProvider.tsx
|
|
1300
|
+
// packages/hydra/HydraResourceSchemaProvider.tsx
|
|
1312
1301
|
function useHydraResourceSchema({ apiUrl, enabled }) {
|
|
1313
1302
|
return useResourceSchema(apiUrl, { enabled });
|
|
1314
1303
|
}
|
|
@@ -1319,8 +1308,7 @@ function HydraResourceSchemaProvider({ children }) {
|
|
|
1319
1308
|
children
|
|
1320
1309
|
});
|
|
1321
1310
|
}
|
|
1322
|
-
|
|
1323
|
-
//#region packages/hydra/resolveInferredFormDetail.ts
|
|
1311
|
+
// packages/hydra/resolveInferredFormDetail.ts
|
|
1324
1312
|
/**
|
|
1325
1313
|
* Builds or augments `formDetail` from `x-embedded-lines` when the parent
|
|
1326
1314
|
* resource publishes embedded line metadata. Thin entry point over
|
|
@@ -1331,5 +1319,4 @@ function resolveInferredFormDetail(apiUrl, formDetail, schemaData, embeddedLines
|
|
|
1331
1319
|
if (!schemaData) return formDetail;
|
|
1332
1320
|
return getSchemaResolver(schemaData).resolveFormDetail(apiUrl, formDetail, embeddedLines);
|
|
1333
1321
|
}
|
|
1334
|
-
//#endregion
|
|
1335
1322
|
export { API_DOC_QUERY_KEY, HydraRemoteDataSource, HydraResourceSchemaProvider, HydraResourceStoreProvider, HydraSchemaResolver, SchemaProvider, buildEmbeddedFormDetail, createHydraResourceStore, getSchemaResolver, mapHydraSchemaToFields, parseHydraDoc, parseOpenApiDoc, resolveEmbeddedBinding, resolveInferredFormDetail, resolveRangeTag, useHydraMetadata, useResourceSchema, useSchemaContext };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nubitio/hydra",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.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",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@tanstack/react-query": "^5.0.0",
|
|
50
|
-
"i18next": "^23.0.0",
|
|
50
|
+
"i18next": "^23.0.0 || ^27.0.0",
|
|
51
51
|
"react": "^18.2.0 || ^19.0.0",
|
|
52
52
|
"react-dom": "^18.2.0 || ^19.0.0",
|
|
53
|
-
"react-i18next": "^14.0.0",
|
|
54
|
-
"@nubitio/core": "^
|
|
55
|
-
"@nubitio/crud": "^
|
|
53
|
+
"react-i18next": "^14.0.0 || ^15.0.0 || ^18.0.0",
|
|
54
|
+
"@nubitio/core": "^2.0.0",
|
|
55
|
+
"@nubitio/crud": "^2.0.0"
|
|
56
56
|
}
|
|
57
57
|
}
|