@btst/stack 1.2.2 → 1.3.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.
@@ -75,11 +75,21 @@ const blogSchema = createDbPlugin("blog", {
75
75
  fields: {
76
76
  postId: {
77
77
  type: "string",
78
- required: true
78
+ required: true,
79
+ references: {
80
+ model: "post",
81
+ field: "id",
82
+ onDelete: "cascade"
83
+ }
79
84
  },
80
85
  tagId: {
81
86
  type: "string",
82
- required: true
87
+ required: true,
88
+ references: {
89
+ model: "tag",
90
+ field: "id",
91
+ onDelete: "cascade"
92
+ }
83
93
  }
84
94
  }
85
95
  }
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
2
2
  import '@btst/stack/plugins/api';
3
3
  import 'better-call';
4
4
  import 'zod';
5
- import '../../../shared/stack.Cr2JoQdo.cjs';
5
+ import '../../../shared/stack.DLhzx1-D.cjs';
6
6
  import '@tanstack/react-query';
7
7
  import '@btst/stack/plugins/client';
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
2
2
  import '@btst/stack/plugins/api';
3
3
  import 'better-call';
4
4
  import 'zod';
5
- import '../../../shared/stack.Cr2JoQdo.mjs';
5
+ import '../../../shared/stack.DLhzx1-D.mjs';
6
6
  import '@tanstack/react-query';
7
7
  import '@btst/stack/plugins/client';
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
2
2
  import '@btst/stack/plugins/api';
3
3
  import 'better-call';
4
4
  import 'zod';
5
- import '../../../shared/stack.Cr2JoQdo.js';
5
+ import '../../../shared/stack.DLhzx1-D.js';
6
6
  import '@tanstack/react-query';
7
7
  import '@btst/stack/plugins/client';
@@ -1,5 +1,5 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.Cr2JoQdo.cjs';
2
+ import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.DLhzx1-D.cjs';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /**
@@ -141,9 +141,9 @@ declare function useCreatePost(): _tanstack_react_query.UseMutationResult<Serial
141
141
  })[];
142
142
  slug?: string | undefined;
143
143
  createdAt?: Date | undefined;
144
+ image?: string | undefined;
144
145
  publishedAt?: Date | undefined;
145
146
  updatedAt?: Date | undefined;
146
- image?: string | undefined;
147
147
  }, unknown>;
148
148
  /** Update an existing post by id */
149
149
  declare function useUpdatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
@@ -1,5 +1,5 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.Cr2JoQdo.mjs';
2
+ import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.DLhzx1-D.mjs';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /**
@@ -141,9 +141,9 @@ declare function useCreatePost(): _tanstack_react_query.UseMutationResult<Serial
141
141
  })[];
142
142
  slug?: string | undefined;
143
143
  createdAt?: Date | undefined;
144
+ image?: string | undefined;
144
145
  publishedAt?: Date | undefined;
145
146
  updatedAt?: Date | undefined;
146
- image?: string | undefined;
147
147
  }, unknown>;
148
148
  /** Update an existing post by id */
149
149
  declare function useUpdatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
@@ -1,5 +1,5 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.Cr2JoQdo.js';
2
+ import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.DLhzx1-D.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /**
@@ -141,9 +141,9 @@ declare function useCreatePost(): _tanstack_react_query.UseMutationResult<Serial
141
141
  })[];
142
142
  slug?: string | undefined;
143
143
  createdAt?: Date | undefined;
144
+ image?: string | undefined;
144
145
  publishedAt?: Date | undefined;
145
146
  updatedAt?: Date | undefined;
146
- image?: string | undefined;
147
147
  }, unknown>;
148
148
  /** Update an existing post by id */
149
149
  declare function useUpdatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
@@ -3,7 +3,7 @@ import * as react from 'react';
3
3
  import { ComponentType } from 'react';
4
4
  import * as _btst_yar from '@btst/yar';
5
5
  import { QueryClient } from '@tanstack/react-query';
6
- import { P as Post, S as SerializedPost } from '../../../shared/stack.Cr2JoQdo.cjs';
6
+ import { P as Post, S as SerializedPost } from '../../../shared/stack.DLhzx1-D.cjs';
7
7
  export { UsePostsOptions, UsePostsResult } from './hooks/index.cjs';
8
8
  import 'zod';
9
9
 
@@ -3,7 +3,7 @@ import * as react from 'react';
3
3
  import { ComponentType } from 'react';
4
4
  import * as _btst_yar from '@btst/yar';
5
5
  import { QueryClient } from '@tanstack/react-query';
6
- import { P as Post, S as SerializedPost } from '../../../shared/stack.Cr2JoQdo.mjs';
6
+ import { P as Post, S as SerializedPost } from '../../../shared/stack.DLhzx1-D.mjs';
7
7
  export { UsePostsOptions, UsePostsResult } from './hooks/index.mjs';
8
8
  import 'zod';
9
9
 
@@ -3,7 +3,7 @@ import * as react from 'react';
3
3
  import { ComponentType } from 'react';
4
4
  import * as _btst_yar from '@btst/yar';
5
5
  import { QueryClient } from '@tanstack/react-query';
6
- import { P as Post, S as SerializedPost } from '../../../shared/stack.Cr2JoQdo.js';
6
+ import { P as Post, S as SerializedPost } from '../../../shared/stack.DLhzx1-D.js';
7
7
  export { UsePostsOptions, UsePostsResult } from './hooks/index.js';
8
8
  import 'zod';
9
9
 
@@ -1,7 +1,7 @@
1
1
  import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
2
2
  import * as better_call from 'better-call';
3
3
  import { z } from 'zod';
4
- import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.Cr2JoQdo.cjs';
4
+ import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.DLhzx1-D.cjs';
5
5
  import * as _tanstack_react_query from '@tanstack/react-query';
6
6
  import { createApiClient } from '@btst/stack/plugins/client';
7
7
 
@@ -199,8 +199,6 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
199
199
  slug?: string | undefined;
200
200
  published?: boolean | undefined;
201
201
  createdAt?: unknown;
202
- publishedAt?: unknown;
203
- updatedAt?: unknown;
204
202
  image?: string | undefined;
205
203
  tags?: ({
206
204
  name: string;
@@ -209,6 +207,8 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
209
207
  name: string;
210
208
  slug: string;
211
209
  })[] | undefined;
210
+ publishedAt?: unknown;
211
+ updatedAt?: unknown;
212
212
  };
213
213
  } & {
214
214
  method?: "POST" | undefined;
@@ -239,8 +239,6 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
239
239
  slug: z.ZodOptional<z.ZodString>;
240
240
  published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
241
241
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
242
- publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
243
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
244
242
  content: z.ZodString;
245
243
  excerpt: z.ZodString;
246
244
  image: z.ZodOptional<z.ZodString>;
@@ -251,6 +249,8 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
251
249
  name: z.ZodString;
252
250
  slug: z.ZodString;
253
251
  }, z.core.$strip>]>>>>;
252
+ publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
253
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
254
254
  }, z.core.$strip>;
255
255
  };
256
256
  path: "/posts";
@@ -1,7 +1,7 @@
1
1
  import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
2
2
  import * as better_call from 'better-call';
3
3
  import { z } from 'zod';
4
- import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.Cr2JoQdo.mjs';
4
+ import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.DLhzx1-D.mjs';
5
5
  import * as _tanstack_react_query from '@tanstack/react-query';
6
6
  import { createApiClient } from '@btst/stack/plugins/client';
7
7
 
@@ -199,8 +199,6 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
199
199
  slug?: string | undefined;
200
200
  published?: boolean | undefined;
201
201
  createdAt?: unknown;
202
- publishedAt?: unknown;
203
- updatedAt?: unknown;
204
202
  image?: string | undefined;
205
203
  tags?: ({
206
204
  name: string;
@@ -209,6 +207,8 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
209
207
  name: string;
210
208
  slug: string;
211
209
  })[] | undefined;
210
+ publishedAt?: unknown;
211
+ updatedAt?: unknown;
212
212
  };
213
213
  } & {
214
214
  method?: "POST" | undefined;
@@ -239,8 +239,6 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
239
239
  slug: z.ZodOptional<z.ZodString>;
240
240
  published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
241
241
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
242
- publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
243
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
244
242
  content: z.ZodString;
245
243
  excerpt: z.ZodString;
246
244
  image: z.ZodOptional<z.ZodString>;
@@ -251,6 +249,8 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
251
249
  name: z.ZodString;
252
250
  slug: z.ZodString;
253
251
  }, z.core.$strip>]>>>>;
252
+ publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
253
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
254
254
  }, z.core.$strip>;
255
255
  };
256
256
  path: "/posts";
@@ -1,7 +1,7 @@
1
1
  import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
2
2
  import * as better_call from 'better-call';
3
3
  import { z } from 'zod';
4
- import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.Cr2JoQdo.js';
4
+ import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.DLhzx1-D.js';
5
5
  import * as _tanstack_react_query from '@tanstack/react-query';
6
6
  import { createApiClient } from '@btst/stack/plugins/client';
7
7
 
@@ -199,8 +199,6 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
199
199
  slug?: string | undefined;
200
200
  published?: boolean | undefined;
201
201
  createdAt?: unknown;
202
- publishedAt?: unknown;
203
- updatedAt?: unknown;
204
202
  image?: string | undefined;
205
203
  tags?: ({
206
204
  name: string;
@@ -209,6 +207,8 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
209
207
  name: string;
210
208
  slug: string;
211
209
  })[] | undefined;
210
+ publishedAt?: unknown;
211
+ updatedAt?: unknown;
212
212
  };
213
213
  } & {
214
214
  method?: "POST" | undefined;
@@ -239,8 +239,6 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
239
239
  slug: z.ZodOptional<z.ZodString>;
240
240
  published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
241
241
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
242
- publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
243
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
244
242
  content: z.ZodString;
245
243
  excerpt: z.ZodString;
246
244
  image: z.ZodOptional<z.ZodString>;
@@ -251,6 +249,8 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
251
249
  name: z.ZodString;
252
250
  slug: z.ZodString;
253
251
  }, z.core.$strip>]>>>>;
252
+ publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
253
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
254
254
  }, z.core.$strip>;
255
255
  };
256
256
  path: "/posts";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@btst/stack",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "description": "A composable, plugin-based library for building full-stack applications.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -157,7 +157,7 @@
157
157
  }
158
158
  },
159
159
  "dependencies": {
160
- "@btst/db": "2.0.1",
160
+ "@btst/db": "2.0.2",
161
161
  "@lukemorales/query-key-factory": "^1.3.4",
162
162
  "@milkdown/crepe": "^7.17.1",
163
163
  "@milkdown/kit": "^7.17.1",
@@ -196,7 +196,7 @@
196
196
  "zod": ">=3.24.0"
197
197
  },
198
198
  "devDependencies": {
199
- "@btst/adapter-memory": "2.0.1",
199
+ "@btst/adapter-memory": "2.0.2",
200
200
  "@btst/yar": "1.1.1",
201
201
  "@types/react": "^19.0.0",
202
202
  "@types/slug": "^5.0.9",