@archildata/client 0.1.6 → 0.1.8
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
CHANGED
|
@@ -82,7 +82,7 @@ The main client class for interacting with Archil filesystems.
|
|
|
82
82
|
|
|
83
83
|
#### Delegation Operations
|
|
84
84
|
|
|
85
|
-
- `checkout(inodeId,
|
|
85
|
+
- `checkout(inodeId, options?, user?)` - Acquire write delegation
|
|
86
86
|
- `checkin(inodeId, user?)` - Release delegation
|
|
87
87
|
- `checkinAll()` - Release all delegations
|
|
88
88
|
- `listDelegations()` - List currently held delegations
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/index.d.ts
CHANGED
|
@@ -148,6 +148,11 @@ export interface DelegationInfo {
|
|
|
148
148
|
/** State of the delegation: "Active", "Pending", or "Removing" */
|
|
149
149
|
state: string
|
|
150
150
|
}
|
|
151
|
+
/** Options for checkout operation */
|
|
152
|
+
export interface CheckoutOptions {
|
|
153
|
+
/** Force revoke existing delegations held by other clients (default: false) */
|
|
154
|
+
force?: boolean
|
|
155
|
+
}
|
|
151
156
|
/**
|
|
152
157
|
* Options for setattr operation
|
|
153
158
|
*
|
|
@@ -231,8 +236,20 @@ export declare class ArchilClient {
|
|
|
231
236
|
*
|
|
232
237
|
* This tracks the delegation locally so that subsequent write operations
|
|
233
238
|
* can proceed without additional server round-trips for permission checks.
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* ```typescript
|
|
242
|
+
* // Basic checkout
|
|
243
|
+
* await client.checkout(inodeId);
|
|
244
|
+
*
|
|
245
|
+
* // Force revoke existing delegations from other clients
|
|
246
|
+
* await client.checkout(inodeId, { force: true });
|
|
247
|
+
*
|
|
248
|
+
* // With user context
|
|
249
|
+
* await client.checkout(inodeId, { force: false }, { uid: 1000, gid: 1000 });
|
|
250
|
+
* ```
|
|
234
251
|
*/
|
|
235
|
-
checkout(inodeId: number,
|
|
252
|
+
checkout(inodeId: number, options?: CheckoutOptions | undefined | null, user?: UnixUser | undefined | null): Promise<void>
|
|
236
253
|
/**
|
|
237
254
|
* Checkin (release delegation for) an inode.
|
|
238
255
|
*
|
|
@@ -258,11 +275,11 @@ export declare class ArchilClient {
|
|
|
258
275
|
* @example
|
|
259
276
|
* ```typescript
|
|
260
277
|
* // First checkout to get write delegation
|
|
261
|
-
* await client.checkout(inodeId
|
|
278
|
+
* await client.checkout(inodeId);
|
|
262
279
|
* // Then write data
|
|
263
|
-
* await client.writeData(inodeId,
|
|
280
|
+
* await client.writeData(inodeId, 0, Buffer.from('Hello World'), user);
|
|
264
281
|
* // Optionally checkin when done
|
|
265
|
-
* await client.checkin(inodeId
|
|
282
|
+
* await client.checkin(inodeId);
|
|
266
283
|
* ```
|
|
267
284
|
*/
|
|
268
285
|
writeData(inodeId: number, offset: number, data: Buffer, user?: UnixUser | undefined | null): Promise<void>
|
|
@@ -277,13 +294,13 @@ export declare class ArchilClient {
|
|
|
277
294
|
* @example
|
|
278
295
|
* ```typescript
|
|
279
296
|
* // First checkout to get write delegation
|
|
280
|
-
* await client.checkout(inodeId
|
|
297
|
+
* await client.checkout(inodeId);
|
|
281
298
|
* // Update timestamps (touch)
|
|
282
299
|
* await client.setattr(inodeId, { atimeMs: -1, mtimeMs: -1 }, user);
|
|
283
300
|
* // Or change mode
|
|
284
301
|
* await client.setattr(inodeId, { mode: 0o755 }, user);
|
|
285
302
|
* // Checkin when done
|
|
286
|
-
* await client.checkin(inodeId
|
|
303
|
+
* await client.checkin(inodeId);
|
|
287
304
|
* ```
|
|
288
305
|
*/
|
|
289
306
|
setattr(inodeId: number, options: SetAttrOptions, user: UnixUser): Promise<InodeAttributes>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@archildata/client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "High-performance Node.js client for Archil distributed filesystem",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"native"
|
|
51
51
|
],
|
|
52
52
|
"optionalDependencies": {
|
|
53
|
-
"@archildata/client-win32-x64-msvc": "0.1.
|
|
54
|
-
"@archildata/client-darwin-x64": "0.1.
|
|
55
|
-
"@archildata/client-linux-x64-gnu": "0.1.
|
|
56
|
-
"@archildata/client-darwin-arm64": "0.1.
|
|
57
|
-
"@archildata/client-linux-arm64-gnu": "0.1.
|
|
53
|
+
"@archildata/client-win32-x64-msvc": "0.1.8",
|
|
54
|
+
"@archildata/client-darwin-x64": "0.1.8",
|
|
55
|
+
"@archildata/client-linux-x64-gnu": "0.1.8",
|
|
56
|
+
"@archildata/client-darwin-arm64": "0.1.8",
|
|
57
|
+
"@archildata/client-linux-arm64-gnu": "0.1.8"
|
|
58
58
|
}
|
|
59
59
|
}
|