@prisma-next/target-postgres 0.5.0-dev.6 → 0.5.0-dev.60

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 (81) hide show
  1. package/dist/{codec-ids-CojIXVf9.mjs → codec-ids-ckQX9Kcg.mjs} +3 -2
  2. package/dist/{codec-ids-CojIXVf9.mjs.map → codec-ids-ckQX9Kcg.mjs.map} +1 -1
  3. package/dist/codec-ids.d.mts +2 -1
  4. package/dist/codec-ids.d.mts.map +1 -1
  5. package/dist/codec-ids.mjs +2 -2
  6. package/dist/codec-types.d.mts +1 -1
  7. package/dist/codec-types.mjs +2 -1
  8. package/dist/{codecs-D-F2KJqt.d.mts → codecs-B03dFv94.d.mts} +64 -30
  9. package/dist/codecs-B03dFv94.d.mts.map +1 -0
  10. package/dist/{codecs-BoahtY_Q.mjs → codecs-D0oXyJIH.mjs} +24 -104
  11. package/dist/codecs-D0oXyJIH.mjs.map +1 -0
  12. package/dist/codecs.d.mts +1 -1
  13. package/dist/codecs.mjs +2 -1
  14. package/dist/control.mjs +21 -63
  15. package/dist/control.mjs.map +1 -1
  16. package/dist/{data-transform-VfEGzXWt.mjs → data-transform-Be_i_DBc.mjs} +24 -5
  17. package/dist/data-transform-Be_i_DBc.mjs.map +1 -0
  18. package/dist/data-transform-CrpmG4uJ.d.mts +39 -0
  19. package/dist/data-transform-CrpmG4uJ.d.mts.map +1 -0
  20. package/dist/data-transform.d.mts +1 -1
  21. package/dist/data-transform.mjs +1 -1
  22. package/dist/{descriptor-meta-BVoVtyp-.mjs → descriptor-meta-Ieg1XLOs.mjs} +7 -12
  23. package/dist/descriptor-meta-Ieg1XLOs.mjs.map +1 -0
  24. package/dist/issue-planner.d.mts +1 -1
  25. package/dist/migration.d.mts +2 -2
  26. package/dist/migration.mjs +2 -2
  27. package/dist/op-factory-call-C3bWXKSP.d.mts.map +1 -1
  28. package/dist/pack.d.mts +28 -9
  29. package/dist/pack.d.mts.map +1 -1
  30. package/dist/pack.mjs +1 -1
  31. package/dist/{planner-CLUvVhUN.mjs → planner-Cm-ZLutk.mjs} +6 -6
  32. package/dist/planner-Cm-ZLutk.mjs.map +1 -0
  33. package/dist/{planner-produced-postgres-migration-DSSPq8QS.mjs → planner-produced-postgres-migration-Bi-RWO4-.mjs} +3 -4
  34. package/dist/{planner-produced-postgres-migration-DSSPq8QS.mjs.map → planner-produced-postgres-migration-Bi-RWO4-.mjs.map} +1 -1
  35. package/dist/{planner-produced-postgres-migration-CRRTno6Z.d.mts → planner-produced-postgres-migration-M3EfhWSS.d.mts} +2 -2
  36. package/dist/planner-produced-postgres-migration-M3EfhWSS.d.mts.map +1 -0
  37. package/dist/planner-produced-postgres-migration.d.mts +3 -2
  38. package/dist/planner-produced-postgres-migration.mjs +1 -1
  39. package/dist/planner.d.mts +17 -10
  40. package/dist/planner.d.mts.map +1 -1
  41. package/dist/planner.mjs +1 -1
  42. package/dist/{postgres-migration-BjA3Zmts.d.mts → postgres-migration-BFjbb25b.d.mts} +4 -3
  43. package/dist/postgres-migration-BFjbb25b.d.mts.map +1 -0
  44. package/dist/{postgres-migration-qtmtbONe.mjs → postgres-migration-BS9vQW97.mjs} +2 -2
  45. package/dist/postgres-migration-BS9vQW97.mjs.map +1 -0
  46. package/dist/{render-typescript-1rF_SB4g.mjs → render-typescript-Co3Emwgz.mjs} +1 -2
  47. package/dist/render-typescript-Co3Emwgz.mjs.map +1 -0
  48. package/dist/render-typescript.d.mts +1 -2
  49. package/dist/render-typescript.d.mts.map +1 -1
  50. package/dist/render-typescript.mjs +1 -1
  51. package/dist/runtime.mjs +1 -1
  52. package/dist/{statement-builders-BPnmt6wx.mjs → statement-builders-CHqCtSfe.mjs} +13 -8
  53. package/dist/statement-builders-CHqCtSfe.mjs.map +1 -0
  54. package/dist/statement-builders.d.mts +10 -3
  55. package/dist/statement-builders.d.mts.map +1 -1
  56. package/dist/statement-builders.mjs +2 -2
  57. package/package.json +15 -14
  58. package/src/core/authoring.ts +5 -11
  59. package/src/core/codec-ids.ts +1 -0
  60. package/src/core/codecs.ts +53 -40
  61. package/src/core/migrations/operations/data-transform.ts +86 -21
  62. package/src/core/migrations/planner-produced-postgres-migration.ts +0 -1
  63. package/src/core/migrations/planner.ts +17 -11
  64. package/src/core/migrations/postgres-migration.ts +3 -6
  65. package/src/core/migrations/render-typescript.ts +1 -5
  66. package/src/core/migrations/runner.ts +43 -112
  67. package/src/core/migrations/statement-builders.ts +22 -6
  68. package/src/exports/statement-builders.ts +1 -1
  69. package/dist/codecs-BoahtY_Q.mjs.map +0 -1
  70. package/dist/codecs-D-F2KJqt.d.mts.map +0 -1
  71. package/dist/data-transform-CxFRBIUp.d.mts +0 -32
  72. package/dist/data-transform-CxFRBIUp.d.mts.map +0 -1
  73. package/dist/data-transform-VfEGzXWt.mjs.map +0 -1
  74. package/dist/descriptor-meta-BVoVtyp-.mjs.map +0 -1
  75. package/dist/planner-CLUvVhUN.mjs.map +0 -1
  76. package/dist/planner-produced-postgres-migration-CRRTno6Z.d.mts.map +0 -1
  77. package/dist/postgres-migration-BjA3Zmts.d.mts.map +0 -1
  78. package/dist/postgres-migration-qtmtbONe.mjs.map +0 -1
  79. package/dist/render-typescript-1rF_SB4g.mjs.map +0 -1
  80. package/dist/statement-builders-BPnmt6wx.mjs.map +0 -1
  81. package/src/core/json-schema-type-expression.ts +0 -131
@@ -23,7 +23,8 @@ const PG_TIMETZ_CODEC_ID = "pg/timetz@1";
23
23
  const PG_INTERVAL_CODEC_ID = "pg/interval@1";
24
24
  const PG_JSON_CODEC_ID = "pg/json@1";
25
25
  const PG_JSONB_CODEC_ID = "pg/jsonb@1";
26
+ const PG_BYTEA_CODEC_ID = "pg/bytea@1";
26
27
 
27
28
  //#endregion
28
- export { SQL_CHAR_CODEC_ID as C, SQL_TIMESTAMP_CODEC_ID as D, SQL_TEXT_CODEC_ID as E, SQL_VARCHAR_CODEC_ID as O, PG_VARCHAR_CODEC_ID as S, SQL_INT_CODEC_ID as T, PG_TIMESTAMPTZ_CODEC_ID as _, PG_FLOAT4_CODEC_ID as a, PG_TIME_CODEC_ID as b, PG_INT2_CODEC_ID as c, PG_INTERVAL_CODEC_ID as d, PG_INT_CODEC_ID as f, PG_TEXT_CODEC_ID as g, PG_NUMERIC_CODEC_ID as h, PG_ENUM_CODEC_ID as i, PG_INT4_CODEC_ID as l, PG_JSON_CODEC_ID as m, PG_BOOL_CODEC_ID as n, PG_FLOAT8_CODEC_ID as o, PG_JSONB_CODEC_ID as p, PG_CHAR_CODEC_ID as r, PG_FLOAT_CODEC_ID as s, PG_BIT_CODEC_ID as t, PG_INT8_CODEC_ID as u, PG_TIMESTAMP_CODEC_ID as v, SQL_FLOAT_CODEC_ID as w, PG_VARBIT_CODEC_ID as x, PG_TIMETZ_CODEC_ID as y };
29
- //# sourceMappingURL=codec-ids-CojIXVf9.mjs.map
29
+ export { PG_VARCHAR_CODEC_ID as C, SQL_TEXT_CODEC_ID as D, SQL_INT_CODEC_ID as E, SQL_TIMESTAMP_CODEC_ID as O, PG_VARBIT_CODEC_ID as S, SQL_FLOAT_CODEC_ID as T, PG_TEXT_CODEC_ID as _, PG_ENUM_CODEC_ID as a, PG_TIMETZ_CODEC_ID as b, PG_FLOAT_CODEC_ID as c, PG_INT8_CODEC_ID as d, PG_INTERVAL_CODEC_ID as f, PG_NUMERIC_CODEC_ID as g, PG_JSON_CODEC_ID as h, PG_CHAR_CODEC_ID as i, SQL_VARCHAR_CODEC_ID as k, PG_INT2_CODEC_ID as l, PG_JSONB_CODEC_ID as m, PG_BOOL_CODEC_ID as n, PG_FLOAT4_CODEC_ID as o, PG_INT_CODEC_ID as p, PG_BYTEA_CODEC_ID as r, PG_FLOAT8_CODEC_ID as s, PG_BIT_CODEC_ID as t, PG_INT4_CODEC_ID as u, PG_TIMESTAMPTZ_CODEC_ID as v, SQL_CHAR_CODEC_ID as w, PG_TIME_CODEC_ID as x, PG_TIMESTAMP_CODEC_ID as y };
30
+ //# sourceMappingURL=codec-ids-ckQX9Kcg.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"codec-ids-CojIXVf9.mjs","names":[],"sources":["../src/core/codec-ids.ts"],"sourcesContent":["export {\n SQL_CHAR_CODEC_ID,\n SQL_FLOAT_CODEC_ID,\n SQL_INT_CODEC_ID,\n SQL_TEXT_CODEC_ID,\n SQL_TIMESTAMP_CODEC_ID,\n SQL_VARCHAR_CODEC_ID,\n} from '@prisma-next/sql-relational-core/ast';\nexport const PG_TEXT_CODEC_ID = 'pg/text@1' as const;\nexport const PG_ENUM_CODEC_ID = 'pg/enum@1' as const;\nexport const PG_CHAR_CODEC_ID = 'pg/char@1' as const;\nexport const PG_VARCHAR_CODEC_ID = 'pg/varchar@1' as const;\nexport const PG_INT_CODEC_ID = 'pg/int@1' as const;\nexport const PG_INT2_CODEC_ID = 'pg/int2@1' as const;\nexport const PG_INT4_CODEC_ID = 'pg/int4@1' as const;\nexport const PG_INT8_CODEC_ID = 'pg/int8@1' as const;\nexport const PG_FLOAT_CODEC_ID = 'pg/float@1' as const;\nexport const PG_FLOAT4_CODEC_ID = 'pg/float4@1' as const;\nexport const PG_FLOAT8_CODEC_ID = 'pg/float8@1' as const;\nexport const PG_NUMERIC_CODEC_ID = 'pg/numeric@1' as const;\nexport const PG_BOOL_CODEC_ID = 'pg/bool@1' as const;\nexport const PG_BIT_CODEC_ID = 'pg/bit@1' as const;\nexport const PG_VARBIT_CODEC_ID = 'pg/varbit@1' as const;\nexport const PG_TIMESTAMP_CODEC_ID = 'pg/timestamp@1' as const;\nexport const PG_TIMESTAMPTZ_CODEC_ID = 'pg/timestamptz@1' as const;\nexport const PG_TIME_CODEC_ID = 'pg/time@1' as const;\nexport const PG_TIMETZ_CODEC_ID = 'pg/timetz@1' as const;\nexport const PG_INTERVAL_CODEC_ID = 'pg/interval@1' as const;\nexport const PG_JSON_CODEC_ID = 'pg/json@1' as const;\nexport const PG_JSONB_CODEC_ID = 'pg/jsonb@1' as const;\n"],"mappings":";;;AAQA,MAAa,mBAAmB;AAChC,MAAa,mBAAmB;AAChC,MAAa,mBAAmB;AAChC,MAAa,sBAAsB;AACnC,MAAa,kBAAkB;AAC/B,MAAa,mBAAmB;AAChC,MAAa,mBAAmB;AAChC,MAAa,mBAAmB;AAChC,MAAa,oBAAoB;AACjC,MAAa,qBAAqB;AAClC,MAAa,qBAAqB;AAClC,MAAa,sBAAsB;AACnC,MAAa,mBAAmB;AAChC,MAAa,kBAAkB;AAC/B,MAAa,qBAAqB;AAClC,MAAa,wBAAwB;AACrC,MAAa,0BAA0B;AACvC,MAAa,mBAAmB;AAChC,MAAa,qBAAqB;AAClC,MAAa,uBAAuB;AACpC,MAAa,mBAAmB;AAChC,MAAa,oBAAoB"}
1
+ {"version":3,"file":"codec-ids-ckQX9Kcg.mjs","names":[],"sources":["../src/core/codec-ids.ts"],"sourcesContent":["export {\n SQL_CHAR_CODEC_ID,\n SQL_FLOAT_CODEC_ID,\n SQL_INT_CODEC_ID,\n SQL_TEXT_CODEC_ID,\n SQL_TIMESTAMP_CODEC_ID,\n SQL_VARCHAR_CODEC_ID,\n} from '@prisma-next/sql-relational-core/ast';\nexport const PG_TEXT_CODEC_ID = 'pg/text@1' as const;\nexport const PG_ENUM_CODEC_ID = 'pg/enum@1' as const;\nexport const PG_CHAR_CODEC_ID = 'pg/char@1' as const;\nexport const PG_VARCHAR_CODEC_ID = 'pg/varchar@1' as const;\nexport const PG_INT_CODEC_ID = 'pg/int@1' as const;\nexport const PG_INT2_CODEC_ID = 'pg/int2@1' as const;\nexport const PG_INT4_CODEC_ID = 'pg/int4@1' as const;\nexport const PG_INT8_CODEC_ID = 'pg/int8@1' as const;\nexport const PG_FLOAT_CODEC_ID = 'pg/float@1' as const;\nexport const PG_FLOAT4_CODEC_ID = 'pg/float4@1' as const;\nexport const PG_FLOAT8_CODEC_ID = 'pg/float8@1' as const;\nexport const PG_NUMERIC_CODEC_ID = 'pg/numeric@1' as const;\nexport const PG_BOOL_CODEC_ID = 'pg/bool@1' as const;\nexport const PG_BIT_CODEC_ID = 'pg/bit@1' as const;\nexport const PG_VARBIT_CODEC_ID = 'pg/varbit@1' as const;\nexport const PG_TIMESTAMP_CODEC_ID = 'pg/timestamp@1' as const;\nexport const PG_TIMESTAMPTZ_CODEC_ID = 'pg/timestamptz@1' as const;\nexport const PG_TIME_CODEC_ID = 'pg/time@1' as const;\nexport const PG_TIMETZ_CODEC_ID = 'pg/timetz@1' as const;\nexport const PG_INTERVAL_CODEC_ID = 'pg/interval@1' as const;\nexport const PG_JSON_CODEC_ID = 'pg/json@1' as const;\nexport const PG_JSONB_CODEC_ID = 'pg/jsonb@1' as const;\nexport const PG_BYTEA_CODEC_ID = 'pg/bytea@1' as const;\n"],"mappings":";;;AAQA,MAAa,mBAAmB;AAChC,MAAa,mBAAmB;AAChC,MAAa,mBAAmB;AAChC,MAAa,sBAAsB;AACnC,MAAa,kBAAkB;AAC/B,MAAa,mBAAmB;AAChC,MAAa,mBAAmB;AAChC,MAAa,mBAAmB;AAChC,MAAa,oBAAoB;AACjC,MAAa,qBAAqB;AAClC,MAAa,qBAAqB;AAClC,MAAa,sBAAsB;AACnC,MAAa,mBAAmB;AAChC,MAAa,kBAAkB;AAC/B,MAAa,qBAAqB;AAClC,MAAa,wBAAwB;AACrC,MAAa,0BAA0B;AACvC,MAAa,mBAAmB;AAChC,MAAa,qBAAqB;AAClC,MAAa,uBAAuB;AACpC,MAAa,mBAAmB;AAChC,MAAa,oBAAoB;AACjC,MAAa,oBAAoB"}
@@ -23,6 +23,7 @@ declare const PG_TIMETZ_CODEC_ID: "pg/timetz@1";
23
23
  declare const PG_INTERVAL_CODEC_ID: "pg/interval@1";
24
24
  declare const PG_JSON_CODEC_ID: "pg/json@1";
25
25
  declare const PG_JSONB_CODEC_ID: "pg/jsonb@1";
26
+ declare const PG_BYTEA_CODEC_ID: "pg/bytea@1";
26
27
  //#endregion
27
- export { PG_BIT_CODEC_ID, PG_BOOL_CODEC_ID, PG_CHAR_CODEC_ID, PG_ENUM_CODEC_ID, PG_FLOAT4_CODEC_ID, PG_FLOAT8_CODEC_ID, PG_FLOAT_CODEC_ID, PG_INT2_CODEC_ID, PG_INT4_CODEC_ID, PG_INT8_CODEC_ID, PG_INTERVAL_CODEC_ID, PG_INT_CODEC_ID, PG_JSONB_CODEC_ID, PG_JSON_CODEC_ID, PG_NUMERIC_CODEC_ID, PG_TEXT_CODEC_ID, PG_TIMESTAMPTZ_CODEC_ID, PG_TIMESTAMP_CODEC_ID, PG_TIMETZ_CODEC_ID, PG_TIME_CODEC_ID, PG_VARBIT_CODEC_ID, PG_VARCHAR_CODEC_ID, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_TIMESTAMP_CODEC_ID, SQL_VARCHAR_CODEC_ID };
28
+ export { PG_BIT_CODEC_ID, PG_BOOL_CODEC_ID, PG_BYTEA_CODEC_ID, PG_CHAR_CODEC_ID, PG_ENUM_CODEC_ID, PG_FLOAT4_CODEC_ID, PG_FLOAT8_CODEC_ID, PG_FLOAT_CODEC_ID, PG_INT2_CODEC_ID, PG_INT4_CODEC_ID, PG_INT8_CODEC_ID, PG_INTERVAL_CODEC_ID, PG_INT_CODEC_ID, PG_JSONB_CODEC_ID, PG_JSON_CODEC_ID, PG_NUMERIC_CODEC_ID, PG_TEXT_CODEC_ID, PG_TIMESTAMPTZ_CODEC_ID, PG_TIMESTAMP_CODEC_ID, PG_TIMETZ_CODEC_ID, PG_TIME_CODEC_ID, PG_VARBIT_CODEC_ID, PG_VARCHAR_CODEC_ID, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_TIMESTAMP_CODEC_ID, SQL_VARCHAR_CODEC_ID };
28
29
  //# sourceMappingURL=codec-ids.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codec-ids.d.mts","names":[],"sources":["../src/core/codec-ids.ts"],"sour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AA;AACrC,cAEA,uBAF2C,EAAA,kBAAA;AAC3C,cAEA,gBAFiD,EAAA,WAAA;AACjD,cAEA,kBAFqD,EAAA,aAAA;AACrD,cAEA,oBAFuC,EAAA,eAAA;AACvC,cAEA,gBAF2C,EAAA,WAAA;AAC3C,cAEA,iBAF+C,EAAA,YAAA;AAC/C,cAEA,iBAFuC,EAAA,YAAA"}
@@ -1,3 +1,3 @@
1
- import { C as SQL_CHAR_CODEC_ID, D as SQL_TIMESTAMP_CODEC_ID, E as SQL_TEXT_CODEC_ID, O as SQL_VARCHAR_CODEC_ID, S as PG_VARCHAR_CODEC_ID, T as SQL_INT_CODEC_ID, _ as PG_TIMESTAMPTZ_CODEC_ID, a as PG_FLOAT4_CODEC_ID, b as PG_TIME_CODEC_ID, c as PG_INT2_CODEC_ID, d as PG_INTERVAL_CODEC_ID, f as PG_INT_CODEC_ID, g as PG_TEXT_CODEC_ID, h as PG_NUMERIC_CODEC_ID, i as PG_ENUM_CODEC_ID, l as PG_INT4_CODEC_ID, m as PG_JSON_CODEC_ID, n as PG_BOOL_CODEC_ID, o as PG_FLOAT8_CODEC_ID, p as PG_JSONB_CODEC_ID, r as PG_CHAR_CODEC_ID, s as PG_FLOAT_CODEC_ID, t as PG_BIT_CODEC_ID, u as PG_INT8_CODEC_ID, v as PG_TIMESTAMP_CODEC_ID, w as SQL_FLOAT_CODEC_ID, x as PG_VARBIT_CODEC_ID, y as PG_TIMETZ_CODEC_ID } from "./codec-ids-CojIXVf9.mjs";
1
+ import { C as PG_VARCHAR_CODEC_ID, D as SQL_TEXT_CODEC_ID, E as SQL_INT_CODEC_ID, O as SQL_TIMESTAMP_CODEC_ID, S as PG_VARBIT_CODEC_ID, T as SQL_FLOAT_CODEC_ID, _ as PG_TEXT_CODEC_ID, a as PG_ENUM_CODEC_ID, b as PG_TIMETZ_CODEC_ID, c as PG_FLOAT_CODEC_ID, d as PG_INT8_CODEC_ID, f as PG_INTERVAL_CODEC_ID, g as PG_NUMERIC_CODEC_ID, h as PG_JSON_CODEC_ID, i as PG_CHAR_CODEC_ID, k as SQL_VARCHAR_CODEC_ID, l as PG_INT2_CODEC_ID, m as PG_JSONB_CODEC_ID, n as PG_BOOL_CODEC_ID, o as PG_FLOAT4_CODEC_ID, p as PG_INT_CODEC_ID, r as PG_BYTEA_CODEC_ID, s as PG_FLOAT8_CODEC_ID, t as PG_BIT_CODEC_ID, u as PG_INT4_CODEC_ID, v as PG_TIMESTAMPTZ_CODEC_ID, w as SQL_CHAR_CODEC_ID, x as PG_TIME_CODEC_ID, y as PG_TIMESTAMP_CODEC_ID } from "./codec-ids-ckQX9Kcg.mjs";
2
2
 
3
- export { PG_BIT_CODEC_ID, PG_BOOL_CODEC_ID, PG_CHAR_CODEC_ID, PG_ENUM_CODEC_ID, PG_FLOAT4_CODEC_ID, PG_FLOAT8_CODEC_ID, PG_FLOAT_CODEC_ID, PG_INT2_CODEC_ID, PG_INT4_CODEC_ID, PG_INT8_CODEC_ID, PG_INTERVAL_CODEC_ID, PG_INT_CODEC_ID, PG_JSONB_CODEC_ID, PG_JSON_CODEC_ID, PG_NUMERIC_CODEC_ID, PG_TEXT_CODEC_ID, PG_TIMESTAMPTZ_CODEC_ID, PG_TIMESTAMP_CODEC_ID, PG_TIMETZ_CODEC_ID, PG_TIME_CODEC_ID, PG_VARBIT_CODEC_ID, PG_VARCHAR_CODEC_ID, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_TIMESTAMP_CODEC_ID, SQL_VARCHAR_CODEC_ID };
3
+ export { PG_BIT_CODEC_ID, PG_BOOL_CODEC_ID, PG_BYTEA_CODEC_ID, PG_CHAR_CODEC_ID, PG_ENUM_CODEC_ID, PG_FLOAT4_CODEC_ID, PG_FLOAT8_CODEC_ID, PG_FLOAT_CODEC_ID, PG_INT2_CODEC_ID, PG_INT4_CODEC_ID, PG_INT8_CODEC_ID, PG_INTERVAL_CODEC_ID, PG_INT_CODEC_ID, PG_JSONB_CODEC_ID, PG_JSON_CODEC_ID, PG_NUMERIC_CODEC_ID, PG_TEXT_CODEC_ID, PG_TIMESTAMPTZ_CODEC_ID, PG_TIMESTAMP_CODEC_ID, PG_TIMETZ_CODEC_ID, PG_TIME_CODEC_ID, PG_VARBIT_CODEC_ID, PG_VARCHAR_CODEC_ID, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_TIMESTAMP_CODEC_ID, SQL_VARCHAR_CODEC_ID };
@@ -1,4 +1,4 @@
1
- import { r as dataTypes, t as CodecTypes$1 } from "./codecs-D-F2KJqt.mjs";
1
+ import { r as dataTypes, t as CodecTypes$1 } from "./codecs-B03dFv94.mjs";
2
2
  import { JsonValue } from "@prisma-next/contract/types";
3
3
 
4
4
  //#region src/exports/codec-types.d.ts
@@ -1,3 +1,4 @@
1
- import { n as dataTypes } from "./codecs-BoahtY_Q.mjs";
1
+ import "./codec-ids-ckQX9Kcg.mjs";
2
+ import { n as dataTypes } from "./codecs-D0oXyJIH.mjs";
2
3
 
3
4
  export { dataTypes };
@@ -10,9 +10,7 @@ declare const codecs: _prisma_next_sql_relational_core_ast0.CodecDefBuilder<{
10
10
  int: Codec<"sql/int@1", readonly ["equality", "order", "numeric"], number, number, Record<string, unknown>, unknown>;
11
11
  float: Codec<"sql/float@1", readonly ["equality", "order", "numeric"], number, number, Record<string, unknown>, unknown>;
12
12
  "sql-text": Codec<"sql/text@1", readonly ["equality", "order", "textual"], string, string, Record<string, unknown>, unknown>;
13
- "sql-timestamp": Codec<"sql/timestamp@1", readonly ["equality", "order"], string, string, {
14
- precision?: number;
15
- }, unknown>;
13
+ "sql-timestamp": Codec<"sql/timestamp@1", readonly ["equality", "order"], Date, Date, Record<string, unknown>, unknown>;
16
14
  text: Codec<"pg/text@1", readonly ["equality", "order", "textual"], string, string, Record<string, unknown>, unknown>;
17
15
  character: Codec<"pg/char@1", readonly ["equality", "order", "textual"], string, string, Record<string, unknown>, unknown>;
18
16
  "character varying": Codec<"pg/varchar@1", readonly ["equality", "order", "textual"], string, string, Record<string, unknown>, unknown>;
@@ -24,17 +22,26 @@ declare const codecs: _prisma_next_sql_relational_core_ast0.CodecDefBuilder<{
24
22
  float4: Codec<"pg/float4@1", readonly ["equality", "order", "numeric"], number, number, Record<string, unknown>, unknown>;
25
23
  float8: Codec<"pg/float8@1", readonly ["equality", "order", "numeric"], number, number, Record<string, unknown>, unknown>;
26
24
  numeric: Codec<"pg/numeric@1", readonly ["equality", "order", "numeric"], string, string, Record<string, unknown>, unknown>;
27
- timestamp: Codec<"pg/timestamp@1", readonly ["equality", "order"], string | Date, string | Date, Record<string, unknown>, unknown>;
28
- timestamptz: Codec<"pg/timestamptz@1", readonly ["equality", "order"], string | Date, string | Date, Record<string, unknown>, unknown>;
25
+ timestamp: Codec<"pg/timestamp@1", readonly ["equality", "order"], Date, Date, Record<string, unknown>, unknown>;
26
+ timestamptz: Codec<"pg/timestamptz@1", readonly ["equality", "order"], Date, Date, Record<string, unknown>, unknown>;
29
27
  time: Codec<"pg/time@1", readonly ["equality", "order"], string, string, Record<string, unknown>, unknown>;
30
28
  timetz: Codec<"pg/timetz@1", readonly ["equality", "order"], string, string, Record<string, unknown>, unknown>;
31
29
  bool: Codec<"pg/bool@1", readonly ["equality", "boolean"], boolean, boolean, Record<string, unknown>, unknown>;
32
30
  bit: Codec<"pg/bit@1", readonly ["equality", "order"], string, string, Record<string, unknown>, unknown>;
33
31
  "bit varying": Codec<"pg/varbit@1", readonly ["equality", "order"], string, string, Record<string, unknown>, unknown>;
32
+ bytea: Codec<"pg/bytea@1", readonly ["equality"], Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>, Record<string, unknown>, unknown>;
34
33
  interval: Codec<"pg/interval@1", readonly ["equality", "order"], string | Record<string, unknown>, string, Record<string, unknown>, unknown>;
35
34
  enum: Codec<"pg/enum@1", readonly ["equality", "order"], string, string, Record<string, unknown>, unknown>;
36
- json: Codec<"pg/json@1", readonly [], string, JsonValue, Record<string, unknown>, unknown>;
37
- } & Record<"jsonb", Codec<"pg/jsonb@1", readonly ["equality"], string, JsonValue, Record<string, unknown>, unknown>>>;
35
+ json: Codec<"pg/json@1", readonly [], string | number | boolean | {
36
+ readonly [key: string]: JsonValue;
37
+ } | readonly JsonValue[] | null, string | number | boolean | {
38
+ readonly [key: string]: JsonValue;
39
+ } | readonly JsonValue[] | null, Record<string, unknown>, unknown>;
40
+ } & Record<"jsonb", Codec<"pg/jsonb@1", readonly ["equality"], string | number | boolean | {
41
+ readonly [key: string]: JsonValue;
42
+ } | readonly JsonValue[] | null, string | number | boolean | {
43
+ readonly [key: string]: JsonValue;
44
+ } | readonly JsonValue[] | null, Record<string, unknown>, unknown>>>;
38
45
  declare const codecDefinitions: {
39
46
  readonly char: {
40
47
  readonly typeId: "sql/char@1";
@@ -79,12 +86,10 @@ declare const codecDefinitions: {
79
86
  readonly "sql-timestamp": {
80
87
  readonly typeId: "sql/timestamp@1";
81
88
  readonly scalar: "sql-timestamp";
82
- readonly codec: Codec<"sql/timestamp@1", readonly ["equality", "order"], string, string, {
83
- precision?: number;
84
- }, unknown>;
85
- readonly input: string;
86
- readonly output: string;
87
- readonly jsType: string;
89
+ readonly codec: Codec<"sql/timestamp@1", readonly ["equality", "order"], Date, Date, Record<string, unknown>, unknown>;
90
+ readonly input: Date;
91
+ readonly output: Date;
92
+ readonly jsType: Date;
88
93
  };
89
94
  readonly text: {
90
95
  readonly typeId: "pg/text@1";
@@ -177,18 +182,18 @@ declare const codecDefinitions: {
177
182
  readonly timestamp: {
178
183
  readonly typeId: "pg/timestamp@1";
179
184
  readonly scalar: "timestamp";
180
- readonly codec: Codec<"pg/timestamp@1", readonly ["equality", "order"], string | Date, string | Date, Record<string, unknown>, unknown>;
181
- readonly input: string | Date;
182
- readonly output: string | Date;
183
- readonly jsType: string | Date;
185
+ readonly codec: Codec<"pg/timestamp@1", readonly ["equality", "order"], Date, Date, Record<string, unknown>, unknown>;
186
+ readonly input: Date;
187
+ readonly output: Date;
188
+ readonly jsType: Date;
184
189
  };
185
190
  readonly timestamptz: {
186
191
  readonly typeId: "pg/timestamptz@1";
187
192
  readonly scalar: "timestamptz";
188
- readonly codec: Codec<"pg/timestamptz@1", readonly ["equality", "order"], string | Date, string | Date, Record<string, unknown>, unknown>;
189
- readonly input: string | Date;
190
- readonly output: string | Date;
191
- readonly jsType: string | Date;
193
+ readonly codec: Codec<"pg/timestamptz@1", readonly ["equality", "order"], Date, Date, Record<string, unknown>, unknown>;
194
+ readonly input: Date;
195
+ readonly output: Date;
196
+ readonly jsType: Date;
192
197
  };
193
198
  readonly time: {
194
199
  readonly typeId: "pg/time@1";
@@ -230,6 +235,14 @@ declare const codecDefinitions: {
230
235
  readonly output: string;
231
236
  readonly jsType: string;
232
237
  };
238
+ readonly bytea: {
239
+ readonly typeId: "pg/bytea@1";
240
+ readonly scalar: "bytea";
241
+ readonly codec: Codec<"pg/bytea@1", readonly ["equality"], Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>, Record<string, unknown>, unknown>;
242
+ readonly input: Uint8Array<ArrayBufferLike>;
243
+ readonly output: Uint8Array<ArrayBufferLike>;
244
+ readonly jsType: Uint8Array<ArrayBufferLike>;
245
+ };
233
246
  readonly interval: {
234
247
  readonly typeId: "pg/interval@1";
235
248
  readonly scalar: "interval";
@@ -249,18 +262,38 @@ declare const codecDefinitions: {
249
262
  readonly json: {
250
263
  readonly typeId: "pg/json@1";
251
264
  readonly scalar: "json";
252
- readonly codec: Codec<"pg/json@1", readonly [], string, JsonValue, Record<string, unknown>, unknown>;
253
- readonly input: JsonValue;
254
- readonly output: JsonValue;
255
- readonly jsType: JsonValue;
265
+ readonly codec: Codec<"pg/json@1", readonly [], string | number | boolean | {
266
+ readonly [key: string]: JsonValue;
267
+ } | readonly JsonValue[] | null, string | number | boolean | {
268
+ readonly [key: string]: JsonValue;
269
+ } | readonly JsonValue[] | null, Record<string, unknown>, unknown>;
270
+ readonly input: string | number | boolean | {
271
+ readonly [key: string]: JsonValue;
272
+ } | readonly JsonValue[] | null;
273
+ readonly output: string | number | boolean | {
274
+ readonly [key: string]: JsonValue;
275
+ } | readonly JsonValue[] | null;
276
+ readonly jsType: string | number | boolean | {
277
+ readonly [key: string]: JsonValue;
278
+ } | readonly JsonValue[] | null;
256
279
  };
257
280
  readonly jsonb: {
258
281
  readonly typeId: "pg/jsonb@1";
259
282
  readonly scalar: "jsonb";
260
- readonly codec: Codec<"pg/jsonb@1", readonly ["equality"], string, JsonValue, Record<string, unknown>, unknown>;
261
- readonly input: JsonValue;
262
- readonly output: JsonValue;
263
- readonly jsType: JsonValue;
283
+ readonly codec: Codec<"pg/jsonb@1", readonly ["equality"], string | number | boolean | {
284
+ readonly [key: string]: JsonValue;
285
+ } | readonly JsonValue[] | null, string | number | boolean | {
286
+ readonly [key: string]: JsonValue;
287
+ } | readonly JsonValue[] | null, Record<string, unknown>, unknown>;
288
+ readonly input: string | number | boolean | {
289
+ readonly [key: string]: JsonValue;
290
+ } | readonly JsonValue[] | null;
291
+ readonly output: string | number | boolean | {
292
+ readonly [key: string]: JsonValue;
293
+ } | readonly JsonValue[] | null;
294
+ readonly jsType: string | number | boolean | {
295
+ readonly [key: string]: JsonValue;
296
+ } | readonly JsonValue[] | null;
264
297
  };
265
298
  };
266
299
  declare const dataTypes: {
@@ -288,6 +321,7 @@ declare const dataTypes: {
288
321
  readonly bool: "pg/bool@1";
289
322
  readonly bit: "pg/bit@1";
290
323
  readonly "bit varying": "pg/varbit@1";
324
+ readonly bytea: "pg/bytea@1";
291
325
  readonly interval: "pg/interval@1";
292
326
  readonly enum: "pg/enum@1";
293
327
  readonly json: "pg/json@1";
@@ -296,4 +330,4 @@ declare const dataTypes: {
296
330
  type CodecTypes = typeof codecs.CodecTypes;
297
331
  //#endregion
298
332
  export { codecDefinitions as n, dataTypes as r, CodecTypes as t };
299
- //# sourceMappingURL=codecs-D-F2KJqt.d.mts.map
333
+ //# sourceMappingURL=codecs-B03dFv94.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codecs-B03dFv94.d.mts","names":[],"sources":["../src/core/codecs.ts"],"sourcesContent":[],"mappings":";;;;;;cA8mBM,8CAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgCC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAhCD,SAAA,UAAA,EAAA;IAgCC,SAAA,MAA0C,EAAA,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAC1C,SAA4B,KAAA,OAAA,CAAA,gBAAA,EAAA,SAAA,CAAA,UAAA,EAAA,OAAA,CAAA,MAAA,MAAA,QAAA,CAAA,MAAA,EAAA,OAAA,CAAA,EAAA,OAAA,CAAA;IAE7B,SAAU,KAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAFT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAED,UAAA,UAAoB,MAAA,CAAO"}
@@ -1,80 +1,8 @@
1
- import { S as PG_VARCHAR_CODEC_ID, _ as PG_TIMESTAMPTZ_CODEC_ID, a as PG_FLOAT4_CODEC_ID, b as PG_TIME_CODEC_ID, c as PG_INT2_CODEC_ID, d as PG_INTERVAL_CODEC_ID, f as PG_INT_CODEC_ID, g as PG_TEXT_CODEC_ID, h as PG_NUMERIC_CODEC_ID, i as PG_ENUM_CODEC_ID, l as PG_INT4_CODEC_ID, m as PG_JSON_CODEC_ID, n as PG_BOOL_CODEC_ID, o as PG_FLOAT8_CODEC_ID, p as PG_JSONB_CODEC_ID, r as PG_CHAR_CODEC_ID, s as PG_FLOAT_CODEC_ID, t as PG_BIT_CODEC_ID, u as PG_INT8_CODEC_ID, v as PG_TIMESTAMP_CODEC_ID, x as PG_VARBIT_CODEC_ID, y as PG_TIMETZ_CODEC_ID } from "./codec-ids-CojIXVf9.mjs";
1
+ import { C as PG_VARCHAR_CODEC_ID, S as PG_VARBIT_CODEC_ID, _ as PG_TEXT_CODEC_ID, a as PG_ENUM_CODEC_ID, b as PG_TIMETZ_CODEC_ID, c as PG_FLOAT_CODEC_ID, d as PG_INT8_CODEC_ID, f as PG_INTERVAL_CODEC_ID, g as PG_NUMERIC_CODEC_ID, h as PG_JSON_CODEC_ID, i as PG_CHAR_CODEC_ID, l as PG_INT2_CODEC_ID, m as PG_JSONB_CODEC_ID, n as PG_BOOL_CODEC_ID, o as PG_FLOAT4_CODEC_ID, p as PG_INT_CODEC_ID, r as PG_BYTEA_CODEC_ID, s as PG_FLOAT8_CODEC_ID, t as PG_BIT_CODEC_ID, u as PG_INT4_CODEC_ID, v as PG_TIMESTAMPTZ_CODEC_ID, x as PG_TIME_CODEC_ID, y as PG_TIMESTAMP_CODEC_ID } from "./codec-ids-ckQX9Kcg.mjs";
2
2
  import { codec, defineCodecs, sqlCodecDefinitions } from "@prisma-next/sql-relational-core/ast";
3
3
  import { ifDefined } from "@prisma-next/utils/defined";
4
4
  import { type } from "arktype";
5
5
 
6
- //#region src/core/json-schema-type-expression.ts
7
- const MAX_DEPTH = 32;
8
- function isRecord(value) {
9
- return typeof value === "object" && value !== null;
10
- }
11
- function escapeStringLiteral(str) {
12
- return str.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/\n/g, "\\n").replace(/\r/g, "\\r");
13
- }
14
- function quotePropertyKey(key) {
15
- return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(key) ? key : `'${escapeStringLiteral(key)}'`;
16
- }
17
- function renderLiteral(value) {
18
- if (typeof value === "string") return `'${escapeStringLiteral(value)}'`;
19
- if (typeof value === "number" || typeof value === "boolean") return String(value);
20
- if (value === null) return "null";
21
- return "unknown";
22
- }
23
- function renderUnion(items, depth) {
24
- return items.map((item) => render(item, depth)).join(" | ");
25
- }
26
- function renderObjectType(schema, depth) {
27
- const properties = isRecord(schema["properties"]) ? schema["properties"] : {};
28
- const required = Array.isArray(schema["required"]) ? new Set(schema["required"].filter((key) => typeof key === "string")) : /* @__PURE__ */ new Set();
29
- const keys = Object.keys(properties).sort((left, right) => left.localeCompare(right));
30
- if (keys.length === 0) {
31
- const additionalProperties = schema["additionalProperties"];
32
- if (additionalProperties === true || additionalProperties === void 0) return "Record<string, unknown>";
33
- return `Record<string, ${render(additionalProperties, depth)}>`;
34
- }
35
- return `{ ${keys.map((key) => {
36
- const valueSchema = properties[key];
37
- const optionalMarker = required.has(key) ? "" : "?";
38
- return `${quotePropertyKey(key)}${optionalMarker}: ${render(valueSchema, depth)}`;
39
- }).join("; ")} }`;
40
- }
41
- function renderArrayType(schema, depth) {
42
- if (Array.isArray(schema["items"])) return `readonly [${schema["items"].map((item) => render(item, depth)).join(", ")}]`;
43
- if (schema["items"] !== void 0) {
44
- const itemType = render(schema["items"], depth);
45
- return itemType.includes(" | ") || itemType.includes(" & ") ? `(${itemType})[]` : `${itemType}[]`;
46
- }
47
- return "unknown[]";
48
- }
49
- function render(schema, depth) {
50
- if (depth > MAX_DEPTH || !isRecord(schema)) return "JsonValue";
51
- const nextDepth = depth + 1;
52
- if ("const" in schema) return renderLiteral(schema["const"]);
53
- if (Array.isArray(schema["enum"])) return schema["enum"].map((value) => renderLiteral(value)).join(" | ");
54
- if (Array.isArray(schema["oneOf"])) return renderUnion(schema["oneOf"], nextDepth);
55
- if (Array.isArray(schema["anyOf"])) return renderUnion(schema["anyOf"], nextDepth);
56
- if (Array.isArray(schema["allOf"])) return schema["allOf"].map((item) => render(item, nextDepth)).join(" & ");
57
- if (Array.isArray(schema["type"])) return schema["type"].map((item) => render({
58
- ...schema,
59
- type: item
60
- }, nextDepth)).join(" | ");
61
- switch (schema["type"]) {
62
- case "string": return "string";
63
- case "number":
64
- case "integer": return "number";
65
- case "boolean": return "boolean";
66
- case "null": return "null";
67
- case "array": return renderArrayType(schema, nextDepth);
68
- case "object": return renderObjectType(schema, nextDepth);
69
- default: break;
70
- }
71
- return "JsonValue";
72
- }
73
- function renderTypeScriptTypeFromJsonSchema(schema) {
74
- return render(schema, 0);
75
- }
76
-
77
- //#endregion
78
6
  //#region src/core/codecs.ts
79
7
  const lengthParamsSchema = type({ length: "number.integer > 0" });
80
8
  const numericParamsSchema = type({
@@ -94,13 +22,6 @@ function renderPrecision(typeName, typeParams) {
94
22
  if (typeof precision !== "number" || !Number.isFinite(precision) || !Number.isInteger(precision)) throw new Error(`renderOutputType: expected integer "precision" in typeParams for ${typeName}, got ${String(precision)}`);
95
23
  return `${typeName}<${precision}>`;
96
24
  }
97
- function renderJsonOutputType(typeParams) {
98
- const typeName = typeParams["type"];
99
- if (typeof typeName === "string" && typeName.trim().length > 0) return typeName.trim();
100
- const schema = typeParams["schemaJson"];
101
- if (schema && typeof schema === "object") return renderTypeScriptTypeFromJsonSchema(schema);
102
- throw new Error(`renderOutputType: JSON codec typeParams must contain "type" (string) or "schemaJson" (object), got keys: ${Object.keys(typeParams).join(", ")}`);
103
- }
104
25
  function aliasCodec(base, options) {
105
26
  return {
106
27
  id: options.typeId,
@@ -241,16 +162,9 @@ const pgTimestampCodec = codec({
241
162
  typeId: PG_TIMESTAMP_CODEC_ID,
242
163
  targetTypes: ["timestamp"],
243
164
  traits: ["equality", "order"],
244
- encode: (value) => {
245
- if (value instanceof Date) return value.toISOString();
246
- if (typeof value === "string") return value;
247
- return String(value);
248
- },
249
- decode: (wire) => {
250
- if (wire instanceof Date) return wire.toISOString();
251
- return wire;
252
- },
253
- encodeJson: (value) => value instanceof Date ? value.toISOString() : value,
165
+ encode: (value) => value,
166
+ decode: (wire) => wire,
167
+ encodeJson: (value) => value.toISOString(),
254
168
  decodeJson: (json) => {
255
169
  if (typeof json !== "string") throw new Error(`Expected ISO date string for pg/timestamp@1, got ${typeof json}`);
256
170
  const date = new Date(json);
@@ -265,16 +179,9 @@ const pgTimestamptzCodec = codec({
265
179
  typeId: PG_TIMESTAMPTZ_CODEC_ID,
266
180
  targetTypes: ["timestamptz"],
267
181
  traits: ["equality", "order"],
268
- encode: (value) => {
269
- if (value instanceof Date) return value.toISOString();
270
- if (typeof value === "string") return value;
271
- return String(value);
272
- },
273
- decode: (wire) => {
274
- if (wire instanceof Date) return wire.toISOString();
275
- return wire;
276
- },
277
- encodeJson: (value) => value instanceof Date ? value.toISOString() : value,
182
+ encode: (value) => value,
183
+ decode: (wire) => wire,
184
+ encodeJson: (value) => value.toISOString(),
278
185
  decodeJson: (json) => {
279
186
  if (typeof json !== "string") throw new Error(`Expected ISO date string for pg/timestamptz@1, got ${typeof json}`);
280
187
  const date = new Date(json);
@@ -333,6 +240,21 @@ const pgVarbitCodec = codec({
333
240
  renderOutputType: (typeParams) => renderLength("VarBit", typeParams),
334
241
  meta: { db: { sql: { postgres: { nativeType: "bit varying" } } } }
335
242
  });
243
+ const pgByteaCodec = codec({
244
+ typeId: PG_BYTEA_CODEC_ID,
245
+ targetTypes: ["bytea"],
246
+ traits: ["equality"],
247
+ encode: (value) => value,
248
+ decode: (wire) => wire instanceof Uint8Array && wire.constructor === Uint8Array ? wire : new Uint8Array(wire.buffer, wire.byteOffset, wire.byteLength),
249
+ encodeJson: (value) => Buffer.from(value).toString("base64"),
250
+ decodeJson: (json) => {
251
+ if (typeof json !== "string") throw new Error(`Expected base64 string for pg/bytea@1, got ${typeof json}`);
252
+ const decoded = Buffer.from(json, "base64");
253
+ if (decoded.toString("base64") !== json) throw new Error(`Invalid base64 string for pg/bytea@1 (length: ${json.length})`);
254
+ return new Uint8Array(decoded);
255
+ },
256
+ meta: { db: { sql: { postgres: { nativeType: "bytea" } } } }
257
+ });
336
258
  const pgEnumCodec = codec({
337
259
  typeId: PG_ENUM_CODEC_ID,
338
260
  targetTypes: ["enum"],
@@ -364,7 +286,6 @@ const pgJsonCodec = codec({
364
286
  traits: [],
365
287
  encode: (value) => JSON.stringify(value),
366
288
  decode: (wire) => typeof wire === "string" ? JSON.parse(wire) : wire,
367
- renderOutputType: renderJsonOutputType,
368
289
  meta: { db: { sql: { postgres: { nativeType: "json" } } } }
369
290
  });
370
291
  const pgJsonbCodec = codec({
@@ -373,13 +294,12 @@ const pgJsonbCodec = codec({
373
294
  traits: ["equality"],
374
295
  encode: (value) => JSON.stringify(value),
375
296
  decode: (wire) => typeof wire === "string" ? JSON.parse(wire) : wire,
376
- renderOutputType: renderJsonOutputType,
377
297
  meta: { db: { sql: { postgres: { nativeType: "jsonb" } } } }
378
298
  });
379
- const codecs = defineCodecs().add("char", sqlCharCodec).add("varchar", sqlVarcharCodec).add("int", sqlIntCodec).add("float", sqlFloatCodec).add("sql-text", sqlTextCodec).add("sql-timestamp", sqlTimestampCodec).add("text", pgTextCodec).add("character", pgCharCodec).add("character varying", pgVarcharCodec).add("integer", pgIntCodec).add("double precision", pgFloatCodec).add("int4", pgInt4Codec).add("int2", pgInt2Codec).add("int8", pgInt8Codec).add("float4", pgFloat4Codec).add("float8", pgFloat8Codec).add("numeric", pgNumericCodec).add("timestamp", pgTimestampCodec).add("timestamptz", pgTimestamptzCodec).add("time", pgTimeCodec).add("timetz", pgTimetzCodec).add("bool", pgBoolCodec).add("bit", pgBitCodec).add("bit varying", pgVarbitCodec).add("interval", pgIntervalCodec).add("enum", pgEnumCodec).add("json", pgJsonCodec).add("jsonb", pgJsonbCodec);
299
+ const codecs = defineCodecs().add("char", sqlCharCodec).add("varchar", sqlVarcharCodec).add("int", sqlIntCodec).add("float", sqlFloatCodec).add("sql-text", sqlTextCodec).add("sql-timestamp", sqlTimestampCodec).add("text", pgTextCodec).add("character", pgCharCodec).add("character varying", pgVarcharCodec).add("integer", pgIntCodec).add("double precision", pgFloatCodec).add("int4", pgInt4Codec).add("int2", pgInt2Codec).add("int8", pgInt8Codec).add("float4", pgFloat4Codec).add("float8", pgFloat8Codec).add("numeric", pgNumericCodec).add("timestamp", pgTimestampCodec).add("timestamptz", pgTimestamptzCodec).add("time", pgTimeCodec).add("timetz", pgTimetzCodec).add("bool", pgBoolCodec).add("bit", pgBitCodec).add("bit varying", pgVarbitCodec).add("bytea", pgByteaCodec).add("interval", pgIntervalCodec).add("enum", pgEnumCodec).add("json", pgJsonCodec).add("jsonb", pgJsonbCodec);
380
300
  const codecDefinitions = codecs.codecDefinitions;
381
301
  const dataTypes = codecs.dataTypes;
382
302
 
383
303
  //#endregion
384
304
  export { dataTypes as n, codecDefinitions as t };
385
- //# sourceMappingURL=codecs-BoahtY_Q.mjs.map
305
+ //# sourceMappingURL=codecs-D0oXyJIH.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codecs-D0oXyJIH.mjs","names":["arktype"],"sources":["../src/core/codecs.ts"],"sourcesContent":["/**\n * Unified codec definitions for Postgres adapter.\n *\n * This file contains a single source of truth for all codec information:\n * - Scalar names\n * - Type IDs\n * - Codec implementations (runtime)\n * - Type information (compile-time)\n *\n * This structure is used both at runtime (to populate the registry) and\n * at compile time (to derive CodecTypes).\n */\n\nimport type { JsonValue } from '@prisma-next/contract/types';\nimport type { Codec, CodecMeta, CodecTrait } from '@prisma-next/sql-relational-core/ast';\nimport { codec, defineCodecs, sqlCodecDefinitions } from '@prisma-next/sql-relational-core/ast';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport { type as arktype } from 'arktype';\nimport {\n PG_BIT_CODEC_ID,\n PG_BOOL_CODEC_ID,\n PG_BYTEA_CODEC_ID,\n PG_CHAR_CODEC_ID,\n PG_ENUM_CODEC_ID,\n PG_FLOAT_CODEC_ID,\n PG_FLOAT4_CODEC_ID,\n PG_FLOAT8_CODEC_ID,\n PG_INT_CODEC_ID,\n PG_INT2_CODEC_ID,\n PG_INT4_CODEC_ID,\n PG_INT8_CODEC_ID,\n PG_INTERVAL_CODEC_ID,\n PG_JSON_CODEC_ID,\n PG_JSONB_CODEC_ID,\n PG_NUMERIC_CODEC_ID,\n PG_TEXT_CODEC_ID,\n PG_TIME_CODEC_ID,\n PG_TIMESTAMP_CODEC_ID,\n PG_TIMESTAMPTZ_CODEC_ID,\n PG_TIMETZ_CODEC_ID,\n PG_VARBIT_CODEC_ID,\n PG_VARCHAR_CODEC_ID,\n} from './codec-ids';\n\nconst lengthParamsSchema = arktype({\n length: 'number.integer > 0',\n});\n\nconst numericParamsSchema = arktype({\n precision: 'number.integer > 0 & number.integer <= 1000',\n 'scale?': 'number.integer >= 0',\n});\n\nconst precisionParamsSchema = arktype({\n 'precision?': 'number.integer >= 0 & number.integer <= 6',\n});\n\nfunction renderLength(typeName: string, typeParams: Record<string, unknown>): string | undefined {\n const length = typeParams['length'];\n if (length === undefined) {\n return undefined;\n }\n if (typeof length !== 'number' || !Number.isFinite(length) || !Number.isInteger(length)) {\n throw new Error(\n `renderOutputType: expected integer \"length\" in typeParams for ${typeName}, got ${String(length)}`,\n );\n }\n return `${typeName}<${length}>`;\n}\n\nfunction renderPrecision(typeName: string, typeParams: Record<string, unknown>): string {\n const precision = typeParams['precision'];\n if (precision === undefined) {\n return typeName;\n }\n if (\n typeof precision !== 'number' ||\n !Number.isFinite(precision) ||\n !Number.isInteger(precision)\n ) {\n throw new Error(\n `renderOutputType: expected integer \"precision\" in typeParams for ${typeName}, got ${String(precision)}`,\n );\n }\n return `${typeName}<${precision}>`;\n}\n\n// Phase C: postgres' raw json/jsonb codecs no longer carry a\n// `renderOutputType` slot — the schema-typed JSON surface that drove\n// `typeParams: { schemaJson, type? }` retired in favor of the per-library\n// extension package (`@prisma-next/extension-arktype-json`). Untyped\n// json/jsonb columns have no typeParams; the framework emit path falls\n// through to the generic `CodecTypes['pg/jsonb@1']['output']` accessor\n// (which resolves to `JsonValue` via the codec-types map).\n\nfunction aliasCodec<\n Id extends string,\n TTraits extends readonly CodecTrait[],\n TWire,\n TJs,\n TParams,\n THelper,\n>(\n base: Codec<string, TTraits, TWire, TJs, TParams, THelper>,\n options: {\n readonly typeId: Id;\n readonly targetTypes: readonly string[];\n readonly meta?: CodecMeta;\n },\n): Codec<Id, TTraits, TWire, TJs, TParams, THelper> {\n return {\n id: options.typeId,\n targetTypes: options.targetTypes,\n ...ifDefined('meta', options.meta),\n ...ifDefined('paramsSchema', base.paramsSchema),\n ...ifDefined('init', base.init),\n ...ifDefined('encode', base.encode),\n ...ifDefined('traits', base.traits),\n ...ifDefined('renderOutputType', base.renderOutputType),\n decode: base.decode,\n encodeJson: base.encodeJson,\n decodeJson: base.decodeJson,\n } as Codec<Id, TTraits, TWire, TJs, TParams, THelper>;\n}\n\nconst sqlCharCodec = sqlCodecDefinitions.char.codec;\nconst sqlVarcharCodec = sqlCodecDefinitions.varchar.codec;\nconst sqlIntCodec = sqlCodecDefinitions.int.codec;\nconst sqlFloatCodec = sqlCodecDefinitions.float.codec;\nconst sqlTextCodec = sqlCodecDefinitions.text.codec;\nconst sqlTimestampCodec = sqlCodecDefinitions.timestamp.codec;\n\n// Create individual codec instances\nconst pgTextCodec = codec({\n typeId: PG_TEXT_CODEC_ID,\n targetTypes: ['text'],\n traits: ['equality', 'order', 'textual'],\n encode: (value: string): string => value,\n decode: (wire: string): string => wire,\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'text',\n },\n },\n },\n },\n});\n\nconst pgCharCodec = aliasCodec(sqlCharCodec, {\n typeId: PG_CHAR_CODEC_ID,\n targetTypes: ['character'],\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'character',\n },\n },\n },\n },\n});\n\nconst pgVarcharCodec = aliasCodec(sqlVarcharCodec, {\n typeId: PG_VARCHAR_CODEC_ID,\n targetTypes: ['character varying'],\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'character varying',\n },\n },\n },\n },\n});\n\nconst pgIntCodec = aliasCodec(sqlIntCodec, {\n typeId: PG_INT_CODEC_ID,\n targetTypes: ['int4'],\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'integer',\n },\n },\n },\n },\n});\n\nconst pgFloatCodec = aliasCodec(sqlFloatCodec, {\n typeId: PG_FLOAT_CODEC_ID,\n targetTypes: ['float8'],\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'double precision',\n },\n },\n },\n },\n});\n\nconst pgInt4Codec = codec({\n typeId: PG_INT4_CODEC_ID,\n targetTypes: ['int4'],\n traits: ['equality', 'order', 'numeric'],\n encode: (value: number): number => value,\n decode: (wire: number): number => wire,\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'integer',\n },\n },\n },\n },\n});\n\nconst pgNumericCodec = codec<\n typeof PG_NUMERIC_CODEC_ID,\n readonly ['equality', 'order', 'numeric'],\n string,\n string\n>({\n typeId: PG_NUMERIC_CODEC_ID,\n targetTypes: ['numeric', 'decimal'],\n traits: ['equality', 'order', 'numeric'],\n encode: (value: string): string => value,\n decode: (wire: string | number): string => {\n if (typeof wire === 'number') return String(wire);\n return wire;\n },\n paramsSchema: numericParamsSchema,\n renderOutputType: (typeParams) => {\n const precision = typeParams['precision'];\n if (precision === undefined) return undefined;\n if (\n typeof precision !== 'number' ||\n !Number.isFinite(precision) ||\n !Number.isInteger(precision)\n ) {\n throw new Error(\n `renderOutputType: expected integer \"precision\" in typeParams for Numeric, got ${String(precision)}`,\n );\n }\n const scale = typeParams['scale'];\n return typeof scale === 'number' ? `Numeric<${precision}, ${scale}>` : `Numeric<${precision}>`;\n },\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'numeric',\n },\n },\n },\n },\n});\n\nconst pgInt2Codec = codec({\n typeId: PG_INT2_CODEC_ID,\n targetTypes: ['int2'],\n traits: ['equality', 'order', 'numeric'],\n encode: (value: number): number => value,\n decode: (wire: number): number => wire,\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'smallint',\n },\n },\n },\n },\n});\n\nconst pgInt8Codec = codec({\n typeId: PG_INT8_CODEC_ID,\n targetTypes: ['int8'],\n traits: ['equality', 'order', 'numeric'],\n encode: (value: number): number => value,\n decode: (wire: number): number => wire,\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'bigint',\n },\n },\n },\n },\n});\n\nconst pgFloat4Codec = codec({\n typeId: PG_FLOAT4_CODEC_ID,\n targetTypes: ['float4'],\n traits: ['equality', 'order', 'numeric'],\n encode: (value: number): number => value,\n decode: (wire: number): number => wire,\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'real',\n },\n },\n },\n },\n});\n\nconst pgFloat8Codec = codec({\n typeId: PG_FLOAT8_CODEC_ID,\n targetTypes: ['float8'],\n traits: ['equality', 'order', 'numeric'],\n encode: (value: number): number => value,\n decode: (wire: number): number => wire,\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'double precision',\n },\n },\n },\n },\n});\n\nconst pgTimestampCodec = codec<\n typeof PG_TIMESTAMP_CODEC_ID,\n readonly ['equality', 'order'],\n Date,\n Date\n>({\n typeId: PG_TIMESTAMP_CODEC_ID,\n targetTypes: ['timestamp'],\n traits: ['equality', 'order'],\n encode: (value: Date): Date => value,\n decode: (wire: Date): Date => wire,\n encodeJson: (value: Date) => value.toISOString(),\n decodeJson: (json) => {\n if (typeof json !== 'string') {\n throw new Error(`Expected ISO date string for pg/timestamp@1, got ${typeof json}`);\n }\n const date = new Date(json);\n if (Number.isNaN(date.getTime())) {\n throw new Error(`Invalid ISO date string for pg/timestamp@1: ${json}`);\n }\n return date;\n },\n paramsSchema: precisionParamsSchema,\n renderOutputType: (typeParams) => renderPrecision('Timestamp', typeParams),\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'timestamp without time zone',\n },\n },\n },\n },\n});\n\nconst pgTimestamptzCodec = codec<\n typeof PG_TIMESTAMPTZ_CODEC_ID,\n readonly ['equality', 'order'],\n Date,\n Date\n>({\n typeId: PG_TIMESTAMPTZ_CODEC_ID,\n targetTypes: ['timestamptz'],\n traits: ['equality', 'order'],\n encode: (value: Date): Date => value,\n decode: (wire: Date): Date => wire,\n encodeJson: (value: Date) => value.toISOString(),\n decodeJson: (json) => {\n if (typeof json !== 'string') {\n throw new Error(`Expected ISO date string for pg/timestamptz@1, got ${typeof json}`);\n }\n const date = new Date(json);\n if (Number.isNaN(date.getTime())) {\n throw new Error(`Invalid ISO date string for pg/timestamptz@1: ${json}`);\n }\n return date;\n },\n paramsSchema: precisionParamsSchema,\n renderOutputType: (typeParams) => renderPrecision('Timestamptz', typeParams),\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'timestamp with time zone',\n },\n },\n },\n },\n});\n\nconst pgTimeCodec = codec<typeof PG_TIME_CODEC_ID, readonly ['equality', 'order'], string, string>({\n typeId: PG_TIME_CODEC_ID,\n targetTypes: ['time'],\n traits: ['equality', 'order'],\n encode: (value: string): string => value,\n decode: (wire: string): string => wire,\n paramsSchema: precisionParamsSchema,\n renderOutputType: (typeParams) => renderPrecision('Time', typeParams),\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'time',\n },\n },\n },\n },\n});\n\nconst pgTimetzCodec = codec<\n typeof PG_TIMETZ_CODEC_ID,\n readonly ['equality', 'order'],\n string,\n string\n>({\n typeId: PG_TIMETZ_CODEC_ID,\n targetTypes: ['timetz'],\n traits: ['equality', 'order'],\n encode: (value: string): string => value,\n decode: (wire: string): string => wire,\n paramsSchema: precisionParamsSchema,\n renderOutputType: (typeParams) => renderPrecision('Timetz', typeParams),\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'timetz',\n },\n },\n },\n },\n});\n\nconst pgBoolCodec = codec({\n typeId: PG_BOOL_CODEC_ID,\n targetTypes: ['bool'],\n traits: ['equality', 'boolean'],\n encode: (value: boolean): boolean => value,\n decode: (wire: boolean): boolean => wire,\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'boolean',\n },\n },\n },\n },\n});\n\nconst pgBitCodec = codec<typeof PG_BIT_CODEC_ID, readonly ['equality', 'order'], string, string>({\n typeId: PG_BIT_CODEC_ID,\n targetTypes: ['bit'],\n traits: ['equality', 'order'],\n encode: (value: string): string => value,\n decode: (wire: string): string => wire,\n paramsSchema: lengthParamsSchema,\n renderOutputType: (typeParams) => renderLength('Bit', typeParams),\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'bit',\n },\n },\n },\n },\n});\n\nconst pgVarbitCodec = codec<\n typeof PG_VARBIT_CODEC_ID,\n readonly ['equality', 'order'],\n string,\n string\n>({\n typeId: PG_VARBIT_CODEC_ID,\n targetTypes: ['bit varying'],\n traits: ['equality', 'order'],\n encode: (value: string): string => value,\n decode: (wire: string): string => wire,\n paramsSchema: lengthParamsSchema,\n renderOutputType: (typeParams) => renderLength('VarBit', typeParams),\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'bit varying',\n },\n },\n },\n },\n});\n\nconst pgByteaCodec = codec({\n typeId: PG_BYTEA_CODEC_ID,\n targetTypes: ['bytea'],\n traits: ['equality'],\n encode: (value: Uint8Array): Uint8Array => value,\n decode: (wire: Uint8Array): Uint8Array =>\n // Postgres node drivers commonly return Buffer instances (which extend\n // Uint8Array) — normalize to a plain Uint8Array view so engine-agnostic\n // consumers don't accidentally observe Buffer-specific APIs.\n wire instanceof Uint8Array && wire.constructor === Uint8Array\n ? wire\n : new Uint8Array(wire.buffer, wire.byteOffset, wire.byteLength),\n encodeJson: (value: Uint8Array): string => Buffer.from(value).toString('base64'),\n decodeJson: (json): Uint8Array => {\n if (typeof json !== 'string') {\n throw new Error(`Expected base64 string for pg/bytea@1, got ${typeof json}`);\n }\n const decoded = Buffer.from(json, 'base64');\n if (decoded.toString('base64') !== json) {\n throw new Error(`Invalid base64 string for pg/bytea@1 (length: ${json.length})`);\n }\n return new Uint8Array(decoded);\n },\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'bytea',\n },\n },\n },\n },\n});\n\nconst pgEnumCodec = codec({\n typeId: PG_ENUM_CODEC_ID,\n targetTypes: ['enum'],\n traits: ['equality', 'order'],\n encode: (value: string): string => value,\n decode: (wire: string): string => wire,\n renderOutputType: (typeParams) => {\n const values = typeParams['values'];\n if (!Array.isArray(values)) {\n throw new Error(\n `renderOutputType: expected array \"values\" in typeParams for enum, got ${typeof values}`,\n );\n }\n return values\n .map((value) => `'${String(value).replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")}'`)\n .join(' | ');\n },\n});\n\nconst pgIntervalCodec = codec<\n typeof PG_INTERVAL_CODEC_ID,\n readonly ['equality', 'order'],\n string | Record<string, unknown>,\n string\n>({\n typeId: PG_INTERVAL_CODEC_ID,\n targetTypes: ['interval'],\n traits: ['equality', 'order'],\n encode: (value: string): string => value,\n decode: (wire: string | Record<string, unknown>): string => {\n if (typeof wire === 'string') return wire;\n return JSON.stringify(wire);\n },\n paramsSchema: precisionParamsSchema,\n renderOutputType: (typeParams) => renderPrecision('Interval', typeParams),\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'interval',\n },\n },\n },\n },\n});\n\nconst pgJsonCodec = codec({\n typeId: PG_JSON_CODEC_ID,\n targetTypes: ['json'],\n traits: [],\n encode: (value: string | JsonValue): string => JSON.stringify(value),\n decode: (wire: string | JsonValue): JsonValue =>\n typeof wire === 'string' ? JSON.parse(wire) : wire,\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'json',\n },\n },\n },\n },\n});\n\nconst pgJsonbCodec = codec({\n typeId: PG_JSONB_CODEC_ID,\n targetTypes: ['jsonb'],\n traits: ['equality'],\n encode: (value: string | JsonValue): string => JSON.stringify(value),\n decode: (wire: string | JsonValue): JsonValue =>\n typeof wire === 'string' ? JSON.parse(wire) : wire,\n meta: {\n db: {\n sql: {\n postgres: {\n nativeType: 'jsonb',\n },\n },\n },\n },\n});\n\n// Build codec definitions using the builder DSL\nconst codecs = defineCodecs()\n .add('char', sqlCharCodec)\n .add('varchar', sqlVarcharCodec)\n .add('int', sqlIntCodec)\n .add('float', sqlFloatCodec)\n .add('sql-text', sqlTextCodec)\n .add('sql-timestamp', sqlTimestampCodec)\n .add('text', pgTextCodec)\n .add('character', pgCharCodec)\n .add('character varying', pgVarcharCodec)\n .add('integer', pgIntCodec)\n .add('double precision', pgFloatCodec)\n .add('int4', pgInt4Codec)\n .add('int2', pgInt2Codec)\n .add('int8', pgInt8Codec)\n .add('float4', pgFloat4Codec)\n .add('float8', pgFloat8Codec)\n .add('numeric', pgNumericCodec)\n .add('timestamp', pgTimestampCodec)\n .add('timestamptz', pgTimestamptzCodec)\n .add('time', pgTimeCodec)\n .add('timetz', pgTimetzCodec)\n .add('bool', pgBoolCodec)\n .add('bit', pgBitCodec)\n .add('bit varying', pgVarbitCodec)\n .add('bytea', pgByteaCodec)\n .add('interval', pgIntervalCodec)\n .add('enum', pgEnumCodec)\n .add('json', pgJsonCodec)\n .add('jsonb', pgJsonbCodec);\n\n// Export derived structures directly from codecs builder\nexport const codecDefinitions = codecs.codecDefinitions;\nexport const dataTypes = codecs.dataTypes;\n\nexport type CodecTypes = typeof codecs.CodecTypes;\n"],"mappings":";;;;;;AA4CA,MAAM,qBAAqBA,KAAQ,EACjC,QAAQ,sBACT,CAAC;AAEF,MAAM,sBAAsBA,KAAQ;CAClC,WAAW;CACX,UAAU;CACX,CAAC;AAEF,MAAM,wBAAwBA,KAAQ,EACpC,cAAc,6CACf,CAAC;AAEF,SAAS,aAAa,UAAkB,YAAyD;CAC/F,MAAM,SAAS,WAAW;AAC1B,KAAI,WAAW,OACb;AAEF,KAAI,OAAO,WAAW,YAAY,CAAC,OAAO,SAAS,OAAO,IAAI,CAAC,OAAO,UAAU,OAAO,CACrF,OAAM,IAAI,MACR,iEAAiE,SAAS,QAAQ,OAAO,OAAO,GACjG;AAEH,QAAO,GAAG,SAAS,GAAG,OAAO;;AAG/B,SAAS,gBAAgB,UAAkB,YAA6C;CACtF,MAAM,YAAY,WAAW;AAC7B,KAAI,cAAc,OAChB,QAAO;AAET,KACE,OAAO,cAAc,YACrB,CAAC,OAAO,SAAS,UAAU,IAC3B,CAAC,OAAO,UAAU,UAAU,CAE5B,OAAM,IAAI,MACR,oEAAoE,SAAS,QAAQ,OAAO,UAAU,GACvG;AAEH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K,EACH,UAAU,EACR,YAAY,SACb,EACF,EACF,EACF;CACF,CAAC;AAGF,MAAM,SAAS,cAAc,CAC1B,IAAI,QAAQ,aAAa,CACzB,IAAI,WAAW,gBAAgB,CAC/B,IAAI,OAAO,YAAY,CACvB,IAAI,SAAS,cAAc,CAC3B,IAAI,YAAY,aAAa,CAC7B,IAAI,iBAAiB,kBAAkB,CACvC,IAAI,QAAQ,YAAY,CACxB,IAAI,aAAa,YAAY,CAC7B,IAAI,qBAAqB,eAAe,CACxC,IAAI,WAAW,WAAW,CAC1B,IAAI,oBAAoB,aAAa,CACrC,IAAI,QAAQ,YAAY,CACxB,IAAI,QAAQ,YAAY,CACxB,IAAI,QAAQ,YAAY,CACxB,IAAI,UAAU,cAAc,CAC5B,IAAI,UAAU,cAAc,CAC5B,IAAI,WAAW,eAAe,CAC9B,IAAI,aAAa,iBAAiB,CAClC,IAAI,eAAe,mBAAmB,CACtC,IAAI,QAAQ,YAAY,CACxB,IAAI,UAAU,cAAc,CAC5B,IAAI,QAAQ,YAAY,CACxB,IAAI,OAAO,WAAW,CACtB,IAAI,eAAe,cAAc,CACjC,IAAI,SAAS,aAAa,CAC1B,IAAI,YAAY,gBAAgB,CAChC,IAAI,QAAQ,YAAY,CACxB,IAAI,QAAQ,YAAY,CACxB,IAAI,SAAS,aAAa;AAG7B,MAAa,mBAAmB,OAAO;AACvC,MAAa,YAAY,OAAO"}
package/dist/codecs.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as codecDefinitions, r as dataTypes, t as CodecTypes } from "./codecs-D-F2KJqt.mjs";
1
+ import { n as codecDefinitions, r as dataTypes, t as CodecTypes } from "./codecs-B03dFv94.mjs";
2
2
  export { type CodecTypes, codecDefinitions, dataTypes };
package/dist/codecs.mjs CHANGED
@@ -1,3 +1,4 @@
1
- import { n as dataTypes, t as codecDefinitions } from "./codecs-BoahtY_Q.mjs";
1
+ import "./codec-ids-ckQX9Kcg.mjs";
2
+ import { n as dataTypes, t as codecDefinitions } from "./codecs-D0oXyJIH.mjs";
2
3
 
3
4
  export { codecDefinitions, dataTypes };