@rljson/bs 0.0.20 → 0.0.22
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/dist/bs-server.d.ts +6 -5
- package/dist/bs.js +15 -14
- package/package.json +15 -15
package/dist/bs-server.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Socket } from './socket.ts';
|
|
|
5
5
|
* Allows multiple clients to access the same blob storage instance remotely.
|
|
6
6
|
*/
|
|
7
7
|
export declare class BsServer {
|
|
8
|
-
private
|
|
8
|
+
private _bs;
|
|
9
9
|
private _sockets;
|
|
10
10
|
constructor(_bs: Bs);
|
|
11
11
|
/**
|
|
@@ -24,9 +24,10 @@ export declare class BsServer {
|
|
|
24
24
|
*/
|
|
25
25
|
private _addTransportLayer;
|
|
26
26
|
/**
|
|
27
|
-
* Generates a transport layer object
|
|
28
|
-
*
|
|
29
|
-
*
|
|
27
|
+
* Generates a transport layer object that always delegates to the current
|
|
28
|
+
* this._bs. Each method is an arrow function reading this._bs at call
|
|
29
|
+
* time so that external code can replace _bs after construction and all
|
|
30
|
+
* existing socket handlers pick up the new instance.
|
|
30
31
|
*/
|
|
31
|
-
private
|
|
32
|
+
private _generateTransportLayerCRUD;
|
|
32
33
|
}
|
package/dist/bs.js
CHANGED
|
@@ -909,8 +909,8 @@ class BsServer {
|
|
|
909
909
|
* @param socket - The socket to add the transport layer to.
|
|
910
910
|
*/
|
|
911
911
|
async _addTransportLayer(socket) {
|
|
912
|
-
const
|
|
913
|
-
for (const [key, fn] of Object.entries(
|
|
912
|
+
const crud = this._generateTransportLayerCRUD();
|
|
913
|
+
for (const [key, fn] of Object.entries(crud)) {
|
|
914
914
|
socket.on(key, (...args) => {
|
|
915
915
|
const cb = args[args.length - 1];
|
|
916
916
|
fn.apply(this, args.slice(0, -1)).then((result) => {
|
|
@@ -923,19 +923,20 @@ class BsServer {
|
|
|
923
923
|
}
|
|
924
924
|
// ...........................................................................
|
|
925
925
|
/**
|
|
926
|
-
* Generates a transport layer object
|
|
927
|
-
*
|
|
928
|
-
*
|
|
926
|
+
* Generates a transport layer object that always delegates to the current
|
|
927
|
+
* this._bs. Each method is an arrow function reading this._bs at call
|
|
928
|
+
* time so that external code can replace _bs after construction and all
|
|
929
|
+
* existing socket handlers pick up the new instance.
|
|
929
930
|
*/
|
|
930
|
-
|
|
931
|
-
setBlob: (content) =>
|
|
932
|
-
getBlob: (blobId, options) =>
|
|
933
|
-
getBlobStream: (blobId) =>
|
|
934
|
-
deleteBlob: (blobId) =>
|
|
935
|
-
blobExists: (blobId) =>
|
|
936
|
-
getBlobProperties: (blobId) =>
|
|
937
|
-
listBlobs: (options) =>
|
|
938
|
-
generateSignedUrl: (blobId, expiresIn, permissions) =>
|
|
931
|
+
_generateTransportLayerCRUD = () => ({
|
|
932
|
+
setBlob: (content) => this._bs.setBlob(content),
|
|
933
|
+
getBlob: (blobId, options) => this._bs.getBlob(blobId, options),
|
|
934
|
+
getBlobStream: (blobId) => this._bs.getBlobStream(blobId),
|
|
935
|
+
deleteBlob: (blobId) => this._bs.deleteBlob(blobId),
|
|
936
|
+
blobExists: (blobId) => this._bs.blobExists(blobId),
|
|
937
|
+
getBlobProperties: (blobId) => this._bs.getBlobProperties(blobId),
|
|
938
|
+
listBlobs: (options) => this._bs.listBlobs(options),
|
|
939
|
+
generateSignedUrl: (blobId, expiresIn, permissions) => this._bs.generateSignedUrl(blobId, expiresIn, permissions)
|
|
939
940
|
});
|
|
940
941
|
}
|
|
941
942
|
class SocketMock {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rljson/bs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"description": "Blob storage interface and implementations for rljson",
|
|
5
5
|
"homepage": "https://github.com/rljson/bs",
|
|
6
6
|
"bugs": "https://github.com/rljson/bs/issues",
|
|
@@ -20,36 +20,36 @@
|
|
|
20
20
|
],
|
|
21
21
|
"type": "module",
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@types/node": "^25.
|
|
24
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
25
|
-
"@typescript-eslint/parser": "^8.
|
|
23
|
+
"@types/node": "^25.2.3",
|
|
24
|
+
"@typescript-eslint/eslint-plugin": "^8.56.0",
|
|
25
|
+
"@typescript-eslint/parser": "^8.56.0",
|
|
26
26
|
"@vitest/coverage-v8": "^4.0.18",
|
|
27
27
|
"cross-env": "^10.1.0",
|
|
28
|
-
"eslint": "
|
|
29
|
-
"eslint-plugin-jsdoc": "^62.5.
|
|
28
|
+
"eslint": "~9.39.2",
|
|
29
|
+
"eslint-plugin-jsdoc": "^62.5.5",
|
|
30
30
|
"eslint-plugin-tsdoc": "^0.5.0",
|
|
31
|
-
"globals": "^17.
|
|
31
|
+
"globals": "^17.3.0",
|
|
32
32
|
"jsdoc": "^4.0.5",
|
|
33
|
-
"read-pkg": "^10.
|
|
33
|
+
"read-pkg": "^10.1.0",
|
|
34
34
|
"typescript": "~5.9.3",
|
|
35
|
-
"typescript-eslint": "^8.
|
|
35
|
+
"typescript-eslint": "^8.56.0",
|
|
36
36
|
"vite": "^7.3.1",
|
|
37
37
|
"vite-node": "^5.3.0",
|
|
38
38
|
"vite-plugin-dts": "^4.5.4",
|
|
39
|
-
"vite-tsconfig-paths": "^6.
|
|
39
|
+
"vite-tsconfig-paths": "^6.1.1",
|
|
40
40
|
"vitest": "^4.0.18",
|
|
41
41
|
"vitest-dom": "^0.1.1"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@rljson/hash": "^0.0.18",
|
|
45
45
|
"@rljson/json": "^0.0.23",
|
|
46
|
-
"@rljson/rljson": "^0.0.
|
|
46
|
+
"@rljson/rljson": "^0.0.76"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
|
-
"build": "
|
|
50
|
-
"test": "
|
|
51
|
-
"prebuild": "
|
|
52
|
-
"lint": "
|
|
49
|
+
"build": "pnpm exec vite build && tsc && node scripts/copy-readme-to-dist.js && node scripts/deploy-conformance-tests.js",
|
|
50
|
+
"test": "pnpm exec vitest run --coverage && pnpm run lint",
|
|
51
|
+
"prebuild": "pnpm run test",
|
|
52
|
+
"lint": "pnpm exec eslint",
|
|
53
53
|
"updateGoldens": "cross-env UPDATE_GOLDENS=true pnpm test"
|
|
54
54
|
}
|
|
55
55
|
}
|