@orpc/client 0.0.3 → 1.0.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/LICENSE +21 -0
- package/dist/index.js +17 -256
- package/dist/index.js.map +1 -0
- package/package.json +7 -6
package/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2023 oRPC
|
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/dist/index.js
CHANGED
@@ -1,261 +1,18 @@
|
|
1
|
-
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
import {
|
7
|
-
|
8
|
-
|
9
|
-
function set(root, segments, value) {
|
10
|
-
const ref = { root };
|
11
|
-
let currentRef = ref;
|
12
|
-
let preSegment = "root";
|
13
|
-
for (const segment of segments) {
|
14
|
-
currentRef = currentRef[preSegment];
|
15
|
-
preSegment = segment;
|
16
|
-
}
|
17
|
-
currentRef[preSegment] = value;
|
18
|
-
return ref.root;
|
19
|
-
}
|
20
|
-
function findDeepMatches(check, payload, segments = [], maps = [], values = []) {
|
21
|
-
if (check(payload)) {
|
22
|
-
maps.push(segments);
|
23
|
-
values.push(payload);
|
24
|
-
} else if (Array.isArray(payload)) {
|
25
|
-
payload.forEach((v, i) => {
|
26
|
-
findDeepMatches(check, v, [...segments, i], maps, values);
|
27
|
-
});
|
28
|
-
} else if (isPlainObject(payload)) {
|
29
|
-
for (const key in payload) {
|
30
|
-
findDeepMatches(check, payload[key], [...segments, key], maps, values);
|
31
|
-
}
|
32
|
-
}
|
33
|
-
return { maps, values };
|
34
|
-
}
|
35
|
-
const ORPC_ERROR_CODE_STATUSES = {
|
36
|
-
BAD_REQUEST: 400,
|
37
|
-
UNAUTHORIZED: 401,
|
38
|
-
FORBIDDEN: 403,
|
39
|
-
NOT_FOUND: 404,
|
40
|
-
METHOD_NOT_SUPPORTED: 405,
|
41
|
-
NOT_ACCEPTABLE: 406,
|
42
|
-
TIMEOUT: 408,
|
43
|
-
CONFLICT: 409,
|
44
|
-
PRECONDITION_FAILED: 412,
|
45
|
-
PAYLOAD_TOO_LARGE: 413,
|
46
|
-
UNSUPPORTED_MEDIA_TYPE: 415,
|
47
|
-
UNPROCESSABLE_CONTENT: 422,
|
48
|
-
TOO_MANY_REQUESTS: 429,
|
49
|
-
CLIENT_CLOSED_REQUEST: 499,
|
50
|
-
INTERNAL_SERVER_ERROR: 500,
|
51
|
-
NOT_IMPLEMENTED: 501,
|
52
|
-
BAD_GATEWAY: 502,
|
53
|
-
SERVICE_UNAVAILABLE: 503,
|
54
|
-
GATEWAY_TIMEOUT: 504
|
55
|
-
};
|
56
|
-
class ORPCError extends Error {
|
57
|
-
constructor(zz$oe) {
|
58
|
-
if (zz$oe.status && (zz$oe.status < 400 || zz$oe.status >= 600)) {
|
59
|
-
throw new Error("The ORPCError status code must be in the 400-599 range.");
|
60
|
-
}
|
61
|
-
super(zz$oe.message, { cause: zz$oe.cause });
|
62
|
-
this.zz$oe = zz$oe;
|
63
|
-
}
|
64
|
-
get code() {
|
65
|
-
return this.zz$oe.code;
|
66
|
-
}
|
67
|
-
get status() {
|
68
|
-
return this.zz$oe.status ?? ORPC_ERROR_CODE_STATUSES[this.code];
|
69
|
-
}
|
70
|
-
get data() {
|
71
|
-
return this.zz$oe.data;
|
72
|
-
}
|
73
|
-
get issues() {
|
74
|
-
if (this.code === "BAD_REQUEST" && this.zz$oe.cause instanceof ZodError) {
|
75
|
-
return this.zz$oe.cause.issues;
|
76
|
-
}
|
77
|
-
return void 0;
|
78
|
-
}
|
79
|
-
toJSON() {
|
80
|
-
return {
|
81
|
-
code: this.code,
|
82
|
-
status: this.status,
|
83
|
-
message: this.message,
|
84
|
-
data: this.data,
|
85
|
-
issues: this.issues
|
86
|
-
};
|
87
|
-
}
|
88
|
-
static fromJSON(json) {
|
89
|
-
if (typeof json !== "object" || json === null || !("code" in json) || !Object.keys(ORPC_ERROR_CODE_STATUSES).find((key) => json.code === key) || !("status" in json) || typeof json.status !== "number" || "message" in json && json.message !== void 0 && typeof json.message !== "string" || "issues" in json && json.issues !== void 0 && !Array.isArray(json.issues)) {
|
90
|
-
return void 0;
|
91
|
-
}
|
92
|
-
return new ORPCError({
|
93
|
-
code: json.code,
|
94
|
-
status: json.status,
|
95
|
-
message: Reflect.get(json, "message"),
|
96
|
-
data: Reflect.get(json, "data"),
|
97
|
-
cause: "issues" in json ? new ZodError(json.issues) : void 0
|
98
|
-
});
|
99
|
-
}
|
100
|
-
}
|
101
|
-
function serialize(value, segments = [], meta = []) {
|
102
|
-
if (typeof value === "bigint") {
|
103
|
-
meta.push(["bigint", segments]);
|
104
|
-
return { data: value.toString(), meta };
|
105
|
-
}
|
106
|
-
if (value instanceof Date) {
|
107
|
-
meta.push(["date", segments]);
|
108
|
-
const data = Number.isNaN(value.getTime()) ? "Invalid Date" : value.toISOString();
|
109
|
-
return { data, meta };
|
110
|
-
}
|
111
|
-
if (Number.isNaN(value)) {
|
112
|
-
meta.push(["nan", segments]);
|
113
|
-
return { data: "NaN", meta };
|
114
|
-
}
|
115
|
-
if (value instanceof RegExp) {
|
116
|
-
meta.push(["regexp", segments]);
|
117
|
-
return { data: value.toString(), meta };
|
118
|
-
}
|
119
|
-
if (value instanceof URL) {
|
120
|
-
meta.push(["url", segments]);
|
121
|
-
return { data: value.toString(), meta };
|
122
|
-
}
|
123
|
-
if (isPlainObject(value)) {
|
124
|
-
const data = {};
|
125
|
-
for (const k in value) {
|
126
|
-
data[k] = serialize(value[k], [...segments, k], meta).data;
|
127
|
-
}
|
128
|
-
return { data, meta };
|
129
|
-
}
|
130
|
-
if (Array.isArray(value)) {
|
131
|
-
const data = value.map((v, i) => {
|
132
|
-
if (v === void 0) {
|
133
|
-
meta.push(["undefined", [...segments, i]]);
|
134
|
-
return null;
|
135
|
-
}
|
136
|
-
return serialize(v, [...segments, i], meta).data;
|
137
|
-
});
|
138
|
-
return { data, meta };
|
139
|
-
}
|
140
|
-
if (value instanceof Set) {
|
141
|
-
const result = serialize(Array.from(value), segments, meta);
|
142
|
-
meta.push(["set", segments]);
|
143
|
-
return result;
|
144
|
-
}
|
145
|
-
if (value instanceof Map) {
|
146
|
-
const result = serialize(Array.from(value.entries()), segments, meta);
|
147
|
-
meta.push(["map", segments]);
|
148
|
-
return result;
|
149
|
-
}
|
150
|
-
return { data: value, meta };
|
151
|
-
}
|
152
|
-
function deserialize({
|
153
|
-
data,
|
154
|
-
meta
|
155
|
-
}) {
|
156
|
-
if (meta.length === 0) {
|
157
|
-
return data;
|
158
|
-
}
|
159
|
-
const ref = { data };
|
160
|
-
for (const [type, segments] of meta) {
|
161
|
-
let currentRef = ref;
|
162
|
-
let preSegment = "data";
|
163
|
-
for (let i = 0; i < segments.length; i++) {
|
164
|
-
currentRef = currentRef[preSegment];
|
165
|
-
preSegment = segments[i];
|
166
|
-
}
|
167
|
-
switch (type) {
|
168
|
-
case "nan":
|
169
|
-
currentRef[preSegment] = Number.NaN;
|
170
|
-
break;
|
171
|
-
case "bigint":
|
172
|
-
currentRef[preSegment] = BigInt(currentRef[preSegment]);
|
173
|
-
break;
|
174
|
-
case "date":
|
175
|
-
currentRef[preSegment] = new Date(currentRef[preSegment]);
|
176
|
-
break;
|
177
|
-
case "regexp": {
|
178
|
-
const match = currentRef[preSegment].match(/^\/(.*)\/([a-z]*)$/);
|
179
|
-
if (match) {
|
180
|
-
const [, pattern, flags] = match;
|
181
|
-
currentRef[preSegment] = new RegExp(pattern, flags);
|
182
|
-
} else {
|
183
|
-
currentRef[preSegment] = new RegExp(currentRef[preSegment]);
|
184
|
-
}
|
185
|
-
break;
|
186
|
-
}
|
187
|
-
case "url":
|
188
|
-
currentRef[preSegment] = new URL(currentRef[preSegment]);
|
189
|
-
break;
|
190
|
-
case "undefined":
|
191
|
-
currentRef[preSegment] = void 0;
|
192
|
-
break;
|
193
|
-
case "map":
|
194
|
-
currentRef[preSegment] = new Map(currentRef[preSegment]);
|
195
|
-
break;
|
196
|
-
case "set":
|
197
|
-
currentRef[preSegment] = new Set(currentRef[preSegment]);
|
198
|
-
break;
|
199
|
-
}
|
200
|
-
}
|
201
|
-
return ref.data;
|
202
|
-
}
|
203
|
-
class ORPCDeserializer {
|
204
|
-
async deserialize(re) {
|
205
|
-
var _a;
|
206
|
-
if ((_a = re.headers.get("Content-Type")) == null ? void 0 : _a.startsWith("multipart/form-data")) {
|
207
|
-
const form = await re.formData();
|
208
|
-
const rawData = form.get("data");
|
209
|
-
const rawMeta = form.get("meta");
|
210
|
-
const rawMaps = form.get("maps");
|
211
|
-
let data = rawData === null ? void 0 : JSON.parse(rawData);
|
212
|
-
const meta = JSON.parse(rawMeta);
|
213
|
-
const maps = JSON.parse(rawMaps);
|
214
|
-
for (const i in maps) {
|
215
|
-
data = set(data, maps[i], form.get(i));
|
216
|
-
}
|
217
|
-
return deserialize({
|
218
|
-
data,
|
219
|
-
meta
|
220
|
-
});
|
221
|
-
}
|
222
|
-
const json = await re.json();
|
223
|
-
return deserialize(json);
|
224
|
-
}
|
225
|
-
}
|
226
|
-
class ORPCSerializer {
|
227
|
-
serialize(payload) {
|
228
|
-
const { data, meta } = serialize(payload);
|
229
|
-
const { maps, values } = findDeepMatches((v) => v instanceof Blob, data);
|
230
|
-
if (values.length > 0) {
|
231
|
-
const form = new FormData();
|
232
|
-
if (data !== void 0) {
|
233
|
-
form.append("data", JSON.stringify(data));
|
234
|
-
}
|
235
|
-
form.append("meta", JSON.stringify(meta));
|
236
|
-
form.append("maps", JSON.stringify(maps));
|
237
|
-
for (const i in values) {
|
238
|
-
const value = values[i];
|
239
|
-
form.append(i, value);
|
240
|
-
}
|
241
|
-
return { body: form, headers: new Headers() };
|
242
|
-
}
|
243
|
-
return {
|
244
|
-
body: JSON.stringify({ data, meta }),
|
245
|
-
headers: new Headers({
|
246
|
-
"Content-Type": "application/json"
|
247
|
-
})
|
248
|
-
};
|
249
|
-
}
|
250
|
-
}
|
1
|
+
// src/procedure.ts
|
2
|
+
import {
|
3
|
+
ORPC_HEADER,
|
4
|
+
ORPC_HEADER_VALUE
|
5
|
+
} from "@orpc/contract";
|
6
|
+
import { trim } from "@orpc/shared";
|
7
|
+
import { ORPCError } from "@orpc/shared/error";
|
8
|
+
import { ORPCDeserializer, ORPCSerializer } from "@orpc/transformer";
|
251
9
|
function createProcedureClient(options) {
|
252
10
|
const serializer = new ORPCSerializer();
|
253
11
|
const deserializer = new ORPCDeserializer();
|
254
12
|
const client = async (input) => {
|
255
|
-
var _a;
|
256
13
|
const fetch_ = options.fetch ?? fetch;
|
257
14
|
const url = `${trim(options.baseURL, "/")}/${options.path.map(encodeURIComponent).join("/")}`;
|
258
|
-
let headers = await
|
15
|
+
let headers = await options.headers?.(input);
|
259
16
|
headers = headers instanceof Headers ? headers : new Headers(headers);
|
260
17
|
const { body, headers: headers_ } = serializer.serialize(input);
|
261
18
|
for (const [key, value] of headers_.entries()) {
|
@@ -289,8 +46,10 @@ function createProcedureClient(options) {
|
|
289
46
|
};
|
290
47
|
return client;
|
291
48
|
}
|
49
|
+
|
50
|
+
// src/router.ts
|
292
51
|
function createRouterClient(options) {
|
293
|
-
const path =
|
52
|
+
const path = options?.path ?? [];
|
294
53
|
const client = new Proxy(
|
295
54
|
createProcedureClient({
|
296
55
|
baseURL: options.baseURL,
|
@@ -312,11 +71,13 @@ function createRouterClient(options) {
|
|
312
71
|
);
|
313
72
|
return client;
|
314
73
|
}
|
315
|
-
|
74
|
+
|
75
|
+
// src/index.ts
|
76
|
+
export * from "@orpc/shared/error";
|
77
|
+
var createORPCClient = createRouterClient;
|
316
78
|
export {
|
317
|
-
ORPCError,
|
318
|
-
ORPC_ERROR_CODE_STATUSES,
|
319
79
|
createORPCClient,
|
320
80
|
createProcedureClient,
|
321
81
|
createRouterClient
|
322
82
|
};
|
83
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/procedure.ts","../src/router.ts","../src/index.ts"],"sourcesContent":["/// <reference lib=\"dom\" />\n/// <reference lib=\"dom.iterable\" />\n\nimport {\n ORPC_HEADER,\n ORPC_HEADER_VALUE,\n type Schema,\n type SchemaInput,\n type SchemaOutput,\n} from '@orpc/contract'\nimport type { Promisable } from '@orpc/shared'\nimport { trim } from '@orpc/shared'\nimport { ORPCError } from '@orpc/shared/error'\nimport { ORPCDeserializer, ORPCSerializer } from '@orpc/transformer'\n\nexport interface ProcedureClient<\n TInputSchema extends Schema,\n TOutputSchema extends Schema,\n THandlerOutput extends SchemaOutput<TOutputSchema>,\n> {\n (\n input: SchemaInput<TInputSchema>,\n ): Promise<SchemaOutput<TOutputSchema, THandlerOutput>>\n}\n\nexport interface CreateProcedureClientOptions {\n /**\n * The base url of the server.\n */\n baseURL: string\n\n /**\n * The fetch function used to make the request.\n * @default global fetch\n */\n fetch?: typeof fetch\n\n /**\n * The headers used to make the request.\n * Invoked before the request is made.\n */\n headers?: (input: unknown) => Promisable<Headers | Record<string, string>>\n\n /**\n * The path of the procedure on server.\n */\n path: string[]\n}\n\nexport function createProcedureClient<\n TInputSchema extends Schema,\n TOutputSchema extends Schema,\n THandlerOutput extends SchemaOutput<TOutputSchema>,\n>(\n options: CreateProcedureClientOptions,\n): ProcedureClient<TInputSchema, TOutputSchema, THandlerOutput> {\n const serializer = new ORPCSerializer()\n const deserializer = new ORPCDeserializer()\n\n const client = async (input: unknown): Promise<unknown> => {\n const fetch_ = options.fetch ?? fetch\n const url = `${trim(options.baseURL, '/')}/${options.path.map(encodeURIComponent).join('/')}`\n let headers = await options.headers?.(input)\n headers = headers instanceof Headers ? headers : new Headers(headers)\n\n const { body, headers: headers_ } = serializer.serialize(input)\n\n for (const [key, value] of headers_.entries()) {\n headers.set(key, value)\n }\n\n headers.set(ORPC_HEADER, ORPC_HEADER_VALUE)\n\n const response = await fetch_(url, {\n method: 'POST',\n headers,\n body,\n })\n\n const json = await (async () => {\n try {\n return await deserializer.deserialize(response)\n } catch (e) {\n throw new ORPCError({\n code: 'INTERNAL_SERVER_ERROR',\n message: 'Cannot parse response.',\n cause: e,\n })\n }\n })()\n\n if (!response.ok) {\n throw (\n ORPCError.fromJSON(json) ??\n new ORPCError({\n status: response.status,\n code: 'INTERNAL_SERVER_ERROR',\n message: 'Internal server error',\n })\n )\n }\n\n return json\n }\n\n return client as any\n}\n","/// <reference lib=\"dom\" />\n\nimport type {\n ContractProcedure,\n ContractRouter,\n SchemaOutput,\n} from '@orpc/contract'\nimport type { Procedure, Promisable, Router } from '@orpc/server'\nimport { type ProcedureClient, createProcedureClient } from './procedure'\n\nexport type RouterClientWithContractRouter<TRouter extends ContractRouter> = {\n [K in keyof TRouter]: TRouter[K] extends ContractProcedure<\n infer UInputSchema,\n infer UOutputSchema\n >\n ? ProcedureClient<UInputSchema, UOutputSchema, SchemaOutput<UOutputSchema>>\n : TRouter[K] extends ContractRouter\n ? RouterClientWithContractRouter<TRouter[K]>\n : never\n}\n\nexport type RouterClientWithRouter<TRouter extends Router<any>> = {\n [K in keyof TRouter]: TRouter[K] extends Procedure<\n any,\n any,\n infer UInputSchema,\n infer UOutputSchema,\n infer UHandlerOutput\n >\n ? ProcedureClient<UInputSchema, UOutputSchema, UHandlerOutput>\n : TRouter[K] extends Router<any>\n ? RouterClientWithRouter<TRouter[K]>\n : never\n}\n\nexport interface CreateRouterClientOptions {\n /**\n * The base url of the server.\n */\n baseURL: string\n\n /**\n * The fetch function used to make the request.\n * @default global fetch\n */\n fetch?: typeof fetch\n\n /**\n * The headers used to make the request.\n * Invoked before the request is made.\n */\n headers?: (input: unknown) => Promisable<Headers | Record<string, string>>\n\n /**\n * This used for internal purpose only.\n *\n * @internal\n */\n path?: string[]\n}\n\nexport function createRouterClient<\n TRouter extends Router<any> | ContractRouter,\n>(\n options: CreateRouterClientOptions,\n): TRouter extends Router<any>\n ? RouterClientWithRouter<TRouter>\n : TRouter extends ContractRouter\n ? RouterClientWithContractRouter<TRouter>\n : never {\n const path = options?.path ?? []\n\n const client = new Proxy(\n createProcedureClient({\n baseURL: options.baseURL,\n fetch: options.fetch,\n headers: options.headers,\n path,\n }),\n {\n get(target, key) {\n if (typeof key !== 'string') {\n return Reflect.get(target, key)\n }\n\n return createRouterClient({\n ...options,\n path: [...path, key],\n })\n },\n },\n )\n\n return client as any\n}\n","/** unnoq */\n\nimport { createRouterClient } from './router'\n\nexport * from './procedure'\nexport * from './router'\nexport * from '@orpc/shared/error'\n\nexport const createORPCClient = createRouterClient\n"],"mappings":";AAGA;AAAA,EACE;AAAA,EACA;AAAA,OAIK;AAEP,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB,sBAAsB;AAoC1C,SAAS,sBAKd,SAC8D;AAC9D,QAAM,aAAa,IAAI,eAAe;AACtC,QAAM,eAAe,IAAI,iBAAiB;AAE1C,QAAM,SAAS,OAAO,UAAqC;AACzD,UAAM,SAAS,QAAQ,SAAS;AAChC,UAAM,MAAM,GAAG,KAAK,QAAQ,SAAS,GAAG,CAAC,IAAI,QAAQ,KAAK,IAAI,kBAAkB,EAAE,KAAK,GAAG,CAAC;AAC3F,QAAI,UAAU,MAAM,QAAQ,UAAU,KAAK;AAC3C,cAAU,mBAAmB,UAAU,UAAU,IAAI,QAAQ,OAAO;AAEpE,UAAM,EAAE,MAAM,SAAS,SAAS,IAAI,WAAW,UAAU,KAAK;AAE9D,eAAW,CAAC,KAAK,KAAK,KAAK,SAAS,QAAQ,GAAG;AAC7C,cAAQ,IAAI,KAAK,KAAK;AAAA,IACxB;AAEA,YAAQ,IAAI,aAAa,iBAAiB;AAE1C,UAAM,WAAW,MAAM,OAAO,KAAK;AAAA,MACjC,QAAQ;AAAA,MACR;AAAA,MACA;AAAA,IACF,CAAC;AAED,UAAM,OAAO,OAAO,YAAY;AAC9B,UAAI;AACF,eAAO,MAAM,aAAa,YAAY,QAAQ;AAAA,MAChD,SAAS,GAAG;AACV,cAAM,IAAI,UAAU;AAAA,UAClB,MAAM;AAAA,UACN,SAAS;AAAA,UACT,OAAO;AAAA,QACT,CAAC;AAAA,MACH;AAAA,IACF,GAAG;AAEH,QAAI,CAAC,SAAS,IAAI;AAChB,YACE,UAAU,SAAS,IAAI,KACvB,IAAI,UAAU;AAAA,QACZ,QAAQ,SAAS;AAAA,QACjB,MAAM;AAAA,QACN,SAAS;AAAA,MACX,CAAC;AAAA,IAEL;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;AC7CO,SAAS,mBAGd,SAKU;AACV,QAAM,OAAO,SAAS,QAAQ,CAAC;AAE/B,QAAM,SAAS,IAAI;AAAA,IACjB,sBAAsB;AAAA,MACpB,SAAS,QAAQ;AAAA,MACjB,OAAO,QAAQ;AAAA,MACf,SAAS,QAAQ;AAAA,MACjB;AAAA,IACF,CAAC;AAAA,IACD;AAAA,MACE,IAAI,QAAQ,KAAK;AACf,YAAI,OAAO,QAAQ,UAAU;AAC3B,iBAAO,QAAQ,IAAI,QAAQ,GAAG;AAAA,QAChC;AAEA,eAAO,mBAAmB;AAAA,UACxB,GAAG;AAAA,UACH,MAAM,CAAC,GAAG,MAAM,GAAG;AAAA,QACrB,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;;;ACxFA,cAAc;AAEP,IAAM,mBAAmB;","names":[]}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@orpc/client",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.0
|
4
|
+
"version": "1.0.0",
|
5
5
|
"author": {
|
6
6
|
"name": "unnoq",
|
7
7
|
"email": "contact@unnoq.com",
|
@@ -38,15 +38,16 @@
|
|
38
38
|
"zod": "^3.23.8"
|
39
39
|
},
|
40
40
|
"dependencies": {
|
41
|
-
"@orpc/shared": "0.0.
|
42
|
-
"@orpc/transformer": "0.0.
|
41
|
+
"@orpc/shared": "0.0.5",
|
42
|
+
"@orpc/transformer": "0.0.4"
|
43
43
|
},
|
44
44
|
"peerDependencies": {
|
45
|
-
"@orpc/contract": "0.0.
|
46
|
-
"@orpc/server": "0.0
|
45
|
+
"@orpc/contract": "0.0.4",
|
46
|
+
"@orpc/server": "0.1.0"
|
47
47
|
},
|
48
48
|
"scripts": {
|
49
|
-
"build": "
|
49
|
+
"build": "tsup --clean --sourcemap --entry.index=src/index.ts --format=esm --onSuccess='tsc -b --noCheck'",
|
50
|
+
"build:watch": "pnpm run build --watch",
|
50
51
|
"type:check": "tsc -b"
|
51
52
|
}
|
52
53
|
}
|