@tthr/vue 0.0.83 → 0.0.85

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.
Files changed (36) hide show
  1. package/nuxt/module.js +7 -9
  2. package/nuxt/module.ts +7 -9
  3. package/nuxt/runtime/composables.ts +638 -0
  4. package/nuxt/runtime/plugin.client.ts +34 -0
  5. package/nuxt/runtime/server/mutation.post.ts +53 -0
  6. package/nuxt/runtime/server/plugins/cron.ts +377 -0
  7. package/nuxt/runtime/server/query.post.ts +51 -0
  8. package/nuxt/runtime/server/utils/handler.ts +375 -0
  9. package/nuxt/runtime/server/utils/{tether.js → tether.ts} +78 -29
  10. package/package.json +6 -9
  11. package/dist/nuxt.d.ts +0 -14
  12. package/dist/nuxt.d.ts.map +0 -1
  13. package/dist/nuxt.js +0 -48
  14. package/dist/nuxt.js.map +0 -1
  15. package/dist/runtime/composables.d.ts +0 -73
  16. package/dist/runtime/composables.d.ts.map +0 -1
  17. package/dist/runtime/composables.js +0 -112
  18. package/dist/runtime/composables.js.map +0 -1
  19. package/dist/runtime/plugin.d.ts +0 -11
  20. package/dist/runtime/plugin.d.ts.map +0 -1
  21. package/dist/runtime/plugin.js +0 -33
  22. package/dist/runtime/plugin.js.map +0 -1
  23. package/nuxt/runtime/composables.d.ts +0 -142
  24. package/nuxt/runtime/composables.d.ts.map +0 -1
  25. package/nuxt/runtime/composables.js +0 -414
  26. package/nuxt/runtime/composables.js.map +0 -1
  27. package/nuxt/runtime/plugin.client.d.ts +0 -17
  28. package/nuxt/runtime/plugin.client.d.ts.map +0 -1
  29. package/nuxt/runtime/plugin.client.js +0 -21
  30. package/nuxt/runtime/plugin.client.js.map +0 -1
  31. package/nuxt/runtime/server/mutation.post.js +0 -373
  32. package/nuxt/runtime/server/plugins/cron.d.ts +0 -38
  33. package/nuxt/runtime/server/plugins/cron.d.ts.map +0 -1
  34. package/nuxt/runtime/server/plugins/cron.js +0 -621
  35. package/nuxt/runtime/server/plugins/cron.js.map +0 -1
  36. package/nuxt/runtime/server/query.post.js +0 -372
@@ -1,73 +0,0 @@
1
- /**
2
- * Nuxt composables for Tether
3
- *
4
- * These are auto-imported when using the Tether Nuxt module.
5
- */
6
- import { type Ref } from 'vue';
7
- import type { TetherClient } from '@tthr/client';
8
- /**
9
- * Get the Tether client instance
10
- */
11
- export declare function useTether(): TetherClient;
12
- /**
13
- * Query state returned by useQuery
14
- */
15
- export interface QueryState<T> {
16
- data: Ref<T | undefined>;
17
- error: Ref<Error | null>;
18
- isLoading: Ref<boolean>;
19
- refetch: () => Promise<void>;
20
- }
21
- /**
22
- * Query function reference
23
- */
24
- export interface QueryFunction<TArgs = void, TResult = unknown> {
25
- _name: string;
26
- _args?: TArgs;
27
- _result?: TResult;
28
- }
29
- /**
30
- * Reactive query composable with auto-subscription
31
- *
32
- * @example
33
- * ```vue
34
- * <script setup>
35
- * const { data: posts, isLoading } = useQuery(api.posts.list);
36
- * </script>
37
- * ```
38
- */
39
- export declare function useQuery<TArgs, TResult>(query: QueryFunction<TArgs, TResult>, args?: TArgs): QueryState<TResult>;
40
- /**
41
- * Mutation state returned by useMutation
42
- */
43
- export interface MutationState<TArgs, TResult> {
44
- data: Ref<TResult | undefined>;
45
- error: Ref<Error | null>;
46
- isPending: Ref<boolean>;
47
- mutate: (args: TArgs) => Promise<TResult>;
48
- reset: () => void;
49
- }
50
- /**
51
- * Mutation function reference
52
- */
53
- export interface MutationFunction<TArgs = void, TResult = unknown> {
54
- _name: string;
55
- _args?: TArgs;
56
- _result?: TResult;
57
- }
58
- /**
59
- * Mutation composable
60
- *
61
- * @example
62
- * ```vue
63
- * <script setup>
64
- * const { mutate: createPost, isPending } = useMutation(api.posts.create);
65
- *
66
- * async function handleSubmit() {
67
- * await createPost({ title: 'Hello', content: '...' });
68
- * }
69
- * </script>
70
- * ```
71
- */
72
- export declare function useMutation<TArgs, TResult>(mutation: MutationFunction<TArgs, TResult>): MutationState<TArgs, TResult>;
73
- //# sourceMappingUR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AAC,CAAC;IAC1C,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,KAAK,GAAG,IAAI,EAAE,OAAO,GAAG,OAAO;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EACxC,QAAQ,EAAE,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,GACzC,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAmC/B"}
@@ -1,112 +0,0 @@
1
- /**
2
- * Nuxt composables for Tether
3
- *
4
- * These are auto-imported when using the Tether Nuxt module.
5
- */
6
- import { ref, onMounted, onUnmounted } from 'vue';
7
- import { getTetherClient } from './plugin';
8
- /**
9
- * Get the Tether client instance
10
- */
11
- export function useTether() {
12
- return getTetherClient();
13
- }
14
- /**
15
- * Reactive query composable with auto-subscription
16
- *
17
- * @example
18
- * ```vue
19
- * <script setup>
20
- * const { data: posts, isLoading } = useQuery(api.posts.list);
21
- * </script>
22
- * ```
23
- */
24
- export function useQuery(query, args) {
25
- const data = ref();
26
- const error = ref(null);
27
- const isLoading = ref(true);
28
- let unsubscribe = null;
29
- const fetchData = async () => {
30
- try {
31
- isLoading.value = true;
32
- error.value = null;
33
- const client = getTetherClient();
34
- const result = await client.query(query._name, args);
35
- data.value = result;
36
- }
37
- catch (e) {
38
- error.value = e instanceof Error ? e : new Error(String(e));
39
- }
40
- finally {
41
- isLoading.value = false;
42
- }
43
- };
44
- onMounted(async () => {
45
- await fetchData();
46
- // Subscribe to realtime updates
47
- const client = getTetherClient();
48
- unsubscribe = client.subscribe(query._name, args, (newData) => {
49
- data.value = newData;
50
- });
51
- });
52
- onUnmounted(() => {
53
- if (unsubscribe) {
54
- unsubscribe();
55
- }
56
- });
57
- return {
58
- data: data,
59
- error,
60
- isLoading,
61
- refetch: fetchData,
62
- };
63
- }
64
- /**
65
- * Mutation composable
66
- *
67
- * @example
68
- * ```vue
69
- * <script setup>
70
- * const { mutate: createPost, isPending } = useMutation(api.posts.create);
71
- *
72
- * async function handleSubmit() {
73
- * await createPost({ title: 'Hello', content: '...' });
74
- * }
75
- * </script>
76
- * ```
77
- */
78
- export function useMutation(mutation) {
79
- const data = ref();
80
- const error = ref(null);
81
- const isPending = ref(false);
82
- const mutate = async (args) => {
83
- try {
84
- isPending.value = true;
85
- error.value = null;
86
- const client = getTetherClient();
87
- const result = await client.mutation(mutation._name, args);
88
- data.value = result;
89
- return result;
90
- }
91
- catch (e) {
92
- error.value = e instanceof Error ? e : new Error(String(e));
93
- throw e;
94
- }
95
- finally {
96
- isPending.value = false;
97
- }
98
- };
99
- const reset = () => {
100
- data.value = undefined;
101
- error.value = null;
102
- isPending.value = false;
103
- };
104
- return {
105
- data: data,
106
- error,
107
- isPending,
108
- mutate,
109
- reset,
110
- };
111
- }
112
- //# sourceMappingURL=composables.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"composables.js","sourceRoot":"","sources":["../../src/runtime/composables.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,WAAW,EAAY,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG3C;;GAEG;AACH,MAAM,UAAU,SAAS;IACvB,OAAO,eAAe,EAAE,CAAC;AAC3B,CAAC;AAqBD;;;;;;;;;GASG;AACH,MAAM,UAAU,QAAQ,CACtB,KAAoC,EACpC,IAAY;IAEZ,MAAM,IAAI,GAAG,GAAG,EAAW,CAAC;IAC5B,MAAM,KAAK,GAAG,GAAG,CAAe,IAAI,CAAC,CAAC;IACtC,MAAM,SAAS,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;IAE5B,IAAI,WAAW,GAAwB,IAAI,CAAC;IAE5C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G,GAAG,EAAW,CAAC;IAC5B,MAAM,KAAK,GAAG,GAAG,CAAe,IAAI,CAAC,CAAC;IACtC,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;IAE7B,MAAM,MAAM,GAAG,KAAK,EAAE,IAAW,EAAoB,EAAE;QACrD,IAAI,CAAC;YACH,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC;YACvB,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC;YAEnB,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;YACjC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YAC3D,IAAI,CAAC,KAAK,GAAG,MAAiB,CAAC;YAC/B,OAAO,MAAiB,CAAC;QAC3B,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,KAAK,CAAC,KAAK,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5D,MAAM,CAAC,CAAC;QACV,CAAC;gBAAS,CAAC;YACT,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC;QAC1B,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,KAAK,GAAG,GAAG,EAAE;QACjB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACvB,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC;QACnB,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC;IAC1B,CAAC,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,IAAgC;QACtC,KAAK;QACL,SAAS;QACT,MAAM;QACN,KAAK;KACN,CAAC;AACJ,CAAC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Nuxt plugin that initialises the Tether client
3
- */
4
- import { TetherClient } from '@tthr/client';
5
- declare const _default: any;
6
- export default _default;
7
- /**
8
- * Get the Tether client instance (for internal use by composables)
9
- */
10
- export declare function getTetherClient(): TetherClient;
11
- //# sourceMappingURL=plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/runtime/plugin.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;;AAK5C,wBAkBG;AAEH;;GAEG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAK9C"}
@@ -1,33 +0,0 @@
1
- /**
2
- * Nuxt plugin that initialises the Tether client
3
- */
4
- import { defineNuxtPlugin, useRuntimeConfig } from '#app';
5
- import { TetherClient } from '@tthr/client';
6
- // Global client instance
7
- let tetherClient = null;
8
- export default defineNuxtPlugin(() => {
9
- const config = useRuntimeConfig();
10
- const tetherConfig = config.public.tether;
11
- if (!tetherConfig.projectId) {
12
- console.warn('[Tether] No projectId configured. Set it in nuxt.config.ts under tether.projectId or via NUXT_PUBLIC_TETHER_PROJECT_ID env var.');
13
- }
14
- tetherClient = new TetherClient({
15
- projectId: tetherConfig.projectId,
16
- url: tetherConfig.url,
17
- });
18
- return {
19
- provide: {
20
- tether: tetherClient,
21
- },
22
- };
23
- });
24
- /**
25
- * Get the Tether client instance (for internal use by composables)
26
- */
27
- export function getTetherClient() {
28
- if (!tetherClient) {
29
- throw new Error('[Tether] Client not initialised. Make sure the Tether module is configured in nuxt.config.ts');
30
- }
31
- return tetherClient;
32
- }
33
- //# sourceMappingURL=plugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/runtime/plugin.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,yBAAyB;AACzB,IAAI,YAAY,GAAwB,IAAI,CAAC;AAE7C,eAAe,gBAAgB,CAAC,GAAG,EAAE;IACnC,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;IAClC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,MAA4C,CAAC;IAEhF,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC;QAC5B,OAAO,CAAC,IAAI,CAAC,iIAAiI,CAAC,CAAC;IAClJ,CAAC;IAED,YAAY,GAAG,IAAI,YAAY,CAAC;QAC9B,SAAS,EAAE,YAAY,CAAC,SAAS;QACjC,GAAG,EAAE,YAAY,CAAC,GAAG;KACtB,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,EAAE;YACP,MAAM,EAAE,YAAY;SACrB;KACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,UAAU,eAAe;IAC7B,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,8FAA8F,CAAC,CAAC;IAClH,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC"}
@@ -1,142 +0,0 @@
1
- /**
2
- * Nuxt composables for Tether
3
- *
4
- * These are auto-imported when using the Tether Nuxt module.
5
- * Queries and mutations are executed server-side to keep API keys secure.
6
- * WebSocket subscriptions run client-side for realtime updates - automatically!
7
- */
8
- import { type Ref, type ComputedRef } from 'vue';
9
- /**
10
- * Query state returned by useQuery
11
- */
12
- export interface QueryState<T> {
13
- data: Ref<T | undefined>;
14
- error: Ref<Error | null>;
15
- isLoading: ComputedRef<boolean>;
16
- isConnected: Ref<boolean>;
17
- refetch: () => Promise<void>;
18
- }
19
- /**
20
- * Thenable query state — can be awaited or destructured directly.
21
- * When awaited, resolves after the initial fetch completes (data is populated).
22
- * When destructured without await, data starts as undefined and populates reactively.
23
- */
24
- export type AsyncQueryState<T> = QueryState<T> & PromiseLike<QueryState<T>>;
25
- /**
26
- * Query function reference
27
- */
28
- export interface QueryFunction<TArgs = void, TResult = unknown> {
29
- _name: string;
30
- _args?: TArgs;
31
- _result?: TResult;
32
- }
33
- /**
34
- * Reactive query composable with automatic realtime updates
35
- *
36
- * Uses Nuxt's useAsyncData internally for proper SSR support.
37
- * Data is fetched on the server and hydrated on the client.
38
- * Automatically subscribes to WebSocket updates for realtime sync.
39
- *
40
- * Can be used with or without await:
41
- *
42
- * @example
43
- * ```vue
44
- * <script setup>
45
- * // Reactive — data fills in asynchronously, updates in realtime
46
- * const { data: posts, isLoading, isConnected } = useQuery(api.posts.list);
47
- *
48
- * // Awaited — data is populated when the promise resolves, still updates in realtime
49
- * const { data: posts } = await useQuery(api.posts.list);
50
- * </script>
51
- * ```
52
- */
53
- export declare function useQuery<TArgs, TResult>(query: QueryFunction<TArgs, TResult> | string, args?: TArgs): AsyncQueryState<TResult>;
54
- /**
55
- * Execute a query and return raw data directly.
56
- *
57
- * Unlike useQuery, this does NOT set up reactive state or WebSocket subscriptions.
58
- * Use this in event handlers, utilities, or anywhere you need a one-shot data fetch.
59
- * Proxies through the Nuxt server route to keep API keys secure.
60
- *
61
- * @example
62
- * ```ts
63
- * const messages = await $query(api.messages.listByChannel, { channelId });
64
- * ```
65
- */
66
- export declare function $query<TArgs, TResult>(query: QueryFunction<TArgs, TResult> | string, args?: TArgs): Promise<TResult>;
67
- /**
68
- * Mutation state returned by useMutation
69
- */
70
- export interface MutationState<TArgs, TResult> {
71
- data: Ref<TResult | undefined>;
72
- error: Ref<Error | null>;
73
- isPending: Ref<boolean>;
74
- mutate: (args: TArgs) => Promise<TResult>;
75
- reset: () => void;
76
- }
77
- /**
78
- * Mutation function reference
79
- */
80
- export interface MutationFunction<TArgs = void, TResult = unknown> {
81
- _name: string;
82
- _args?: TArgs;
83
- _result?: TResult;
84
- }
85
- /**
86
- * Mutation composable
87
- *
88
- * @example
89
- * ```vue
90
- * <script setup>
91
- * const { mutate: createPost, isPending } = useMutation(api.posts.create);
92
- *
93
- * async function handleSubmit() {
94
- * await createPost({ title: 'Hello', content: '...' });
95
- * // All useQuery subscribers automatically update!
96
- * }
97
- * </script>
98
- * ```
99
- */
100
- export declare function useMutation<TArgs, TResult>(mutation: MutationFunction<TArgs, TResult> | string): MutationState<TArgs, TResult>;
101
- /**
102
- * Execute a mutation and return the result directly.
103
- *
104
- * Unlike useMutation, this does NOT set up reactive state.
105
- * Use this in event handlers, utilities, or anywhere you need a one-shot mutation.
106
- * Proxies through the Nuxt server route to keep API keys secure.
107
- *
108
- * @example
109
- * ```ts
110
- * const post = await $mutation(api.posts.create, { title: 'Hello' });
111
- * ```
112
- */
113
- export declare function $mutation<TArgs, TResult>(mutation: MutationFunction<TArgs, TResult> | string, args?: TArgs): Promise<TResult>;
114
- /**
115
- * Subscription handler options
116
- */
117
- export interface SubscriptionHandlers {
118
- /** Called when fresh data is received from the server */
119
- onData?: (data: unknown) => void;
120
- /** Called when server invalidates the subscription (signals to refetch) */
121
- onInvalidate?: () => void;
122
- }
123
- /**
124
- * Manual WebSocket subscription composable
125
- *
126
- * NOTE: You typically don't need this! useQuery automatically subscribes to updates.
127
- * This is only for advanced use cases where you need custom subscription handling.
128
- *
129
- * @example
130
- * ```vue
131
- * <script setup>
132
- * // For custom subscription handling (rare)
133
- * const { isConnected } = useTetherSubscription('custom.query', {}, {
134
- * onData: (data) => console.log('Got data:', data),
135
- * onInvalidate: () => console.log('Data invalidated'),
136
- * });
137
- * </script>
138
- * ```
139
- */
140
- export declare function useTetherSubscription(queryName: string, args: Record<string, unknown> | undefined, handlers: SubscriptionHandlers | ((data?: unknown) => void)): {
141
- isConnected: Ref<boolean>;
142
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"composables.d.ts","sourceRoot":"","sources":["composables.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAyC,KAAK,GAAG,EAAE,KAAK,WAAW,EAAE,MAAM,KAAK,CAAC;AA2NxF;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,IAAI,EAAE,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IACzB,KAAK,EAAE,GAAG,CAA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