@digitalculture/ochre-sdk 0.7.11 → 0.7.12
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 +0 -53
- package/dist/index.cjs +580 -7
- package/dist/index.d.cts +686 -596
- package/dist/index.d.ts +686 -596
- package/dist/index.js +580 -7
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -42,59 +42,6 @@ pnpm run ci
|
|
|
42
42
|
pnpm run release
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
## Features
|
|
46
|
-
|
|
47
|
-
- Type-safe parsing of OCHRE data structures
|
|
48
|
-
- Comprehensive TypeScript types for OCHRE entities
|
|
49
|
-
- Utilities for handling OCHRE websites, resources, and metadata
|
|
50
|
-
- Support for parsing rich text, documents, and multilingual content
|
|
51
|
-
|
|
52
|
-
## Usage
|
|
53
|
-
|
|
54
|
-
```typescript
|
|
55
|
-
import { fetchWebsite, fetchResource, fetchSet } from "@uchicago/ochre";
|
|
56
|
-
|
|
57
|
-
// Fetch and parse OCHRE website data
|
|
58
|
-
const website = await fetchWebsite(abbreviation);
|
|
59
|
-
|
|
60
|
-
// Fetch and parse OCHRE resource data
|
|
61
|
-
const resource = await fetchResource(uuid);
|
|
62
|
-
|
|
63
|
-
// Fetch and parse OCHRE set data
|
|
64
|
-
const set = await fetchSet(uuid);
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## API Reference
|
|
68
|
-
|
|
69
|
-
### Core Functions
|
|
70
|
-
|
|
71
|
-
#### `fetchWebsite(abbreviation: string): Promise<Website | null>`
|
|
72
|
-
|
|
73
|
-
Fetch and parse OCHRE website data.
|
|
74
|
-
|
|
75
|
-
```typescript
|
|
76
|
-
const website = await fetchWebsite("guerrilla-television");
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
#### `fetchResource(uuid: string): Promise<Resource | null>`
|
|
80
|
-
|
|
81
|
-
Fetch and parse OCHRE resource data.
|
|
82
|
-
|
|
83
|
-
```typescript
|
|
84
|
-
const resource = await fetchResource("27adf18a-21ad-442b-b186-0c7f3b8cb2d1");
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### Types
|
|
88
|
-
|
|
89
|
-
The SDK provides comprehensive TypeScript types for OCHRE data structures. Key types include:
|
|
90
|
-
|
|
91
|
-
- `Website` - Represents an OCHRE website
|
|
92
|
-
- `Resource` - Represents an OCHRE resource
|
|
93
|
-
- `Set` - Represents an OCHRE set
|
|
94
|
-
- `Document` - Represents an OCHRE MDX document
|
|
95
|
-
- `WebElement` - Represents a web element in an OCHRE website
|
|
96
|
-
- And many more...
|
|
97
|
-
|
|
98
45
|
## Contributing
|
|
99
46
|
|
|
100
47
|
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
|