@prisma-next/extension-paradedb 0.5.0-dev.9 → 0.5.1

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 (40) hide show
  1. package/README.md +36 -105
  2. package/dist/control.d.mts +21 -1
  3. package/dist/control.d.mts.map +1 -1
  4. package/dist/control.mjs +132 -2
  5. package/dist/control.mjs.map +1 -0
  6. package/dist/descriptor-meta-Dr4mAlbx.mjs +276 -0
  7. package/dist/descriptor-meta-Dr4mAlbx.mjs.map +1 -0
  8. package/dist/index-types-BZqoAhWT.mjs +11 -0
  9. package/dist/index-types-BZqoAhWT.mjs.map +1 -0
  10. package/dist/index-types.d.mts +9 -106
  11. package/dist/index-types.d.mts.map +1 -1
  12. package/dist/index-types.mjs +2 -84
  13. package/dist/operation-types-DXmTJ7jd.d.mts +135 -0
  14. package/dist/operation-types-DXmTJ7jd.d.mts.map +1 -0
  15. package/dist/operation-types.d.mts +2 -0
  16. package/dist/operation-types.mjs +1 -0
  17. package/dist/pack.d.mts +16 -0
  18. package/dist/pack.d.mts.map +1 -1
  19. package/dist/pack.mjs +3 -5
  20. package/dist/pack.mjs.map +1 -1
  21. package/dist/runtime.d.mts +7 -0
  22. package/dist/runtime.d.mts.map +1 -0
  23. package/dist/runtime.mjs +21 -0
  24. package/dist/runtime.mjs.map +1 -0
  25. package/package.json +25 -7
  26. package/src/contract.d.ts +81 -0
  27. package/src/contract.json +33 -0
  28. package/src/contract.prisma +22 -0
  29. package/src/core/constants.ts +26 -15
  30. package/src/core/descriptor-meta.ts +200 -0
  31. package/src/core/proximity-chain.ts +83 -0
  32. package/src/exports/control.ts +70 -2
  33. package/src/exports/index-types.ts +2 -12
  34. package/src/exports/operation-types.ts +1 -0
  35. package/src/exports/runtime.ts +20 -0
  36. package/src/types/index-types.ts +12 -179
  37. package/src/types/operation-types.ts +84 -0
  38. package/dist/descriptor-meta-BTFnIGJ6.mjs +0 -20
  39. package/dist/descriptor-meta-BTFnIGJ6.mjs.map +0 -1
  40. package/dist/index-types.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptor-meta-Dr4mAlbx.mjs","names":["TEXT"],"sources":["../src/core/constants.ts","../src/core/proximity-chain.ts","../src/core/descriptor-meta.ts"],"sourcesContent":["/**\n * Extension ID for ParadeDB pg_search.\n */\nexport const PARADEDB_EXTENSION_ID = 'paradedb' as const;\n\n/**\n * Static names and identifiers used across paradedb's contract space.\n *\n * Centralised here so the contract IR (`./contract`), the baseline\n * migration ops (`./migrations`), the head ref, and the descriptor\n * (`../exports/control`) all reference the same values without typos.\n *\n * The space identifier `'paradedb'` is what the framework writes to\n * `migrations/` in the user's repo and what the marker table's\n * `space` column carries for paradedb-owned rows.\n *\n * The `paradedb:*` invariantId namespace is locked here — once\n * published, an invariantId is immutable so downstream consumers can\n * reference it by literal string match.\n */\nexport const PARADEDB_SPACE_ID = 'paradedb' as const;\n\nexport const PARADEDB_BASELINE_MIGRATION_NAME =\n '20260601T0000_install_pg_search_extension' as const;\n\n/**\n * `paradedb:*` invariantIds emitted by the baseline migration. Each id,\n * once published, is immutable: downstream consumers reference them by\n * literal string match.\n */\nexport const PARADEDB_INVARIANTS = {\n installPgSearch: 'paradedb:install-pg-search-v1',\n} as const;\n","import {\n type AnyExpression,\n LiteralExpr,\n OperationExpr,\n} from '@prisma-next/sql-relational-core/ast';\nimport { type Expression, toExpr } from '@prisma-next/sql-relational-core/expression';\n\nconst TEXT = 'pg/text@1' as const;\n\nexport type ProximityTerm = unknown;\n\nexport interface ProximityWithinOptions {\n readonly ordered?: boolean;\n}\n\ninterface ProximityStep {\n readonly distance: number;\n readonly term: ProximityTerm;\n readonly ordered: boolean;\n}\n\n// https://docs.paradedb.com/documentation/full-text/proximity\nexport class ParadeDbProximityChain\n implements Expression<{ codecId: 'pg/text@1'; nullable: false }>\n{\n readonly returnType = { codecId: TEXT, nullable: false } as const;\n\n private readonly start: ProximityTerm;\n private readonly steps: readonly ProximityStep[];\n\n constructor(start: ProximityTerm, steps: readonly ProximityStep[] = []) {\n this.start = start;\n this.steps = steps;\n }\n\n within(\n distance: number,\n term: ProximityTerm,\n options?: ProximityWithinOptions,\n ): ParadeDbProximityChain {\n if (!Number.isInteger(distance) || distance < 0) {\n throw new Error(\n `paradeDbProximity.within: distance must be a non-negative integer; got ${String(distance)}`,\n );\n }\n return new ParadeDbProximityChain(this.start, [\n ...this.steps,\n { distance, term, ordered: options?.ordered === true },\n ]);\n }\n\n buildAst(): AnyExpression {\n if (this.steps.length === 0) {\n throw new Error(\n 'paradeDbProximity: chain must have at least one .within(distance, term) step',\n );\n }\n const args: AnyExpression[] = [toExpr(this.start, TEXT)];\n let template = '({{self}}';\n this.steps.forEach((step, i) => {\n const op = step.ordered ? '##>' : '##';\n args.push(LiteralExpr.of(step.distance));\n args.push(toExpr(step.term, TEXT));\n template += ` ${op} {{arg${2 * i}}} ${op} {{arg${2 * i + 1}}}`;\n });\n template += ')';\n const [self, ...rest] = args;\n if (!self) {\n throw new Error('paradeDbProximity: invariant violation — empty args');\n }\n return new OperationExpr({\n method: 'paradeDbProximity',\n self,\n args: rest.length > 0 ? rest : undefined,\n returns: this.returnType,\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template,\n },\n });\n }\n}\n","import { LiteralExpr } from '@prisma-next/sql-relational-core/ast';\nimport { buildOperation, toExpr } from '@prisma-next/sql-relational-core/expression';\nimport { paradedbIndexTypes } from '../types/index-types';\nimport type { QueryOperationTypes } from '../types/operation-types';\nimport { PARADEDB_EXTENSION_ID } from './constants';\nimport { ParadeDbProximityChain } from './proximity-chain';\n\ntype CodecTypesBase = Record<string, { readonly input: unknown; readonly output: unknown }>;\n\nconst TEXT = 'pg/text@1' as const;\nconst BOOL = 'pg/bool@1' as const;\nconst FLOAT4 = 'pg/float4@1' as const;\nconst INT4 = 'pg/int4@1' as const;\n\nexport function paradedbQueryOperations<CT extends CodecTypesBase>(): QueryOperationTypes<CT> {\n return {\n // `@@@` accepts both text and structured query types on its RHS.\n // https://docs.paradedb.com/documentation/full-text/match\n paradeDbMatch: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbMatch',\n args: [toExpr(self, TEXT), toExpr(query, TEXT)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} @@@ {{arg0}}',\n },\n }),\n },\n paradeDbMatchAny: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbMatchAny',\n args: [toExpr(self, TEXT), toExpr(query, TEXT)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} ||| {{arg0}}',\n },\n }),\n },\n paradeDbMatchAll: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbMatchAll',\n args: [toExpr(self, TEXT), toExpr(query, TEXT)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} &&& {{arg0}}',\n },\n }),\n },\n // https://docs.paradedb.com/documentation/full-text/term\n paradeDbTerm: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbTerm',\n args: [toExpr(self, TEXT), toExpr(query, TEXT)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} === {{arg0}}',\n },\n }),\n },\n // https://docs.paradedb.com/documentation/full-text/phrase\n paradeDbPhrase: {\n self: { codecId: TEXT },\n impl: (self, query) =>\n buildOperation({\n method: 'paradeDbPhrase',\n args: [toExpr(self, TEXT), toExpr(query, TEXT)],\n returns: { codecId: BOOL, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}} ### {{arg0}}',\n },\n }),\n },\n // https://docs.paradedb.com/documentation/sorting/score\n paradeDbScore: {\n self: { codecId: INT4 },\n impl: (self) =>\n buildOperation({\n method: 'paradeDbScore',\n args: [toExpr(self, INT4)],\n returns: { codecId: FLOAT4, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: 'pdb.score({{self}})',\n },\n }),\n },\n // PG rejects parameterized typmods, so the cast argument lowers to a literal.\n // https://docs.paradedb.com/documentation/full-text/fuzzy\n paradeDbFuzzy: {\n self: { codecId: TEXT },\n impl: (self, distance) => {\n if (!Number.isInteger(distance) || distance < 0 || distance > 2) {\n throw new Error(\n `paradeDbFuzzy: distance must be an integer in [0, 2]; got ${String(distance)}`,\n );\n }\n return buildOperation({\n method: 'paradeDbFuzzy',\n args: [toExpr(self, TEXT), LiteralExpr.of(distance)],\n returns: { codecId: TEXT, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}}::pdb.fuzzy({{arg0}})',\n },\n });\n },\n },\n // https://docs.paradedb.com/documentation/sorting/boost\n paradeDbBoost: {\n self: { codecId: TEXT },\n impl: (self, weight) => {\n if (!Number.isInteger(weight) || weight < -2048 || weight > 2048) {\n throw new Error(\n `paradeDbBoost: boost must be an integer in [-2048, 2048]; got ${String(weight)}`,\n );\n }\n return buildOperation({\n method: 'paradeDbBoost',\n args: [toExpr(self, TEXT), LiteralExpr.of(weight)],\n returns: { codecId: TEXT, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}}::pdb.boost({{arg0}})',\n },\n });\n },\n },\n paradeDbConst: {\n self: { codecId: TEXT },\n impl: (self, value) => {\n if (!Number.isInteger(value)) {\n throw new Error(`paradeDbConst: value must be an integer; got ${String(value)}`);\n }\n return buildOperation({\n method: 'paradeDbConst',\n args: [toExpr(self, TEXT), LiteralExpr.of(value)],\n returns: { codecId: TEXT, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}}::pdb.const({{arg0}})',\n },\n });\n },\n },\n paradeDbSlop: {\n self: { codecId: TEXT },\n impl: (self, slop) => {\n if (!Number.isInteger(slop) || slop < 0) {\n throw new Error(`paradeDbSlop: slop must be a non-negative integer; got ${String(slop)}`);\n }\n return buildOperation({\n method: 'paradeDbSlop',\n args: [toExpr(self, TEXT), LiteralExpr.of(slop)],\n returns: { codecId: TEXT, nullable: false },\n lowering: {\n targetFamily: 'sql',\n strategy: 'function',\n template: '{{self}}::pdb.slop({{arg0}})',\n },\n });\n },\n },\n // https://docs.paradedb.com/documentation/full-text/proximity\n paradeDbProximity: {\n self: { codecId: TEXT },\n impl: (start) => new ParadeDbProximityChain(start),\n },\n };\n}\n\nexport const paradedbPackMeta = {\n kind: 'extension',\n id: PARADEDB_EXTENSION_ID,\n familyId: 'sql',\n targetId: 'postgres',\n version: '0.0.1',\n capabilities: {\n postgres: {\n 'paradedb/bm25': true,\n },\n },\n indexTypes: paradedbIndexTypes,\n types: {\n queryOperationTypes: {\n import: {\n package: '@prisma-next/extension-paradedb/operation-types',\n named: 'QueryOperationTypes',\n alias: 'ParadeDbQueryOperationTypes',\n },\n },\n },\n} as const;\n"],"mappings":";;;;;;;AAGA,MAAa,wBAAwB;;;;;;;;;;;;;;;;AAiBrC,MAAa,oBAAoB;;;ACbjC,MAAMA,SAAO;AAeb,IAAa,yBAAb,MAAa,uBAEb;CACE,aAAsB;EAAE,SAASA;EAAM,UAAU;EAAO;CAExD;CACA;CAEA,YAAY,OAAsB,QAAkC,EAAE,EAAE;EACtE,KAAK,QAAQ;EACb,KAAK,QAAQ;;CAGf,OACE,UACA,MACA,SACwB;EACxB,IAAI,CAAC,OAAO,UAAU,SAAS,IAAI,WAAW,GAC5C,MAAM,IAAI,MACR,0EAA0E,OAAO,SAAS,GAC3F;EAEH,OAAO,IAAI,uBAAuB,KAAK,OAAO,CAC5C,GAAG,KAAK,OACR;GAAE;GAAU;GAAM,SAAS,SAAS,YAAY;GAAM,CACvD,CAAC;;CAGJ,WAA0B;EACxB,IAAI,KAAK,MAAM,WAAW,GACxB,MAAM,IAAI,MACR,+EACD;EAEH,MAAM,OAAw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AmB;GACjB,MAAM,EAAE,SAAS,MAAM;GACvB,OAAO,UAAU,IAAI,uBAAuB,MAAM;GACnD;EACF;;AAGH,MAAa,mBAAmB;CAC9B,MAAM;CACN,IAAI;CACJ,UAAU;CACV,UAAU;CACV,SAAS;CACT,cAAc,EACZ,UAAU,EACR,iBAAiB,MAClB,EACF;CACD,YAAY;CACZ,OAAO,EACL,qBAAqB,EACnB,QAAQ;EACN,SAAS;EACT,OAAO;EACP,OAAO;EACR,EACF,EACF;CACF"}
@@ -0,0 +1,11 @@
1
+ import { defineIndexTypes } from "@prisma-next/sql-contract/index-types";
2
+ import { type } from "arktype";
3
+ //#region src/types/index-types.ts
4
+ const paradedbIndexTypes = defineIndexTypes().add("bm25", { options: type({
5
+ "+": "reject",
6
+ key_field: "string"
7
+ }) });
8
+ //#endregion
9
+ export { paradedbIndexTypes as t };
10
+
11
+ //# sourceMappingURL=index-types-BZqoAhWT.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-types-BZqoAhWT.mjs","names":[],"sources":["../src/types/index-types.ts"],"sourcesContent":["import { defineIndexTypes } from '@prisma-next/sql-contract/index-types';\nimport { type } from 'arktype';\n\nexport const paradedbIndexTypes = defineIndexTypes().add('bm25', {\n options: type({\n '+': 'reject',\n key_field: 'string',\n }),\n});\n\nexport type IndexTypes = typeof paradedbIndexTypes.IndexTypes;\nexport type Bm25IndexOptions = IndexTypes['bm25']['options'];\n"],"mappings":";;;AAGA,MAAa,qBAAqB,kBAAkB,CAAC,IAAI,QAAQ,EAC/D,SAAS,KAAK;CACZ,KAAK;CACL,WAAW;CACZ,CAAC,EACH,CAAC"}
@@ -1,110 +1,13 @@
1
- import { IndexDef } from "@prisma-next/contract-authoring";
1
+ import * as _$_prisma_next_sql_contract_index_types0 from "@prisma-next/sql-contract/index-types";
2
2
 
3
- //#region src/core/constants.d.ts
4
-
5
- /**
6
- * Built-in ParadeDB tokenizer IDs.
7
- * These correspond to the `pdb.*` casting syntax in `CREATE INDEX ... USING bm25`.
8
- */
9
- type TokenizerId = 'unicode_words' | 'simple' | 'ngram' | 'icu' | 'regex_pattern' | 'source_code' | 'literal' | 'literal_normalized' | 'whitespace' | 'chinese_compatible' | 'jieba' | 'lindera';
10
- //#endregion
11
3
  //#region src/types/index-types.d.ts
12
- /**
13
- * BM25 field config for a table column.
14
- */
15
- type Bm25ColumnFieldConfig = {
16
- readonly column: string;
17
- readonly expression?: never;
18
- readonly tokenizer?: string;
19
- readonly tokenizerParams?: Record<string, unknown>;
20
- readonly alias?: string;
21
- };
22
- /**
23
- * BM25 field config for a SQL expression.
24
- */
25
- type Bm25ExpressionFieldConfig = {
26
- readonly expression: string;
27
- readonly column?: never;
28
- readonly alias: string;
29
- readonly tokenizer?: string;
30
- readonly tokenizerParams?: Record<string, unknown>;
31
- };
32
- /**
33
- * BM25 field config union.
34
- */
35
- type Bm25FieldConfig = Bm25ColumnFieldConfig | Bm25ExpressionFieldConfig;
36
- /**
37
- * BM25 index configuration payload stored in `IndexDef.config`.
38
- */
39
- type Bm25IndexConfig = {
40
- readonly keyField: string;
41
- readonly fields: readonly Bm25FieldConfig[];
42
- };
43
- /**
44
- * Options for a BM25 text field (text, varchar columns).
45
- */
46
- type Bm25TextFieldOptions = {
47
- readonly tokenizer?: TokenizerId | (string & {});
48
- readonly stemmer?: string;
49
- readonly alias?: string;
50
- readonly remove_emojis?: boolean;
51
- };
52
- /**
53
- * Options for a BM25 JSON field (json, jsonb columns).
54
- */
55
- type Bm25JsonFieldOptions = {
56
- readonly tokenizer?: TokenizerId | (string & {});
57
- readonly alias?: string;
58
- /** Ngram-specific params when tokenizer is 'ngram'. */
59
- readonly min?: number;
60
- readonly max?: number;
61
- };
62
- /**
63
- * Options for a BM25 expression-based field.
64
- */
65
- type Bm25ExpressionFieldOptions = {
66
- readonly alias: string;
67
- readonly tokenizer?: TokenizerId | (string & {});
68
- readonly min?: number;
69
- readonly max?: number;
70
- readonly stemmer?: string;
71
- readonly pattern?: string;
72
- };
73
- /**
74
- * Options for constructing a BM25 index definition.
75
- */
76
- type Bm25IndexOptions = {
77
- readonly keyField: string;
78
- readonly fields: readonly Bm25FieldConfig[];
79
- readonly name?: string;
80
- };
81
- /**
82
- * Typed BM25 field builders.
83
- * These produce `Bm25FieldConfig` objects for use in `bm25Index()`.
84
- */
85
- declare const bm25: {
86
- /** Text field with optional tokenizer config. */
87
- readonly text: (column: string, opts?: Bm25TextFieldOptions) => Bm25FieldConfig;
88
- /** Numeric field (filterable, sortable in BM25). */
89
- readonly numeric: (column: string) => Bm25FieldConfig;
90
- /** Boolean field. */
91
- readonly boolean: (column: string) => Bm25FieldConfig;
92
- /** JSON/JSONB field with optional tokenizer config. */
93
- readonly json: (column: string, opts?: Bm25JsonFieldOptions) => Bm25FieldConfig;
94
- /** Datetime (timestamp/date) field. */
95
- readonly datetime: (column: string) => Bm25FieldConfig;
96
- /** Range field. */
97
- readonly range: (column: string) => Bm25FieldConfig;
98
- /** Raw SQL expression field. `alias` is required. */
99
- readonly expression: (sql: string, opts: Bm25ExpressionFieldOptions) => Bm25FieldConfig;
100
- };
101
- /**
102
- * Creates a generic index definition with a ParadeDB BM25 payload.
103
- *
104
- * `columns` only includes real table columns so core index validation remains
105
- * target-agnostic. Expression fields stay in extension-owned `config.fields`.
106
- */
107
- declare function bm25Index(opts: Bm25IndexOptions): IndexDef;
4
+ declare const paradedbIndexTypes: _$_prisma_next_sql_contract_index_types0.IndexTypeBuilder<Record<never, never> & Record<"bm25", {
5
+ readonly options: {
6
+ key_field: string;
7
+ };
8
+ }>>;
9
+ type IndexTypes = typeof paradedbIndexTypes.IndexTypes;
10
+ type Bm25IndexOptions = IndexTypes['bm25']['options'];
108
11
  //#endregion
109
- export { type Bm25ColumnFieldConfig, type Bm25ExpressionFieldConfig, type Bm25ExpressionFieldOptions, type Bm25FieldConfig, type Bm25IndexConfig, type Bm25IndexOptions, type Bm25JsonFieldOptions, type Bm25TextFieldOptions, type TokenizerId, bm25, bm25Index };
12
+ export { type Bm25IndexOptions, type IndexTypes, paradedbIndexTypes };
110
13
  //# sourceMappingURL=index-types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-types.d.mts","names":[],"sources":["../src/core/constants.ts","../src/types/index-types.ts"],"sourcesContent":[],"mappings":";;;;;;;ACMA;AAWY,KDRA,WAAA,GCQA,eAAyB,GAKR,QAAM,GAAA,OAAA,GAAA,KAAA,GAAA,eAAA,GAAA,aAAA,GAAA,SAAA,GAAA,oBAAA,GAAA,YAAA,GAAA,oBAAA,GAAA,OAAA,GAAA,SAAA;;;;ADbnC;;KCHY,qBAAA;;EAAA,SAAA,UAAA,CAAA,EAAA,KAAqB;EAWrB,SAAA,SAAA,CAAA,EAAA,MAAA;EAWA,SAAA,eAAe,CAAA,EAlBE,MAkBC,CAAA,MAAA,EAAA,OAAA,CAAA;EAKlB,SAAA,KAAA,CAAA,EAAA,MAAe;AAQ3B,CAAA;AAUA;AAWA;AAiBA;AAUa,KAxED,yBAAA,GA+HF;EArDoB,SAAA,UAAA,EAAA,MAAA;EAAuB,SAAA,MAAA,CAAA,EAAA,KAAA;EAY1B,SAAA,KAAA,EAAA,MAAA;EAKA,SAAA,SAAA,CAAA,EAAA,MAAA;EAKG,SAAA,eAAA,CAAA,EA3FD,MA2FC,CAAA,MAAA,EAAA,OAAA,CAAA;CAAuB;;;;AAmBQ,KAxGjD,eAAA,GAAkB,qBAwG+B,GAxGP,yBAwGO;;AAoB7D;;KAvHY,eAAA;;4BAEgB;;;;;KAMhB,oBAAA;uBACW;;;;;;;;KASX,oBAAA;uBACW;;;;;;;;;KAUX,0BAAA;;uBAEW;;;;;;;;;KAeX,gBAAA;;4BAEgB;;;;;;;cAQf;;yCAEiB,yBAAuB;;wCAY1B;;wCAKA;;yCAKG,yBAAuB;;yCASzB;;sCAKH;;2CAKO,+BAA6B;;;;;;;;iBAoB7C,SAAA,OAAgB,mBAAmB"}
1
+ {"version":3,"file":"index-types.d.mts","names":[],"sources":["../src/types/index-types.ts"],"mappings":";;;cAGa,kBAAA,EAAkB,wCAAA,CAAA,gBAAA,CAAA,MAAA,iBAAA,MAAA;EAAA;;;;KAOnB,UAAA,UAAoB,kBAAA,CAAmB,UAAA;AAAA,KACvC,gBAAA,GAAmB,UAAA"}
@@ -1,84 +1,2 @@
1
- //#region src/types/index-types.ts
2
- /**
3
- * Typed BM25 field builders.
4
- * These produce `Bm25FieldConfig` objects for use in `bm25Index()`.
5
- */
6
- const bm25 = {
7
- text(column, opts) {
8
- return {
9
- column,
10
- ...buildTokenizerConfig(opts?.tokenizer, {
11
- stemmer: opts?.stemmer,
12
- remove_emojis: opts?.remove_emojis
13
- }),
14
- ...opts?.alias !== void 0 && { alias: opts.alias }
15
- };
16
- },
17
- numeric(column) {
18
- return { column };
19
- },
20
- boolean(column) {
21
- return { column };
22
- },
23
- json(column, opts) {
24
- return {
25
- column,
26
- ...buildTokenizerConfig(opts?.tokenizer, {
27
- min: opts?.min,
28
- max: opts?.max
29
- }),
30
- ...opts?.alias !== void 0 && { alias: opts.alias }
31
- };
32
- },
33
- datetime(column) {
34
- return { column };
35
- },
36
- range(column) {
37
- return { column };
38
- },
39
- expression(sql, opts) {
40
- return {
41
- expression: sql,
42
- alias: opts.alias,
43
- ...buildTokenizerConfig(opts.tokenizer, {
44
- min: opts.min,
45
- max: opts.max,
46
- stemmer: opts.stemmer,
47
- pattern: opts.pattern
48
- })
49
- };
50
- }
51
- };
52
- /**
53
- * Creates a generic index definition with a ParadeDB BM25 payload.
54
- *
55
- * `columns` only includes real table columns so core index validation remains
56
- * target-agnostic. Expression fields stay in extension-owned `config.fields`.
57
- */
58
- function bm25Index(opts) {
59
- return {
60
- columns: opts.fields.flatMap((field) => "column" in field ? [field.column] : []),
61
- ...opts.name !== void 0 && { name: opts.name },
62
- using: "bm25",
63
- config: {
64
- keyField: opts.keyField,
65
- fields: opts.fields
66
- }
67
- };
68
- }
69
- /**
70
- * Builds `{ tokenizer, tokenizerParams? }` from a tokenizer ID and a bag of params.
71
- * Filters out undefined values and omits `tokenizerParams` when empty.
72
- */
73
- function buildTokenizerConfig(tokenizer, params) {
74
- if (!tokenizer) return {};
75
- const filtered = Object.fromEntries(Object.entries(params).filter(([, v]) => v !== void 0));
76
- return {
77
- tokenizer,
78
- ...Object.keys(filtered).length > 0 && { tokenizerParams: filtered }
79
- };
80
- }
81
-
82
- //#endregion
83
- export { bm25, bm25Index };
84
- //# sourceMappingURL=index-types.mjs.map
1
+ import { t as paradedbIndexTypes } from "./index-types-BZqoAhWT.mjs";
2
+ export { paradedbIndexTypes };
@@ -0,0 +1,135 @@
1
+ import { AnyExpression } from "@prisma-next/sql-relational-core/ast";
2
+ import { CodecExpression, Expression } from "@prisma-next/sql-relational-core/expression";
3
+ import { SqlQueryOperationTypes } from "@prisma-next/sql-contract/types";
4
+
5
+ //#region src/core/proximity-chain.d.ts
6
+ type ProximityTerm = unknown;
7
+ interface ProximityWithinOptions {
8
+ readonly ordered?: boolean;
9
+ }
10
+ interface ProximityStep {
11
+ readonly distance: number;
12
+ readonly term: ProximityTerm;
13
+ readonly ordered: boolean;
14
+ }
15
+ declare class ParadeDbProximityChain implements Expression<{
16
+ codecId: 'pg/text@1';
17
+ nullable: false;
18
+ }> {
19
+ readonly returnType: {
20
+ readonly codecId: "pg/text@1";
21
+ readonly nullable: false;
22
+ };
23
+ private readonly start;
24
+ private readonly steps;
25
+ constructor(start: ProximityTerm, steps?: readonly ProximityStep[]);
26
+ within(distance: number, term: ProximityTerm, options?: ProximityWithinOptions): ParadeDbProximityChain;
27
+ buildAst(): AnyExpression;
28
+ }
29
+ //#endregion
30
+ //#region src/types/operation-types.d.ts
31
+ type CodecTypesBase = Record<string, {
32
+ readonly input: unknown;
33
+ readonly output: unknown;
34
+ }>;
35
+ type QueryOperationTypes<CT extends CodecTypesBase> = SqlQueryOperationTypes<CT, {
36
+ readonly paradeDbMatch: {
37
+ readonly self: {
38
+ readonly codecId: 'pg/text@1';
39
+ };
40
+ readonly impl: (self: CodecExpression<'pg/text@1', boolean, CT>, query: CodecExpression<'pg/text@1', boolean, CT>) => Expression<{
41
+ codecId: 'pg/bool@1';
42
+ nullable: false;
43
+ }>;
44
+ };
45
+ readonly paradeDbMatchAny: {
46
+ readonly self: {
47
+ readonly codecId: 'pg/text@1';
48
+ };
49
+ readonly impl: (self: CodecExpression<'pg/text@1', boolean, CT>, query: CodecExpression<'pg/text@1', boolean, CT>) => Expression<{
50
+ codecId: 'pg/bool@1';
51
+ nullable: false;
52
+ }>;
53
+ };
54
+ readonly paradeDbMatchAll: {
55
+ readonly self: {
56
+ readonly codecId: 'pg/text@1';
57
+ };
58
+ readonly impl: (self: CodecExpression<'pg/text@1', boolean, CT>, query: CodecExpression<'pg/text@1', boolean, CT>) => Expression<{
59
+ codecId: 'pg/bool@1';
60
+ nullable: false;
61
+ }>;
62
+ };
63
+ readonly paradeDbTerm: {
64
+ readonly self: {
65
+ readonly codecId: 'pg/text@1';
66
+ };
67
+ readonly impl: (self: CodecExpression<'pg/text@1', boolean, CT>, query: CodecExpression<'pg/text@1', boolean, CT>) => Expression<{
68
+ codecId: 'pg/bool@1';
69
+ nullable: false;
70
+ }>;
71
+ };
72
+ readonly paradeDbPhrase: {
73
+ readonly self: {
74
+ readonly codecId: 'pg/text@1';
75
+ };
76
+ readonly impl: (self: CodecExpression<'pg/text@1', boolean, CT>, query: CodecExpression<'pg/text@1', boolean, CT>) => Expression<{
77
+ codecId: 'pg/bool@1';
78
+ nullable: false;
79
+ }>;
80
+ };
81
+ readonly paradeDbScore: {
82
+ readonly self: {
83
+ readonly codecId: 'pg/int4@1';
84
+ };
85
+ readonly impl: (self: CodecExpression<'pg/int4@1', boolean, CT>) => Expression<{
86
+ codecId: 'pg/float4@1';
87
+ nullable: false;
88
+ }>;
89
+ };
90
+ readonly paradeDbFuzzy: {
91
+ readonly self: {
92
+ readonly codecId: 'pg/text@1';
93
+ };
94
+ readonly impl: (self: CodecExpression<'pg/text@1', boolean, CT>, distance: number) => Expression<{
95
+ codecId: 'pg/text@1';
96
+ nullable: false;
97
+ }>;
98
+ };
99
+ readonly paradeDbBoost: {
100
+ readonly self: {
101
+ readonly codecId: 'pg/text@1';
102
+ };
103
+ readonly impl: (self: CodecExpression<'pg/text@1', boolean, CT>, weight: number) => Expression<{
104
+ codecId: 'pg/text@1';
105
+ nullable: false;
106
+ }>;
107
+ };
108
+ readonly paradeDbConst: {
109
+ readonly self: {
110
+ readonly codecId: 'pg/text@1';
111
+ };
112
+ readonly impl: (self: CodecExpression<'pg/text@1', boolean, CT>, value: number) => Expression<{
113
+ codecId: 'pg/text@1';
114
+ nullable: false;
115
+ }>;
116
+ };
117
+ readonly paradeDbSlop: {
118
+ readonly self: {
119
+ readonly codecId: 'pg/text@1';
120
+ };
121
+ readonly impl: (self: CodecExpression<'pg/text@1', boolean, CT>, slop: number) => Expression<{
122
+ codecId: 'pg/text@1';
123
+ nullable: false;
124
+ }>;
125
+ };
126
+ readonly paradeDbProximity: {
127
+ readonly self: {
128
+ readonly codecId: 'pg/text@1';
129
+ };
130
+ readonly impl: (start: CodecExpression<'pg/text@1', boolean, CT>) => ParadeDbProximityChain;
131
+ };
132
+ }>;
133
+ //#endregion
134
+ export { QueryOperationTypes as t };
135
+ //# sourceMappingURL=operation-types-DXmTJ7jd.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-types-DXmTJ7jd.d.mts","names":[],"sources":["../src/core/proximity-chain.ts","../src/types/operation-types.ts"],"mappings":";;;;;KASY,aAAA;AAAA,UAEK,sBAAA;EAAA,SACN,OAAA;AAAA;AAAA,UAGD,aAAA;EAAA,SACC,QAAA;EAAA,SACA,IAAA,EAAM,aAAA;EAAA,SACN,OAAA;AAAA;AAAA,cAIE,sBAAA,YACA,UAAA;EAAa,OAAA;EAAsB,QAAA;AAAA;EAAA,SAErC,UAAA;IAAA;;;mBAEQ,KAAA;EAAA,iBACA,KAAA;cAEL,KAAA,EAAO,aAAA,EAAe,KAAA,YAAgB,aAAA;EAKlD,MAAA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C,UAAA;MAAa,OAAA;MAAsB,QAAA;IAAA;EAAA;EAAA,SAEjC,aAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,uBAAsC,EAAA,MACzC,UAAA;MAAa,OAAA;MAAwB,QAAA;IAAA;EAAA;EAAA,SAEnC,aAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,uBAAsC,EAAA,GAC5C,QAAA,aACG,UAAA;MAAa,OAAA;MAAsB,QAAA;IAAA;EAAA;EAAA,SAEjC,aAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,uBAAsC,EAAA,GAC5C,MAAA,aACG,UAAA;MAAa,OAAA;MAAsB,QAAA;IAAA;EAAA;EAAA,SAEjC,aAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,uBAAsC,EAAA,GAC5C,KAAA,aACG,UAAA;MAAa,OAAA;MAAsB,QAAA;IAAA;EAAA;EAAA,SAEjC,YAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,uBAAsC,EAAA,GAC5C,IAAA,aACG,UAAA;MAAa,OAAA;MAAsB,QAAA;IAAA;EAAA;EAAA,SAEjC,iBAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GAAO,KAAA,EAAO,eAAA,uBAAsC,EAAA,MAAQ,sBAAA;EAAA;AAAA"}
@@ -0,0 +1,2 @@
1
+ import { t as QueryOperationTypes } from "./operation-types-DXmTJ7jd.mjs";
2
+ export { type QueryOperationTypes };
@@ -0,0 +1 @@
1
+ export {};
package/dist/pack.d.mts CHANGED
@@ -1,3 +1,5 @@
1
+ import * as _$_prisma_next_sql_contract_index_types0 from "@prisma-next/sql-contract/index-types";
2
+
1
3
  //#region src/exports/pack.d.ts
2
4
  declare const paradedbPack: {
3
5
  readonly kind: "extension";
@@ -10,6 +12,20 @@ declare const paradedbPack: {
10
12
  readonly 'paradedb/bm25': true;
11
13
  };
12
14
  };
15
+ readonly indexTypes: _$_prisma_next_sql_contract_index_types0.IndexTypeBuilder<Record<never, never> & Record<"bm25", {
16
+ readonly options: {
17
+ key_field: string;
18
+ };
19
+ }>>;
20
+ readonly types: {
21
+ readonly queryOperationTypes: {
22
+ readonly import: {
23
+ readonly package: "@prisma-next/extension-paradedb/operation-types";
24
+ readonly named: "QueryOperationTypes";
25
+ readonly alias: "ParadeDbQueryOperationTypes";
26
+ };
27
+ };
28
+ };
13
29
  };
14
30
  //#endregion
15
31
  export { paradedbPack as default };
@@ -1 +1 @@
1
- {"version":3,"file":"pack.d.mts","names":[],"sources":["../src/exports/pack.ts"],"sourcesContent":[],"mappings":";cAEM;EAAA,SAAA,IAAA,EAA+B,WAAA"}
1
+ {"version":3,"file":"pack.d.mts","names":[],"sources":["../src/exports/pack.ts"],"mappings":";;;cAEM,YAAA;EAAA"}
package/dist/pack.mjs CHANGED
@@ -1,9 +1,7 @@
1
- import { t as paradedbPackMeta } from "./descriptor-meta-BTFnIGJ6.mjs";
2
-
1
+ import { t as paradedbPackMeta } from "./descriptor-meta-Dr4mAlbx.mjs";
3
2
  //#region src/exports/pack.ts
4
3
  const paradedbPack = paradedbPackMeta;
5
- var pack_default = paradedbPack;
6
-
7
4
  //#endregion
8
- export { pack_default as default };
5
+ export { paradedbPack as default };
6
+
9
7
  //# sourceMappingURL=pack.mjs.map
package/dist/pack.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"pack.mjs","names":[],"sources":["../src/exports/pack.ts"],"sourcesContent":["import { paradedbPackMeta } from '../core/descriptor-meta';\n\nconst paradedbPack = paradedbPackMeta;\n\nexport default paradedbPack;\n"],"mappings":";;;AAEA,MAAM,eAAe;AAErB,mBAAe"}
1
+ {"version":3,"file":"pack.mjs","names":[],"sources":["../src/exports/pack.ts"],"sourcesContent":["import { paradedbPackMeta } from '../core/descriptor-meta';\n\nconst paradedbPack = paradedbPackMeta;\n\nexport default paradedbPack;\n"],"mappings":";;AAEA,MAAM,eAAe"}
@@ -0,0 +1,7 @@
1
+ import { SqlRuntimeExtensionDescriptor } from "@prisma-next/sql-runtime";
2
+
3
+ //#region src/exports/runtime.d.ts
4
+ declare const paradedbRuntimeDescriptor: SqlRuntimeExtensionDescriptor<'postgres'>;
5
+ //#endregion
6
+ export { paradedbRuntimeDescriptor as default };
7
+ //# sourceMappingURL=runtime.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.mts","names":[],"sources":["../src/exports/runtime.ts"],"mappings":";;;cAGM,yBAAA,EAA2B,6BAAA"}
@@ -0,0 +1,21 @@
1
+ import { n as paradedbQueryOperations, t as paradedbPackMeta } from "./descriptor-meta-Dr4mAlbx.mjs";
2
+ //#region src/exports/runtime.ts
3
+ const paradedbRuntimeDescriptor = {
4
+ kind: "extension",
5
+ id: paradedbPackMeta.id,
6
+ version: paradedbPackMeta.version,
7
+ familyId: "sql",
8
+ targetId: "postgres",
9
+ codecs: () => [],
10
+ queryOperations: () => paradedbQueryOperations(),
11
+ create() {
12
+ return {
13
+ familyId: "sql",
14
+ targetId: "postgres"
15
+ };
16
+ }
17
+ };
18
+ //#endregion
19
+ export { paradedbRuntimeDescriptor as default };
20
+
21
+ //# sourceMappingURL=runtime.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.mjs","names":[],"sources":["../src/exports/runtime.ts"],"sourcesContent":["import type { SqlRuntimeExtensionDescriptor } from '@prisma-next/sql-runtime';\nimport { paradedbPackMeta, paradedbQueryOperations } from '../core/descriptor-meta';\n\nconst paradedbRuntimeDescriptor: SqlRuntimeExtensionDescriptor<'postgres'> = {\n kind: 'extension' as const,\n id: paradedbPackMeta.id,\n version: paradedbPackMeta.version,\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n codecs: () => [],\n queryOperations: () => paradedbQueryOperations(),\n create() {\n return {\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n };\n },\n};\n\nexport default paradedbRuntimeDescriptor;\n"],"mappings":";;AAGA,MAAM,4BAAuE;CAC3E,MAAM;CACN,IAAI,iBAAiB;CACrB,SAAS,iBAAiB;CAC1B,UAAU;CACV,UAAU;CACV,cAAc,EAAE;CAChB,uBAAuB,yBAAyB;CAChD,SAAS;EACP,OAAO;GACL,UAAU;GACV,UAAU;GACX;;CAEJ"}
package/package.json CHANGED
@@ -1,18 +1,33 @@
1
1
  {
2
2
  "name": "@prisma-next/extension-paradedb",
3
- "version": "0.5.0-dev.9",
3
+ "version": "0.5.1",
4
+ "license": "Apache-2.0",
4
5
  "type": "module",
5
6
  "sideEffects": false,
6
7
  "dependencies": {
7
- "@prisma-next/contract": "0.5.0-dev.9",
8
- "@prisma-next/contract-authoring": "0.5.0-dev.9"
8
+ "arktype": "^2.1.25",
9
+ "@prisma-next/contract": "0.5.1",
10
+ "@prisma-next/family-sql": "0.5.1",
11
+ "@prisma-next/contract-authoring": "0.5.1",
12
+ "@prisma-next/migration-tools": "0.5.1",
13
+ "@prisma-next/sql-contract": "0.5.1",
14
+ "@prisma-next/sql-operations": "0.5.1",
15
+ "@prisma-next/sql-relational-core": "0.5.1",
16
+ "@prisma-next/sql-runtime": "0.5.1",
17
+ "@prisma-next/framework-components": "0.5.1"
9
18
  },
10
19
  "devDependencies": {
11
- "tsdown": "0.18.4",
20
+ "tsdown": "0.22.0",
12
21
  "typescript": "5.9.3",
13
- "vitest": "4.0.17",
14
- "@prisma-next/tsdown": "0.0.0",
15
- "@prisma-next/tsconfig": "0.0.0"
22
+ "vitest": "4.1.5",
23
+ "@prisma-next/adapter-postgres": "0.5.1",
24
+ "@prisma-next/cli": "0.5.1",
25
+ "@prisma-next/operations": "0.5.1",
26
+ "@prisma-next/sql-contract-ts": "0.5.1",
27
+ "@prisma-next/target-postgres": "0.5.1",
28
+ "@prisma-next/test-utils": "0.0.1",
29
+ "@prisma-next/tsconfig": "0.0.0",
30
+ "@prisma-next/tsdown": "0.0.0"
16
31
  },
17
32
  "files": [
18
33
  "dist",
@@ -21,7 +36,9 @@
21
36
  "exports": {
22
37
  "./control": "./dist/control.mjs",
23
38
  "./index-types": "./dist/index-types.mjs",
39
+ "./operation-types": "./dist/operation-types.mjs",
24
40
  "./pack": "./dist/pack.mjs",
41
+ "./runtime": "./dist/runtime.mjs",
25
42
  "./package.json": "./package.json"
26
43
  },
27
44
  "repository": {
@@ -30,6 +47,7 @@
30
47
  "directory": "packages/3-extensions/paradedb"
31
48
  },
32
49
  "scripts": {
50
+ "build:contract-space": "prisma-next contract emit",
33
51
  "build": "tsdown",
34
52
  "test": "vitest run",
35
53
  "test:coverage": "vitest run --coverage",
@@ -0,0 +1,81 @@
1
+ // ⚠️ GENERATED FILE - DO NOT EDIT
2
+ // This file is automatically generated by 'prisma-next contract emit'.
3
+ // To regenerate, run: prisma-next contract emit
4
+ import type { CodecTypes as PgTypes } from '@prisma-next/target-postgres/codec-types';
5
+ import type { JsonValue } from '@prisma-next/target-postgres/codec-types';
6
+ import type { Char } from '@prisma-next/target-postgres/codec-types';
7
+ import type { Varchar } from '@prisma-next/target-postgres/codec-types';
8
+ import type { Numeric } from '@prisma-next/target-postgres/codec-types';
9
+ import type { Bit } from '@prisma-next/target-postgres/codec-types';
10
+ import type { VarBit } from '@prisma-next/target-postgres/codec-types';
11
+ import type { Timestamp } from '@prisma-next/target-postgres/codec-types';
12
+ import type { Timestamptz } from '@prisma-next/target-postgres/codec-types';
13
+ import type { Time } from '@prisma-next/target-postgres/codec-types';
14
+ import type { Timetz } from '@prisma-next/target-postgres/codec-types';
15
+ import type { Interval } from '@prisma-next/target-postgres/codec-types';
16
+ import type { QueryOperationTypes as PgAdapterQueryOps } from '@prisma-next/adapter-postgres/operation-types';
17
+
18
+ import type {
19
+ ContractWithTypeMaps,
20
+ TypeMaps as TypeMapsType,
21
+ } from '@prisma-next/sql-contract/types';
22
+ import type {
23
+ Contract as ContractType,
24
+ ExecutionHashBase,
25
+ ProfileHashBase,
26
+ StorageHashBase,
27
+ } from '@prisma-next/contract/types';
28
+
29
+ export type StorageHash =
30
+ StorageHashBase<'sha256:7d13ea93bd4726b9962c00ced807a79149e3ff69e0a47d936c0e82f39a637393'>;
31
+ export type ExecutionHash = ExecutionHashBase<string>;
32
+ export type ProfileHash =
33
+ ProfileHashBase<'sha256:1a8dbe044289f30a1de958fe800cc5a8378b285d2e126a8c44b58864bac2c18e'>;
34
+
35
+ export type CodecTypes = PgTypes;
36
+ export type LaneCodecTypes = CodecTypes;
37
+ export type QueryOperationTypes = PgAdapterQueryOps<CodecTypes>;
38
+ type DefaultLiteralValue<CodecId extends string, _Encoded> = CodecId extends keyof CodecTypes
39
+ ? CodecTypes[CodecId]['output']
40
+ : _Encoded;
41
+
42
+ export type FieldOutputTypes = Record<string, never>;
43
+ export type FieldInputTypes = Record<string, never>;
44
+ export type TypeMaps = TypeMapsType<
45
+ CodecTypes,
46
+ QueryOperationTypes,
47
+ FieldOutputTypes,
48
+ FieldInputTypes
49
+ >;
50
+
51
+ type ContractBase = ContractType<
52
+ { readonly tables: {}; readonly types: Record<string, never>; readonly storageHash: StorageHash },
53
+ Record<string, never>
54
+ > & {
55
+ readonly target: 'postgres';
56
+ readonly targetFamily: 'sql';
57
+ readonly roots: Record<string, string>;
58
+ readonly capabilities: {
59
+ readonly postgres: {
60
+ readonly jsonAgg: true;
61
+ readonly lateral: true;
62
+ readonly limit: true;
63
+ readonly orderBy: true;
64
+ readonly returning: true;
65
+ };
66
+ readonly sql: {
67
+ readonly defaultInInsert: true;
68
+ readonly enums: true;
69
+ readonly returning: true;
70
+ };
71
+ };
72
+ readonly extensionPacks: {};
73
+ readonly meta: {};
74
+
75
+ readonly profileHash: ProfileHash;
76
+ };
77
+
78
+ export type Contract = ContractWithTypeMaps<ContractBase, TypeMaps>;
79
+
80
+ export type Tables = Contract['storage']['tables'];
81
+ export type Models = Contract['models'];