@orpc/vue-colada 0.0.0-next.c6c659d → 0.0.0-next.ccd4e42

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  // src/key.ts
2
- import { SuperJSON } from "@orpc/server/fetch";
2
+ import { serializeRPCJson } from "@orpc/server/standard";
3
3
  function buildKey(path, options) {
4
4
  return [
5
5
  "__ORPC__",
6
6
  ...path,
7
- ...options?.input !== void 0 ? [{ input: JSON.stringify(SuperJSON.serialize(options.input)) }] : []
7
+ ...options?.input !== void 0 ? [{ input: JSON.stringify(serializeRPCJson(options.input)) }] : []
8
8
  ];
9
9
  }
10
10
 
@@ -5,7 +5,7 @@ import type { MaybeDeepRef } from './types';
5
5
  * Utils at any level (procedure or router)
6
6
  */
7
7
  export interface GeneralUtils<TInput> {
8
- key: (options?: MaybeDeepRef<BuildKeyOptions<TInput>>) => EntryKey;
8
+ key(options?: MaybeDeepRef<BuildKeyOptions<TInput>>): EntryKey;
9
9
  }
10
10
  export declare function createGeneralUtils<TInput>(path: string[]): GeneralUtils<TInput>;
11
11
  //# sourceMappingURL=utils-general.d.ts.map
@@ -1,11 +1,11 @@
1
- import type { ProcedureClient } from '@orpc/server';
1
+ import type { Client } from '@orpc/contract';
2
2
  import type { MutationOptions, MutationOptionsExtra, QueryOptions, QueryOptionsExtra } from './types';
3
3
  /**
4
4
  * Utils at procedure level
5
5
  */
6
6
  export interface ProcedureUtils<TClientContext, TInput, TOutput, TError extends Error> {
7
- queryOptions: <U extends QueryOptionsExtra<TClientContext, TInput, TOutput, TError>>(...opt: [options: U] | (undefined extends TInput & TClientContext ? [] : never)) => QueryOptions<TOutput, TError>;
8
- mutationOptions: <U extends MutationOptionsExtra<TClientContext, TInput, TOutput, TError>>(...opt: [options: U] | (undefined extends TClientContext ? [] : never)) => MutationOptions<TInput, TOutput, TError>;
7
+ queryOptions<U extends QueryOptionsExtra<TClientContext, TInput, TOutput, TError>>(...opt: [options: U] | (undefined extends TInput & TClientContext ? [] : never)): QueryOptions<TOutput, TError>;
8
+ mutationOptions<U extends MutationOptionsExtra<TClientContext, TInput, TOutput, TError>>(...opt: [options: U] | (undefined extends TClientContext ? [] : never)): MutationOptions<TInput, TOutput, TError>;
9
9
  }
10
- export declare function createProcedureUtils<TClientContext, TInput, TOutput, TError extends Error>(client: ProcedureClient<TClientContext, TInput, TOutput, TError>, path: string[]): ProcedureUtils<TClientContext, TInput, TOutput, TError>;
10
+ export declare function createProcedureUtils<TClientContext, TInput, TOutput, TError extends Error>(client: Client<TClientContext, TInput, TOutput, TError>, path: string[]): ProcedureUtils<TClientContext, TInput, TOutput, TError>;
11
11
  //# sourceMappingURL=utils-procedure.d.ts.map
@@ -1,12 +1,12 @@
1
- import type { ProcedureClient, RouterClient } from '@orpc/server';
1
+ import type { Client, NestedClient } from '@orpc/contract';
2
2
  import { type GeneralUtils } from './utils-general';
3
3
  import { type ProcedureUtils } from './utils-procedure';
4
- export type RouterUtils<T extends RouterClient<any, any>> = T extends ProcedureClient<infer UClientContext, infer UInput, infer UOutput, infer UError> ? ProcedureUtils<UClientContext, UInput, UOutput, UError> & GeneralUtils<UInput> : {
5
- [K in keyof T]: T[K] extends RouterClient<any, any> ? RouterUtils<T[K]> : never;
4
+ export type RouterUtils<T extends NestedClient<any>> = T extends Client<infer UClientContext, infer UInput, infer UOutput, infer UError> ? ProcedureUtils<UClientContext, UInput, UOutput, UError> & GeneralUtils<UInput> : {
5
+ [K in keyof T]: T[K] extends NestedClient<any> ? RouterUtils<T[K]> : never;
6
6
  } & GeneralUtils<unknown>;
7
7
  /**
8
8
  * @param client - The client create form `@orpc/client`
9
9
  * @param path - The base path for query key
10
10
  */
11
- export declare function createRouterUtils<T extends RouterClient<any, any>>(client: T, path?: string[]): RouterUtils<T>;
11
+ export declare function createRouterUtils<T extends NestedClient<any>>(client: T, path?: string[]): RouterUtils<T>;
12
12
  //# sourceMappingURL=utils-router.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/vue-colada",
3
3
  "type": "module",
4
- "version": "0.0.0-next.c6c659d",
4
+ "version": "0.0.0-next.ccd4e42",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -35,12 +35,11 @@
35
35
  "peerDependencies": {
36
36
  "@pinia/colada": ">=0.13.1",
37
37
  "vue": ">=3.3.0",
38
- "@orpc/client": "0.0.0-next.c6c659d",
39
- "@orpc/server": "0.0.0-next.c6c659d",
40
- "@orpc/contract": "0.0.0-next.c6c659d"
38
+ "@orpc/client": "0.0.0-next.ccd4e42",
39
+ "@orpc/contract": "0.0.0-next.ccd4e42"
41
40
  },
42
41
  "dependencies": {
43
- "@orpc/server": "0.0.0-next.c6c659d"
42
+ "@orpc/server": "0.0.0-next.ccd4e42"
44
43
  },
45
44
  "devDependencies": {
46
45
  "@pinia/colada": "^0.13.1",