@synnaxlabs/freighter 0.37.0 → 0.38.1

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/index.d.ts CHANGED
@@ -1,9 +1,7 @@
1
- export type { ErrorPayload, MatchableErrorType, TypedError } from './errors';
2
- export { BaseTypedError, decodeError, encodeError, EOF, errorMatcher, errorZ, registerError, StreamClosed, Unreachable, } from './errors';
1
+ export { BaseTypedError, decodeError, encodeError, EOF, errorMatcher, type ErrorPayload, errorZ, type MatchableErrorType, registerError, StreamClosed, type TypedError, Unreachable, } from './errors';
3
2
  export { HTTPClient } from './http';
4
- export type { Context, Middleware, Next } from './middleware';
5
- export type { Stream, StreamClient } from './stream';
6
- export type { UnaryClient } from './unary';
7
- export { sendRequired, unaryWithBreaker } from './unary';
3
+ export { type Context, type Middleware, type Next } from './middleware';
4
+ export { type Stream, type StreamClient } from './stream';
5
+ export { sendRequired, type UnaryClient, unaryWithBreaker } from './unary';
8
6
  export { WebSocketClient } from './websocket';
9
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,EACL,cAAc,EACd,WAAW,EACX,WAAW,EACX,GAAG,EACH,YAAY,EACZ,MAAM,EACN,aAAa,EACb,YAAY,EACZ,WAAW,GACZ,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC9D,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACrD,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EACL,cAAc,EACd,WAAW,EACX,WAAW,EACX,GAAG,EACH,YAAY,EACZ,KAAK,YAAY,EACjB,MAAM,EACN,KAAK,kBAAkB,EACvB,aAAa,EACb,YAAY,EACZ,KAAK,UAAU,EACf,WAAW,GACZ,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,IAAI,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
package/eslint.config.js CHANGED
@@ -1,13 +1,11 @@
1
- /*
2
- * Copyright 2023 Synnax Labs, Inc.
3
- *
4
- * Use of this software is governed by the Business Source License included in the file
5
- * licenses/BSL.txt.
6
- *
7
- * As of the Change Date specified in that file, in accordance with the Business Source
8
- * License, use of this software will be governed by the Apache License, Version 2.0,
9
- * included in the file licenses/APL.txt.
10
- */
1
+ // Copyright 2025 Synnax Labs, Inc.
2
+ //
3
+ // Use of this software is governed by the Business Source License included in the file
4
+ // licenses/BSL.txt.
5
+ //
6
+ // As of the Change Date specified in that file, in accordance with the Business Source
7
+ // License, use of this software will be governed by the Apache License, Version 2.0,
8
+ // included in the file licenses/APL.txt.
11
9
 
12
10
  import synnaxConfig from "eslint-config-synnaxlabs";
13
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synnaxlabs/freighter",
3
- "version": "0.37.0",
3
+ "version": "0.38.1",
4
4
  "type": "module",
5
5
  "description": "a modular transport abstraction",
6
6
  "repository": "https://github.com/synnaxlabs/synnax/tree/main/freighter/ts",
@@ -17,19 +17,18 @@
17
17
  "node-fetch": "^2.7.0",
18
18
  "ws": "^8.18.0",
19
19
  "zod": "^3.24.1",
20
- "@synnaxlabs/alamos": "0.37.0",
21
- "@synnaxlabs/x": "0.37.0"
20
+ "@synnaxlabs/alamos": "0.38.1",
21
+ "@synnaxlabs/x": "0.38.1"
22
22
  },
23
23
  "devDependencies": {
24
- "@types/node": "^22.10.2",
25
- "@vitest/coverage-v8": "^2.1.8",
26
- "eslint": "^9.17.0",
27
- "typescript": "^5.7.2",
28
- "vite": "^6.0.3",
24
+ "@types/node": "^22.10.6",
25
+ "eslint": "^9.18.0",
26
+ "typescript": "^5.7.3",
27
+ "vite": "^6.0.7",
29
28
  "vitest": "^2.1.8",
30
- "@synnaxlabs/tsconfig": "0.0.2",
29
+ "eslint-config-synnaxlabs": "0.0.1",
31
30
  "@synnaxlabs/vite-plugin": "0.0.1",
32
- "eslint-config-synnaxlabs": "0.0.1"
31
+ "@synnaxlabs/tsconfig": "0.0.2"
33
32
  },
34
33
  "main": "dist/freighter.cjs",
35
34
  "module": "dist/freighter.js",
@@ -38,7 +37,6 @@
38
37
  "build": "tsc --noEmit && vite build",
39
38
  "watch": "tsc --noEmit && vite build --watch",
40
39
  "test": "vitest",
41
- "cov": "vitest --coverage",
42
40
  "lint": "eslint --cache",
43
41
  "fix": "eslint --cache --fix"
44
42
  }
package/src/alamos.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2025 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2025 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
package/src/errors.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2025 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -71,7 +71,7 @@ export const assertErrorType = <T>(type: string, error?: Error | null): T => {
71
71
  throw new Error(
72
72
  `Expected error of type ${type}, got ${error.type}: ${error.message}`,
73
73
  );
74
- return error as unknown as T;
74
+ return error as T;
75
75
  };
76
76
 
77
77
  export const UNKNOWN = "unknown";
package/src/http.spec.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2025 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
package/src/http.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2025 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -7,21 +7,22 @@
7
7
  // License, use of this software will be governed by the Apache License, Version 2.0,
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
- export type { ErrorPayload, MatchableErrorType, TypedError } from "@/errors";
11
10
  export {
12
11
  BaseTypedError,
13
12
  decodeError,
14
13
  encodeError,
15
14
  EOF,
16
15
  errorMatcher,
16
+ type ErrorPayload,
17
17
  errorZ,
18
+ type MatchableErrorType,
18
19
  registerError,
19
20
  StreamClosed,
21
+ type TypedError,
20
22
  Unreachable,
21
23
  } from "@/errors";
22
24
  export { HTTPClient } from "@/http";
23
- export type { Context, Middleware, Next } from "@/middleware";
24
- export type { Stream, StreamClient } from "@/stream";
25
- export type { UnaryClient } from "@/unary";
26
- export { sendRequired, unaryWithBreaker } from "@/unary";
25
+ export { type Context, type Middleware, type Next } from "@/middleware";
26
+ export { type Stream, type StreamClient } from "@/stream";
27
+ export { sendRequired, type UnaryClient, unaryWithBreaker } from "@/unary";
27
28
  export { WebSocketClient } from "@/websocket";
package/src/middleware.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2025 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
package/src/stream.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2025 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
package/src/transport.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2025 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
package/src/unary.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2025 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2025 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
package/src/websocket.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2025 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -207,7 +207,7 @@ export class WebSocketClient extends MiddlewareCollector implements StreamClient
207
207
  if (err != null) resolve(err);
208
208
  else resolve(oWs);
209
209
  })
210
- .catch((err) => resolve(err));
210
+ .catch((err: Error) => resolve(err));
211
211
  };
212
212
  ws.onerror = (ev: Event) => {
213
213
  const ev_ = ev as ErrorEvent;
package/vite.config.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2025 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -12,9 +12,5 @@ import { defineConfig } from "vite";
12
12
 
13
13
  export default defineConfig({
14
14
  plugins: [lib({ name: "freighter" })],
15
- build: {
16
- rollupOptions: {
17
- external: ["zod"],
18
- },
19
- },
15
+ build: { rollupOptions: { external: ["zod"] } },
20
16
  });