@http-forge/core 1.0.4 → 1.0.6
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.
|
@@ -36,6 +36,18 @@ export declare class FolderCollectionStore implements ICollectionStore {
|
|
|
36
36
|
private cache;
|
|
37
37
|
private slugToIdMap;
|
|
38
38
|
private idToSlugMap;
|
|
39
|
+
/**
|
|
40
|
+
* Lazily-derived item id → on-disk directory path index, per collection.
|
|
41
|
+
* Built from the in-memory tree (no extra disk I/O) so resolving a path for
|
|
42
|
+
* one item does not re-scan the whole collection folder for every lookup.
|
|
43
|
+
*/
|
|
44
|
+
private itemPathIndex;
|
|
45
|
+
/**
|
|
46
|
+
* Directory for serialized collection metadata caches. Lives inside the
|
|
47
|
+
* collections directory as `.cache/` so it is self-contained and already
|
|
48
|
+
* covered by the existing `.gitignore` (`.cache/`).
|
|
49
|
+
*/
|
|
50
|
+
private cacheDir;
|
|
39
51
|
/**
|
|
40
52
|
* When true, `loadRequestFromDir` delegates to the light loader
|
|
41
53
|
* (metadata only). Set only inside `loadAllLight()`; never left on.
|
|
@@ -87,6 +99,32 @@ export declare class FolderCollectionStore implements ICollectionStore {
|
|
|
87
99
|
* Load a collection from a folder
|
|
88
100
|
*/
|
|
89
101
|
private loadCollectionFromFolder;
|
|
102
|
+
/**
|
|
103
|
+
* Get the cache directory, creating it if needed.
|
|
104
|
+
*/
|
|
105
|
+
private getCacheDir;
|
|
106
|
+
/**
|
|
107
|
+
* Get the cache file path for a collection.
|
|
108
|
+
*/
|
|
109
|
+
private getCachePath;
|
|
110
|
+
/**
|
|
111
|
+
* Try to load a collection from cache. Returns undefined on miss/stale/corrupt.
|
|
112
|
+
* Uses collection.json's mtime as the freshness key.
|
|
113
|
+
*/
|
|
114
|
+
private loadCollectionFromCache;
|
|
115
|
+
/**
|
|
116
|
+
* Collect item id → slug mappings from the in-memory tree.
|
|
117
|
+
*/
|
|
118
|
+
private collectItemSlugs;
|
|
119
|
+
/**
|
|
120
|
+
* Write the collection cache asynchronously (fire-and-forget).
|
|
121
|
+
* Uses collection.json's mtime as the freshness key.
|
|
122
|
+
*/
|
|
123
|
+
private saveCollectionToCacheAsync;
|
|
124
|
+
/**
|
|
125
|
+
* Invalidate (delete) the cache for a collection.
|
|
126
|
+
*/
|
|
127
|
+
private invalidateCollectionCache;
|
|
90
128
|
/**
|
|
91
129
|
* Load items from a directory
|
|
92
130
|
*/
|
|
@@ -235,6 +273,17 @@ export declare class FolderCollectionStore implements ICollectionStore {
|
|
|
235
273
|
*/
|
|
236
274
|
private sortItemsByOrder;
|
|
237
275
|
private findItemPath;
|
|
276
|
+
/**
|
|
277
|
+
* Resolve an item directory from the in-memory tree using a per-collection
|
|
278
|
+
* id→path index. The index is derived (no disk I/O) and rebuilt when a
|
|
279
|
+
* cached path disappears after a move/rename.
|
|
280
|
+
*/
|
|
281
|
+
private findIndexedItemPath;
|
|
282
|
+
/**
|
|
283
|
+
* Build the id→directory index for one collection from its in-memory tree.
|
|
284
|
+
* Uses `idToSlugMap` for each segment, matching the names written on disk.
|
|
285
|
+
*/
|
|
286
|
+
private buildItemPathIndex;
|
|
238
287
|
/**
|
|
239
288
|
* Build the on-disk slug path (root → item) for the given item id by walking the
|
|
240
289
|
* in-memory collection tree. Each segment is resolved via idToSlugMap so it matches
|
|
@@ -193,6 +193,11 @@ export declare class TestSuiteStore implements ITestSuiteStore {
|
|
|
193
193
|
slug?: string;
|
|
194
194
|
description?: string;
|
|
195
195
|
}>;
|
|
196
|
+
/**
|
|
197
|
+
* Index a collection's request items by id from the in-memory tree only.
|
|
198
|
+
* Never triggers heavy-field hydration — used for display resolution.
|
|
199
|
+
*/
|
|
200
|
+
private indexRequestsById;
|
|
196
201
|
/**
|
|
197
202
|
* Get selected requests in order
|
|
198
203
|
* Always resolves fresh from collection service to ensure latest data
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@http-forge/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Headless Postman-compatible API testing engine for Node.js, CI/CD, OpenAPI workflows, and HTTP Forge automation",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"@types/uuid": "^9.0.7",
|
|
108
108
|
"@types/ws": "^8.18.2",
|
|
109
109
|
"esbuild": "0.28.2",
|
|
110
|
-
"rimraf": "^
|
|
110
|
+
"rimraf": "^6.1.4",
|
|
111
111
|
"tsup": "^8.0.1",
|
|
112
112
|
"typescript": "^5.3.0",
|
|
113
113
|
"vitest": "^4.1.9"
|
|
@@ -120,5 +120,8 @@
|
|
|
120
120
|
"homepage": "https://github.com/hsl1230/http-forge.core",
|
|
121
121
|
"bugs": {
|
|
122
122
|
"url": "https://github.com/hsl1230/http-forge.core/issues"
|
|
123
|
+
},
|
|
124
|
+
"allowScripts": {
|
|
125
|
+
"esbuild@0.28.2": true
|
|
123
126
|
}
|
|
124
127
|
}
|