@arrirpc/server 0.49.1 → 0.51.0

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
@@ -81,21 +81,17 @@ Create an `arri.config.ts` in the project directory
81
81
 
82
82
  ```ts
83
83
  // arri.config.ts
84
- import {
85
- defineConfig,
86
- typescriptClientGenerator,
87
- dartClientGenerator,
88
- } from "arri";
84
+ import { defineConfig, generators } from "arri";
89
85
 
90
86
  export default defineConfig({
91
87
  entry: "app.ts",
92
88
  port: 3000,
93
89
  srcDir: "src",
94
90
  generators: [
95
- typescriptClientGenerator({
91
+ generators.typescriptClient({
96
92
  // options
97
93
  }),
98
- dartClientGenerator({
94
+ generators.dartClient({
99
95
  // options
100
96
  }),
101
97
  ],
@@ -434,14 +430,14 @@ Right now Arri RPC has client generators for the following languages:
434
430
 
435
431
  ```ts
436
432
  // arri.config.ts
437
- import { defineConfig, typescriptClientGenerator, dartClientGenerator, kotlinClientGenerator } from "arri";
433
+ import { defineConfig, generators } from "arri";
438
434
 
439
435
  export default defineConfig({
440
436
  // rest of config
441
437
  clientGenerators: [
442
- typescriptClientGenerator({...}),
443
- dartClientGenerator({...}),
444
- kotlinClientGenerator({...})
438
+ generators.typescriptClient({...}),
439
+ generators.dartClient({...}),
440
+ generators.kotlinClient({...})
445
441
  ]
446
442
  });
447
443
  ```
package/dist/index.cjs CHANGED
@@ -569,32 +569,6 @@ class EventStreamConnection {
569
569
  data: JSON.stringify(errorResponse)
570
570
  });
571
571
  }
572
- // /**
573
- // * Push a custom event. These events will need to be parsed manually using the `onEvent` hooks of any generated clients.
574
- // * Note events with the name "error" or "message" cannot be used for custom events.
575
- // */
576
- // async pushCustomEvent(event: SseEvent): Promise<void> {
577
- // if (event.event === "message") {
578
- // throw new Error(
579
- // `Event type "message" is the default event type. Therefore it cannot be used when pushing custom events.`,
580
- // );
581
- // }
582
- // if (event.event === "error") {
583
- // throw new Error(
584
- // `Event type "error" is reserved for the pushError() method. Therefore it cannot be used when pushing custom events.`,
585
- // );
586
- // }
587
- // }
588
- /**
589
- * Publish an error event. This will trigger the `onError` hooks of any connected clients.
590
- */
591
- async pushError(error, eventId) {
592
- await this.eventStream.push({
593
- id: eventId,
594
- event: "error",
595
- data: JSON.stringify(error)
596
- });
597
- }
598
572
  cleanup() {
599
573
  if (this.pingInterval) {
600
574
  clearInterval(this.pingInterval);
@@ -1174,7 +1148,7 @@ class ArriApp {
1174
1148
  }
1175
1149
  getAppDefinition() {
1176
1150
  const appDef = {
1177
- arriSchemaVersion: codegenUtils.SCHEMA_VERSION,
1151
+ schemaVersion: codegenUtils.SCHEMA_VERSION,
1178
1152
  info: this.appInfo,
1179
1153
  procedures: {},
1180
1154
  definitions: this._definitions
package/dist/index.d.cts CHANGED
@@ -110,10 +110,6 @@ declare class EventStreamConnection<TData> {
110
110
  */
111
111
  push(data: TData[], eventId?: string): Promise<void>;
112
112
  push(data: TData, eventId?: string): Promise<void>;
113
- /**
114
- * Publish an error event. This will trigger the `onError` hooks of any connected clients.
115
- */
116
- pushError(error: ArriServerErrorResponse, eventId?: string): Promise<void>;
117
113
  private cleanup;
118
114
  /**
119
115
  * Tell clients that the stream has ended and close the connection.
package/dist/index.d.mts CHANGED
@@ -110,10 +110,6 @@ declare class EventStreamConnection<TData> {
110
110
  */
111
111
  push(data: TData[], eventId?: string): Promise<void>;
112
112
  push(data: TData, eventId?: string): Promise<void>;
113
- /**
114
- * Publish an error event. This will trigger the `onError` hooks of any connected clients.
115
- */
116
- pushError(error: ArriServerErrorResponse, eventId?: string): Promise<void>;
117
113
  private cleanup;
118
114
  /**
119
115
  * Tell clients that the stream has ended and close the connection.
package/dist/index.d.ts CHANGED
@@ -110,10 +110,6 @@ declare class EventStreamConnection<TData> {
110
110
  */
111
111
  push(data: TData[], eventId?: string): Promise<void>;
112
112
  push(data: TData, eventId?: string): Promise<void>;
113
- /**
114
- * Publish an error event. This will trigger the `onError` hooks of any connected clients.
115
- */
116
- pushError(error: ArriServerErrorResponse, eventId?: string): Promise<void>;
117
113
  private cleanup;
118
114
  /**
119
115
  * Tell clients that the stream has ended and close the connection.
package/dist/index.mjs CHANGED
@@ -568,32 +568,6 @@ class EventStreamConnection {
568
568
  data: JSON.stringify(errorResponse)
569
569
  });
570
570
  }
571
- // /**
572
- // * Push a custom event. These events will need to be parsed manually using the `onEvent` hooks of any generated clients.
573
- // * Note events with the name "error" or "message" cannot be used for custom events.
574
- // */
575
- // async pushCustomEvent(event: SseEvent): Promise<void> {
576
- // if (event.event === "message") {
577
- // throw new Error(
578
- // `Event type "message" is the default event type. Therefore it cannot be used when pushing custom events.`,
579
- // );
580
- // }
581
- // if (event.event === "error") {
582
- // throw new Error(
583
- // `Event type "error" is reserved for the pushError() method. Therefore it cannot be used when pushing custom events.`,
584
- // );
585
- // }
586
- // }
587
- /**
588
- * Publish an error event. This will trigger the `onError` hooks of any connected clients.
589
- */
590
- async pushError(error, eventId) {
591
- await this.eventStream.push({
592
- id: eventId,
593
- event: "error",
594
- data: JSON.stringify(error)
595
- });
596
- }
597
571
  cleanup() {
598
572
  if (this.pingInterval) {
599
573
  clearInterval(this.pingInterval);
@@ -1173,7 +1147,7 @@ class ArriApp {
1173
1147
  }
1174
1148
  getAppDefinition() {
1175
1149
  const appDef = {
1176
- arriSchemaVersion: SCHEMA_VERSION,
1150
+ schemaVersion: SCHEMA_VERSION,
1177
1151
  info: this.appInfo,
1178
1152
  procedures: {},
1179
1153
  definitions: this._definitions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arrirpc/server",
3
- "version": "0.49.1",
3
+ "version": "0.51.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -29,14 +29,14 @@
29
29
  "scule": "^1.3.0",
30
30
  "source-map-support": "^0.5.21",
31
31
  "uncrypto": "^0.1.3",
32
- "@arrirpc/codegen-dart": "0.49.1",
33
- "@arrirpc/codegen-kotlin": "0.49.1",
34
- "@arrirpc/codegen-ts": "0.49.1",
35
- "@arrirpc/schema": "0.49.1",
36
- "arri": "0.49.1",
37
- "@arrirpc/codegen-utils": "0.49.1"
32
+ "@arrirpc/codegen-dart": "0.51.0",
33
+ "@arrirpc/codegen-ts": "0.51.0",
34
+ "@arrirpc/codegen-kotlin": "0.51.0",
35
+ "@arrirpc/codegen-utils": "0.51.0",
36
+ "@arrirpc/schema": "0.51.0",
37
+ "arri": "0.51.0"
38
38
  },
39
39
  "devDependencies": {
40
- "bun-types": "^1.1.12"
40
+ "bun-types": "^1.1.13"
41
41
  }
42
42
  }