@orpc/pinia-colada 2.0.0-beta.49 → 2.0.0-beta.50

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/types.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- import type { ClientContext } from '@orpc/client';
2
- import type { DefineInfiniteQueryOptions, DefineInfiniteQueryOptionsTagged, DefineMutationOptionsTagged, DefineQueryOptions, DefineQueryOptionsTagged, EntryKey, UseInfiniteQueryData, UseMutationOptions, UseMutationOptionsGlobal, UseQueryOptions } from '@pinia/colada';
3
- import type { SerializableStreamedQueryOptions, SettleOnFirstDataOptions } from './stream-query.ts';
1
+ import { SerializableStreamedQueryOptions, SettleOnFirstDataOptions } from "./stream-query.js";
2
+ import { ClientContext } from "@orpc/client";
3
+ import { DefineInfiniteQueryOptions, DefineInfiniteQueryOptionsTagged, DefineMutationOptionsTagged, DefineQueryOptions, DefineQueryOptionsTagged, EntryKey, UseInfiniteQueryData, UseMutationOptions, UseMutationOptionsGlobal, UseQueryOptions } from "@pinia/colada";
4
4
  export type InferStreamedQueryOutput<TOutput> = TOutput extends AsyncIterable<infer U> ? U[] : never;
5
5
  export type InferLiveQueryOutput<TOutput> = TOutput extends AsyncIterable<infer U> ? U : never;
6
- export type UseQueryFnContext = Parameters<UseQueryOptions<any>['query']>[0];
6
+ export type UseQueryFnContext = Parameters<UseQueryOptions<any>["query"]>[0];
7
7
  /**
8
8
  * The context passed to the mutation function, including the merged
9
9
  * `UseMutationGlobalContext` values provided by a global `onMutate` hook.
10
10
  */
11
- export type UseMutationFnContext = Parameters<NonNullable<UseMutationOptionsGlobal['onSuccess']>>[2];
11
+ export type UseMutationFnContext = Parameters<NonNullable<UseMutationOptionsGlobal["onSuccess"]>>[2];
12
12
  /**
13
13
  * The symbol under which Pinia Colada utils attach operation details
14
14
  * (key and operation type) to the client context.
@@ -16,7 +16,7 @@ export type UseMutationFnContext = Parameters<NonNullable<UseMutationOptionsGlob
16
16
  * @see {@link https://orpc.dev/docs/integrations/pinia-colada#client-context | Pinia Colada Integration - Client Context}
17
17
  */
18
18
  export declare const OPERATION_CONTEXT_SYMBOL: unique symbol;
19
- export type OperationType = 'query' | 'streamed' | 'live' | 'infinite' | 'mutation';
19
+ export type OperationType = "query" | "streamed" | "live" | "infinite" | "mutation";
20
20
  /**
21
21
  * A client context automatically populated by Pinia Colada utils,
22
22
  * exposing the operation key and type of the calling operation.
@@ -24,57 +24,57 @@ export type OperationType = 'query' | 'streamed' | 'live' | 'infinite' | 'mutati
24
24
  * @see {@link https://orpc.dev/docs/integrations/pinia-colada#client-context | Pinia Colada Integration - Client Context}
25
25
  */
26
26
  export interface OperationContext {
27
- [OPERATION_CONTEXT_SYMBOL]?: {
28
- key: EntryKey;
29
- type: OperationType;
30
- };
27
+ [OPERATION_CONTEXT_SYMBOL]?: {
28
+ key: EntryKey;
29
+ type: OperationType;
30
+ };
31
31
  }
32
32
  export type QueryKeyOptions<TInput> = (undefined extends TInput ? {
33
- input?: TInput;
33
+ input?: TInput;
34
34
  } : {
35
- input: TInput;
35
+ input: TInput;
36
36
  }) | {
37
- key: EntryKey;
37
+ key: EntryKey;
38
38
  };
39
39
  export type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TInitialData extends TOutput | undefined> = (undefined extends TInput ? {
40
- input?: TInput;
40
+ input?: TInput;
41
41
  } : {
42
- input: TInput;
42
+ input: TInput;
43
43
  }) & (object extends TClientContext ? {
44
- context?: TClientContext | undefined;
44
+ context?: TClientContext | undefined;
45
45
  } : {
46
- context: TClientContext;
47
- }) & Omit<DefineQueryOptions<TOutput, TError, TInitialData>, 'key' | 'query'> & Partial<Pick<DefineQueryOptions<TOutput, TError, TInitialData>, 'key' | 'query'>>;
46
+ context: TClientContext;
47
+ }) & Omit<DefineQueryOptions<TOutput, TError, TInitialData>, "key" | "query"> & Partial<Pick<DefineQueryOptions<TOutput, TError, TInitialData>, "key" | "query">>;
48
48
  export type QueryOptionsOut<TOutput, TError, TInitialData extends TOutput | undefined> = DefineQueryOptionsTagged<TOutput, TError, TInitialData>;
49
49
  export type StreamedKeyOptions<TInput> = ((undefined extends TInput ? {
50
- input?: TInput;
50
+ input?: TInput;
51
51
  } : {
52
- input: TInput;
52
+ input: TInput;
53
53
  }) & {
54
- fnOptions?: SerializableStreamedQueryOptions | undefined;
54
+ fnOptions?: SerializableStreamedQueryOptions | undefined;
55
55
  }) | {
56
- key: EntryKey;
56
+ key: EntryKey;
57
57
  };
58
58
  export type StreamedOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TInitialData extends TOutput | undefined> = QueryOptionsIn<TClientContext, TInput, TOutput, TError, TInitialData> & {
59
- fnOptions?: SerializableStreamedQueryOptions | undefined;
59
+ fnOptions?: SerializableStreamedQueryOptions | undefined;
60
60
  } & SettleOnFirstDataOptions;
61
61
  export type StreamedOptionsOut<TOutput, TError, TInitialData extends TOutput | undefined> = QueryOptionsOut<TOutput, TError, TInitialData>;
62
62
  export type LiveOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TInitialData extends TOutput | undefined> = QueryOptionsIn<TClientContext, TInput, TOutput, TError, TInitialData> & SettleOnFirstDataOptions;
63
- export type InfiniteKeyOptions<TInput, TPageParam> = Pick<InfiniteOptionsIn<any, TInput, any, any, TPageParam, any>, 'input' | 'initialPageParam'> | {
64
- key: EntryKey;
63
+ export type InfiniteKeyOptions<TInput, TPageParam> = Pick<InfiniteOptionsIn<any, TInput, any, any, TPageParam, any>, "input" | "initialPageParam"> | {
64
+ key: EntryKey;
65
65
  };
66
66
  export type InfiniteOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TPageParam, TInitialData extends UseInfiniteQueryData<TOutput, TPageParam> | undefined> = {
67
- input: (pageParam: TPageParam) => TInput;
67
+ input: (pageParam: TPageParam) => TInput;
68
68
  } & (object extends TClientContext ? {
69
- context?: TClientContext | undefined;
69
+ context?: TClientContext | undefined;
70
70
  } : {
71
- context: TClientContext;
72
- }) & Omit<DefineInfiniteQueryOptions<TOutput, TError, TPageParam, TInitialData>, 'key' | 'query'> & Partial<Pick<DefineInfiniteQueryOptions<TOutput, TError, TPageParam, TInitialData>, 'key' | 'query'>>;
71
+ context: TClientContext;
72
+ }) & Omit<DefineInfiniteQueryOptions<TOutput, TError, TPageParam, TInitialData>, "key" | "query"> & Partial<Pick<DefineInfiniteQueryOptions<TOutput, TError, TPageParam, TInitialData>, "key" | "query">>;
73
73
  export type InfiniteOptionsOut<TOutput, TError, TPageParam, TInitialData extends UseInfiniteQueryData<TOutput, TPageParam> | undefined> = DefineInfiniteQueryOptionsTagged<TOutput, TError, TPageParam, TInitialData>;
74
- export type MutationKeyOptions<TInput> = Pick<MutationOptionsIn<any, TInput, any, any, any>, 'key'>;
74
+ export type MutationKeyOptions<TInput> = Pick<MutationOptionsIn<any, TInput, any, any, any>, "key">;
75
75
  export type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TMutationContext extends Record<any, any>> = (object extends TClientContext ? {
76
- context?: TClientContext | undefined;
76
+ context?: TClientContext | undefined;
77
77
  } : {
78
- context: TClientContext;
79
- }) & Omit<UseMutationOptions<TOutput, TInput, TError, TMutationContext>, 'mutation'> & Partial<Pick<UseMutationOptions<TOutput, TInput, TError, TMutationContext>, 'mutation'>>;
80
- export type MutationOptionsOut<TInput, TOutput, TError, TMutationContext extends Record<any, any>> = DefineMutationOptionsTagged<TOutput, TInput, TError, TMutationContext>;
78
+ context: TClientContext;
79
+ }) & Omit<UseMutationOptions<TOutput, TInput, TError, TMutationContext>, "mutation"> & Partial<Pick<UseMutationOptions<TOutput, TInput, TError, TMutationContext>, "mutation">>;
80
+ export type MutationOptionsOut<TInput, TOutput, TError, TMutationContext extends Record<any, any>> = DefineMutationOptionsTagged<TOutput, TInput, TError, TMutationContext>;
package/dist/types.js CHANGED
@@ -1,7 +1,9 @@
1
+ // src/types.ts
1
2
  /**
2
- * The symbol under which Pinia Colada utils attach operation details
3
- * (key and operation type) to the client context.
4
- *
5
- * @see {@link https://orpc.dev/docs/integrations/pinia-colada#client-context | Pinia Colada Integration - Client Context}
6
- */
7
- export const OPERATION_CONTEXT_SYMBOL = /* @__PURE__ */ Symbol.for('ORPC_PINIA_COLADA_OPERATION_CONTEXT');
3
+ * The symbol under which Pinia Colada utils attach operation details
4
+ * (key and operation type) to the client context.
5
+ *
6
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#client-context | Pinia Colada Integration - Client Context}
7
+ */
8
+ const OPERATION_CONTEXT_SYMBOL = /* @__PURE__ */ Symbol.for("ORPC_PINIA_COLADA_OPERATION_CONTEXT");
9
+ export { OPERATION_CONTEXT_SYMBOL };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orpc/pinia-colada",
3
- "version": "2.0.0-beta.49",
3
+ "version": "2.0.0-beta.50",
4
4
  "description": "Pinia Colada integration for oRPC: typesafe queries and mutations for Vue",
5
5
  "keywords": [
6
6
  "mutation",
@@ -37,10 +37,10 @@
37
37
  }
38
38
  },
39
39
  "dependencies": {
40
- "@orpc/client": "2.0.0-beta.49",
41
- "@orpc/contract": "2.0.0-beta.49",
42
- "@orpc/openapi": "2.0.0-beta.49",
43
- "@orpc/shared": "2.0.0-beta.49"
40
+ "@orpc/client": "2.0.0-beta.50",
41
+ "@orpc/contract": "2.0.0-beta.50",
42
+ "@orpc/openapi": "2.0.0-beta.50",
43
+ "@orpc/shared": "2.0.0-beta.50"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@pinia/colada": "^1.4.9",
@@ -1,8 +0,0 @@
1
- import type { Promisable } from '@orpc/shared';
2
- import type { SettleOnFirstDataOptions } from './stream-query.ts';
3
- import type { UseQueryFnContext } from './types.ts';
4
- /**
5
- * A Pinia Colada query function that publishes each streamed chunk to the
6
- * cache entry as it arrives, replacing the previous value.
7
- */
8
- export declare function liveQuery<T>(queryFn: (context: UseQueryFnContext) => Promisable<AsyncIterable<T>>, { settleOnFirstData }?: SettleOnFirstDataOptions): (context: UseQueryFnContext) => Promise<T>;