Skip to content

Commit a64f9d9

Browse files
authored
Merge pull request #31 from betwixt-labs/to-JSON
fix!: typedefs for methods
2 parents 84769cb + ad0421f commit a64f9d9

File tree

15 files changed

+32
-944
lines changed

15 files changed

+32
-944
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION=0.0.9
1+
VERSION=0.0.10

examples/typescript/minimal/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
],
2020
"devDependencies": {
2121
"@types/node": "^18.7.20",
22-
"bebop-tools": "^2.8.3",
22+
"bebop-tools": "^2.8.5",
2323
"tsup": "^6.7.0",
2424
"tsx": "^3.12.7",
2525
"typescript": "^4.8.3",
2626
"wait-port": "^1.0.4"
2727
},
2828
"dependencies": {
29-
"@tempojs/client": "^0.0.6",
30-
"@tempojs/node-http-router": "^0.0.6",
31-
"bebop": "^2.8.3"
29+
"@tempojs/client": "^0.0.10",
30+
"@tempojs/node-http-router": "^0.0.10",
31+
"bebop": "^2.8.5"
3232
}
3333
}

examples/typescript/minimal/yarn.lock

Lines changed: 0 additions & 912 deletions
This file was deleted.

typescript/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tempojs",
3-
"version": "0.0.9",
3+
"version": "0.0.10",
44
"description": "something",
55
"private": true,
66
"workspaces": [
@@ -26,8 +26,8 @@
2626
"vitest": "^0.30.1"
2727
},
2828
"dependencies": {
29-
"@tempojs/client": "^0.0.9",
30-
"@tempojs/common": "^0.0.9",
31-
"@tempojs/server": "^0.0.9"
29+
"@tempojs/client": "^0.0.10",
30+
"@tempojs/common": "^0.0.10",
31+
"@tempojs/server": "^0.0.10"
3232
}
3333
}

typescript/packages/cf-router/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tempojs/cloudflare-worker-router",
3-
"version": "0.0.9",
3+
"version": "0.0.10",
44
"description": "",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",
@@ -19,7 +19,7 @@
1919
"author": "andrew",
2020
"license": "",
2121
"dependencies": {
22-
"@tempojs/server": "^0.0.9"
22+
"@tempojs/server": "^0.0.10"
2323
},
2424
"devDependencies": {
2525
"@cloudflare/workers-types": "^4.20221111.1"

typescript/packages/client/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tempojs/client",
3-
"version": "0.0.9",
3+
"version": "0.0.10",
44
"description": "xrpc client",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",
@@ -16,6 +16,6 @@
1616
"test": "vitest"
1717
},
1818
"dependencies": {
19-
"@tempojs/common": "^0.0.9"
19+
"@tempojs/common": "^0.0.10"
2020
}
2121
}

typescript/packages/client/src/channel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export abstract class BaseChannel {
159159
case 'bebop':
160160
return method.serialize(request);
161161
case 'json':
162-
return TempoUtil.utf8GetBytes(method.toJson(request));
162+
return TempoUtil.utf8GetBytes(method.toJSON(request));
163163
default:
164164
throw new TempoError(TempoStatusCode.UNKNOWN_CONTENT_TYPE, `invalid request content type: ${this.contentType}`);
165165
}
@@ -182,7 +182,7 @@ export abstract class BaseChannel {
182182
case 'bebop':
183183
return method.deserialize(response);
184184
case 'json':
185-
return method.fromJson(TempoUtil.utf8GetString(response));
185+
return method.fromJSON(TempoUtil.utf8GetString(response));
186186
default:
187187
throw new TempoError(
188188
TempoStatusCode.UNKNOWN_CONTENT_TYPE,

typescript/packages/client/src/method.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ export interface MethodInfo<TRequest extends BebopRecord, TResponse extends Bebo
4141
* @param value - The request object to convert.
4242
* @returns A JSON string representation of the request object.
4343
*/
44-
toJson(value: TRequest): string;
44+
toJSON(value: TRequest): string;
4545

4646
/**
4747
* Converts the given JSON string to a response object.
4848
* @param data - The JSON string to convert.
4949
* @returns The response object.
5050
*/
51-
fromJson(data: string): TResponse;
51+
fromJSON(data: string): TResponse;
5252

5353
/**
5454
* The type of the method.

typescript/packages/common/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tempojs/common",
3-
"version": "0.0.9",
3+
"version": "0.0.10",
44
"description": "tempo common",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",
@@ -13,7 +13,7 @@
1313
}
1414
},
1515
"dependencies": {
16-
"bebop": "^2.8.4"
16+
"bebop": "^2.8.5"
1717
},
1818
"scripts": {
1919
"test": "vitest"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const TempoVersion = '0.0.9';
1+
export const TempoVersion = '0.0.10';

0 commit comments

Comments
 (0)