alizarin 1.0.0 → 2.0.0-alpha.103

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.
Files changed (61) hide show
  1. package/README.md +120 -2
  2. package/dist/_wasm.d.ts +27 -0
  3. package/dist/alizarin.full.js +803 -0
  4. package/dist/alizarin.full.js.map +1 -0
  5. package/dist/alizarin.inline-full.js +4 -0
  6. package/dist/alizarin.inline.js +4 -0
  7. package/dist/alizarin.js +49 -4970
  8. package/dist/alizarin.js.map +1 -1
  9. package/dist/alizarin_bg.wasm +0 -0
  10. package/dist/backend.d.ts +212 -0
  11. package/dist/cards.d.ts +21 -0
  12. package/dist/client.d.ts +86 -0
  13. package/dist/collectionMutator.d.ts +155 -0
  14. package/dist/csvModelLoader.d.ts +62 -0
  15. package/dist/full.d.ts +3 -0
  16. package/dist/graphManager.d.ts +269 -0
  17. package/dist/interfaces.d.ts +145 -0
  18. package/dist/main-CbnMkf4m.js +12929 -0
  19. package/dist/main-CbnMkf4m.js.map +1 -0
  20. package/dist/main.d.ts +28 -0
  21. package/dist/nodeConfig.d.ts +61 -0
  22. package/dist/pseudos.d.ts +118 -0
  23. package/dist/rdm.d.ts +68 -0
  24. package/dist/renderers.d.ts +72 -0
  25. package/dist/semantic.d.ts +35 -0
  26. package/dist/static-types.d.ts +190 -0
  27. package/dist/staticStore.d.ts +60 -0
  28. package/dist/tracing/index.d.ts +172 -0
  29. package/dist/utils.d.ts +43 -0
  30. package/dist/validation/index.d.ts +734 -0
  31. package/dist/validation/index.js +1194 -0
  32. package/dist/validation/index.js.map +1 -0
  33. package/dist/validation/validators/graphLoading.d.ts +69 -0
  34. package/dist/validation/validators/index.d.ts +1 -0
  35. package/dist/viewModels/BooleanViewModel.d.ts +17 -0
  36. package/dist/viewModels/ConceptListViewModel.d.ts +15 -0
  37. package/dist/viewModels/ConceptValueViewModel.d.ts +28 -0
  38. package/dist/viewModels/DateViewModel.d.ts +16 -0
  39. package/dist/viewModels/DomainValueListViewModel.d.ts +15 -0
  40. package/dist/viewModels/DomainValueViewModel.d.ts +17 -0
  41. package/dist/viewModels/EDTFViewModel.d.ts +13 -0
  42. package/dist/viewModels/GeoJSONViewModel.d.ts +27 -0
  43. package/dist/viewModels/NodeViewModel.d.ts +15 -0
  44. package/dist/viewModels/NonLocalizedStringViewModel.d.ts +13 -0
  45. package/dist/viewModels/NumberViewModel.d.ts +14 -0
  46. package/dist/viewModels/ResourceInstanceListViewModel.d.ts +25 -0
  47. package/dist/viewModels/ResourceInstanceViewModel.d.ts +62 -0
  48. package/dist/viewModels/StringViewModel.d.ts +17 -0
  49. package/dist/viewModels/UrlViewModel.d.ts +22 -0
  50. package/dist/viewModels/cacheEntries.d.ts +73 -0
  51. package/dist/viewModels/getViewModel.d.ts +4 -0
  52. package/dist/viewModels/index.d.ts +20 -0
  53. package/dist/viewModels/types.d.ts +15 -0
  54. package/dist/viewModels.d.ts +1 -0
  55. package/dist/wasmTiming.d.ts +11 -0
  56. package/package.json +65 -8
  57. package/dist/__vite-browser-external-2Ng8QIWW.js +0 -5
  58. package/dist/__vite-browser-external-2Ng8QIWW.js.map +0 -1
  59. package/dist/alizarin.d.ts +0 -1298
  60. package/dist/alizarin.umd.cjs +0 -4981
  61. package/dist/alizarin.umd.cjs.map +0 -1
package/README.md CHANGED
@@ -2,8 +2,126 @@
2
2
 
3
3
  # Alizarin
4
4
 
5
- This is a pure JS/TS implementation of [AORM](https://github.com/flaxandteal/arches-orm/)
6
- for front or backend.
5
+ A high-performance TypeScript/JavaScript SDK for working with [Arches](https://www.archesproject.org/) data management systems. Alizarin provides a sophisticated object-relational mapping (ORM) layer that enables seamless interaction with Arches' graph-based data models.
6
+
7
+ This is a pure JS/TS implementation of [AORM](https://github.com/flaxandteal/arches-orm/) for front or backend.
8
+
9
+ ## Features
10
+
11
+ - **Universal Compatibility**: Works in both browser and Node.js environments
12
+ - **Type-Safe**: Full TypeScript support with comprehensive type definitions
13
+ - **Lazy Loading**: Optimized data fetching with on-demand tile loading
14
+ - **Graph-Based ORM**: Intuitive API for working with Arches' complex graph structures
15
+ - **Multiple Data Sources**: Support for remote servers, static JSON files, and local data
16
+ - **Internationalization**: Built-in support for multilingual content
17
+ - **Schema Manipulation**: Programmatically create and modify graph schemas
18
+ - **Caching**: Intelligent caching for improved performance
19
+
20
+ ## Goals
21
+
22
+ Alizarin aims to:
23
+
24
+ 1. **Simplify Arches Development**: Provide an intuitive, developer-friendly interface to Arches' complex data models
25
+ 2. **Enable Modern Web Applications**: Support building reactive, performant front-end applications with Arches data
26
+ 3. **Maintain Flexibility**: Work with any Arches instance without requiring server-side modifications
27
+ 4. **Ensure Type Safety**: Leverage TypeScript to catch errors early and improve developer experience
28
+ 5. **Optimize Performance**: Minimize network requests and memory usage through intelligent caching and lazy loading
29
+
30
+ ## Installation
31
+
32
+ ```bash
33
+ npm install alizarin
34
+ ```
35
+
36
+ ## Quick Start
37
+
38
+ ### Basic Usage
39
+
40
+ ```typescript
41
+ import { ArchesClientRemote, GraphManager } from 'alizarin';
42
+
43
+ // Connect to an Arches instance
44
+ const client = new ArchesClientRemote('https://your-arches-instance.org');
45
+ const graphManager = new GraphManager(client);
46
+
47
+ // Load a resource model
48
+ const MonumentModel = await graphManager.loadGraph('Monument');
49
+
50
+ // Query all monuments
51
+ const monuments = await MonumentModel.all();
52
+
53
+ // Access monument data
54
+ for (const monument of monuments) {
55
+ console.log(monument.name);
56
+ console.log(monument.constructionDate);
57
+ console.log(monument.heritage_status?.prefLabel);
58
+ }
59
+ ```
60
+
61
+ ### Working with Static Data
62
+
63
+ ```typescript
64
+ import { ArchesClientRemoteStatic, GraphManager } from 'alizarin';
65
+
66
+ // Load from static JSON exports
67
+ const client = new ArchesClientRemoteStatic('/data/exports');
68
+ const graphManager = new GraphManager(client);
69
+
70
+ // Usage is identical to remote client
71
+ const PersonModel = await graphManager.loadGraph('Person');
72
+ ```
73
+
74
+ ### Creating Resources
75
+
76
+ ```typescript
77
+ const PersonModel = await graphManager.loadGraph('Person');
78
+
79
+ // Create a new person
80
+ const newPerson = PersonModel.create();
81
+ newPerson.forename = "Jane";
82
+ newPerson.surname = "Smith";
83
+ newPerson.birthDate = new Date(1990, 5, 15);
84
+ ```
85
+
86
+ ## API Reference
87
+
88
+ ### Client Classes
89
+
90
+ - `ArchesClient` - Abstract base class for all clients
91
+ - `ArchesClientRemote` - Connect to live Arches servers
92
+ - `ArchesClientRemoteStatic` - Load from static JSON files
93
+ - `ArchesClientLocal` - Load from local filesystem (Node.js)
94
+
95
+ ### Core Classes
96
+
97
+ - `GraphManager` - Central manager for graphs and resources
98
+ - `ResourceModelWrapper` - ORM wrapper for resource models
99
+ - `ResourceInstanceViewModel` - View model for resource instances
100
+ - `GraphMutator` - Tool for modifying graph schemas
101
+
102
+ ### View Model Types
103
+
104
+ - `StringViewModel` - String values
105
+ - `NumberViewModel` - Numeric values
106
+ - `DateViewModel` - Date/time values
107
+ - `ConceptValueViewModel` - Controlled vocabulary concepts
108
+ - `GeojsonFeatureCollectionViewModel` - Geographic data
109
+ - `ResourceInstanceListViewModel` - Related resources
110
+ - `SemanticViewModel` - Complex nested structures
111
+
112
+ ## Development
113
+
114
+ ### Running Tests
115
+
116
+ ```bash
117
+ npm test
118
+ ```
119
+
120
+ ### Linting
121
+
122
+ ```bash
123
+ npm run lint
124
+ ```
7
125
 
8
126
  ### CI
9
127
 
@@ -0,0 +1,27 @@
1
+ import { StaticNode as WasmStaticNode, StaticGraphMeta as WasmStaticGraphMeta, WasmRdmCache } from "../pkg/alizarin";
2
+ export declare function setWasmURL(url: string): void;
3
+ /**
4
+ * Get the global WASM RDM cache singleton.
5
+ * Creates the cache on first access (after WASM initialization).
6
+ * @throws Error if WASM is not yet initialized
7
+ */
8
+ export declare function getGlobalWasmRdmCache(): WasmRdmCache;
9
+ /**
10
+ * Check if the global WASM RDM cache is available.
11
+ */
12
+ export declare function hasGlobalWasmRdmCache(): boolean;
13
+ /**
14
+ * Ensure the WASM RDM cache is initialized and ready.
15
+ * This can be awaited early in the application lifecycle to ensure
16
+ * the cache is available before any hierarchy methods are called.
17
+ * @returns The initialized WasmRdmCache
18
+ */
19
+ export declare function ensureWasmRdmCache(): Promise<WasmRdmCache>;
20
+ export declare function initWasm(): Promise<void>;
21
+ export { WasmStaticNode, WasmStaticGraphMeta, WasmRdmCache };
22
+ declare function _parseSkosXml(xmlContent: string, baseUri?: string): any;
23
+ declare function _parseSkosXmlToCollection(xmlContent: string, baseUri?: string): any;
24
+ declare function _collectionToSkosXml(collection: any, baseUri?: string): string;
25
+ declare function _collectionsToSkosXml(collections: any[], baseUri?: string): string;
26
+ export { _parseSkosXml as parseSkosXml, _parseSkosXmlToCollection as parseSkosXmlToCollection, _collectionToSkosXml as collectionToSkosXml, _collectionsToSkosXml as collectionsToSkosXml, };
27
+ export { registerExtensionHandler } from "./backend";