@keystrokehq/snowflake 0.0.16 → 0.0.18

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 (82) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +9 -233
  3. package/package.json +39 -171
  4. package/dist/accounts/index.d.mts +0 -40
  5. package/dist/accounts/index.mjs +0 -51
  6. package/dist/bulk/index.d.mts +0 -71
  7. package/dist/bulk/index.mjs +0 -65
  8. package/dist/catalog/index.d.mts +0 -144
  9. package/dist/catalog/index.mjs +0 -158
  10. package/dist/client/index.d.mts +0 -44
  11. package/dist/client/index.mjs +0 -273
  12. package/dist/common-DfpCwJx5.mjs +0 -92
  13. package/dist/credential-sets/index.d.mts +0 -3
  14. package/dist/credential-sets/index.mjs +0 -4
  15. package/dist/databases/index.d.mts +0 -2
  16. package/dist/databases/index.mjs +0 -3
  17. package/dist/errors-60AsF7Su.mjs +0 -95
  18. package/dist/events/index.d.mts +0 -382
  19. package/dist/events/index.mjs +0 -291
  20. package/dist/file-formats/index.d.mts +0 -39
  21. package/dist/file-formats/index.mjs +0 -48
  22. package/dist/functions/index.d.mts +0 -53
  23. package/dist/functions/index.mjs +0 -56
  24. package/dist/grants/index.d.mts +0 -93
  25. package/dist/grants/index.mjs +0 -102
  26. package/dist/index.d.mts +0 -4
  27. package/dist/index.mjs +0 -6
  28. package/dist/operations/index.d.mts +0 -1
  29. package/dist/operations/index.mjs +0 -1
  30. package/dist/org-admin/index.d.mts +0 -80
  31. package/dist/org-admin/index.mjs +0 -79
  32. package/dist/pipes/index.d.mts +0 -119
  33. package/dist/pipes/index.mjs +0 -106
  34. package/dist/procedures/index.d.mts +0 -61
  35. package/dist/procedures/index.mjs +0 -79
  36. package/dist/results/index.d.mts +0 -16
  37. package/dist/results/index.mjs +0 -64
  38. package/dist/retry-B4-9MZIp.mjs +0 -164
  39. package/dist/retry-w7cTp1QL.d.mts +0 -10
  40. package/dist/roles/index.d.mts +0 -60
  41. package/dist/roles/index.mjs +0 -74
  42. package/dist/rows/index.d.mts +0 -106
  43. package/dist/rows/index.mjs +0 -223
  44. package/dist/schemas/index.d.mts +0 -2
  45. package/dist/schemas/index.mjs +0 -4
  46. package/dist/schemas-catalog/index.d.mts +0 -2
  47. package/dist/schemas-catalog/index.mjs +0 -3
  48. package/dist/shares/index.d.mts +0 -56
  49. package/dist/shares/index.mjs +0 -77
  50. package/dist/snowflake-s3-sns-webhook.credential-set-D6bLAWy5.d.mts +0 -50
  51. package/dist/snowflake-s3-sns-webhook.credential-set-DzR7oWNK.mjs +0 -44
  52. package/dist/snowflake.credential-set-BxT7Gf3A.d.mts +0 -114
  53. package/dist/snowflake.credential-set-DE3gXf-a.mjs +0 -106
  54. package/dist/sql/index.d.mts +0 -84
  55. package/dist/sql/index.mjs +0 -209
  56. package/dist/sql-options-2k5xQ-oS.d.mts +0 -32
  57. package/dist/sql-options-D6GEa21F.mjs +0 -79
  58. package/dist/sql-safety-BZpAPsq6.mjs +0 -56
  59. package/dist/stages/index.d.mts +0 -64
  60. package/dist/stages/index.mjs +0 -81
  61. package/dist/statements-BumhMhN4.mjs +0 -81
  62. package/dist/statements-DJL0qVNA.d.mts +0 -238
  63. package/dist/status-page/index.d.mts +0 -510
  64. package/dist/status-page/index.mjs +0 -261
  65. package/dist/streaming/index.d.mts +0 -70
  66. package/dist/streaming/index.mjs +0 -56
  67. package/dist/streams/index.d.mts +0 -71
  68. package/dist/streams/index.mjs +0 -78
  69. package/dist/tables/index.d.mts +0 -2
  70. package/dist/tables/index.mjs +0 -3
  71. package/dist/tasks/index.d.mts +0 -79
  72. package/dist/tasks/index.mjs +0 -104
  73. package/dist/triggers/index.d.mts +0 -381
  74. package/dist/triggers/index.mjs +0 -1100
  75. package/dist/users/index.d.mts +0 -61
  76. package/dist/users/index.mjs +0 -67
  77. package/dist/verification/index.d.mts +0 -201
  78. package/dist/verification/index.mjs +0 -512
  79. package/dist/views/index.d.mts +0 -2
  80. package/dist/views/index.mjs +0 -3
  81. package/dist/warehouses/index.d.mts +0 -68
  82. package/dist/warehouses/index.mjs +0 -101
@@ -1,238 +0,0 @@
1
- import { z } from "zod";
2
-
3
- //#region src/schemas/common.d.ts
4
- /**
5
- * Snowflake identifiers are 1-255 chars. Unquoted identifiers are normalized
6
- * to upper-case; quoted identifiers preserve case. We keep raw validation
7
- * permissive and let the server reject bad names — a strict regex would
8
- * forbid unicode-quoted identifiers legitimately used in the wild.
9
- */
10
- declare const snowflakeIdentifier: z.ZodString;
11
- /**
12
- * Fully-qualified name: `DATABASE.SCHEMA.NAME` (or subsets). Stored as a
13
- * single string; we do *not* split/rejoin so callers can pass quoted
14
- * segments through verbatim.
15
- */
16
- declare const snowflakeFqn: z.ZodString;
17
- /**
18
- * Optional context overrides applied per-statement.
19
- * Every field is optional — absent values fall back to the connection's
20
- * session defaults and then to account-level defaults.
21
- */
22
- declare const statementContextSchema: z.ZodObject<{
23
- database: z.ZodOptional<z.ZodString>;
24
- schema: z.ZodOptional<z.ZodString>;
25
- warehouse: z.ZodOptional<z.ZodString>;
26
- role: z.ZodOptional<z.ZodString>;
27
- timeout: z.ZodOptional<z.ZodNumber>;
28
- parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
29
- }, z.core.$strict>;
30
- type StatementContext = z.infer<typeof statementContextSchema>;
31
- /**
32
- * SQL API v2 supports typed bindings: each binding is an object with a
33
- * `type` and a `value`. We allow the simple positional shape and the
34
- * keyed-map shape Snowflake accepts.
35
- */
36
- declare const sqlBindingValueSchema: z.ZodObject<{
37
- type: z.ZodString;
38
- value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
39
- }, z.core.$strip>;
40
- declare const sqlBindingsSchema: z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodObject<{
41
- type: z.ZodString;
42
- value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
43
- }, z.core.$strip>>, z.ZodArray<z.ZodObject<{
44
- type: z.ZodString;
45
- value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
46
- }, z.core.$strip>>]>;
47
- type SqlBinding = z.infer<typeof sqlBindingValueSchema>;
48
- type SqlBindings = z.infer<typeof sqlBindingsSchema>;
49
- /**
50
- * Loosely-typed record shape for objects returned by `SHOW ...` commands.
51
- * Snowflake returns positional arrays with a `rowType[]` describing each
52
- * column — callers either consume the tuple form directly or `hydrateRow`
53
- * into a `Record<string, unknown>`.
54
- */
55
- declare const snowflakeObjectRowSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
56
- type SnowflakeObjectRow = z.infer<typeof snowflakeObjectRowSchema>;
57
- /**
58
- * Column metadata entry as returned under `resultSetMetaData.rowType`.
59
- */
60
- declare const columnMetaSchema: z.ZodObject<{
61
- name: z.ZodString;
62
- type: z.ZodString;
63
- nullable: z.ZodOptional<z.ZodBoolean>;
64
- length: z.ZodOptional<z.ZodNumber>;
65
- precision: z.ZodOptional<z.ZodNumber>;
66
- scale: z.ZodOptional<z.ZodNumber>;
67
- byteLength: z.ZodOptional<z.ZodNumber>;
68
- collation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
69
- database: z.ZodOptional<z.ZodString>;
70
- schema: z.ZodOptional<z.ZodString>;
71
- table: z.ZodOptional<z.ZodString>;
72
- }, z.core.$catchall<z.ZodUnknown>>;
73
- type ColumnMeta = z.infer<typeof columnMetaSchema>;
74
- /**
75
- * Partition entry describing a shard of the total result set.
76
- */
77
- declare const partitionInfoSchema: z.ZodObject<{
78
- rowCount: z.ZodNumber;
79
- uncompressedSize: z.ZodOptional<z.ZodNumber>;
80
- compressedSize: z.ZodOptional<z.ZodNumber>;
81
- }, z.core.$catchall<z.ZodUnknown>>;
82
- type PartitionInfo = z.infer<typeof partitionInfoSchema>;
83
- declare const resultSetMetaDataSchema: z.ZodObject<{
84
- numRows: z.ZodOptional<z.ZodNumber>;
85
- format: z.ZodOptional<z.ZodString>;
86
- partitionInfo: z.ZodOptional<z.ZodArray<z.ZodObject<{
87
- rowCount: z.ZodNumber;
88
- uncompressedSize: z.ZodOptional<z.ZodNumber>;
89
- compressedSize: z.ZodOptional<z.ZodNumber>;
90
- }, z.core.$catchall<z.ZodUnknown>>>>;
91
- rowType: z.ZodOptional<z.ZodArray<z.ZodObject<{
92
- name: z.ZodString;
93
- type: z.ZodString;
94
- nullable: z.ZodOptional<z.ZodBoolean>;
95
- length: z.ZodOptional<z.ZodNumber>;
96
- precision: z.ZodOptional<z.ZodNumber>;
97
- scale: z.ZodOptional<z.ZodNumber>;
98
- byteLength: z.ZodOptional<z.ZodNumber>;
99
- collation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
100
- database: z.ZodOptional<z.ZodString>;
101
- schema: z.ZodOptional<z.ZodString>;
102
- table: z.ZodOptional<z.ZodString>;
103
- }, z.core.$catchall<z.ZodUnknown>>>>;
104
- }, z.core.$catchall<z.ZodUnknown>>;
105
- type ResultSetMetaData = z.infer<typeof resultSetMetaDataSchema>;
106
- //#endregion
107
- //#region src/schemas/results.d.ts
108
- declare const partitionResponseSchema: z.ZodObject<{
109
- statementHandle: z.ZodOptional<z.ZodString>;
110
- code: z.ZodOptional<z.ZodString>;
111
- message: z.ZodOptional<z.ZodString>;
112
- resultSetMetaData: z.ZodOptional<z.ZodObject<{
113
- numRows: z.ZodOptional<z.ZodNumber>;
114
- format: z.ZodOptional<z.ZodString>;
115
- partitionInfo: z.ZodOptional<z.ZodArray<z.ZodObject<{
116
- rowCount: z.ZodNumber;
117
- uncompressedSize: z.ZodOptional<z.ZodNumber>;
118
- compressedSize: z.ZodOptional<z.ZodNumber>;
119
- }, z.core.$catchall<z.ZodUnknown>>>>;
120
- rowType: z.ZodOptional<z.ZodArray<z.ZodObject<{
121
- name: z.ZodString;
122
- type: z.ZodString;
123
- nullable: z.ZodOptional<z.ZodBoolean>;
124
- length: z.ZodOptional<z.ZodNumber>;
125
- precision: z.ZodOptional<z.ZodNumber>;
126
- scale: z.ZodOptional<z.ZodNumber>;
127
- byteLength: z.ZodOptional<z.ZodNumber>;
128
- collation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
129
- database: z.ZodOptional<z.ZodString>;
130
- schema: z.ZodOptional<z.ZodString>;
131
- table: z.ZodOptional<z.ZodString>;
132
- }, z.core.$catchall<z.ZodUnknown>>>>;
133
- }, z.core.$catchall<z.ZodUnknown>>>;
134
- data: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodUnknown>>>;
135
- }, z.core.$catchall<z.ZodUnknown>>;
136
- type PartitionResponse = z.infer<typeof partitionResponseSchema>;
137
- /**
138
- * A single logical row as hydrated into an object keyed by column name.
139
- * Values are permissive (`unknown`) because Snowflake types map to many
140
- * TS shapes — callers coerce further with `hydrateValue` when needed.
141
- */
142
- type HydratedRow = Record<string, unknown>;
143
- //#endregion
144
- //#region src/schemas/statements.d.ts
145
- /** Status code reported under `code` / `message` alongside the HTTP status. */
146
- declare const statementStatusCodeSchema: z.ZodString;
147
- /**
148
- * Input body for `POST /api/v2/statements`.
149
- * `statement` is required. All other fields fall back to session / account
150
- * defaults when omitted.
151
- */
152
- declare const submitStatementInputSchema: z.ZodObject<{
153
- statement: z.ZodString;
154
- bindings: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodObject<{
155
- type: z.ZodString;
156
- value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
157
- }, z.core.$strip>>, z.ZodArray<z.ZodObject<{
158
- type: z.ZodString;
159
- value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
160
- }, z.core.$strip>>]>>;
161
- database: z.ZodOptional<z.ZodString>;
162
- schema: z.ZodOptional<z.ZodString>;
163
- warehouse: z.ZodOptional<z.ZodString>;
164
- role: z.ZodOptional<z.ZodString>;
165
- timeout: z.ZodOptional<z.ZodNumber>;
166
- parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
167
- }, z.core.$strict>;
168
- type SubmitStatementInput = z.infer<typeof submitStatementInputSchema>;
169
- /**
170
- * Response body for a submitted statement — either the inline result (200)
171
- * or a pending handle (202).
172
- */
173
- declare const statementResponseSchema: z.ZodObject<{
174
- code: z.ZodOptional<z.ZodString>;
175
- sqlState: z.ZodOptional<z.ZodString>;
176
- message: z.ZodOptional<z.ZodString>;
177
- statementHandle: z.ZodString;
178
- statementStatusUrl: z.ZodOptional<z.ZodString>;
179
- createdOn: z.ZodOptional<z.ZodNumber>;
180
- requestId: z.ZodOptional<z.ZodString>;
181
- statementHandles: z.ZodOptional<z.ZodArray<z.ZodString>>;
182
- resultSetMetaData: z.ZodOptional<z.ZodObject<{
183
- numRows: z.ZodOptional<z.ZodNumber>;
184
- format: z.ZodOptional<z.ZodString>;
185
- partitionInfo: z.ZodOptional<z.ZodArray<z.ZodObject<{
186
- rowCount: z.ZodNumber;
187
- uncompressedSize: z.ZodOptional<z.ZodNumber>;
188
- compressedSize: z.ZodOptional<z.ZodNumber>;
189
- }, z.core.$catchall<z.ZodUnknown>>>>;
190
- rowType: z.ZodOptional<z.ZodArray<z.ZodObject<{
191
- name: z.ZodString;
192
- type: z.ZodString;
193
- nullable: z.ZodOptional<z.ZodBoolean>;
194
- length: z.ZodOptional<z.ZodNumber>;
195
- precision: z.ZodOptional<z.ZodNumber>;
196
- scale: z.ZodOptional<z.ZodNumber>;
197
- byteLength: z.ZodOptional<z.ZodNumber>;
198
- collation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
199
- database: z.ZodOptional<z.ZodString>;
200
- schema: z.ZodOptional<z.ZodString>;
201
- table: z.ZodOptional<z.ZodString>;
202
- }, z.core.$catchall<z.ZodUnknown>>>>;
203
- }, z.core.$catchall<z.ZodUnknown>>>;
204
- data: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodUnknown>>>;
205
- }, z.core.$catchall<z.ZodUnknown>>;
206
- type StatementResponse = z.infer<typeof statementResponseSchema>;
207
- /**
208
- * Terminal + transient statuses as exposed through the `code` field. Most
209
- * callers only care whether the statement is `pending`, `done`, or
210
- * `failed` — the `statementStatus` helper below compresses the raw `code`
211
- * into those buckets.
212
- */
213
- type StatementTerminalStatus = 'done' | 'failed' | 'cancelled';
214
- type StatementStatus = StatementTerminalStatus | 'pending';
215
- /**
216
- * Snowflake code ranges (SQL API v2):
217
- * - 090002 — success (inline result)
218
- * - 333333 — statement accepted (async)
219
- * - 333334 — statement executing (still polling)
220
- * - 333335 — user-triggered cancel succeeded
221
- * - 390xxx / 3900xx / 0919xx / ... — SQL-level failures
222
- *
223
- * We map explicitly the two non-error status codes; everything else is
224
- * treated as `failed` when the HTTP status is also an error, otherwise
225
- * `done`.
226
- */
227
- declare function statementStatus(input: {
228
- httpStatus: number;
229
- code?: string | undefined;
230
- }): StatementStatus;
231
- declare const cancelStatementResponseSchema: z.ZodObject<{
232
- code: z.ZodOptional<z.ZodString>;
233
- message: z.ZodOptional<z.ZodString>;
234
- statementHandle: z.ZodOptional<z.ZodString>;
235
- }, z.core.$catchall<z.ZodUnknown>>;
236
- type CancelStatementResponse = z.infer<typeof cancelStatementResponseSchema>;
237
- //#endregion
238
- export { resultSetMetaDataSchema as C, sqlBindingValueSchema as D, snowflakeObjectRowSchema as E, sqlBindingsSchema as O, partitionInfoSchema as S, snowflakeIdentifier as T, SnowflakeObjectRow as _, SubmitStatementInput as a, StatementContext as b, statementStatus as c, HydratedRow as d, PartitionResponse as f, ResultSetMetaData as g, PartitionInfo as h, StatementTerminalStatus as i, statementContextSchema as k, statementStatusCodeSchema as l, ColumnMeta as m, StatementResponse as n, cancelStatementResponseSchema as o, partitionResponseSchema as p, StatementStatus as r, statementResponseSchema as s, CancelStatementResponse as t, submitStatementInputSchema as u, SqlBinding as v, snowflakeFqn as w, columnMetaSchema as x, SqlBindings as y };