@towns-protocol/rpc-connector 0.0.244
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/LICENSE.txt +21 -0
- package/README.md +7 -0
- package/dist/chunk-CUT6urMc.cjs +30 -0
- package/dist/common/index.cjs +9 -0
- package/dist/common/index.d.cts +3 -0
- package/dist/common/index.d.ts +3 -0
- package/dist/common/index.js +1 -0
- package/dist/index-Cm1mDfJp.d.ts +10 -0
- package/dist/index-Cm1mDfJp.d.ts.map +1 -0
- package/dist/index-DC9u-Yv3.d.cts +10 -0
- package/dist/index-DC9u-Yv3.d.cts.map +1 -0
- package/dist/node/index.cjs +14 -0
- package/dist/node/index.cjs.map +1 -0
- package/dist/node/index.d.cts +10 -0
- package/dist/node/index.d.cts.map +1 -0
- package/dist/node/index.d.ts +10 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +13 -0
- package/dist/node/index.js.map +1 -0
- package/dist/web/index.cjs +11 -0
- package/dist/web/index.cjs.map +1 -0
- package/dist/web/index.d.cts +10 -0
- package/dist/web/index.d.cts.map +1 -0
- package/dist/web/index.d.ts +10 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +10 -0
- package/dist/web/index.js.map +1 -0
- package/package.json +73 -0
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 River Association
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# @towns-protocol/rpc-connector
|
|
2
|
+
|
|
3
|
+
This package is a wrapper around `@connectrpc/connect-node` and `@connectrpc/connect-web`.
|
|
4
|
+
We need this wrapper so we can properly bundle SDK for the web and node, relying on `package.json` exports to solve the correct import path.
|
|
5
|
+
|
|
6
|
+
> [!IMPORTANT]
|
|
7
|
+
> This package require the caller to have `@connectrpc/connect-node` or `@connectrpc/connect-web` installed, depending on the environment.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
|
|
25
|
+
Object.defineProperty(exports, '__toESM', {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return __toESM;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
var __connectrpc_connect = require("@connectrpc/connect");
|
|
4
|
+
Object.keys(__connectrpc_connect).forEach(function (k) {
|
|
5
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function () { return __connectrpc_connect[k]; }
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@connectrpc/connect"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ConnectTransportOptions } from "@connectrpc/connect-web";
|
|
2
|
+
|
|
3
|
+
//#region src/common/index.d.ts
|
|
4
|
+
/** Using the web version of the transport options as a common type */
|
|
5
|
+
type ConnectTransportOptions$1 = ConnectTransportOptions;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { ConnectTransportOptions$1 as ConnectTransportOptions };
|
|
10
|
+
//# sourceMappingURL=index-Cm1mDfJp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-Cm1mDfJp.d.ts","names":[],"sources":["../src/common/index.ts"],"sourcesContent":[],"mappings":";;;;AAKY,KAAA,yBAAA,GAA0B,uBAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ConnectTransportOptions } from "@connectrpc/connect-web";
|
|
2
|
+
|
|
3
|
+
//#region src/common/index.d.ts
|
|
4
|
+
/** Using the web version of the transport options as a common type */
|
|
5
|
+
type ConnectTransportOptions$1 = ConnectTransportOptions;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { ConnectTransportOptions$1 as ConnectTransportOptions };
|
|
10
|
+
//# sourceMappingURL=index-DC9u-Yv3.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DC9u-Yv3.d.cts","names":[],"sources":["../src/common/index.ts"],"sourcesContent":[],"mappings":";;;;AAKY,KAAA,yBAAA,GAA0B,uBAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const require_chunk = require('../chunk-CUT6urMc.cjs');
|
|
2
|
+
const __connectrpc_connect_node = require_chunk.__toESM(require("@connectrpc/connect-node"));
|
|
3
|
+
|
|
4
|
+
//#region src/node/index.ts
|
|
5
|
+
function createHttp2ConnectTransport(options) {
|
|
6
|
+
return (0, __connectrpc_connect_node.createConnectTransport)({
|
|
7
|
+
...options,
|
|
8
|
+
httpVersion: "2"
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
exports.createHttp2ConnectTransport = createHttp2ConnectTransport;
|
|
14
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["options: ConnectTransportOptions"],"sources":["../../src/node/index.ts"],"sourcesContent":["import type { Transport } from '@connectrpc/connect'\nimport type { ConnectTransportOptions } from '../common'\nimport { createConnectTransport } from '@connectrpc/connect-node'\n\nexport function createHttp2ConnectTransport(options: ConnectTransportOptions): Transport {\n return createConnectTransport({ ...options, httpVersion: '2' })\n}\n"],"mappings":";;;;AAIA,SAAgB,4BAA4BA,SAA6C;AACrF,QAAO,sDAAuB;EAAE,GAAG;EAAS,aAAa;CAAK,EAAC;AAClE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ConnectTransportOptions } from "../index-DC9u-Yv3.cjs";
|
|
2
|
+
import { Transport } from "@connectrpc/connect";
|
|
3
|
+
|
|
4
|
+
//#region src/node/index.d.ts
|
|
5
|
+
declare function createHttp2ConnectTransport(options: ConnectTransportOptions): Transport;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { createHttp2ConnectTransport };
|
|
10
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/node/index.ts"],"sourcesContent":[],"mappings":";;;;iBAIgB,2BAAA,UAAqC,0BAA0B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ConnectTransportOptions } from "../index-Cm1mDfJp.js";
|
|
2
|
+
import { Transport } from "@connectrpc/connect";
|
|
3
|
+
|
|
4
|
+
//#region src/node/index.d.ts
|
|
5
|
+
declare function createHttp2ConnectTransport(options: ConnectTransportOptions): Transport;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { createHttp2ConnectTransport };
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/node/index.ts"],"sourcesContent":[],"mappings":";;;;iBAIgB,2BAAA,UAAqC,0BAA0B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createConnectTransport } from "@connectrpc/connect-node";
|
|
2
|
+
|
|
3
|
+
//#region src/node/index.ts
|
|
4
|
+
function createHttp2ConnectTransport(options) {
|
|
5
|
+
return createConnectTransport({
|
|
6
|
+
...options,
|
|
7
|
+
httpVersion: "2"
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { createHttp2ConnectTransport };
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["options: ConnectTransportOptions"],"sources":["../../src/node/index.ts"],"sourcesContent":["import type { Transport } from '@connectrpc/connect'\nimport type { ConnectTransportOptions } from '../common'\nimport { createConnectTransport } from '@connectrpc/connect-node'\n\nexport function createHttp2ConnectTransport(options: ConnectTransportOptions): Transport {\n return createConnectTransport({ ...options, httpVersion: '2' })\n}\n"],"mappings":";;;AAIA,SAAgB,4BAA4BA,SAA6C;AACrF,QAAO,uBAAuB;EAAE,GAAG;EAAS,aAAa;CAAK,EAAC;AAClE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const require_chunk = require('../chunk-CUT6urMc.cjs');
|
|
2
|
+
const __connectrpc_connect_web = require_chunk.__toESM(require("@connectrpc/connect-web"));
|
|
3
|
+
|
|
4
|
+
//#region src/web/index.ts
|
|
5
|
+
function createHttp2ConnectTransport(options) {
|
|
6
|
+
return (0, __connectrpc_connect_web.createConnectTransport)(options);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
exports.createHttp2ConnectTransport = createHttp2ConnectTransport;
|
|
11
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["options: ConnectTransportOptions"],"sources":["../../src/web/index.ts"],"sourcesContent":["import type { Transport } from '@connectrpc/connect'\nimport type { ConnectTransportOptions } from '../common'\nimport { createConnectTransport } from '@connectrpc/connect-web'\n\nexport function createHttp2ConnectTransport(options: ConnectTransportOptions): Transport {\n return createConnectTransport(options)\n}\n"],"mappings":";;;;AAIA,SAAgB,4BAA4BA,SAA6C;AACrF,QAAO,qDAAuB,QAAQ;AACzC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ConnectTransportOptions } from "../index-DC9u-Yv3.cjs";
|
|
2
|
+
import { Transport } from "@connectrpc/connect";
|
|
3
|
+
|
|
4
|
+
//#region src/web/index.d.ts
|
|
5
|
+
declare function createHttp2ConnectTransport(options: ConnectTransportOptions): Transport;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { createHttp2ConnectTransport };
|
|
10
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/web/index.ts"],"sourcesContent":[],"mappings":";;;;iBAIgB,2BAAA,UAAqC,0BAA0B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ConnectTransportOptions } from "../index-Cm1mDfJp.js";
|
|
2
|
+
import { Transport } from "@connectrpc/connect";
|
|
3
|
+
|
|
4
|
+
//#region src/web/index.d.ts
|
|
5
|
+
declare function createHttp2ConnectTransport(options: ConnectTransportOptions): Transport;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { createHttp2ConnectTransport };
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/web/index.ts"],"sourcesContent":[],"mappings":";;;;iBAIgB,2BAAA,UAAqC,0BAA0B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createConnectTransport } from "@connectrpc/connect-web";
|
|
2
|
+
|
|
3
|
+
//#region src/web/index.ts
|
|
4
|
+
function createHttp2ConnectTransport(options) {
|
|
5
|
+
return createConnectTransport(options);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { createHttp2ConnectTransport };
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["options: ConnectTransportOptions"],"sources":["../../src/web/index.ts"],"sourcesContent":["import type { Transport } from '@connectrpc/connect'\nimport type { ConnectTransportOptions } from '../common'\nimport { createConnectTransport } from '@connectrpc/connect-web'\n\nexport function createHttp2ConnectTransport(options: ConnectTransportOptions): Transport {\n return createConnectTransport(options)\n}\n"],"mappings":";;;AAIA,SAAgB,4BAA4BA,SAA6C;AACrF,QAAO,uBAAuB,QAAQ;AACzC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@towns-protocol/rpc-connector",
|
|
3
|
+
"version": "0.0.244",
|
|
4
|
+
"packageManager": "yarn@3.8.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/node/index.cjs",
|
|
10
|
+
"module": "./dist/node/index.js",
|
|
11
|
+
"types": "./dist/node/index.d.ts",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": {
|
|
16
|
+
"node": "./dist/node/index.js",
|
|
17
|
+
"browser": "./dist/web/index.js",
|
|
18
|
+
"default": "./dist/web/index.js"
|
|
19
|
+
},
|
|
20
|
+
"require": {
|
|
21
|
+
"node": "./dist/node/index.cjs",
|
|
22
|
+
"browser": "./dist/web/index.cjs",
|
|
23
|
+
"default": "./dist/web/index.cjs"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"./common": {
|
|
27
|
+
"import": "./dist/common/index.js",
|
|
28
|
+
"require": "./dist/common/index.cjs"
|
|
29
|
+
},
|
|
30
|
+
"./package.json": "./package.json"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsdown",
|
|
34
|
+
"cb": "yarn clean && yarn build",
|
|
35
|
+
"clean": "rm -rf dist",
|
|
36
|
+
"lint": "eslint --format unix ./src --max-warnings=0",
|
|
37
|
+
"lint:fix": "yarn lint --fix",
|
|
38
|
+
"test": "vitest",
|
|
39
|
+
"test:ci": "echo 'CI test skipped'",
|
|
40
|
+
"watch": "tsdown --watch"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@connectrpc/connect": "^2.0.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/node": "^20.14.8",
|
|
47
|
+
"@typescript-eslint/eslint-plugin": "^8.29.0",
|
|
48
|
+
"@typescript-eslint/parser": "^8.29.0",
|
|
49
|
+
"eslint": "^8.57.1",
|
|
50
|
+
"eslint-import-resolver-typescript": "^4.3.2",
|
|
51
|
+
"eslint-plugin-import-x": "^4.10.2",
|
|
52
|
+
"eslint-plugin-tsdoc": "^0.3.0",
|
|
53
|
+
"tsdown": "^0.12.3",
|
|
54
|
+
"typescript": "^5.8.2",
|
|
55
|
+
"vitest": "^3.2.3"
|
|
56
|
+
},
|
|
57
|
+
"peerDependencies": {
|
|
58
|
+
"@connectrpc/connect-node": ">=2.0.0",
|
|
59
|
+
"@connectrpc/connect-web": ">=2.0.0"
|
|
60
|
+
},
|
|
61
|
+
"peerDependenciesMeta": {
|
|
62
|
+
"@connectrpc/connect-node": {
|
|
63
|
+
"optional": true
|
|
64
|
+
},
|
|
65
|
+
"@connectrpc/connect-web": {
|
|
66
|
+
"optional": true
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"files": [
|
|
70
|
+
"/dist"
|
|
71
|
+
],
|
|
72
|
+
"gitHead": "8f17f6f7a619532ed6e0e50687b9073d49cc8eb5"
|
|
73
|
+
}
|