@gencow/core 0.1.23 → 0.1.25

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 (77) hide show
  1. package/dist/crud.d.ts +2 -2
  2. package/dist/crud.js +225 -208
  3. package/dist/index.d.ts +7 -3
  4. package/dist/index.js +4 -1
  5. package/dist/reactive.js +10 -3
  6. package/dist/retry.js +1 -1
  7. package/dist/rls-db.d.ts +2 -2
  8. package/dist/rls-db.js +1 -5
  9. package/dist/scheduler.d.ts +2 -0
  10. package/dist/scheduler.js +16 -6
  11. package/dist/server.d.ts +0 -1
  12. package/dist/server.js +0 -1
  13. package/dist/storage.js +29 -22
  14. package/dist/v.d.ts +2 -2
  15. package/dist/workflow-types.d.ts +81 -0
  16. package/dist/workflow-types.js +12 -0
  17. package/dist/workflow.d.ts +30 -0
  18. package/dist/workflow.js +150 -0
  19. package/dist/workflows-api.d.ts +13 -0
  20. package/dist/workflows-api.js +321 -0
  21. package/package.json +46 -42
  22. package/src/__tests__/auth.test.ts +90 -86
  23. package/src/__tests__/crons.test.ts +69 -67
  24. package/src/__tests__/crud-codegen-integration.test.ts +164 -170
  25. package/src/__tests__/crud-owner-rls.test.ts +308 -301
  26. package/src/__tests__/crud.test.ts +694 -711
  27. package/src/__tests__/dist-exports.test.ts +120 -114
  28. package/src/__tests__/fixtures/basic/auth.ts +16 -16
  29. package/src/__tests__/fixtures/basic/drizzle.config.ts +1 -4
  30. package/src/__tests__/fixtures/basic/index.ts +1 -1
  31. package/src/__tests__/fixtures/basic/schema.ts +1 -1
  32. package/src/__tests__/fixtures/basic/tasks.ts +4 -4
  33. package/src/__tests__/fixtures/common/auth-schema.ts +38 -34
  34. package/src/__tests__/helpers/basic-rls-fixture.ts +80 -78
  35. package/src/__tests__/helpers/pglite-migrations.ts +2 -5
  36. package/src/__tests__/helpers/pglite-rls-session.ts +13 -16
  37. package/src/__tests__/helpers/seed-like-fill.ts +50 -44
  38. package/src/__tests__/helpers/test-gencow-ctx-rls.ts +4 -7
  39. package/src/__tests__/httpaction.test.ts +91 -91
  40. package/src/__tests__/image-optimization.test.ts +570 -574
  41. package/src/__tests__/load.test.ts +321 -308
  42. package/src/__tests__/network-sim.test.ts +238 -215
  43. package/src/__tests__/reactive.test.ts +380 -358
  44. package/src/__tests__/retry.test.ts +99 -84
  45. package/src/__tests__/rls-crud-basic.test.ts +172 -245
  46. package/src/__tests__/rls-crud-no-owner-rls-pglite.test.ts +81 -81
  47. package/src/__tests__/rls-custom-mutation-handlers.test.ts +47 -94
  48. package/src/__tests__/rls-custom-query-handlers.test.ts +92 -92
  49. package/src/__tests__/rls-db-leased-connection.test.ts +2 -6
  50. package/src/__tests__/rls-session-and-policies.test.ts +181 -199
  51. package/src/__tests__/scheduler-durable-v2.test.ts +199 -181
  52. package/src/__tests__/scheduler-durable.test.ts +117 -117
  53. package/src/__tests__/scheduler-exec.test.ts +258 -246
  54. package/src/__tests__/scheduler.test.ts +129 -111
  55. package/src/__tests__/storage.test.ts +282 -269
  56. package/src/__tests__/tsconfig.json +6 -6
  57. package/src/__tests__/validator.test.ts +236 -232
  58. package/src/__tests__/workflow.test.ts +606 -0
  59. package/src/__tests__/ws-integration.test.ts +223 -218
  60. package/src/__tests__/ws-scale.test.ts +168 -159
  61. package/src/auth-config.ts +18 -18
  62. package/src/auth.ts +106 -106
  63. package/src/crons.ts +77 -77
  64. package/src/crud.ts +523 -479
  65. package/src/index.ts +71 -6
  66. package/src/reactive.ts +357 -331
  67. package/src/retry.ts +51 -54
  68. package/src/rls-db.ts +195 -205
  69. package/src/rls.ts +33 -36
  70. package/src/scheduler.ts +237 -211
  71. package/src/server.ts +0 -1
  72. package/src/storage.ts +632 -593
  73. package/src/v.ts +119 -114
  74. package/src/workflow-types.ts +108 -0
  75. package/src/workflow.ts +188 -0
  76. package/src/workflows-api.ts +415 -0
  77. package/src/db.ts +0 -18
package/src/index.ts CHANGED
@@ -5,11 +5,79 @@
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.js";
9
- export { query, mutation, httpAction, buildRealtimeCtx, subscribe, unsubscribe, registerClient, deregisterClient, handleWsMessage, getQueryHandler, getQueryDef, getRegisteredQueries, getRegisteredMutations, getRegisteredHttpActions } from "./reactive.js";
8
+ export type {
9
+ GencowCtx,
10
+ AuthCtx,
11
+ UserIdentity,
12
+ QueryDef,
13
+ MutationDef,
14
+ RealtimeCtx,
15
+ HttpActionDef,
16
+ HttpActionRequest,
17
+ HttpActionResponse,
18
+ HttpActionHandler,
19
+ AIContext,
20
+ AIMessage,
21
+ AIResult,
22
+ } from "./reactive.js";
23
+ export {
24
+ query,
25
+ mutation,
26
+ httpAction,
27
+ buildRealtimeCtx,
28
+ subscribe,
29
+ unsubscribe,
30
+ registerClient,
31
+ deregisterClient,
32
+ handleWsMessage,
33
+ getQueryHandler,
34
+ getQueryDef,
35
+ getRegisteredQueries,
36
+ getRegisteredMutations,
37
+ getRegisteredHttpActions,
38
+ } from "./reactive.js";
10
39
  export type { Storage } from "./storage.js";
11
40
  export { createScheduler, getSchedulerInfo } from "./scheduler.js";
12
- export type { Scheduler, ScheduleOptions, FailedJob, CreateSchedulerOptions, ScheduledJobRecord } from "./scheduler.js";
41
+ export type {
42
+ Scheduler,
43
+ ScheduleOptions,
44
+ FailedJob,
45
+ CreateSchedulerOptions,
46
+ ScheduledJobRecord,
47
+ } from "./scheduler.js";
48
+ export {
49
+ workflow,
50
+ getWorkflowDef,
51
+ getRegisteredWorkflows,
52
+ getWorkflowResumeActionName,
53
+ getWorkflowRealtimeKey,
54
+ createWorkflowRealtimeToken,
55
+ serializeWorkflowValue,
56
+ deserializeWorkflowValue,
57
+ parseWorkflowDurationMs,
58
+ DEFAULT_WORKFLOW_MAX_DURATION_MS,
59
+ DEFAULT_WORKFLOW_MAX_RETRIES,
60
+ WORKFLOW_RESUME_ACTION_PREFIX,
61
+ WORKFLOW_REALTIME_KEY_PREFIX,
62
+ } from "./workflow.js";
63
+ export { deriveWorkflowStatus } from "./workflow-types.js";
64
+ export type {
65
+ WorkflowCtx,
66
+ WorkflowHandler,
67
+ WorkflowOptions,
68
+ WorkflowDef,
69
+ WorkflowResumePayload,
70
+ WorkflowStartResult,
71
+ WorkflowSignalResult,
72
+ WorkflowStatus,
73
+ WorkflowDerivedStatus,
74
+ WorkflowSummary,
75
+ WorkflowSnapshot,
76
+ WorkflowStepSnapshot,
77
+ WorkflowListArgs,
78
+ WorkflowDuration,
79
+ } from "./workflow-types.js";
80
+ export { loadWorkflowSnapshot } from "./workflows-api.js";
13
81
  export { v, parseArgs, GencowValidationError } from "./v.js";
14
82
  export type { Validator, Infer, InferArgs } from "./v.js";
15
83
  export { withRetry } from "./retry.js";
@@ -28,6 +96,3 @@ export { crud, parseFilterNode, applyFilterOp, getOwnerRlsTables } from "./crud.
28
96
 
29
97
  // Deprecated alias — 하위호환용, 향후 메이저 버전에서 제거 예정
30
98
  export { crud as gencowCrud } from "./crud.js";
31
-
32
-
33
-