@gencow/core 0.1.21 → 0.1.22

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/crud.d.ts CHANGED
@@ -118,23 +118,23 @@ export declare function parseFilterNode(node: Record<string, unknown>, table: an
118
118
  * ```
119
119
  */
120
120
  export declare function crud<T extends PgTable>(table: T, options?: CrudOptions<T>): {
121
- list: import("./reactive").QueryDef<{
122
- page: import("./v").Validator<number | undefined>;
123
- limit: import("./v").Validator<number | undefined>;
124
- search: import("./v").Validator<string | undefined>;
125
- orderBy: import("./v").Validator<string | undefined>;
126
- orderDir: import("./v").Validator<string | undefined>;
127
- filters: import("./v").Validator<any>;
121
+ list: import("./reactive.js").QueryDef<{
122
+ page: import("./v.js").Validator<number | undefined>;
123
+ limit: import("./v.js").Validator<number | undefined>;
124
+ search: import("./v.js").Validator<string | undefined>;
125
+ orderBy: import("./v.js").Validator<string | undefined>;
126
+ orderDir: import("./v.js").Validator<string | undefined>;
127
+ filters: import("./v.js").Validator<any>;
128
128
  }, {
129
129
  data: any;
130
130
  total: number;
131
131
  }> | undefined;
132
- get: import("./reactive").QueryDef<{
133
- id: import("./v").Validator<string> | import("./v").Validator<number>;
132
+ get: import("./reactive.js").QueryDef<{
133
+ id: import("./v.js").Validator<string> | import("./v.js").Validator<number>;
134
134
  }, any> | undefined;
135
- create: import("./reactive").MutationDef<any, any> | undefined;
136
- update: import("./reactive").MutationDef<any, any> | undefined;
137
- remove: import("./reactive").MutationDef<any, {
135
+ create: import("./reactive.js").MutationDef<any, any> | undefined;
136
+ update: import("./reactive.js").MutationDef<any, any> | undefined;
137
+ remove: import("./reactive.js").MutationDef<any, {
138
138
  success: boolean;
139
139
  }> | undefined;
140
140
  };
package/dist/crud.js CHANGED
@@ -36,9 +36,9 @@
36
36
  */
37
37
  import { eq, ne, gt, gte, lt, lte, desc, asc, like, ilike, inArray, notInArray, or, and, count as drizzleCount, getTableName, getTableColumns } from "drizzle-orm";
38
38
  import { getTableConfig } from "drizzle-orm/pg-core";
39
- import { query, mutation } from "./reactive";
40
- import { v } from "./v";
41
- import { getOwnerRlsMeta, registerOwnerRls } from "./rls";
39
+ import { query, mutation } from "./reactive.js";
40
+ import { v } from "./v.js";
41
+ import { getOwnerRlsMeta, registerOwnerRls } from "./rls.js";
42
42
  // ─── ownerRls 감지 추적 (부트 로그용) ──────────────────
43
43
  /** crud()가 ownerRls를 자동 감지한 테이블 목록 — 서버 부트 로그에서 출력 */
44
44
  const _ownerRlsTables = [];
package/dist/index.d.ts CHANGED
@@ -4,21 +4,21 @@
4
4
  * Provides: query, mutation, storage, scheduler, auth
5
5
  * All with Convex-compatible DX patterns.
6
6
  */
7
- export type { GencowCtx, AuthCtx, UserIdentity, QueryDef, MutationDef, RealtimeCtx, HttpActionDef, HttpActionRequest, HttpActionResponse, HttpActionHandler, AIContext, AIMessage, AIResult } from "./reactive";
8
- export { query, mutation, httpAction, buildRealtimeCtx, subscribe, unsubscribe, registerClient, deregisterClient, handleWsMessage, getQueryHandler, getQueryDef, getRegisteredQueries, getRegisteredMutations, getRegisteredHttpActions } from "./reactive";
9
- export type { Storage } from "./storage";
10
- export { createScheduler, getSchedulerInfo } from "./scheduler";
11
- export type { Scheduler, ScheduleOptions, FailedJob } from "./scheduler";
12
- export { v, parseArgs, GencowValidationError } from "./v";
13
- export type { Validator, Infer, InferArgs } from "./v";
14
- export { withRetry } from "./retry";
15
- export type { RetryOptions } from "./retry";
16
- export { cronJobs } from "./crons";
17
- export type { CronJobsBuilder, CronJobDef, IntervalOptions, DailyOptions, WeeklyOptions } from "./crons";
18
- export { defineAuth } from "./auth-config";
19
- export type { GencowAuthConfig, AuthEmailVerification } from "./auth-config";
20
- export { ownerRls, getOwnerRlsMeta, registerOwnerRls } from "./rls";
21
- export type { OwnerRlsMeta } from "./rls";
22
- export { createRlsDb } from "./rls-db";
23
- export { crud, parseFilterNode, applyFilterOp, getOwnerRlsTables } from "./crud";
24
- export { crud as gencowCrud } from "./crud";
7
+ export type { GencowCtx, AuthCtx, UserIdentity, QueryDef, MutationDef, RealtimeCtx, HttpActionDef, HttpActionRequest, HttpActionResponse, HttpActionHandler, AIContext, AIMessage, AIResult } from "./reactive.js";
8
+ export { query, mutation, httpAction, buildRealtimeCtx, subscribe, unsubscribe, registerClient, deregisterClient, handleWsMessage, getQueryHandler, getQueryDef, getRegisteredQueries, getRegisteredMutations, getRegisteredHttpActions } from "./reactive.js";
9
+ export type { Storage } from "./storage.js";
10
+ export { createScheduler, getSchedulerInfo } from "./scheduler.js";
11
+ export type { Scheduler, ScheduleOptions, FailedJob } from "./scheduler.js";
12
+ export { v, parseArgs, GencowValidationError } from "./v.js";
13
+ export type { Validator, Infer, InferArgs } from "./v.js";
14
+ export { withRetry } from "./retry.js";
15
+ export type { RetryOptions } from "./retry.js";
16
+ export { cronJobs } from "./crons.js";
17
+ export type { CronJobsBuilder, CronJobDef, IntervalOptions, DailyOptions, WeeklyOptions } from "./crons.js";
18
+ export { defineAuth } from "./auth-config.js";
19
+ export type { GencowAuthConfig, AuthEmailVerification } from "./auth-config.js";
20
+ export { ownerRls, getOwnerRlsMeta, registerOwnerRls } from "./rls.js";
21
+ export type { OwnerRlsMeta } from "./rls.js";
22
+ export { createRlsDb } from "./rls-db.js";
23
+ export { crud, parseFilterNode, applyFilterOp, getOwnerRlsTables } from "./crud.js";
24
+ export { crud as gencowCrud } from "./crud.js";
package/dist/index.js CHANGED
@@ -4,15 +4,15 @@
4
4
  * Provides: query, mutation, storage, scheduler, auth
5
5
  * All with Convex-compatible DX patterns.
6
6
  */
7
- export { query, mutation, httpAction, buildRealtimeCtx, subscribe, unsubscribe, registerClient, deregisterClient, handleWsMessage, getQueryHandler, getQueryDef, getRegisteredQueries, getRegisteredMutations, getRegisteredHttpActions } from "./reactive";
8
- export { createScheduler, getSchedulerInfo } from "./scheduler";
9
- export { v, parseArgs, GencowValidationError } from "./v";
10
- export { withRetry } from "./retry";
11
- export { cronJobs } from "./crons";
12
- export { defineAuth } from "./auth-config";
7
+ export { query, mutation, httpAction, buildRealtimeCtx, subscribe, unsubscribe, registerClient, deregisterClient, handleWsMessage, getQueryHandler, getQueryDef, getRegisteredQueries, getRegisteredMutations, getRegisteredHttpActions } from "./reactive.js";
8
+ export { createScheduler, getSchedulerInfo } from "./scheduler.js";
9
+ export { v, parseArgs, GencowValidationError } from "./v.js";
10
+ export { withRetry } from "./retry.js";
11
+ export { cronJobs } from "./crons.js";
12
+ export { defineAuth } from "./auth-config.js";
13
13
  // ─── RLS + CRUD Factory ───────────
14
- export { ownerRls, getOwnerRlsMeta, registerOwnerRls } from "./rls";
15
- export { createRlsDb } from "./rls-db";
16
- export { crud, parseFilterNode, applyFilterOp, getOwnerRlsTables } from "./crud";
14
+ export { ownerRls, getOwnerRlsMeta, registerOwnerRls } from "./rls.js";
15
+ export { createRlsDb } from "./rls-db.js";
16
+ export { crud, parseFilterNode, applyFilterOp, getOwnerRlsTables } from "./crud.js";
17
17
  // Deprecated alias — 하위호환용, 향후 메이저 버전에서 제거 예정
18
- export { crud as gencowCrud } from "./crud";
18
+ export { crud as gencowCrud } from "./crud.js";
@@ -1,7 +1,7 @@
1
1
  import type { WSContext } from "hono/ws";
2
- import type { Storage } from "./storage";
3
- import type { Scheduler } from "./scheduler";
4
- import { type InferArgs } from "./v";
2
+ import type { Storage } from "./storage.js";
3
+ import type { Scheduler } from "./scheduler.js";
4
+ import { type InferArgs } from "./v.js";
5
5
  export interface UserIdentity {
6
6
  id: string;
7
7
  email: string;
@@ -100,7 +100,7 @@ export interface GencowCtx {
100
100
  /** 실시간 push — ctx.realtime.emit(queryKey, data) */
101
101
  realtime: RealtimeCtx;
102
102
  /** 재시도 — ctx.retry(fn, opts) — exponential backoff + jitter */
103
- retry: <T>(fn: () => Promise<T>, options?: import("./retry").RetryOptions) => Promise<T>;
103
+ retry: <T>(fn: () => Promise<T>, options?: import("./retry.js").RetryOptions) => Promise<T>;
104
104
  /** AI 헬퍼 */
105
105
  ai?: AIContext;
106
106
  }
package/dist/server.d.ts CHANGED
@@ -5,8 +5,8 @@
5
5
  * executing server. Excluded from client-side core (`index.ts`) so they aren't
6
6
  * bundled into user functions which run in Firecracker.
7
7
  */
8
- export { createDb } from "./db";
9
- export { createStorage, storageRoutes } from "./storage";
10
- export type { StorageImageTierConfig } from "./storage";
11
- export { createScheduler, getSchedulerInfo } from "./scheduler";
12
- export { authMiddleware, authRoutes, getUsers } from "./auth";
8
+ export { createDb } from "./db.js";
9
+ export { createStorage, storageRoutes } from "./storage.js";
10
+ export type { StorageImageTierConfig } from "./storage.js";
11
+ export { createScheduler, getSchedulerInfo } from "./scheduler.js";
12
+ export { authMiddleware, authRoutes, getUsers } from "./auth.js";
package/dist/server.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * executing server. Excluded from client-side core (`index.ts`) so they aren't
6
6
  * bundled into user functions which run in Firecracker.
7
7
  */
8
- export { createDb } from "./db";
9
- export { createStorage, storageRoutes } from "./storage";
10
- export { createScheduler, getSchedulerInfo } from "./scheduler";
11
- export { authMiddleware, authRoutes, getUsers } from "./auth";
8
+ export { createDb } from "./db.js";
9
+ export { createStorage, storageRoutes } from "./storage.js";
10
+ export { createScheduler, getSchedulerInfo } from "./scheduler.js";
11
+ export { authMiddleware, authRoutes, getUsers } from "./auth.js";
package/package.json CHANGED
@@ -1,45 +1,46 @@
1
1
  {
2
- "name": "@gencow/core",
3
- "version": "0.1.21",
4
- "description": "Gencow core library — defineQuery, defineMutation, reactive subscriptions",
5
- "type": "module",
6
- "main": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "import": "./dist/index.js",
11
- "require": "./dist/index.js",
12
- "types": "./dist/index.d.ts"
2
+ "name": "@gencow/core",
3
+ "version": "0.1.22",
4
+ "description": "Gencow core library — defineQuery, defineMutation, reactive subscriptions",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "require": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ },
14
+ "./server": {
15
+ "import": "./dist/server.js",
16
+ "require": "./dist/server.js",
17
+ "types": "./dist/server.d.ts"
18
+ }
13
19
  },
14
- "./server": {
15
- "import": "./dist/server.js",
16
- "require": "./dist/server.js",
17
- "types": "./dist/server.d.ts"
20
+ "files": [
21
+ "dist/",
22
+ "src/"
23
+ ],
24
+ "scripts": {
25
+ "db:generate:fixture-basic": "drizzle-kit generate --config ./src/__tests__/fixtures/basic/drizzle.config.ts",
26
+ "build": "tsc",
27
+ "typecheck": "tsc --noEmit",
28
+ "prepublishOnly": "npm run build",
29
+ "postinstall": "tsc"
30
+ },
31
+ "dependencies": {
32
+ "@electric-sql/pglite": "^0.3.15",
33
+ "drizzle-orm": "^0.45.1",
34
+ "hono": "^4.12.0",
35
+ "node-cron": "^4.2.1"
36
+ },
37
+ "devDependencies": {
38
+ "@types/bun": "^1.3.9",
39
+ "@types/node": "^25.3.0",
40
+ "@types/node-cron": "^3.0.11",
41
+ "drizzle-kit": "^0.31.10",
42
+ "drizzle-seed": "^0.3.1",
43
+ "typescript": "^5.9.3",
44
+ "uuid": "^13.0.0"
18
45
  }
19
- },
20
- "files": [
21
- "dist/",
22
- "src/"
23
- ],
24
- "dependencies": {
25
- "@electric-sql/pglite": "^0.3.15",
26
- "drizzle-orm": "^0.45.1",
27
- "hono": "^4.12.0",
28
- "node-cron": "^4.2.1"
29
- },
30
- "devDependencies": {
31
- "@types/bun": "^1.3.9",
32
- "@types/node": "^25.3.0",
33
- "@types/node-cron": "^3.0.11",
34
- "drizzle-kit": "^0.31.10",
35
- "drizzle-seed": "^0.3.1",
36
- "typescript": "^5.9.3",
37
- "uuid": "^13.0.0"
38
- },
39
- "scripts": {
40
- "db:generate:fixture-basic": "drizzle-kit generate --config ./src/__tests__/fixtures/basic/drizzle.config.ts",
41
- "build": "tsc",
42
- "typecheck": "tsc --noEmit",
43
- "postinstall": "tsc"
44
- }
45
- }
46
+ }
package/src/crud.ts CHANGED
@@ -38,9 +38,9 @@
38
38
  import { eq, ne, gt, gte, lt, lte, desc, asc, like, ilike, inArray, notInArray, or, and, count as drizzleCount, getTableName, getTableColumns, type SQL } from "drizzle-orm";
39
39
  import type { PgTable, AnyPgColumn } from "drizzle-orm/pg-core";
40
40
  import { getTableConfig } from "drizzle-orm/pg-core";
41
- import { query, mutation } from "./reactive";
42
- import { v } from "./v";
43
- import { getOwnerRlsMeta, registerOwnerRls } from "./rls";
41
+ import { query, mutation } from "./reactive.js";
42
+ import { v } from "./v.js";
43
+ import { getOwnerRlsMeta, registerOwnerRls } from "./rls.js";
44
44
 
45
45
  // ─── ownerRls 감지 추적 (부트 로그용) ──────────────────
46
46
 
package/src/index.ts CHANGED
@@ -5,28 +5,28 @@
5
5
  * All with Convex-compatible DX patterns.
6
6
  */
7
7
 
8
- export type { GencowCtx, AuthCtx, UserIdentity, QueryDef, MutationDef, RealtimeCtx, HttpActionDef, HttpActionRequest, HttpActionResponse, HttpActionHandler, AIContext, AIMessage, AIResult } from "./reactive";
9
- export { query, mutation, httpAction, buildRealtimeCtx, subscribe, unsubscribe, registerClient, deregisterClient, handleWsMessage, getQueryHandler, getQueryDef, getRegisteredQueries, getRegisteredMutations, getRegisteredHttpActions } from "./reactive";
10
- export type { Storage } from "./storage";
11
- export { createScheduler, getSchedulerInfo } from "./scheduler";
12
- export type { Scheduler, ScheduleOptions, FailedJob } from "./scheduler";
13
- export { v, parseArgs, GencowValidationError } from "./v";
14
- export type { Validator, Infer, InferArgs } from "./v";
15
- export { withRetry } from "./retry";
16
- export type { RetryOptions } from "./retry";
17
- export { cronJobs } from "./crons";
18
- export type { CronJobsBuilder, CronJobDef, IntervalOptions, DailyOptions, WeeklyOptions } from "./crons";
19
- export { defineAuth } from "./auth-config";
20
- export type { GencowAuthConfig, AuthEmailVerification } from "./auth-config";
8
+ export type { GencowCtx, AuthCtx, UserIdentity, QueryDef, MutationDef, RealtimeCtx, HttpActionDef, HttpActionRequest, HttpActionResponse, HttpActionHandler, AIContext, AIMessage, AIResult } from "./reactive.js";
9
+ export { query, mutation, httpAction, buildRealtimeCtx, subscribe, unsubscribe, registerClient, deregisterClient, handleWsMessage, getQueryHandler, getQueryDef, getRegisteredQueries, getRegisteredMutations, getRegisteredHttpActions } from "./reactive.js";
10
+ export type { Storage } from "./storage.js";
11
+ export { createScheduler, getSchedulerInfo } from "./scheduler.js";
12
+ export type { Scheduler, ScheduleOptions, FailedJob } from "./scheduler.js";
13
+ export { v, parseArgs, GencowValidationError } from "./v.js";
14
+ export type { Validator, Infer, InferArgs } from "./v.js";
15
+ export { withRetry } from "./retry.js";
16
+ export type { RetryOptions } from "./retry.js";
17
+ export { cronJobs } from "./crons.js";
18
+ export type { CronJobsBuilder, CronJobDef, IntervalOptions, DailyOptions, WeeklyOptions } from "./crons.js";
19
+ export { defineAuth } from "./auth-config.js";
20
+ export type { GencowAuthConfig, AuthEmailVerification } from "./auth-config.js";
21
21
 
22
22
  // ─── RLS + CRUD Factory ───────────
23
- export { ownerRls, getOwnerRlsMeta, registerOwnerRls } from "./rls";
24
- export type { OwnerRlsMeta } from "./rls";
25
- export { createRlsDb } from "./rls-db";
26
- export { crud, parseFilterNode, applyFilterOp, getOwnerRlsTables } from "./crud";
23
+ export { ownerRls, getOwnerRlsMeta, registerOwnerRls } from "./rls.js";
24
+ export type { OwnerRlsMeta } from "./rls.js";
25
+ export { createRlsDb } from "./rls-db.js";
26
+ export { crud, parseFilterNode, applyFilterOp, getOwnerRlsTables } from "./crud.js";
27
27
 
28
28
  // Deprecated alias — 하위호환용, 향후 메이저 버전에서 제거 예정
29
- export { crud as gencowCrud } from "./crud";
29
+ export { crud as gencowCrud } from "./crud.js";
30
30
 
31
31
 
32
32
 
package/src/reactive.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { WSContext } from "hono/ws";
2
- import type { Storage } from "./storage";
3
- import type { Scheduler } from "./scheduler";
4
- import { type Validator, type InferArgs } from "./v";
2
+ import type { Storage } from "./storage.js";
3
+ import type { Scheduler } from "./scheduler.js";
4
+ import { type Validator, type InferArgs } from "./v.js";
5
5
 
6
6
  // ─── GencowCtx — 사용자 함수에 주입되는 컨텍스트 ──────────
7
7
 
@@ -106,7 +106,7 @@ export interface GencowCtx {
106
106
  /** 실시간 push — ctx.realtime.emit(queryKey, data) */
107
107
  realtime: RealtimeCtx;
108
108
  /** 재시도 — ctx.retry(fn, opts) — exponential backoff + jitter */
109
- retry: <T>(fn: () => Promise<T>, options?: import("./retry").RetryOptions) => Promise<T>;
109
+ retry: <T>(fn: () => Promise<T>, options?: import("./retry.js").RetryOptions) => Promise<T>;
110
110
  /** AI 헬퍼 */
111
111
  ai?: AIContext;
112
112
  }
package/src/server.ts CHANGED
@@ -5,8 +5,8 @@
5
5
  * executing server. Excluded from client-side core (`index.ts`) so they aren't
6
6
  * bundled into user functions which run in Firecracker.
7
7
  */
8
- export { createDb } from "./db";
9
- export { createStorage, storageRoutes } from "./storage";
10
- export type { StorageImageTierConfig } from "./storage";
11
- export { createScheduler, getSchedulerInfo } from "./scheduler";
12
- export { authMiddleware, authRoutes, getUsers } from "./auth";
8
+ export { createDb } from "./db.js";
9
+ export { createStorage, storageRoutes } from "./storage.js";
10
+ export type { StorageImageTierConfig } from "./storage.js";
11
+ export { createScheduler, getSchedulerInfo } from "./scheduler.js";
12
+ export { authMiddleware, authRoutes, getUsers } from "./auth.js";