@resourcexjs/server 2.5.5 → 2.5.7
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 +62 -23
- package/dist/index.d.ts +13 -13
- package/dist/index.js +219 -25
- package/dist/index.js.map +7 -6
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -5,7 +5,9 @@ ResourceX Registry Server - HTTP API server for hosting and serving ResourceX re
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
bun add @resourcexjs/server
|
|
8
|
+
bun add @resourcexjs/server @resourcexjs/node-provider
|
|
9
|
+
# or
|
|
10
|
+
npm install @resourcexjs/server @resourcexjs/node-provider
|
|
9
11
|
```
|
|
10
12
|
|
|
11
13
|
## Overview
|
|
@@ -20,9 +22,11 @@ This package provides three levels of abstraction for building a ResourceX regis
|
|
|
20
22
|
|
|
21
23
|
```typescript
|
|
22
24
|
import { createRegistryServer } from "@resourcexjs/server";
|
|
25
|
+
import { FileSystemRXAStore, FileSystemRXMStore } from "@resourcexjs/node-provider";
|
|
23
26
|
|
|
24
27
|
const server = createRegistryServer({
|
|
25
|
-
|
|
28
|
+
rxaStore: new FileSystemRXAStore("./data/blobs"),
|
|
29
|
+
rxmStore: new FileSystemRXMStore("./data/manifests"),
|
|
26
30
|
});
|
|
27
31
|
|
|
28
32
|
// Bun
|
|
@@ -35,26 +39,31 @@ serve({ fetch: server.fetch, port: 3000 });
|
|
|
35
39
|
|
|
36
40
|
## API
|
|
37
41
|
|
|
38
|
-
### `createRegistryServer(config
|
|
42
|
+
### `createRegistryServer(config)`
|
|
39
43
|
|
|
40
44
|
Creates a Hono app with all registry endpoints configured.
|
|
41
45
|
|
|
42
46
|
```typescript
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
basePath?: string; // Default: ""
|
|
46
|
-
cors?: boolean; // Default: true
|
|
47
|
-
}
|
|
48
|
-
```
|
|
47
|
+
import { createRegistryServer } from "@resourcexjs/server";
|
|
48
|
+
import { FileSystemRXAStore, FileSystemRXMStore } from "@resourcexjs/node-provider";
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
const server = createRegistryServer({
|
|
51
|
+
rxaStore: new FileSystemRXAStore("./data/blobs"),
|
|
52
|
+
rxmStore: new FileSystemRXMStore("./data/manifests"),
|
|
53
|
+
basePath: "", // Optional: API route prefix (default: "")
|
|
54
|
+
cors: true, // Optional: Enable CORS (default: true)
|
|
55
|
+
});
|
|
56
|
+
```
|
|
51
57
|
|
|
52
|
-
|
|
58
|
+
#### Config Interface
|
|
53
59
|
|
|
54
60
|
```typescript
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
interface RegistryServerConfig {
|
|
62
|
+
rxaStore: RXAStore; // Content-addressable blob storage
|
|
63
|
+
rxmStore: RXMStore; // Manifest storage
|
|
64
|
+
basePath?: string; // API route prefix (default: "")
|
|
65
|
+
cors?: boolean; // Enable CORS (default: true)
|
|
66
|
+
}
|
|
58
67
|
```
|
|
59
68
|
|
|
60
69
|
## Handlers
|
|
@@ -69,10 +78,14 @@ import {
|
|
|
69
78
|
handleDeleteResource,
|
|
70
79
|
handleGetContent,
|
|
71
80
|
handleSearch,
|
|
72
|
-
|
|
81
|
+
CASRegistry,
|
|
73
82
|
} from "@resourcexjs/server";
|
|
83
|
+
import { FileSystemRXAStore, FileSystemRXMStore } from "@resourcexjs/node-provider";
|
|
74
84
|
|
|
75
|
-
const registry =
|
|
85
|
+
const registry = new CASRegistry(
|
|
86
|
+
new FileSystemRXAStore("./data/blobs"),
|
|
87
|
+
new FileSystemRXMStore("./data/manifests")
|
|
88
|
+
);
|
|
76
89
|
|
|
77
90
|
// Next.js Route Handler example
|
|
78
91
|
export async function POST(request: Request) {
|
|
@@ -113,14 +126,14 @@ Publish a resource to the registry.
|
|
|
113
126
|
|
|
114
127
|
**Fields:**
|
|
115
128
|
|
|
116
|
-
- `locator` (string) - Resource locator (e.g., `hello
|
|
129
|
+
- `locator` (string) - Resource locator (e.g., `hello:1.0.0`)
|
|
117
130
|
- `manifest` (file) - JSON manifest file
|
|
118
131
|
- `content` (file) - Archive file (tar.gz)
|
|
119
132
|
|
|
120
133
|
**Response (201):**
|
|
121
134
|
|
|
122
135
|
```json
|
|
123
|
-
{ "locator": "hello
|
|
136
|
+
{ "locator": "hello:1.0.0" }
|
|
124
137
|
```
|
|
125
138
|
|
|
126
139
|
### `GET /api/v1/resource/:locator`
|
|
@@ -134,7 +147,6 @@ Get resource manifest.
|
|
|
134
147
|
"name": "hello",
|
|
135
148
|
"type": "text",
|
|
136
149
|
"tag": "1.0.0",
|
|
137
|
-
"registry": "example.com",
|
|
138
150
|
"path": "prompts"
|
|
139
151
|
}
|
|
140
152
|
```
|
|
@@ -173,7 +185,7 @@ Search for resources.
|
|
|
173
185
|
{
|
|
174
186
|
"results": [
|
|
175
187
|
{
|
|
176
|
-
"locator": "hello
|
|
188
|
+
"locator": "hello:1.0.0",
|
|
177
189
|
"name": "hello",
|
|
178
190
|
"type": "text",
|
|
179
191
|
"tag": "1.0.0"
|
|
@@ -218,8 +230,8 @@ import type {
|
|
|
218
230
|
```typescript
|
|
219
231
|
import { buildResourceUrl, buildSearchUrl } from "@resourcexjs/server";
|
|
220
232
|
|
|
221
|
-
const url = buildResourceUrl("https://registry.example.com", "hello
|
|
222
|
-
// "https://registry.example.com/api/v1/resource/hello
|
|
233
|
+
const url = buildResourceUrl("https://registry.example.com", "hello:1.0.0");
|
|
234
|
+
// "https://registry.example.com/api/v1/resource/hello%3A1.0.0"
|
|
223
235
|
|
|
224
236
|
const searchUrl = buildSearchUrl("https://registry.example.com", {
|
|
225
237
|
q: "prompt",
|
|
@@ -256,8 +268,35 @@ All error responses follow a consistent format:
|
|
|
256
268
|
For convenience, this package re-exports commonly used classes:
|
|
257
269
|
|
|
258
270
|
```typescript
|
|
259
|
-
import {
|
|
271
|
+
import { CASRegistry, FileSystemRXAStore, FileSystemRXMStore } from "@resourcexjs/server";
|
|
272
|
+
|
|
273
|
+
import type { RXAStore, RXMStore, Registry } from "@resourcexjs/server";
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## Storage Architecture
|
|
277
|
+
|
|
278
|
+
The server uses content-addressable storage (CAS) for efficient deduplication:
|
|
279
|
+
|
|
260
280
|
```
|
|
281
|
+
./data/
|
|
282
|
+
├── blobs/ # Content-addressable blob storage
|
|
283
|
+
│ └── ab/
|
|
284
|
+
│ └── sha256:abcd1234... # Archive data (tar.gz)
|
|
285
|
+
└── manifests/
|
|
286
|
+
└── _local/ # Resources stored on this server
|
|
287
|
+
└── my-prompt/
|
|
288
|
+
└── 1.0.0.json # Manifest with digest reference
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
**Note:** The server stores resources without registry prefix. When a resource is published to `registry.example.com/hello:1.0.0`, it's stored as `hello:1.0.0` on the server. The registry prefix is added by clients when they pull resources.
|
|
292
|
+
|
|
293
|
+
## Related Packages
|
|
294
|
+
|
|
295
|
+
| Package | Description |
|
|
296
|
+
| ---------------------------- | ------------------------------- |
|
|
297
|
+
| `resourcexjs` | Client SDK |
|
|
298
|
+
| `@resourcexjs/core` | Core primitives and CASRegistry |
|
|
299
|
+
| `@resourcexjs/node-provider` | Node.js/Bun storage providers |
|
|
261
300
|
|
|
262
301
|
## License
|
|
263
302
|
|
package/dist/index.d.ts
CHANGED
|
@@ -75,7 +75,7 @@ declare function buildSearchUrl(baseUrl: string, params?: {
|
|
|
75
75
|
limit?: number
|
|
76
76
|
offset?: number
|
|
77
77
|
}): string;
|
|
78
|
-
import { Registry } from "@resourcexjs/
|
|
78
|
+
import { Registry } from "@resourcexjs/core";
|
|
79
79
|
/**
|
|
80
80
|
* Handle POST /publish
|
|
81
81
|
*/
|
|
@@ -101,12 +101,16 @@ declare function handleGetContent(locator: string, registry: Registry): Promise<
|
|
|
101
101
|
*/
|
|
102
102
|
declare function handleSearch(query: string | undefined, limit: number, offset: number, registry: Registry): Promise<Response>;
|
|
103
103
|
import { Hono } from "hono";
|
|
104
|
+
import { RXAStore, RXMStore } from "@resourcexjs/core";
|
|
104
105
|
interface RegistryServerConfig {
|
|
105
106
|
/**
|
|
106
|
-
*
|
|
107
|
-
* @default "./data"
|
|
107
|
+
* RXA Store (blob storage).
|
|
108
108
|
*/
|
|
109
|
-
|
|
109
|
+
rxaStore: RXAStore;
|
|
110
|
+
/**
|
|
111
|
+
* RXM Store (manifest storage).
|
|
112
|
+
*/
|
|
113
|
+
rxmStore: RXMStore;
|
|
110
114
|
/**
|
|
111
115
|
* Base path for API routes.
|
|
112
116
|
* @default ""
|
|
@@ -121,12 +125,8 @@ interface RegistryServerConfig {
|
|
|
121
125
|
/**
|
|
122
126
|
* Create a registry server Hono app.
|
|
123
127
|
*/
|
|
124
|
-
declare function createRegistryServer(config
|
|
125
|
-
import {
|
|
126
|
-
import {
|
|
127
|
-
import {
|
|
128
|
-
|
|
129
|
-
storagePath: string;
|
|
130
|
-
}
|
|
131
|
-
declare function createRegistry(config: CreateRegistryConfig): Registry2;
|
|
132
|
-
export { handleSearch, handlePublish, handleHeadResource, handleGetResource, handleGetContent, handleDeleteResource, createRegistryServer, createRegistry, buildSearchUrl, buildResourceUrl, buildPublishUrl, buildContentUrl, SearchResultItem, SearchResponse, SearchQuery, RegistryServerConfig, PublishResponse, PUBLISH_FIELDS, MemoryStorage, ManifestData, LocalRegistry, GetResourceResponse, FileSystemStorage, ErrorResponse, ErrorCode, ERROR_STATUS, ERROR_CODES, ENDPOINTS, CreateRegistryConfig, CONTENT_TYPES, API_VERSION, API_PREFIX };
|
|
128
|
+
declare function createRegistryServer(config: RegistryServerConfig): Hono;
|
|
129
|
+
import { CASRegistry } from "@resourcexjs/core";
|
|
130
|
+
import { RXAStore as RXAStore2, RXMStore as RXMStore2, Registry as Registry2 } from "@resourcexjs/core";
|
|
131
|
+
import { FileSystemRXAStore, FileSystemRXMStore } from "@resourcexjs/node-provider";
|
|
132
|
+
export { handleSearch, handlePublish, handleHeadResource, handleGetResource, handleGetContent, handleDeleteResource, createRegistryServer, buildSearchUrl, buildResourceUrl, buildPublishUrl, buildContentUrl, SearchResultItem, SearchResponse, SearchQuery, RegistryServerConfig, Registry2 as Registry, RXMStore2 as RXMStore, RXAStore2 as RXAStore, PublishResponse, PUBLISH_FIELDS, ManifestData, GetResourceResponse, FileSystemRXMStore, FileSystemRXAStore, ErrorResponse, ErrorCode, ERROR_STATUS, ERROR_CODES, ENDPOINTS, CONTENT_TYPES, CASRegistry, API_VERSION, API_PREFIX };
|
package/dist/index.js
CHANGED
|
@@ -93,7 +93,7 @@ async function handlePublish(request, registry) {
|
|
|
93
93
|
const manifestText = await manifestFile.text();
|
|
94
94
|
const manifestData = JSON.parse(manifestText);
|
|
95
95
|
const rxm = manifest({
|
|
96
|
-
registry:
|
|
96
|
+
registry: undefined,
|
|
97
97
|
path: manifestData.path ?? rxl.path,
|
|
98
98
|
name: manifestData.name ?? rxl.name,
|
|
99
99
|
type: manifestData.type,
|
|
@@ -114,7 +114,8 @@ async function handlePublish(request, registry) {
|
|
|
114
114
|
async function handleGetResource(locator, registry) {
|
|
115
115
|
try {
|
|
116
116
|
const rxl = parse(locator);
|
|
117
|
-
const
|
|
117
|
+
const localRxl = { ...rxl, registry: undefined };
|
|
118
|
+
const rxr = await registry.get(localRxl);
|
|
118
119
|
const response = {
|
|
119
120
|
registry: rxr.manifest.registry,
|
|
120
121
|
path: rxr.manifest.path,
|
|
@@ -134,7 +135,8 @@ async function handleGetResource(locator, registry) {
|
|
|
134
135
|
async function handleHeadResource(locator, registry) {
|
|
135
136
|
try {
|
|
136
137
|
const rxl = parse(locator);
|
|
137
|
-
const
|
|
138
|
+
const localRxl = { ...rxl, registry: undefined };
|
|
139
|
+
const exists = await registry.has(localRxl);
|
|
138
140
|
return new Response(null, { status: exists ? 200 : 404 });
|
|
139
141
|
} catch {
|
|
140
142
|
return new Response(null, { status: 500 });
|
|
@@ -143,11 +145,12 @@ async function handleHeadResource(locator, registry) {
|
|
|
143
145
|
async function handleDeleteResource(locator, registry) {
|
|
144
146
|
try {
|
|
145
147
|
const rxl = parse(locator);
|
|
146
|
-
const
|
|
148
|
+
const localRxl = { ...rxl, registry: undefined };
|
|
149
|
+
const exists = await registry.has(localRxl);
|
|
147
150
|
if (!exists) {
|
|
148
151
|
return errorResponse("Resource not found", ERROR_CODES.RESOURCE_NOT_FOUND, 404);
|
|
149
152
|
}
|
|
150
|
-
await registry.remove(
|
|
153
|
+
await registry.remove(localRxl);
|
|
151
154
|
return new Response(null, { status: 204 });
|
|
152
155
|
} catch (error) {
|
|
153
156
|
const message = error instanceof Error ? error.message : "Unknown error";
|
|
@@ -157,7 +160,8 @@ async function handleDeleteResource(locator, registry) {
|
|
|
157
160
|
async function handleGetContent(locator, registry) {
|
|
158
161
|
try {
|
|
159
162
|
const rxl = parse(locator);
|
|
160
|
-
const
|
|
163
|
+
const localRxl = { ...rxl, registry: undefined };
|
|
164
|
+
const rxr = await registry.get(localRxl);
|
|
161
165
|
const buffer = await rxr.archive.buffer();
|
|
162
166
|
return new Response(buffer, {
|
|
163
167
|
status: 200,
|
|
@@ -202,14 +206,11 @@ async function handleSearch(query, limit, offset, registry) {
|
|
|
202
206
|
// src/hono.ts
|
|
203
207
|
import { Hono } from "hono";
|
|
204
208
|
import { cors } from "hono/cors";
|
|
205
|
-
import {
|
|
206
|
-
import { LocalRegistry } from "@resourcexjs/registry";
|
|
209
|
+
import { CASRegistry } from "@resourcexjs/core";
|
|
207
210
|
function createRegistryServer(config) {
|
|
208
|
-
const
|
|
209
|
-
const
|
|
210
|
-
const
|
|
211
|
-
const storage = new FileSystemStorage(storagePath);
|
|
212
|
-
const registry = new LocalRegistry(storage);
|
|
211
|
+
const basePath = config.basePath ?? "";
|
|
212
|
+
const enableCors = config.cors ?? true;
|
|
213
|
+
const registry = new CASRegistry(config.rxaStore, config.rxmStore);
|
|
213
214
|
const app = new Hono().basePath(basePath);
|
|
214
215
|
if (enableCors) {
|
|
215
216
|
app.use("*", cors());
|
|
@@ -244,14 +245,208 @@ function createRegistryServer(config) {
|
|
|
244
245
|
}
|
|
245
246
|
|
|
246
247
|
// src/index.ts
|
|
247
|
-
import {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
import {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
248
|
+
import { CASRegistry as CASRegistry2 } from "@resourcexjs/core";
|
|
249
|
+
|
|
250
|
+
// ../node-provider/dist/index.js
|
|
251
|
+
import { homedir } from "node:os";
|
|
252
|
+
import { FolderLoader } from "@resourcexjs/core";
|
|
253
|
+
import { mkdir, readFile, writeFile, unlink, readdir, stat } from "node:fs/promises";
|
|
254
|
+
import { join } from "node:path";
|
|
255
|
+
import { computeDigest, RegistryError } from "@resourcexjs/core";
|
|
256
|
+
import { mkdir as mkdir2, readFile as readFile2, writeFile as writeFile2, unlink as unlink2, readdir as readdir2, stat as stat2, rm } from "node:fs/promises";
|
|
257
|
+
import { join as join2 } from "node:path";
|
|
258
|
+
|
|
259
|
+
class FileSystemRXAStore {
|
|
260
|
+
basePath;
|
|
261
|
+
constructor(basePath) {
|
|
262
|
+
this.basePath = basePath;
|
|
263
|
+
}
|
|
264
|
+
getPath(digest) {
|
|
265
|
+
const prefix = digest.substring(7, 9);
|
|
266
|
+
return join(this.basePath, prefix, digest);
|
|
267
|
+
}
|
|
268
|
+
async get(digest) {
|
|
269
|
+
const path = this.getPath(digest);
|
|
270
|
+
try {
|
|
271
|
+
return await readFile(path);
|
|
272
|
+
} catch (error) {
|
|
273
|
+
throw new RegistryError(`Blob not found: ${digest}`);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
async put(data) {
|
|
277
|
+
const digest = computeDigest(data);
|
|
278
|
+
const path = this.getPath(digest);
|
|
279
|
+
if (await this.has(digest)) {
|
|
280
|
+
return digest;
|
|
281
|
+
}
|
|
282
|
+
const dir = join(path, "..");
|
|
283
|
+
await mkdir(dir, { recursive: true });
|
|
284
|
+
await writeFile(path, data);
|
|
285
|
+
return digest;
|
|
286
|
+
}
|
|
287
|
+
async has(digest) {
|
|
288
|
+
const path = this.getPath(digest);
|
|
289
|
+
try {
|
|
290
|
+
await stat(path);
|
|
291
|
+
return true;
|
|
292
|
+
} catch {
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
async delete(digest) {
|
|
297
|
+
const path = this.getPath(digest);
|
|
298
|
+
try {
|
|
299
|
+
await unlink(path);
|
|
300
|
+
} catch {}
|
|
301
|
+
}
|
|
302
|
+
async list() {
|
|
303
|
+
const digests = [];
|
|
304
|
+
try {
|
|
305
|
+
const prefixes = await readdir(this.basePath);
|
|
306
|
+
for (const prefix of prefixes) {
|
|
307
|
+
const prefixPath = join(this.basePath, prefix);
|
|
308
|
+
try {
|
|
309
|
+
const files = await readdir(prefixPath);
|
|
310
|
+
for (const file of files) {
|
|
311
|
+
if (file.startsWith("sha256:")) {
|
|
312
|
+
digests.push(file);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
} catch {}
|
|
316
|
+
}
|
|
317
|
+
} catch {}
|
|
318
|
+
return digests;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
var LOCAL_DIR = "_local";
|
|
322
|
+
|
|
323
|
+
class FileSystemRXMStore {
|
|
324
|
+
basePath;
|
|
325
|
+
constructor(basePath) {
|
|
326
|
+
this.basePath = basePath;
|
|
327
|
+
}
|
|
328
|
+
getDir(name, registry) {
|
|
329
|
+
const registryDir = registry ?? LOCAL_DIR;
|
|
330
|
+
return join2(this.basePath, registryDir, name);
|
|
331
|
+
}
|
|
332
|
+
getPath(name, tag, registry) {
|
|
333
|
+
return join2(this.getDir(name, registry), `${tag}.json`);
|
|
334
|
+
}
|
|
335
|
+
async get(name, tag, registry) {
|
|
336
|
+
const path = this.getPath(name, tag, registry);
|
|
337
|
+
try {
|
|
338
|
+
const data = await readFile2(path, "utf-8");
|
|
339
|
+
return JSON.parse(data);
|
|
340
|
+
} catch {
|
|
341
|
+
return null;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
async put(manifest2) {
|
|
345
|
+
const path = this.getPath(manifest2.name, manifest2.tag, manifest2.registry);
|
|
346
|
+
const dir = join2(path, "..");
|
|
347
|
+
await mkdir2(dir, { recursive: true });
|
|
348
|
+
await writeFile2(path, JSON.stringify(manifest2, null, 2), "utf-8");
|
|
349
|
+
}
|
|
350
|
+
async has(name, tag, registry) {
|
|
351
|
+
const path = this.getPath(name, tag, registry);
|
|
352
|
+
try {
|
|
353
|
+
await stat2(path);
|
|
354
|
+
return true;
|
|
355
|
+
} catch {
|
|
356
|
+
return false;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
async delete(name, tag, registry) {
|
|
360
|
+
const path = this.getPath(name, tag, registry);
|
|
361
|
+
try {
|
|
362
|
+
await unlink2(path);
|
|
363
|
+
} catch {}
|
|
364
|
+
}
|
|
365
|
+
async listTags(name, registry) {
|
|
366
|
+
const dir = this.getDir(name, registry);
|
|
367
|
+
const tags = [];
|
|
368
|
+
try {
|
|
369
|
+
const files = await readdir2(dir);
|
|
370
|
+
for (const file of files) {
|
|
371
|
+
if (file.endsWith(".json")) {
|
|
372
|
+
tags.push(file.replace(".json", ""));
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
} catch {}
|
|
376
|
+
return tags;
|
|
377
|
+
}
|
|
378
|
+
async listNames(registry, query) {
|
|
379
|
+
const registryDir = registry ?? LOCAL_DIR;
|
|
380
|
+
const basePath = join2(this.basePath, registryDir);
|
|
381
|
+
const names = [];
|
|
382
|
+
try {
|
|
383
|
+
const entries = await readdir2(basePath);
|
|
384
|
+
for (const entry of entries) {
|
|
385
|
+
const entryPath = join2(basePath, entry);
|
|
386
|
+
try {
|
|
387
|
+
const entryStat = await stat2(entryPath);
|
|
388
|
+
if (entryStat.isDirectory()) {
|
|
389
|
+
if (!query || entry.toLowerCase().includes(query.toLowerCase())) {
|
|
390
|
+
names.push(entry);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
} catch {}
|
|
394
|
+
}
|
|
395
|
+
} catch {}
|
|
396
|
+
return names;
|
|
397
|
+
}
|
|
398
|
+
async search(options) {
|
|
399
|
+
const { registry, query, limit, offset = 0 } = options ?? {};
|
|
400
|
+
const results = [];
|
|
401
|
+
let registryDirs = [];
|
|
402
|
+
if (registry === null) {
|
|
403
|
+
registryDirs = [LOCAL_DIR];
|
|
404
|
+
} else if (registry !== undefined) {
|
|
405
|
+
registryDirs = [registry];
|
|
406
|
+
} else {
|
|
407
|
+
try {
|
|
408
|
+
registryDirs = await readdir2(this.basePath);
|
|
409
|
+
} catch {
|
|
410
|
+
return [];
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
for (const regDir of registryDirs) {
|
|
414
|
+
const regPath = join2(this.basePath, regDir);
|
|
415
|
+
try {
|
|
416
|
+
const names = await readdir2(regPath);
|
|
417
|
+
for (const name of names) {
|
|
418
|
+
if (query && !name.toLowerCase().includes(query.toLowerCase())) {
|
|
419
|
+
continue;
|
|
420
|
+
}
|
|
421
|
+
const namePath = join2(regPath, name);
|
|
422
|
+
try {
|
|
423
|
+
const files = await readdir2(namePath);
|
|
424
|
+
for (const file of files) {
|
|
425
|
+
if (file.endsWith(".json")) {
|
|
426
|
+
const filePath = join2(namePath, file);
|
|
427
|
+
const data = await readFile2(filePath, "utf-8");
|
|
428
|
+
const manifest2 = JSON.parse(data);
|
|
429
|
+
results.push(manifest2);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
} catch {}
|
|
433
|
+
}
|
|
434
|
+
} catch {}
|
|
435
|
+
}
|
|
436
|
+
let paginated = results.slice(offset);
|
|
437
|
+
if (limit !== undefined) {
|
|
438
|
+
paginated = paginated.slice(0, limit);
|
|
439
|
+
}
|
|
440
|
+
return paginated;
|
|
441
|
+
}
|
|
442
|
+
async deleteByRegistry(registry) {
|
|
443
|
+
const regPath = join2(this.basePath, registry);
|
|
444
|
+
try {
|
|
445
|
+
await rm(regPath, { recursive: true });
|
|
446
|
+
} catch {}
|
|
447
|
+
}
|
|
254
448
|
}
|
|
449
|
+
var DEFAULT_BASE_PATH = `${homedir()}/.resourcex`;
|
|
255
450
|
export {
|
|
256
451
|
handleSearch,
|
|
257
452
|
handlePublish,
|
|
@@ -260,21 +455,20 @@ export {
|
|
|
260
455
|
handleGetContent,
|
|
261
456
|
handleDeleteResource,
|
|
262
457
|
createRegistryServer,
|
|
263
|
-
createRegistry,
|
|
264
458
|
buildSearchUrl,
|
|
265
459
|
buildResourceUrl,
|
|
266
460
|
buildPublishUrl,
|
|
267
461
|
buildContentUrl,
|
|
268
462
|
PUBLISH_FIELDS,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
FileSystemStorage2 as FileSystemStorage,
|
|
463
|
+
FileSystemRXMStore,
|
|
464
|
+
FileSystemRXAStore,
|
|
272
465
|
ERROR_STATUS,
|
|
273
466
|
ERROR_CODES,
|
|
274
467
|
ENDPOINTS,
|
|
275
468
|
CONTENT_TYPES,
|
|
469
|
+
CASRegistry2 as CASRegistry,
|
|
276
470
|
API_VERSION,
|
|
277
471
|
API_PREFIX
|
|
278
472
|
};
|
|
279
473
|
|
|
280
|
-
//# debugId=
|
|
474
|
+
//# debugId=3D890F83600C8C7E64756E2164756E21
|
package/dist/index.js.map
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/protocol.ts", "../src/handlers.ts", "../src/hono.ts", "../src/index.ts"],
|
|
3
|
+
"sources": ["../src/protocol.ts", "../src/handlers.ts", "../src/hono.ts", "../src/index.ts", "../../node-provider/dist/index.js"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"/**\n * ResourceX Registry HTTP API Protocol\n *\n * Defines the contract between ResourceX client and registry server.\n */\n\n// ============================================\n// API Endpoints\n// ============================================\n\nexport const API_VERSION: string = \"v1\";\nexport const API_PREFIX: string = `/api/${API_VERSION}`;\n\nexport const ENDPOINTS: {\n readonly publish: string;\n readonly resource: string;\n readonly content: string;\n readonly search: string;\n readonly health: string;\n} = {\n publish: `${API_PREFIX}/publish`,\n resource: `${API_PREFIX}/resource`,\n content: `${API_PREFIX}/content`,\n search: `${API_PREFIX}/search`,\n health: `${API_PREFIX}/health`,\n} as const;\n\nexport const CONTENT_TYPES = {\n json: \"application/json\",\n binary: \"application/gzip\",\n formData: \"multipart/form-data\",\n} as const;\n\n// ============================================\n// Request Types\n// ============================================\n\nexport interface ManifestData {\n registry?: string;\n path?: string;\n name: string;\n type: string;\n tag: string;\n}\n\nexport const PUBLISH_FIELDS = {\n locator: \"locator\",\n manifest: \"manifest\",\n content: \"content\",\n} as const;\n\nexport interface SearchQuery {\n q?: string;\n limit?: number;\n offset?: number;\n}\n\n// ============================================\n// Response Types\n// ============================================\n\nexport interface PublishResponse {\n locator: string;\n}\n\nexport type GetResourceResponse = ManifestData;\n\nexport interface SearchResultItem {\n locator: string;\n registry?: string;\n path?: string;\n name: string;\n type: string;\n tag: string;\n}\n\nexport interface SearchResponse {\n results: SearchResultItem[];\n total?: number;\n}\n\nexport interface ErrorResponse {\n error: string;\n code?: string;\n}\n\n// ============================================\n// Error Codes\n// ============================================\n\nexport const ERROR_CODES = {\n // 400 Bad Request\n LOCATOR_REQUIRED: \"LOCATOR_REQUIRED\",\n MANIFEST_REQUIRED: \"MANIFEST_REQUIRED\",\n CONTENT_REQUIRED: \"CONTENT_REQUIRED\",\n ARCHIVE_REQUIRED: \"ARCHIVE_REQUIRED\",\n INVALID_MANIFEST: \"INVALID_MANIFEST\",\n INVALID_LOCATOR: \"INVALID_LOCATOR\",\n MISSING_REQUIRED_FIELDS: \"MISSING_REQUIRED_FIELDS\",\n\n // 404 Not Found\n RESOURCE_NOT_FOUND: \"RESOURCE_NOT_FOUND\",\n\n // 500 Internal Server Error\n INTERNAL_ERROR: \"INTERNAL_ERROR\",\n} as const;\n\nexport type ErrorCode = (typeof ERROR_CODES)[keyof typeof ERROR_CODES];\n\nexport const ERROR_STATUS: Record<ErrorCode, number> = {\n [ERROR_CODES.LOCATOR_REQUIRED]: 400,\n [ERROR_CODES.MANIFEST_REQUIRED]: 400,\n [ERROR_CODES.CONTENT_REQUIRED]: 400,\n [ERROR_CODES.ARCHIVE_REQUIRED]: 400,\n [ERROR_CODES.INVALID_MANIFEST]: 400,\n [ERROR_CODES.INVALID_LOCATOR]: 400,\n [ERROR_CODES.MISSING_REQUIRED_FIELDS]: 400,\n [ERROR_CODES.RESOURCE_NOT_FOUND]: 404,\n [ERROR_CODES.INTERNAL_ERROR]: 500,\n};\n\n// ============================================\n// URL Builders\n// ============================================\n\nexport function buildResourceUrl(baseUrl: string, locator: string): string {\n return `${baseUrl.replace(/\\/$/, \"\")}${ENDPOINTS.resource}/${encodeURIComponent(locator)}`;\n}\n\nexport function buildContentUrl(baseUrl: string, locator: string): string {\n return `${baseUrl.replace(/\\/$/, \"\")}${ENDPOINTS.content}/${encodeURIComponent(locator)}`;\n}\n\nexport function buildPublishUrl(baseUrl: string): string {\n return `${baseUrl.replace(/\\/$/, \"\")}${ENDPOINTS.publish}`;\n}\n\nexport function buildSearchUrl(\n baseUrl: string,\n params?: { q?: string; limit?: number; offset?: number }\n): string {\n const url = new URL(`${baseUrl.replace(/\\/$/, \"\")}${ENDPOINTS.search}`);\n if (params?.q) url.searchParams.set(\"q\", params.q);\n if (params?.limit) url.searchParams.set(\"limit\", String(params.limit));\n if (params?.offset) url.searchParams.set(\"offset\", String(params.offset));\n return url.toString();\n}\n",
|
|
6
|
-
"/**\n * ResourceX Registry Handlers\n *\n * Handler functions for Next.js Route Handler or any other framework.\n */\n\nimport { parse, format, manifest, wrap, resource } from \"@resourcexjs/core\";\nimport type { Registry } from \"@resourcexjs/
|
|
7
|
-
"/**\n * ResourceX Registry Hono Server\n *\n * Ready-to-use Hono app implementing the ResourceX Registry Protocol.\n */\n\nimport { Hono } from \"hono\";\nimport { cors } from \"hono/cors\";\nimport {
|
|
8
|
-
"/**\n * @resourcexjs/server\n *\n * ResourceX Registry Server - Protocol, Handlers, and Hono Server\n *\n * @example\n * ```typescript\n *
|
|
6
|
+
"/**\n * ResourceX Registry Handlers\n *\n * Handler functions for Next.js Route Handler or any other framework.\n */\n\nimport { parse, format, manifest, wrap, resource } from \"@resourcexjs/core\";\nimport type { Registry } from \"@resourcexjs/core\";\nimport {\n PUBLISH_FIELDS,\n ERROR_CODES,\n type PublishResponse,\n type GetResourceResponse,\n type SearchResponse,\n type ErrorResponse,\n} from \"./protocol.js\";\n\n// ============================================\n// Helper Functions\n// ============================================\n\nfunction jsonResponse<T>(data: T, status = 200): Response {\n return new Response(JSON.stringify(data), {\n status,\n headers: { \"Content-Type\": \"application/json\" },\n });\n}\n\nfunction errorResponse(error: string, code: string, status: number): Response {\n const body: ErrorResponse = { error, code };\n return new Response(JSON.stringify(body), {\n status,\n headers: { \"Content-Type\": \"application/json\" },\n });\n}\n\n// ============================================\n// Handler Functions\n// ============================================\n\n/**\n * Handle POST /publish\n */\nexport async function handlePublish(request: Request, registry: Registry): Promise<Response> {\n try {\n const formData = await request.formData();\n\n const locatorStr = formData.get(PUBLISH_FIELDS.locator);\n if (!locatorStr || typeof locatorStr !== \"string\") {\n return errorResponse(\"Missing locator field\", ERROR_CODES.LOCATOR_REQUIRED, 400);\n }\n\n const manifestFile = formData.get(PUBLISH_FIELDS.manifest);\n if (!manifestFile || typeof manifestFile === \"string\") {\n return errorResponse(\"Missing manifest file\", ERROR_CODES.MANIFEST_REQUIRED, 400);\n }\n\n const contentFile = formData.get(PUBLISH_FIELDS.content);\n if (!contentFile || typeof contentFile === \"string\") {\n return errorResponse(\"Missing content file\", ERROR_CODES.CONTENT_REQUIRED, 400);\n }\n\n const rxl = parse(locatorStr);\n const manifestText = await manifestFile.text();\n const manifestData = JSON.parse(manifestText);\n\n // Server stores resources WITHOUT registry prefix\n // The registry is implicit - resources are stored ON this server\n const rxm = manifest({\n registry: undefined, // Do not store registry - this IS the registry\n path: manifestData.path ?? rxl.path,\n name: manifestData.name ?? rxl.name,\n type: manifestData.type, // Type must come from manifest, not locator\n tag: manifestData.tag ?? rxl.tag ?? \"latest\",\n files: manifestData.files,\n });\n\n const contentBuffer = Buffer.from(await contentFile.arrayBuffer());\n const rxa = wrap(contentBuffer);\n const rxr = resource(rxm, rxa);\n\n await registry.put(rxr);\n\n const response: PublishResponse = { locator: format(rxr.locator) };\n return jsonResponse(response, 201);\n } catch (error) {\n const message = error instanceof Error ? error.message : \"Unknown error\";\n return errorResponse(message, ERROR_CODES.INTERNAL_ERROR, 500);\n }\n}\n\n/**\n * Handle GET /resource/:locator\n */\nexport async function handleGetResource(locator: string, registry: Registry): Promise<Response> {\n try {\n const rxl = parse(locator);\n // Server lookup without registry - resources stored locally don't have registry prefix\n const localRxl = { ...rxl, registry: undefined };\n const rxr = await registry.get(localRxl);\n\n const response: GetResourceResponse = {\n registry: rxr.manifest.registry,\n path: rxr.manifest.path,\n name: rxr.manifest.name,\n type: rxr.manifest.type,\n tag: rxr.manifest.tag,\n };\n return jsonResponse(response);\n } catch (error) {\n const message = error instanceof Error ? error.message : \"Unknown error\";\n if (message.includes(\"not found\")) {\n return errorResponse(\"Resource not found\", ERROR_CODES.RESOURCE_NOT_FOUND, 404);\n }\n return errorResponse(message, ERROR_CODES.INTERNAL_ERROR, 500);\n }\n}\n\n/**\n * Handle HEAD /resource/:locator\n */\nexport async function handleHeadResource(locator: string, registry: Registry): Promise<Response> {\n try {\n const rxl = parse(locator);\n const localRxl = { ...rxl, registry: undefined };\n const exists = await registry.has(localRxl);\n return new Response(null, { status: exists ? 200 : 404 });\n } catch {\n return new Response(null, { status: 500 });\n }\n}\n\n/**\n * Handle DELETE /resource/:locator\n */\nexport async function handleDeleteResource(locator: string, registry: Registry): Promise<Response> {\n try {\n const rxl = parse(locator);\n const localRxl = { ...rxl, registry: undefined };\n const exists = await registry.has(localRxl);\n\n if (!exists) {\n return errorResponse(\"Resource not found\", ERROR_CODES.RESOURCE_NOT_FOUND, 404);\n }\n\n await registry.remove(localRxl);\n return new Response(null, { status: 204 });\n } catch (error) {\n const message = error instanceof Error ? error.message : \"Unknown error\";\n return errorResponse(message, ERROR_CODES.INTERNAL_ERROR, 500);\n }\n}\n\n/**\n * Handle GET /content/:locator\n */\nexport async function handleGetContent(locator: string, registry: Registry): Promise<Response> {\n try {\n const rxl = parse(locator);\n const localRxl = { ...rxl, registry: undefined };\n const rxr = await registry.get(localRxl);\n const buffer = await rxr.archive.buffer();\n\n return new Response(buffer, {\n status: 200,\n headers: {\n \"Content-Type\": \"application/gzip\",\n \"Content-Disposition\": `attachment; filename=\"archive.tar.gz\"`,\n \"Content-Length\": buffer.byteLength.toString(),\n },\n });\n } catch (error) {\n const message = error instanceof Error ? error.message : \"Unknown error\";\n if (message.includes(\"not found\")) {\n return errorResponse(\"Resource not found\", ERROR_CODES.RESOURCE_NOT_FOUND, 404);\n }\n return errorResponse(message, ERROR_CODES.INTERNAL_ERROR, 500);\n }\n}\n\n/**\n * Handle GET /search\n */\nexport async function handleSearch(\n query: string | undefined,\n limit: number,\n offset: number,\n registry: Registry\n): Promise<Response> {\n try {\n const results = await registry.list({\n query: query || undefined,\n limit,\n offset,\n });\n\n const response: SearchResponse = {\n results: results.map((rxl) => ({\n locator: format(rxl),\n registry: rxl.registry,\n path: rxl.path,\n name: rxl.name,\n type: \"\", // Type not in RXL anymore, would need to read manifest\n tag: rxl.tag ?? \"latest\",\n })),\n total: results.length,\n };\n return jsonResponse(response);\n } catch (error) {\n const message = error instanceof Error ? error.message : \"Unknown error\";\n return errorResponse(message, ERROR_CODES.INTERNAL_ERROR, 500);\n }\n}\n",
|
|
7
|
+
"/**\n * ResourceX Registry Hono Server\n *\n * Ready-to-use Hono app implementing the ResourceX Registry Protocol.\n */\n\nimport { Hono } from \"hono\";\nimport { cors } from \"hono/cors\";\nimport type { RXAStore, RXMStore } from \"@resourcexjs/core\";\nimport { CASRegistry } from \"@resourcexjs/core\";\nimport {\n handlePublish,\n handleGetResource,\n handleHeadResource,\n handleDeleteResource,\n handleGetContent,\n handleSearch,\n} from \"./handlers.js\";\nimport { ENDPOINTS } from \"./protocol.js\";\n\nexport interface RegistryServerConfig {\n /**\n * RXA Store (blob storage).\n */\n rxaStore: RXAStore;\n\n /**\n * RXM Store (manifest storage).\n */\n rxmStore: RXMStore;\n\n /**\n * Base path for API routes.\n * @default \"\"\n */\n basePath?: string;\n\n /**\n * Enable CORS.\n * @default true\n */\n cors?: boolean;\n}\n\n/**\n * Create a registry server Hono app.\n */\nexport function createRegistryServer(config: RegistryServerConfig): Hono {\n const basePath = config.basePath ?? \"\";\n const enableCors = config.cors ?? true;\n\n const registry = new CASRegistry(config.rxaStore, config.rxmStore);\n\n const app = new Hono().basePath(basePath);\n\n if (enableCors) {\n app.use(\"*\", cors());\n }\n\n // Health check\n app.get(ENDPOINTS.health, (c) => c.json({ status: \"ok\" }));\n\n // POST /publish\n app.post(ENDPOINTS.publish, async (c) => {\n return handlePublish(c.req.raw, registry);\n });\n\n // GET /resource/:locator\n app.get(`${ENDPOINTS.resource}/:locator`, async (c) => {\n const locator = decodeURIComponent(c.req.param(\"locator\"));\n return handleGetResource(locator, registry);\n });\n\n // HEAD /resource/:locator\n app.on(\"HEAD\", `${ENDPOINTS.resource}/:locator`, async (c) => {\n const locator = decodeURIComponent(c.req.param(\"locator\"));\n return handleHeadResource(locator, registry);\n });\n\n // DELETE /resource/:locator\n app.delete(`${ENDPOINTS.resource}/:locator`, async (c) => {\n const locator = decodeURIComponent(c.req.param(\"locator\"));\n return handleDeleteResource(locator, registry);\n });\n\n // GET /content/:locator\n app.get(`${ENDPOINTS.content}/:locator`, async (c) => {\n const locator = decodeURIComponent(c.req.param(\"locator\"));\n return handleGetContent(locator, registry);\n });\n\n // GET /search\n app.get(ENDPOINTS.search, async (c) => {\n const query = c.req.query(\"q\");\n const limit = parseInt(c.req.query(\"limit\") ?? \"100\", 10);\n const offset = parseInt(c.req.query(\"offset\") ?? \"0\", 10);\n return handleSearch(query, limit, offset, registry);\n });\n\n return app;\n}\n",
|
|
8
|
+
"/**\n * @resourcexjs/server\n *\n * ResourceX Registry Server - Protocol, Handlers, and Hono Server\n *\n * @example\n * ```typescript\n * import { createRegistryServer } from \"@resourcexjs/server\";\n * import { FileSystemRXAStore, FileSystemRXMStore } from \"@resourcexjs/node-provider\";\n *\n * const server = createRegistryServer({\n * rxaStore: new FileSystemRXAStore(\"./data/blobs\"),\n * rxmStore: new FileSystemRXMStore(\"./data/manifests\"),\n * });\n *\n * Bun.serve({ fetch: server.fetch, port: 3000 });\n * ```\n *\n * @packageDocumentation\n */\n\n// Protocol\nexport {\n API_VERSION,\n API_PREFIX,\n ENDPOINTS,\n CONTENT_TYPES,\n PUBLISH_FIELDS,\n ERROR_CODES,\n ERROR_STATUS,\n buildResourceUrl,\n buildContentUrl,\n buildPublishUrl,\n buildSearchUrl,\n type ManifestData,\n type SearchQuery,\n type PublishResponse,\n type GetResourceResponse,\n type SearchResultItem,\n type SearchResponse,\n type ErrorResponse,\n type ErrorCode,\n} from \"./protocol.js\";\n\n// Handlers\nexport {\n handlePublish,\n handleGetResource,\n handleHeadResource,\n handleDeleteResource,\n handleGetContent,\n handleSearch,\n} from \"./handlers.js\";\n\n// Hono Server\nexport { createRegistryServer, type RegistryServerConfig } from \"./hono.js\";\n\n// Re-export core types for convenience\nexport { CASRegistry } from \"@resourcexjs/core\";\nexport type { RXAStore, RXMStore, Registry } from \"@resourcexjs/core\";\n\n// Re-export node-provider stores for convenience\nexport { FileSystemRXAStore, FileSystemRXMStore } from \"@resourcexjs/node-provider\";\n",
|
|
9
|
+
"// src/NodeProvider.ts\nimport { homedir } from \"node:os\";\nimport { join as join3 } from \"node:path\";\nimport { FolderLoader } from \"@resourcexjs/core\";\n\n// src/FileSystemRXAStore.ts\nimport { mkdir, readFile, writeFile, unlink, readdir, stat } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { computeDigest, RegistryError } from \"@resourcexjs/core\";\n\nclass FileSystemRXAStore {\n basePath;\n constructor(basePath) {\n this.basePath = basePath;\n }\n getPath(digest) {\n const prefix = digest.substring(7, 9);\n return join(this.basePath, prefix, digest);\n }\n async get(digest) {\n const path = this.getPath(digest);\n try {\n return await readFile(path);\n } catch (error) {\n throw new RegistryError(`Blob not found: ${digest}`);\n }\n }\n async put(data) {\n const digest = computeDigest(data);\n const path = this.getPath(digest);\n if (await this.has(digest)) {\n return digest;\n }\n const dir = join(path, \"..\");\n await mkdir(dir, { recursive: true });\n await writeFile(path, data);\n return digest;\n }\n async has(digest) {\n const path = this.getPath(digest);\n try {\n await stat(path);\n return true;\n } catch {\n return false;\n }\n }\n async delete(digest) {\n const path = this.getPath(digest);\n try {\n await unlink(path);\n } catch {}\n }\n async list() {\n const digests = [];\n try {\n const prefixes = await readdir(this.basePath);\n for (const prefix of prefixes) {\n const prefixPath = join(this.basePath, prefix);\n try {\n const files = await readdir(prefixPath);\n for (const file of files) {\n if (file.startsWith(\"sha256:\")) {\n digests.push(file);\n }\n }\n } catch {}\n }\n } catch {}\n return digests;\n }\n}\n\n// src/FileSystemRXMStore.ts\nimport { mkdir as mkdir2, readFile as readFile2, writeFile as writeFile2, unlink as unlink2, readdir as readdir2, stat as stat2, rm } from \"node:fs/promises\";\nimport { join as join2 } from \"node:path\";\nvar LOCAL_DIR = \"_local\";\n\nclass FileSystemRXMStore {\n basePath;\n constructor(basePath) {\n this.basePath = basePath;\n }\n getDir(name, registry) {\n const registryDir = registry ?? LOCAL_DIR;\n return join2(this.basePath, registryDir, name);\n }\n getPath(name, tag, registry) {\n return join2(this.getDir(name, registry), `${tag}.json`);\n }\n async get(name, tag, registry) {\n const path = this.getPath(name, tag, registry);\n try {\n const data = await readFile2(path, \"utf-8\");\n return JSON.parse(data);\n } catch {\n return null;\n }\n }\n async put(manifest) {\n const path = this.getPath(manifest.name, manifest.tag, manifest.registry);\n const dir = join2(path, \"..\");\n await mkdir2(dir, { recursive: true });\n await writeFile2(path, JSON.stringify(manifest, null, 2), \"utf-8\");\n }\n async has(name, tag, registry) {\n const path = this.getPath(name, tag, registry);\n try {\n await stat2(path);\n return true;\n } catch {\n return false;\n }\n }\n async delete(name, tag, registry) {\n const path = this.getPath(name, tag, registry);\n try {\n await unlink2(path);\n } catch {}\n }\n async listTags(name, registry) {\n const dir = this.getDir(name, registry);\n const tags = [];\n try {\n const files = await readdir2(dir);\n for (const file of files) {\n if (file.endsWith(\".json\")) {\n tags.push(file.replace(\".json\", \"\"));\n }\n }\n } catch {}\n return tags;\n }\n async listNames(registry, query) {\n const registryDir = registry ?? LOCAL_DIR;\n const basePath = join2(this.basePath, registryDir);\n const names = [];\n try {\n const entries = await readdir2(basePath);\n for (const entry of entries) {\n const entryPath = join2(basePath, entry);\n try {\n const entryStat = await stat2(entryPath);\n if (entryStat.isDirectory()) {\n if (!query || entry.toLowerCase().includes(query.toLowerCase())) {\n names.push(entry);\n }\n }\n } catch {}\n }\n } catch {}\n return names;\n }\n async search(options) {\n const { registry, query, limit, offset = 0 } = options ?? {};\n const results = [];\n let registryDirs = [];\n if (registry === null) {\n registryDirs = [LOCAL_DIR];\n } else if (registry !== undefined) {\n registryDirs = [registry];\n } else {\n try {\n registryDirs = await readdir2(this.basePath);\n } catch {\n return [];\n }\n }\n for (const regDir of registryDirs) {\n const regPath = join2(this.basePath, regDir);\n try {\n const names = await readdir2(regPath);\n for (const name of names) {\n if (query && !name.toLowerCase().includes(query.toLowerCase())) {\n continue;\n }\n const namePath = join2(regPath, name);\n try {\n const files = await readdir2(namePath);\n for (const file of files) {\n if (file.endsWith(\".json\")) {\n const filePath = join2(namePath, file);\n const data = await readFile2(filePath, \"utf-8\");\n const manifest = JSON.parse(data);\n results.push(manifest);\n }\n }\n } catch {}\n }\n } catch {}\n }\n let paginated = results.slice(offset);\n if (limit !== undefined) {\n paginated = paginated.slice(0, limit);\n }\n return paginated;\n }\n async deleteByRegistry(registry) {\n const regPath = join2(this.basePath, registry);\n try {\n await rm(regPath, { recursive: true });\n } catch {}\n }\n}\n\n// src/NodeProvider.ts\nvar DEFAULT_BASE_PATH = `${homedir()}/.resourcex`;\n\nclass NodeProvider {\n platform = \"node\";\n createStores(config) {\n const basePath = config.path ?? DEFAULT_BASE_PATH;\n return {\n rxaStore: new FileSystemRXAStore(join3(basePath, \"blobs\")),\n rxmStore: new FileSystemRXMStore(join3(basePath, \"manifests\"))\n };\n }\n createLoader(_config) {\n return new FolderLoader;\n }\n}\nexport {\n NodeProvider,\n FileSystemRXMStore,\n FileSystemRXAStore\n};\n\n//# debugId=4D70AA91122D166964756E2164756E21\n"
|
|
9
10
|
],
|
|
10
|
-
"mappings": ";AAUO,IAAM,cAAsB;AAC5B,IAAM,aAAqB,QAAQ;AAEnC,IAAM,YAMT;AAAA,EACF,SAAS,GAAG;AAAA,EACZ,UAAU,GAAG;AAAA,EACb,SAAS,GAAG;AAAA,EACZ,QAAQ,GAAG;AAAA,EACX,QAAQ,GAAG;AACb;AAEO,IAAM,gBAAgB;AAAA,EAC3B,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,UAAU;AACZ;AAcO,IAAM,iBAAiB;AAAA,EAC5B,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS;AACX;AAyCO,IAAM,cAAc;AAAA,EAEzB,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,yBAAyB;AAAA,EAGzB,oBAAoB;AAAA,EAGpB,gBAAgB;AAClB;AAIO,IAAM,eAA0C;AAAA,GACpD,YAAY,mBAAmB;AAAA,GAC/B,YAAY,oBAAoB;AAAA,GAChC,YAAY,mBAAmB;AAAA,GAC/B,YAAY,mBAAmB;AAAA,GAC/B,YAAY,mBAAmB;AAAA,GAC/B,YAAY,kBAAkB;AAAA,GAC9B,YAAY,0BAA0B;AAAA,GACtC,YAAY,qBAAqB;AAAA,GACjC,YAAY,iBAAiB;AAChC;AAMO,SAAS,gBAAgB,CAA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F;AAAA,YACA,MAAM;AAAA,QACV;AAAA,QACA,MAAM;AAAA,IACV;AAAA,IACA,IAAI,YAAY,QAAQ,MAAM,MAAM;AAAA,IACpC,IAAI,UAAU,WAAW;AAAA,MACvB,YAAY,UAAU,MAAM,GAAG,KAAK;AAAA,IACtC;AAAA,IACA,OAAO;AAAA;AAAA,OAEH,iBAAgB,CAAC,UAAU;AAAA,IAC/B,MAAM,UAAU,MAAM,KAAK,UAAU,QAAQ;AAAA,IAC7C,IAAI;AAAA,MACF,MAAM,GAAG,SAAS,EAAE,WAAW,KAAK,CAAC;AAAA,MACrC,MAAM;AAAA;AAEZ;AAGA,IAAI,oBAAoB,GAAG,QAAQ;",
|
|
12
|
+
"debugId": "3D890F83600C8C7E64756E2164756E21",
|
|
12
13
|
"names": []
|
|
13
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@resourcexjs/server",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.7",
|
|
4
4
|
"description": "ResourceX Registry Server - Protocol, Handlers, and Hono Server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -21,9 +21,8 @@
|
|
|
21
21
|
"clean": "rm -rf dist"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@resourcexjs/core": "^2.5.
|
|
25
|
-
"@resourcexjs/
|
|
26
|
-
"@resourcexjs/storage": "^2.5.5",
|
|
24
|
+
"@resourcexjs/core": "^2.5.7",
|
|
25
|
+
"@resourcexjs/node-provider": "^2.5.7",
|
|
27
26
|
"hono": "^4.7.10"
|
|
28
27
|
},
|
|
29
28
|
"devDependencies": {},
|