@contractspec/integration.providers-impls 1.57.0 → 1.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/dist/analytics.d.ts +1 -8
  2. package/dist/analytics.d.ts.map +1 -1
  3. package/dist/analytics.js +3 -3
  4. package/dist/calendar.d.ts +1 -8
  5. package/dist/calendar.d.ts.map +1 -1
  6. package/dist/calendar.js +3 -3
  7. package/dist/database.d.ts +1 -8
  8. package/dist/database.d.ts.map +1 -1
  9. package/dist/database.js +3 -3
  10. package/dist/email.d.ts +1 -8
  11. package/dist/email.d.ts.map +1 -1
  12. package/dist/email.js +3 -3
  13. package/dist/embedding.d.ts +1 -8
  14. package/dist/embedding.d.ts.map +1 -1
  15. package/dist/embedding.js +3 -3
  16. package/dist/impls/elevenlabs-voice.d.ts +14 -18
  17. package/dist/impls/elevenlabs-voice.d.ts.map +1 -1
  18. package/dist/impls/elevenlabs-voice.js +98 -88
  19. package/dist/impls/fal-voice.d.ts +22 -26
  20. package/dist/impls/fal-voice.d.ts.map +1 -1
  21. package/dist/impls/fal-voice.js +103 -78
  22. package/dist/impls/fathom-meeting-recorder.d.ts +35 -39
  23. package/dist/impls/fathom-meeting-recorder.d.ts.map +1 -1
  24. package/dist/impls/fathom-meeting-recorder.js +285 -142
  25. package/dist/impls/fathom-meeting-recorder.mapper.d.ts +4 -8
  26. package/dist/impls/fathom-meeting-recorder.mapper.d.ts.map +1 -1
  27. package/dist/impls/fathom-meeting-recorder.mapper.js +102 -38
  28. package/dist/impls/fathom-meeting-recorder.types.d.ts +16 -20
  29. package/dist/impls/fathom-meeting-recorder.types.d.ts.map +1 -1
  30. package/dist/impls/fathom-meeting-recorder.types.js +1 -0
  31. package/dist/impls/fathom-meeting-recorder.utils.d.ts +10 -14
  32. package/dist/impls/fathom-meeting-recorder.utils.d.ts.map +1 -1
  33. package/dist/impls/fathom-meeting-recorder.utils.js +58 -41
  34. package/dist/impls/fathom-meeting-recorder.webhooks.d.ts +3 -7
  35. package/dist/impls/fathom-meeting-recorder.webhooks.d.ts.map +1 -1
  36. package/dist/impls/fathom-meeting-recorder.webhooks.js +25 -20
  37. package/dist/impls/fireflies-meeting-recorder.d.ts +21 -25
  38. package/dist/impls/fireflies-meeting-recorder.d.ts.map +1 -1
  39. package/dist/impls/fireflies-meeting-recorder.js +272 -149
  40. package/dist/impls/fireflies-meeting-recorder.queries.d.ts +3 -6
  41. package/dist/impls/fireflies-meeting-recorder.queries.d.ts.map +1 -1
  42. package/dist/impls/fireflies-meeting-recorder.queries.js +10 -8
  43. package/dist/impls/fireflies-meeting-recorder.types.d.ts +26 -29
  44. package/dist/impls/fireflies-meeting-recorder.types.d.ts.map +1 -1
  45. package/dist/impls/fireflies-meeting-recorder.types.js +1 -0
  46. package/dist/impls/fireflies-meeting-recorder.utils.d.ts +4 -7
  47. package/dist/impls/fireflies-meeting-recorder.utils.d.ts.map +1 -1
  48. package/dist/impls/fireflies-meeting-recorder.utils.js +34 -27
  49. package/dist/impls/gcs-storage.d.ts +18 -22
  50. package/dist/impls/gcs-storage.d.ts.map +1 -1
  51. package/dist/impls/gcs-storage.js +92 -84
  52. package/dist/impls/gmail-inbound.d.ts +20 -24
  53. package/dist/impls/gmail-inbound.d.ts.map +1 -1
  54. package/dist/impls/gmail-inbound.js +212 -185
  55. package/dist/impls/gmail-outbound.d.ts +12 -16
  56. package/dist/impls/gmail-outbound.d.ts.map +1 -1
  57. package/dist/impls/gmail-outbound.js +126 -92
  58. package/dist/impls/google-calendar.d.ts +17 -21
  59. package/dist/impls/google-calendar.d.ts.map +1 -1
  60. package/dist/impls/google-calendar.js +182 -145
  61. package/dist/impls/gradium-voice.d.ts +20 -22
  62. package/dist/impls/gradium-voice.d.ts.map +1 -1
  63. package/dist/impls/gradium-voice.js +85 -74
  64. package/dist/impls/granola-meeting-recorder.d.ts +31 -24
  65. package/dist/impls/granola-meeting-recorder.d.ts.map +1 -1
  66. package/dist/impls/granola-meeting-recorder.js +511 -143
  67. package/dist/impls/granola-meeting-recorder.mcp.d.ts +25 -0
  68. package/dist/impls/granola-meeting-recorder.mcp.d.ts.map +1 -0
  69. package/dist/impls/granola-meeting-recorder.mcp.js +279 -0
  70. package/dist/impls/granola-meeting-recorder.types.d.ts +60 -49
  71. package/dist/impls/granola-meeting-recorder.types.d.ts.map +1 -1
  72. package/dist/impls/granola-meeting-recorder.types.js +1 -0
  73. package/dist/impls/index.d.ts +28 -28
  74. package/dist/impls/index.d.ts.map +1 -0
  75. package/dist/impls/index.js +4659 -29
  76. package/dist/impls/jira.d.ts +18 -22
  77. package/dist/impls/jira.d.ts.map +1 -1
  78. package/dist/impls/jira.js +112 -101
  79. package/dist/impls/linear.d.ts +17 -21
  80. package/dist/impls/linear.d.ts.map +1 -1
  81. package/dist/impls/linear.js +78 -69
  82. package/dist/impls/mistral-embedding.d.ts +17 -21
  83. package/dist/impls/mistral-embedding.d.ts.map +1 -1
  84. package/dist/impls/mistral-embedding.js +41 -39
  85. package/dist/impls/mistral-llm.d.ts +25 -29
  86. package/dist/impls/mistral-llm.d.ts.map +1 -1
  87. package/dist/impls/mistral-llm.js +266 -244
  88. package/dist/impls/notion.d.ts +20 -24
  89. package/dist/impls/notion.d.ts.map +1 -1
  90. package/dist/impls/notion.js +145 -110
  91. package/dist/impls/posthog-reader.d.ts +18 -22
  92. package/dist/impls/posthog-reader.d.ts.map +1 -1
  93. package/dist/impls/posthog-reader.js +148 -129
  94. package/dist/impls/posthog-utils.d.ts +4 -7
  95. package/dist/impls/posthog-utils.d.ts.map +1 -1
  96. package/dist/impls/posthog-utils.js +31 -22
  97. package/dist/impls/posthog.d.ts +33 -37
  98. package/dist/impls/posthog.d.ts.map +1 -1
  99. package/dist/impls/posthog.js +320 -119
  100. package/dist/impls/postmark-email.d.ts +13 -17
  101. package/dist/impls/postmark-email.d.ts.map +1 -1
  102. package/dist/impls/postmark-email.js +55 -50
  103. package/dist/impls/powens-client.d.ts +111 -114
  104. package/dist/impls/powens-client.d.ts.map +1 -1
  105. package/dist/impls/powens-client.js +194 -170
  106. package/dist/impls/powens-openbanking.d.ts +22 -26
  107. package/dist/impls/powens-openbanking.d.ts.map +1 -1
  108. package/dist/impls/powens-openbanking.js +425 -217
  109. package/dist/impls/provider-factory.d.ts +29 -33
  110. package/dist/impls/provider-factory.d.ts.map +1 -1
  111. package/dist/impls/provider-factory.js +4072 -275
  112. package/dist/impls/qdrant-vector.d.ts +18 -22
  113. package/dist/impls/qdrant-vector.d.ts.map +1 -1
  114. package/dist/impls/qdrant-vector.js +76 -69
  115. package/dist/impls/stripe-payments.d.ts +22 -26
  116. package/dist/impls/stripe-payments.d.ts.map +1 -1
  117. package/dist/impls/stripe-payments.js +219 -193
  118. package/dist/impls/supabase-psql.d.ts +21 -25
  119. package/dist/impls/supabase-psql.d.ts.map +1 -1
  120. package/dist/impls/supabase-psql.js +138 -98
  121. package/dist/impls/supabase-vector.d.ts +29 -33
  122. package/dist/impls/supabase-vector.d.ts.map +1 -1
  123. package/dist/impls/supabase-vector.js +278 -103
  124. package/dist/impls/tldv-meeting-recorder.d.ts +18 -22
  125. package/dist/impls/tldv-meeting-recorder.d.ts.map +1 -1
  126. package/dist/impls/tldv-meeting-recorder.js +142 -127
  127. package/dist/impls/twilio-sms.d.ts +14 -17
  128. package/dist/impls/twilio-sms.d.ts.map +1 -1
  129. package/dist/impls/twilio-sms.js +62 -55
  130. package/dist/index.d.ts +15 -64
  131. package/dist/index.d.ts.map +1 -1
  132. package/dist/index.js +4700 -107
  133. package/dist/llm.d.ts +1 -8
  134. package/dist/llm.d.ts.map +1 -1
  135. package/dist/llm.js +3 -3
  136. package/dist/meeting-recorder.d.ts +1 -8
  137. package/dist/meeting-recorder.d.ts.map +1 -1
  138. package/dist/meeting-recorder.js +3 -3
  139. package/dist/node/analytics.js +2 -0
  140. package/dist/node/calendar.js +2 -0
  141. package/dist/node/database.js +2 -0
  142. package/dist/node/email.js +2 -0
  143. package/dist/node/embedding.js +2 -0
  144. package/dist/node/impls/elevenlabs-voice.js +102 -0
  145. package/dist/node/impls/fal-voice.js +112 -0
  146. package/dist/node/impls/fathom-meeting-recorder.js +287 -0
  147. package/dist/node/impls/fathom-meeting-recorder.mapper.js +105 -0
  148. package/dist/node/impls/fathom-meeting-recorder.types.js +0 -0
  149. package/dist/node/impls/fathom-meeting-recorder.utils.js +72 -0
  150. package/dist/node/impls/fathom-meeting-recorder.webhooks.js +29 -0
  151. package/dist/node/impls/fireflies-meeting-recorder.js +274 -0
  152. package/dist/node/impls/fireflies-meeting-recorder.queries.js +85 -0
  153. package/dist/node/impls/fireflies-meeting-recorder.types.js +0 -0
  154. package/dist/node/impls/fireflies-meeting-recorder.utils.js +42 -0
  155. package/dist/node/impls/gcs-storage.js +97 -0
  156. package/dist/node/impls/gmail-inbound.js +227 -0
  157. package/dist/node/impls/gmail-outbound.js +139 -0
  158. package/dist/node/impls/google-calendar.js +191 -0
  159. package/dist/node/impls/gradium-voice.js +90 -0
  160. package/dist/node/impls/granola-meeting-recorder.js +512 -0
  161. package/dist/node/impls/granola-meeting-recorder.mcp.js +278 -0
  162. package/dist/node/impls/granola-meeting-recorder.types.js +0 -0
  163. package/dist/node/impls/index.js +4658 -0
  164. package/dist/node/impls/jira.js +124 -0
  165. package/dist/node/impls/linear.js +83 -0
  166. package/dist/node/impls/mistral-embedding.js +43 -0
  167. package/dist/node/impls/mistral-llm.js +269 -0
  168. package/dist/node/impls/notion.js +160 -0
  169. package/dist/node/impls/posthog-reader.js +159 -0
  170. package/dist/node/impls/posthog-utils.js +38 -0
  171. package/dist/node/impls/posthog.js +322 -0
  172. package/dist/node/impls/postmark-email.js +60 -0
  173. package/dist/node/impls/powens-client.js +195 -0
  174. package/dist/node/impls/powens-openbanking.js +426 -0
  175. package/dist/node/impls/provider-factory.js +4080 -0
  176. package/dist/node/impls/qdrant-vector.js +78 -0
  177. package/dist/node/impls/stripe-payments.js +228 -0
  178. package/dist/node/impls/supabase-psql.js +150 -0
  179. package/dist/node/impls/supabase-vector.js +323 -0
  180. package/dist/node/impls/tldv-meeting-recorder.js +145 -0
  181. package/dist/node/impls/twilio-sms.js +65 -0
  182. package/dist/node/index.js +4699 -0
  183. package/dist/node/llm.js +2 -0
  184. package/dist/node/meeting-recorder.js +2 -0
  185. package/dist/node/openbanking.js +2 -0
  186. package/dist/node/payments.js +2 -0
  187. package/dist/node/project-management.js +2 -0
  188. package/dist/node/runtime.js +0 -0
  189. package/dist/node/secrets/provider.js +11 -0
  190. package/dist/node/sms.js +2 -0
  191. package/dist/node/storage.js +2 -0
  192. package/dist/node/vector-store.js +2 -0
  193. package/dist/node/voice.js +2 -0
  194. package/dist/openbanking.d.ts +1 -8
  195. package/dist/openbanking.d.ts.map +1 -1
  196. package/dist/openbanking.js +3 -3
  197. package/dist/payments.d.ts +1 -8
  198. package/dist/payments.d.ts.map +1 -1
  199. package/dist/payments.js +3 -3
  200. package/dist/project-management.d.ts +1 -8
  201. package/dist/project-management.d.ts.map +1 -1
  202. package/dist/project-management.js +3 -3
  203. package/dist/runtime.d.ts +2 -2
  204. package/dist/runtime.d.ts.map +1 -0
  205. package/dist/runtime.js +1 -0
  206. package/dist/secrets/provider.d.ts +3 -2
  207. package/dist/secrets/provider.d.ts.map +1 -0
  208. package/dist/secrets/provider.js +12 -3
  209. package/dist/sms.d.ts +1 -8
  210. package/dist/sms.d.ts.map +1 -1
  211. package/dist/sms.js +3 -3
  212. package/dist/storage.d.ts +1 -8
  213. package/dist/storage.d.ts.map +1 -1
  214. package/dist/storage.js +3 -3
  215. package/dist/vector-store.d.ts +1 -8
  216. package/dist/vector-store.d.ts.map +1 -1
  217. package/dist/vector-store.js +3 -3
  218. package/dist/voice.d.ts +1 -8
  219. package/dist/voice.d.ts.map +1 -1
  220. package/dist/voice.js +3 -3
  221. package/package.json +405 -114
  222. package/dist/_virtual/_rolldown/runtime.js +0 -36
  223. package/dist/impls/elevenlabs-voice.js.map +0 -1
  224. package/dist/impls/fal-voice.js.map +0 -1
  225. package/dist/impls/fathom-meeting-recorder.js.map +0 -1
  226. package/dist/impls/fathom-meeting-recorder.mapper.js.map +0 -1
  227. package/dist/impls/fathom-meeting-recorder.utils.js.map +0 -1
  228. package/dist/impls/fathom-meeting-recorder.webhooks.js.map +0 -1
  229. package/dist/impls/fireflies-meeting-recorder.js.map +0 -1
  230. package/dist/impls/fireflies-meeting-recorder.queries.js.map +0 -1
  231. package/dist/impls/fireflies-meeting-recorder.utils.js.map +0 -1
  232. package/dist/impls/gcs-storage.js.map +0 -1
  233. package/dist/impls/gmail-inbound.js.map +0 -1
  234. package/dist/impls/gmail-outbound.js.map +0 -1
  235. package/dist/impls/google-calendar.js.map +0 -1
  236. package/dist/impls/gradium-voice.js.map +0 -1
  237. package/dist/impls/granola-meeting-recorder.js.map +0 -1
  238. package/dist/impls/jira.js.map +0 -1
  239. package/dist/impls/linear.js.map +0 -1
  240. package/dist/impls/mistral-embedding.js.map +0 -1
  241. package/dist/impls/mistral-llm.js.map +0 -1
  242. package/dist/impls/notion.js.map +0 -1
  243. package/dist/impls/posthog-reader.js.map +0 -1
  244. package/dist/impls/posthog-utils.js.map +0 -1
  245. package/dist/impls/posthog.js.map +0 -1
  246. package/dist/impls/postmark-email.js.map +0 -1
  247. package/dist/impls/powens-client.js.map +0 -1
  248. package/dist/impls/powens-openbanking.js.map +0 -1
  249. package/dist/impls/provider-factory.js.map +0 -1
  250. package/dist/impls/qdrant-vector.js.map +0 -1
  251. package/dist/impls/stripe-payments.js.map +0 -1
  252. package/dist/impls/supabase-psql.js.map +0 -1
  253. package/dist/impls/supabase-vector.js.map +0 -1
  254. package/dist/impls/tldv-meeting-recorder.js.map +0 -1
  255. package/dist/impls/twilio-sms.js.map +0 -1
  256. package/dist/index.js.map +0 -1
@@ -1,111 +1,151 @@
1
- import { Buffer } from "node:buffer";
2
- import { sql } from "drizzle-orm";
1
+ // @bun
2
+ // src/impls/supabase-psql.ts
3
+ import { Buffer } from "buffer";
4
+ import { sql as drizzleSql } from "drizzle-orm";
3
5
  import { drizzle } from "drizzle-orm/postgres-js";
4
6
  import postgres from "postgres";
5
7
 
6
- //#region src/impls/supabase-psql.ts
7
- var SupabasePostgresProvider = class SupabasePostgresProvider {
8
- client;
9
- db;
10
- ownsClient;
11
- createDrizzle;
12
- constructor(options = {}) {
13
- this.createDrizzle = options.createDrizzle ?? ((client) => drizzle(client));
14
- if (options.db) {
15
- if (!options.client) throw new Error("SupabasePostgresProvider requires a postgres client when db is provided.");
16
- this.client = options.client;
17
- this.db = options.db;
18
- this.ownsClient = false;
19
- return;
20
- }
21
- if (options.client) {
22
- this.client = options.client;
23
- this.ownsClient = false;
24
- } else {
25
- if (!options.connectionString) throw new Error("SupabasePostgresProvider requires either a connectionString or a client.");
26
- this.client = postgres(options.connectionString, {
27
- max: options.maxConnections,
28
- prepare: false,
29
- ssl: resolveSslMode(options.sslMode)
30
- });
31
- this.ownsClient = true;
32
- }
33
- this.db = this.createDrizzle(this.client);
34
- }
35
- async query(statement, params = []) {
36
- const query = buildParameterizedSql(statement, params);
37
- const rows = asRows(await this.db.execute(query));
38
- return {
39
- rows,
40
- rowCount: rows.length
41
- };
42
- }
43
- async execute(statement, params = []) {
44
- const query = buildParameterizedSql(statement, params);
45
- await this.db.execute(query);
46
- }
47
- async transaction(run) {
48
- return this.client.begin(async (transactionClient) => {
49
- return run(new SupabasePostgresProvider({
50
- client: transactionClient,
51
- db: this.createDrizzle(transactionClient),
52
- createDrizzle: this.createDrizzle
53
- }));
54
- });
55
- }
56
- async close() {
57
- if (this.ownsClient) await this.client.end({ timeout: 5 });
58
- }
59
- };
8
+ class SupabasePostgresProvider {
9
+ client;
10
+ db;
11
+ ownsClient;
12
+ createDrizzle;
13
+ constructor(options = {}) {
14
+ this.createDrizzle = options.createDrizzle ?? ((client) => drizzle(client));
15
+ if (options.db) {
16
+ if (!options.client) {
17
+ throw new Error("SupabasePostgresProvider requires a postgres client when db is provided.");
18
+ }
19
+ this.client = options.client;
20
+ this.db = options.db;
21
+ this.ownsClient = false;
22
+ return;
23
+ }
24
+ if (options.client) {
25
+ this.client = options.client;
26
+ this.ownsClient = false;
27
+ } else {
28
+ if (!options.connectionString) {
29
+ throw new Error("SupabasePostgresProvider requires either a connectionString or a client.");
30
+ }
31
+ this.client = postgres(options.connectionString, {
32
+ max: options.maxConnections,
33
+ prepare: false,
34
+ ssl: resolveSslMode(options.sslMode)
35
+ });
36
+ this.ownsClient = true;
37
+ }
38
+ this.db = this.createDrizzle(this.client);
39
+ }
40
+ async query(statement, params = []) {
41
+ const query = buildParameterizedSql(statement, params);
42
+ const result = await this.db.execute(query);
43
+ const rows = asRows(result);
44
+ return {
45
+ rows,
46
+ rowCount: rows.length
47
+ };
48
+ }
49
+ async execute(statement, params = []) {
50
+ const query = buildParameterizedSql(statement, params);
51
+ await this.db.execute(query);
52
+ }
53
+ async transaction(run) {
54
+ const transactionResult = this.client.begin(async (transactionClient) => {
55
+ const transactionalProvider = new SupabasePostgresProvider({
56
+ client: transactionClient,
57
+ db: this.createDrizzle(transactionClient),
58
+ createDrizzle: this.createDrizzle
59
+ });
60
+ return run(transactionalProvider);
61
+ });
62
+ return transactionResult;
63
+ }
64
+ async close() {
65
+ if (this.ownsClient) {
66
+ await this.client.end({ timeout: 5 });
67
+ }
68
+ }
69
+ }
60
70
  function buildParameterizedSql(statement, params) {
61
- const segments = [];
62
- const pattern = /\$(\d+)/g;
63
- let cursor = 0;
64
- for (const match of statement.matchAll(pattern)) {
65
- const token = match[0];
66
- const indexPart = match[1];
67
- const start = match.index;
68
- if (indexPart == null || start == null) continue;
69
- const parameterIndex = Number(indexPart) - 1;
70
- if (!Number.isInteger(parameterIndex) || parameterIndex < 0 || parameterIndex >= params.length) throw new Error(`SQL placeholder ${token} is out of bounds for ${params.length} parameter(s).`);
71
- const staticSegment = statement.slice(cursor, start);
72
- if (staticSegment.length > 0) segments.push(sql.raw(staticSegment));
73
- const parameterValue = params[parameterIndex];
74
- if (parameterValue === void 0) throw new Error(`SQL placeholder ${token} is missing a parameter value.`);
75
- const normalizedValue = normalizeParam(parameterValue);
76
- segments.push(sql`${normalizedValue}`);
77
- cursor = start + token.length;
78
- }
79
- const tailSegment = statement.slice(cursor);
80
- if (tailSegment.length > 0) segments.push(sql.raw(tailSegment));
81
- if (segments.length === 0) return sql.raw("");
82
- return sql.join(segments);
71
+ const segments = [];
72
+ const pattern = /\$(\d+)/g;
73
+ let cursor = 0;
74
+ for (const match of statement.matchAll(pattern)) {
75
+ const token = match[0];
76
+ const indexPart = match[1];
77
+ const start = match.index;
78
+ if (indexPart == null || start == null)
79
+ continue;
80
+ const parameterIndex = Number(indexPart) - 1;
81
+ if (!Number.isInteger(parameterIndex) || parameterIndex < 0 || parameterIndex >= params.length) {
82
+ throw new Error(`SQL placeholder ${token} is out of bounds for ${params.length} parameter(s).`);
83
+ }
84
+ const staticSegment = statement.slice(cursor, start);
85
+ if (staticSegment.length > 0) {
86
+ segments.push(drizzleSql.raw(staticSegment));
87
+ }
88
+ const parameterValue = params[parameterIndex];
89
+ if (parameterValue === undefined) {
90
+ throw new Error(`SQL placeholder ${token} is missing a parameter value.`);
91
+ }
92
+ const normalizedValue = normalizeParam(parameterValue);
93
+ segments.push(drizzleSql`${normalizedValue}`);
94
+ cursor = start + token.length;
95
+ }
96
+ const tailSegment = statement.slice(cursor);
97
+ if (tailSegment.length > 0) {
98
+ segments.push(drizzleSql.raw(tailSegment));
99
+ }
100
+ if (segments.length === 0) {
101
+ return drizzleSql.raw("");
102
+ }
103
+ return drizzleSql.join(segments);
83
104
  }
84
105
  function normalizeParam(value) {
85
- if (typeof value === "bigint") return value.toString();
86
- if (value instanceof Uint8Array) return Buffer.from(value);
87
- if (isPlainObject(value)) return JSON.stringify(value);
88
- return value;
106
+ if (typeof value === "bigint") {
107
+ return value.toString();
108
+ }
109
+ if (value instanceof Uint8Array) {
110
+ return Buffer.from(value);
111
+ }
112
+ if (isPlainObject(value)) {
113
+ return JSON.stringify(value);
114
+ }
115
+ return value;
89
116
  }
90
117
  function asRows(result) {
91
- if (!Array.isArray(result)) return [];
92
- return result;
118
+ if (!Array.isArray(result)) {
119
+ return [];
120
+ }
121
+ return result;
93
122
  }
94
123
  function isPlainObject(value) {
95
- if (value == null || typeof value !== "object") return false;
96
- if (Array.isArray(value)) return false;
97
- if (value instanceof Date) return false;
98
- if (value instanceof Uint8Array) return false;
99
- return true;
124
+ if (value == null || typeof value !== "object") {
125
+ return false;
126
+ }
127
+ if (Array.isArray(value)) {
128
+ return false;
129
+ }
130
+ if (value instanceof Date) {
131
+ return false;
132
+ }
133
+ if (value instanceof Uint8Array) {
134
+ return false;
135
+ }
136
+ return true;
100
137
  }
101
138
  function resolveSslMode(mode) {
102
- switch (mode) {
103
- case "allow": return false;
104
- case "prefer": return "prefer";
105
- default: return "require";
106
- }
139
+ switch (mode) {
140
+ case "allow":
141
+ return false;
142
+ case "prefer":
143
+ return "prefer";
144
+ case "require":
145
+ default:
146
+ return "require";
147
+ }
107
148
  }
108
-
109
- //#endregion
110
- export { SupabasePostgresProvider };
111
- //# sourceMappingURL=supabase-psql.js.map
149
+ export {
150
+ SupabasePostgresProvider
151
+ };
@@ -1,36 +1,32 @@
1
- import { database_d_exports } from "../database.js";
2
- import { vector_store_d_exports } from "../vector-store.js";
3
- import { SupabasePostgresSslMode } from "./supabase-psql.js";
4
-
5
- //#region src/impls/supabase-vector.d.ts
6
- type SupabaseVectorDistanceMetric = 'cosine' | 'l2' | 'inner_product';
7
- interface SupabaseVectorProviderOptions {
8
- connectionString?: string;
9
- database?: database_d_exports.DatabaseProvider;
10
- schema?: string;
11
- table?: string;
12
- createTableIfMissing?: boolean;
13
- distanceMetric?: SupabaseVectorDistanceMetric;
14
- maxConnections?: number;
15
- sslMode?: SupabasePostgresSslMode;
1
+ import type { DatabaseProvider } from '../database';
2
+ import type { VectorDeleteRequest, VectorSearchQuery, VectorSearchResult, VectorStoreProvider, VectorUpsertRequest } from '../vector-store';
3
+ import { type SupabasePostgresSslMode } from './supabase-psql';
4
+ export type SupabaseVectorDistanceMetric = 'cosine' | 'l2' | 'inner_product';
5
+ export interface SupabaseVectorProviderOptions {
6
+ connectionString?: string;
7
+ database?: DatabaseProvider;
8
+ schema?: string;
9
+ table?: string;
10
+ createTableIfMissing?: boolean;
11
+ distanceMetric?: SupabaseVectorDistanceMetric;
12
+ maxConnections?: number;
13
+ sslMode?: SupabasePostgresSslMode;
16
14
  }
17
- declare class SupabaseVectorProvider implements vector_store_d_exports.VectorStoreProvider {
18
- private readonly database;
19
- private readonly createTableIfMissing;
20
- private readonly distanceMetric;
21
- private readonly quotedSchema;
22
- private readonly qualifiedTable;
23
- private readonly collectionIndex;
24
- private readonly namespaceIndex;
25
- private ensureTablePromise?;
26
- constructor(options: SupabaseVectorProviderOptions);
27
- upsert(request: vector_store_d_exports.VectorUpsertRequest): Promise<void>;
28
- search(query: vector_store_d_exports.VectorSearchQuery): Promise<vector_store_d_exports.VectorSearchResult[]>;
29
- delete(request: vector_store_d_exports.VectorDeleteRequest): Promise<void>;
30
- private ensureTable;
31
- private createTable;
32
- private get distanceOperator();
15
+ export declare class SupabaseVectorProvider implements VectorStoreProvider {
16
+ private readonly database;
17
+ private readonly createTableIfMissing;
18
+ private readonly distanceMetric;
19
+ private readonly quotedSchema;
20
+ private readonly qualifiedTable;
21
+ private readonly collectionIndex;
22
+ private readonly namespaceIndex;
23
+ private ensureTablePromise?;
24
+ constructor(options: SupabaseVectorProviderOptions);
25
+ upsert(request: VectorUpsertRequest): Promise<void>;
26
+ search(query: VectorSearchQuery): Promise<VectorSearchResult[]>;
27
+ delete(request: VectorDeleteRequest): Promise<void>;
28
+ private ensureTable;
29
+ private createTable;
30
+ private get distanceOperator();
33
31
  }
34
- //#endregion
35
- export { SupabaseVectorDistanceMetric, SupabaseVectorProvider, SupabaseVectorProviderOptions };
36
32
  //# sourceMappingURL=supabase-vector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"supabase-vector.d.ts","names":[],"sources":["../../src/impls/supabase-vector.ts"],"mappings":";;;;;KAgBY,4BAAA;AAAA,UAEK,6BAAA;EACf,gBAAA;EACA,QAAA,GAAW,kBAAA,CAAA,gBAAA;EACX,MAAA;EACA,KAAA;EACA,oBAAA;EACA,cAAA,GAAiB,4BAAA;EACjB,cAAA;EACA,OAAA,GAAU,uBAAA;AAAA;AAAA,cAQC,sBAAA,YAAkC,sBAAA,CAAA,mBAAA;EAAA,iBAC5B,QAAA;EAAA,iBACA,oBAAA;EAAA,iBACA,cAAA;EAAA,iBACA,YAAA;EAAA,iBACA,cAAA;EAAA,iBACA,eAAA;EAAA,iBACA,cAAA;EAAA,QACT,kBAAA;cAEI,OAAA,EAAS,6BAAA;EAqBf,MAAA,CAAO,OAAA,EAAS,sBAAA,CAAA,mBAAA,GAAsB,OAAA;EA8BtC,MAAA,CAAO,KAAA,EAAO,sBAAA,CAAA,iBAAA,GAAoB,OAAA,CAAQ,sBAAA,CAAA,kBAAA;EAwC1C,MAAA,CAAO,OAAA,EAAS,sBAAA,CAAA,mBAAA,GAAsB,OAAA;EAAA,QAiB9B,WAAA;EAAA,QAMA,WAAA;EAAA,YA2BF,gBAAA,CAAA;AAAA"}
1
+ {"version":3,"file":"supabase-vector.d.ts","sourceRoot":"","sources":["../../src/impls/supabase-vector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAGjB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,iBAAiB,CAAC;AACzB,MAAM,MAAM,4BAA4B,GAAG,QAAQ,GAAG,IAAI,GAAG,eAAe,CAAC;AAE7E,MAAM,WAAW,6BAA6B;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,4BAA4B,CAAC;IAC9C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,uBAAuB,CAAC;CACnC;AAOD,qBAAa,sBAAuB,YAAW,mBAAmB;IAChE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;IAC5C,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAU;IAC/C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA+B;IAC9D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,kBAAkB,CAAC,CAAgB;gBAE/B,OAAO,EAAE,6BAA6B;IAqB5C,MAAM,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IA8BnD,MAAM,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAwC/D,MAAM,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;YAiB3C,WAAW;YAMX,WAAW;IA2BzB,OAAO,KAAK,gBAAgB,GAU3B;CACF"}