arri 0.1.1 → 0.1.3

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/cli.cjs CHANGED
@@ -11,7 +11,7 @@ const consola = require('consola');
11
11
  const esbuild = require('esbuild');
12
12
  const path = require('pathe');
13
13
  const prettier = require('prettier');
14
- const config = require('./shared/arri.ed4bd5e1.cjs');
14
+ const config = require('./shared/arri.2d97a1ad.cjs');
15
15
  const globby = require('globby');
16
16
  const scule = require('scule');
17
17
  const arriCodegenDart = require('arri-codegen-dart');
package/dist/cli.mjs CHANGED
@@ -10,7 +10,7 @@ import * as esbuild from 'esbuild';
10
10
  import { build as build$1 } from 'esbuild';
11
11
  import path from 'pathe';
12
12
  import prettier from 'prettier';
13
- import { m as defaultConfig, l as isResolvedArriConfig, a as DEV_DEFINITION_ENDPOINT } from './shared/arri.121d68e9.mjs';
13
+ import { m as defaultConfig, l as isResolvedArriConfig, a as DEV_DEFINITION_ENDPOINT } from './shared/arri.b18baa8f.mjs';
14
14
  import { globby } from 'globby';
15
15
  import { camelCase, kebabCase } from 'scule';
16
16
  import { dartClientGenerator } from 'arri-codegen-dart';
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const config = require('./shared/arri.ed4bd5e1.cjs');
3
+ const config = require('./shared/arri.2d97a1ad.cjs');
4
4
  const h3 = require('h3');
5
5
  require('arri-validate');
6
6
  require('arri-codegen-utils');
package/dist/index.d.cts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { HttpMethod, RpcDefinition, AppDefinition, ClientGenerator } from 'arri-codegen-utils';
2
- import * as arri_validate from 'arri-validate';
3
2
  import { AObjectSchema, ASchema, InferType, a, ValidationError } from 'arri-validate';
4
3
  import { H3EventContext, H3Event, Router, App, H3Error } from 'h3';
5
4
  export * from 'h3';
@@ -134,11 +133,11 @@ interface ArriOptions {
134
133
  onError?: (error: H3Error, event: MiddlewareEvent) => void | Promise<void>;
135
134
  }
136
135
 
137
- declare const ErrorResponse: arri_validate.AObjectSchema<{
136
+ declare const ErrorResponse: AObjectSchema<{
138
137
  statusCode: number;
139
138
  statusMessage: string;
140
- stack: any[];
141
- data: any;
139
+ stack?: string | undefined;
140
+ data?: any;
142
141
  }, false>;
143
142
  type ErrorResponse = a.infer<typeof ErrorResponse>;
144
143
  declare function defineError(statusCode: StatusCode, input?: Partial<Omit<ErrorResponse, "statusCode" | "stack">> & {
package/dist/index.d.mts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { HttpMethod, RpcDefinition, AppDefinition, ClientGenerator } from 'arri-codegen-utils';
2
- import * as arri_validate from 'arri-validate';
3
2
  import { AObjectSchema, ASchema, InferType, a, ValidationError } from 'arri-validate';
4
3
  import { H3EventContext, H3Event, Router, App, H3Error } from 'h3';
5
4
  export * from 'h3';
@@ -134,11 +133,11 @@ interface ArriOptions {
134
133
  onError?: (error: H3Error, event: MiddlewareEvent) => void | Promise<void>;
135
134
  }
136
135
 
137
- declare const ErrorResponse: arri_validate.AObjectSchema<{
136
+ declare const ErrorResponse: AObjectSchema<{
138
137
  statusCode: number;
139
138
  statusMessage: string;
140
- stack: any[];
141
- data: any;
139
+ stack?: string | undefined;
140
+ data?: any;
142
141
  }, false>;
143
142
  type ErrorResponse = a.infer<typeof ErrorResponse>;
144
143
  declare function defineError(statusCode: StatusCode, input?: Partial<Omit<ErrorResponse, "statusCode" | "stack">> & {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { HttpMethod, RpcDefinition, AppDefinition, ClientGenerator } from 'arri-codegen-utils';
2
- import * as arri_validate from 'arri-validate';
3
2
  import { AObjectSchema, ASchema, InferType, a, ValidationError } from 'arri-validate';
4
3
  import { H3EventContext, H3Event, Router, App, H3Error } from 'h3';
5
4
  export * from 'h3';
@@ -134,11 +133,11 @@ interface ArriOptions {
134
133
  onError?: (error: H3Error, event: MiddlewareEvent) => void | Promise<void>;
135
134
  }
136
135
 
137
- declare const ErrorResponse: arri_validate.AObjectSchema<{
136
+ declare const ErrorResponse: AObjectSchema<{
138
137
  statusCode: number;
139
138
  statusMessage: string;
140
- stack: any[];
141
- data: any;
139
+ stack?: string | undefined;
140
+ data?: any;
142
141
  }, false>;
143
142
  type ErrorResponse = a.infer<typeof ErrorResponse>;
144
143
  declare function defineError(statusCode: StatusCode, input?: Partial<Omit<ErrorResponse, "statusCode" | "stack">> & {
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { A as ArriApp, o as ArriRouter, a as DEV_DEFINITION_ENDPOINT, D as DEV_ENDPOINT_ROOT, E as ErrorResponse, c as createRpcDefinition, m as defaultConfig, n as defineConfig, f as defineError, p as defineRoute, d as defineRpc, h as errorResponseFromValidationErrors, b as getRpcParamName, g as getRpcPath, e as getRpcResponseName, j as handleH3Error, s as handleRoute, k as isArriConfig, l as isResolvedArriConfig, i as isRpc, q as registerRoute, r as registerRpc } from './shared/arri.121d68e9.mjs';
1
+ export { A as ArriApp, o as ArriRouter, a as DEV_DEFINITION_ENDPOINT, D as DEV_ENDPOINT_ROOT, E as ErrorResponse, c as createRpcDefinition, m as defaultConfig, n as defineConfig, f as defineError, p as defineRoute, d as defineRpc, h as errorResponseFromValidationErrors, b as getRpcParamName, g as getRpcPath, e as getRpcResponseName, j as handleH3Error, s as handleRoute, k as isArriConfig, l as isResolvedArriConfig, i as isRpc, q as registerRoute, r as registerRpc } from './shared/arri.b18baa8f.mjs';
2
2
  export * from 'h3';
3
3
  import 'arri-validate';
4
4
  import 'arri-codegen-utils';
@@ -8,7 +8,7 @@ const scule = require('scule');
8
8
  const ErrorResponse = arriValidate.a.object({
9
9
  statusCode: arriValidate.a.int8(),
10
10
  statusMessage: arriValidate.a.string(),
11
- stack: arriValidate.a.array(arriValidate.a.any()),
11
+ stack: arriValidate.a.optional(arriValidate.a.string()),
12
12
  data: arriValidate.a.optional(arriValidate.a.any())
13
13
  });
14
14
  function defineError(statusCode, input = {}) {
@@ -6,7 +6,7 @@ import { kebabCase, pascalCase } from 'scule';
6
6
  const ErrorResponse = a.object({
7
7
  statusCode: a.int8(),
8
8
  statusMessage: a.string(),
9
- stack: a.array(a.any()),
9
+ stack: a.optional(a.string()),
10
10
  data: a.optional(a.any())
11
11
  });
12
12
  function defineError(statusCode, input = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arri",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -8,6 +8,20 @@
8
8
  "files": [
9
9
  "dist"
10
10
  ],
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.mjs",
14
+ "require": "./dist/index.cjs"
15
+ },
16
+ "./codegen": {
17
+ "import": "./dist/codegen.mjs",
18
+ "require": "./dist/codegen.cjs"
19
+ },
20
+ "./cli": {
21
+ "import": "./dist/cli.mjs",
22
+ "require": "./dist/cli.cjs"
23
+ }
24
+ },
11
25
  "repository": {
12
26
  "type": "git",
13
27
  "url": "https://github.com/modiimedia/arri",
@@ -22,7 +36,7 @@
22
36
  "chokidar": "^3.5.3",
23
37
  "citty": "^0.1.4",
24
38
  "consola": "^3.2.3",
25
- "esbuild": "^0.19.4",
39
+ "esbuild": "^0.19.5",
26
40
  "globby": "^13.2.2",
27
41
  "h3": "^1.8.2",
28
42
  "jiti": "^1.20.0",
@@ -31,12 +45,12 @@
31
45
  "pathe": "^1.1.1",
32
46
  "prettier": "^3.0.3",
33
47
  "scule": "^1.0.0",
34
- "arri-codegen-ts": "0.1.1",
35
- "arri-codegen-dart": "0.1.1",
36
- "arri-codegen-utils": "0.1.1",
37
- "arri-validate": "0.1.1"
48
+ "arri-codegen-ts": "0.1.3",
49
+ "arri-codegen-utils": "0.1.3",
50
+ "arri-codegen-dart": "0.1.3",
51
+ "arri-validate": "0.1.3"
38
52
  },
39
53
  "devDependencies": {
40
- "bun-types": "^1.0.5"
54
+ "bun-types": "^1.0.6"
41
55
  }
42
56
  }