@keystrokehq/snowflake 0.0.15 → 0.0.16-integration-id-canonicalization.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 (86) hide show
  1. package/README.md +3 -9
  2. package/dist/{accounts.d.mts → accounts/index.d.mts} +3 -3
  3. package/dist/{accounts.mjs → accounts/index.mjs} +3 -3
  4. package/dist/{bulk.d.mts → bulk/index.d.mts} +6 -6
  5. package/dist/{bulk.mjs → bulk/index.mjs} +5 -5
  6. package/dist/{catalog.d.mts → catalog/index.d.mts} +3 -3
  7. package/dist/{catalog.mjs → catalog/index.mjs} +3 -3
  8. package/dist/{client.d.mts → client/index.d.mts} +3 -3
  9. package/dist/{client.mjs → client/index.mjs} +4 -4
  10. package/dist/credential-sets/index.d.mts +3 -0
  11. package/dist/credential-sets/index.mjs +4 -0
  12. package/dist/{databases.d.mts → databases/index.d.mts} +1 -1
  13. package/dist/databases/index.mjs +3 -0
  14. package/dist/{events.d.mts → events/index.d.mts} +1 -1
  15. package/dist/{events.mjs → events/index.mjs} +2 -2
  16. package/dist/{file-formats.d.mts → file-formats/index.d.mts} +5 -5
  17. package/dist/{file-formats.mjs → file-formats/index.mjs} +5 -5
  18. package/dist/{functions.d.mts → functions/index.d.mts} +5 -5
  19. package/dist/{functions.mjs → functions/index.mjs} +5 -5
  20. package/dist/{grants.d.mts → grants/index.d.mts} +3 -3
  21. package/dist/{grants.mjs → grants/index.mjs} +4 -4
  22. package/dist/index.d.mts +4 -1
  23. package/dist/index.mjs +6 -1
  24. package/dist/{org-admin.d.mts → org-admin/index.d.mts} +4 -4
  25. package/dist/{org-admin.mjs → org-admin/index.mjs} +4 -4
  26. package/dist/{pipes.d.mts → pipes/index.d.mts} +4 -4
  27. package/dist/{pipes.mjs → pipes/index.mjs} +4 -4
  28. package/dist/{procedures.d.mts → procedures/index.d.mts} +7 -7
  29. package/dist/{procedures.mjs → procedures/index.mjs} +6 -6
  30. package/dist/{results.d.mts → results/index.d.mts} +2 -2
  31. package/dist/{results.mjs → results/index.mjs} +1 -1
  32. package/dist/{roles.d.mts → roles/index.d.mts} +4 -4
  33. package/dist/{roles.mjs → roles/index.mjs} +5 -5
  34. package/dist/{rows.d.mts → rows/index.d.mts} +3 -3
  35. package/dist/{rows.mjs → rows/index.mjs} +3 -3
  36. package/dist/schemas/index.mjs +2 -2
  37. package/dist/{schemas-catalog.d.mts → schemas-catalog/index.d.mts} +1 -1
  38. package/dist/schemas-catalog/index.mjs +3 -0
  39. package/dist/{shares.d.mts → shares/index.d.mts} +4 -4
  40. package/dist/{shares.mjs → shares/index.mjs} +4 -4
  41. package/dist/snowflake-s3-sns-webhook.credential-set-D6bLAWy5.d.mts +50 -0
  42. package/dist/snowflake-s3-sns-webhook.credential-set-DzR7oWNK.mjs +44 -0
  43. package/dist/{integration-D8I5-1eb.d.mts → snowflake.credential-set-BxT7Gf3A.d.mts} +37 -67
  44. package/dist/snowflake.credential-set-DE3gXf-a.mjs +106 -0
  45. package/dist/{sql.d.mts → sql/index.d.mts} +3 -3
  46. package/dist/{sql.mjs → sql/index.mjs} +4 -4
  47. package/dist/{sql-options-DI-OmLU6.mjs → sql-options-D6GEa21F.mjs} +1 -1
  48. package/dist/{stages.d.mts → stages/index.d.mts} +6 -6
  49. package/dist/{stages.mjs → stages/index.mjs} +5 -5
  50. package/dist/{statements-B2ThF_4b.mjs → statements-BumhMhN4.mjs} +1 -1
  51. package/dist/{status-page.d.mts → status-page/index.d.mts} +1 -1
  52. package/dist/{status-page.mjs → status-page/index.mjs} +1 -1
  53. package/dist/{streaming.d.mts → streaming/index.d.mts} +2 -2
  54. package/dist/{streaming.mjs → streaming/index.mjs} +1 -1
  55. package/dist/{streams.d.mts → streams/index.d.mts} +5 -5
  56. package/dist/{streams.mjs → streams/index.mjs} +5 -5
  57. package/dist/{tables.d.mts → tables/index.d.mts} +1 -1
  58. package/dist/{tables.mjs → tables/index.mjs} +1 -1
  59. package/dist/{tasks.d.mts → tasks/index.d.mts} +5 -5
  60. package/dist/{tasks.mjs → tasks/index.mjs} +5 -5
  61. package/dist/{triggers.d.mts → triggers/index.d.mts} +11 -9
  62. package/dist/{triggers.mjs → triggers/index.mjs} +60 -12
  63. package/dist/{users.d.mts → users/index.d.mts} +5 -5
  64. package/dist/{users.mjs → users/index.mjs} +5 -5
  65. package/dist/{verification.d.mts → verification/index.d.mts} +2 -2
  66. package/dist/{verification.mjs → verification/index.mjs} +2 -2
  67. package/dist/views/index.d.mts +2 -0
  68. package/dist/views/index.mjs +3 -0
  69. package/dist/{warehouses.d.mts → warehouses/index.d.mts} +5 -5
  70. package/dist/{warehouses.mjs → warehouses/index.mjs} +5 -5
  71. package/package.json +17 -21
  72. package/dist/_official/index.d.mts +0 -2
  73. package/dist/_official/index.mjs +0 -3
  74. package/dist/connection.d.mts +0 -2
  75. package/dist/connection.mjs +0 -3
  76. package/dist/databases.mjs +0 -3
  77. package/dist/integration-DatCj2fe.mjs +0 -211
  78. package/dist/schemas-catalog.mjs +0 -3
  79. package/dist/views.d.mts +0 -2
  80. package/dist/views.mjs +0 -3
  81. /package/dist/{common-BnKTPQXc.mjs → common-DfpCwJx5.mjs} +0 -0
  82. /package/dist/{errors-DKnc9o_a.mjs → errors-60AsF7Su.mjs} +0 -0
  83. /package/dist/{_runtime → operations}/index.d.mts +0 -0
  84. /package/dist/{_runtime → operations}/index.mjs +0 -0
  85. /package/dist/{retry-0hMfb8cC.mjs → retry-B4-9MZIp.mjs} +0 -0
  86. /package/dist/{sql-safety-CywdR3EP.mjs → sql-safety-BZpAPsq6.mjs} +0 -0
@@ -1,16 +1,15 @@
1
- import * as _keystrokehq_integration_authoring_official0 from "@keystrokehq/integration-authoring/official";
1
+ import { CredentialSet } from "@keystrokehq/core";
2
2
  import { z } from "zod";
3
- import * as _keystrokehq_core0 from "@keystrokehq/core";
4
3
  import { InferCredentialSetAuth } from "@keystrokehq/core/credential-set";
5
4
 
6
- //#region src/integration.d.ts
5
+ //#region src/credential-sets/snowflake.credential-set.d.ts
7
6
  /**
8
7
  * Public auth schema for Snowflake connections.
9
8
  *
10
9
  * Modeled as a discriminated union on `mode`. `connection.kind` is `manual`
11
10
  * because Keystroke does not run an interactive Snowflake OAuth dance — OAuth
12
11
  * mode accepts a bearer token provided by the caller (external IdP /
13
- * Snowflake-hosted OAuth). See `IMPLEMENTATION_NOTES.md` § 2 for rationale.
12
+ * Snowflake-hosted OAuth).
14
13
  */
15
14
  declare const snowflakeAuthModeSchema: z.ZodEnum<{
16
15
  keypair: "keypair";
@@ -46,12 +45,37 @@ declare const snowflakeAuthSchema: z.ZodObject<{
46
45
  SNOWFLAKE_REGION: z.ZodOptional<z.ZodString>;
47
46
  SNOWFLAKE_PUBLIC_KEY_FP: z.ZodOptional<z.ZodString>;
48
47
  }, z.core.$strip>;
49
- declare const snowflakeOfficialIntegration: {
50
- id: "snowflake";
51
- name: string;
52
- description: string;
53
- credentialType: "manual";
54
- auth: z.ZodObject<{
48
+ declare const snowflakeCredentialSet: CredentialSet<"snowflake", z.ZodObject<{
49
+ mode: z.ZodEnum<{
50
+ keypair: "keypair";
51
+ oauth: "oauth";
52
+ pat: "pat";
53
+ basic: "basic";
54
+ }>;
55
+ SNOWFLAKE_ACCOUNT: z.ZodString;
56
+ SNOWFLAKE_USER: z.ZodOptional<z.ZodString>;
57
+ SNOWFLAKE_PRIVATE_KEY: z.ZodOptional<z.ZodString>;
58
+ SNOWFLAKE_PRIVATE_KEY_PASSPHRASE: z.ZodOptional<z.ZodString>;
59
+ SNOWFLAKE_PAT: z.ZodOptional<z.ZodString>;
60
+ SNOWFLAKE_PASSWORD: z.ZodOptional<z.ZodString>;
61
+ SNOWFLAKE_OAUTH_ACCESS_TOKEN: z.ZodOptional<z.ZodString>;
62
+ SNOWFLAKE_OAUTH_REFRESH_TOKEN: z.ZodOptional<z.ZodString>;
63
+ SNOWFLAKE_OAUTH_CLIENT_ID: z.ZodOptional<z.ZodString>;
64
+ SNOWFLAKE_OAUTH_CLIENT_SECRET: z.ZodOptional<z.ZodString>;
65
+ SNOWFLAKE_OAUTH_TOKEN_URL: z.ZodOptional<z.ZodString>;
66
+ SNOWFLAKE_OAUTH_SCOPES: z.ZodOptional<z.ZodString>;
67
+ SNOWFLAKE_ROLE: z.ZodOptional<z.ZodString>;
68
+ SNOWFLAKE_WAREHOUSE: z.ZodOptional<z.ZodString>;
69
+ SNOWFLAKE_DATABASE: z.ZodOptional<z.ZodString>;
70
+ SNOWFLAKE_SCHEMA: z.ZodOptional<z.ZodString>;
71
+ SNOWFLAKE_HOST: z.ZodOptional<z.ZodString>;
72
+ SNOWFLAKE_REGION: z.ZodOptional<z.ZodString>;
73
+ SNOWFLAKE_PUBLIC_KEY_FP: z.ZodOptional<z.ZodString>;
74
+ }, z.core.$strip>, {
75
+ id: string;
76
+ kind: "manual";
77
+ label: string;
78
+ input: z.ZodObject<{
55
79
  mode: z.ZodEnum<{
56
80
  keypair: "keypair";
57
81
  oauth: "oauth";
@@ -78,62 +102,8 @@ declare const snowflakeOfficialIntegration: {
78
102
  SNOWFLAKE_REGION: z.ZodOptional<z.ZodString>;
79
103
  SNOWFLAKE_PUBLIC_KEY_FP: z.ZodOptional<z.ZodString>;
80
104
  }, z.core.$strip>;
81
- };
82
- declare const snowflakeBundle: _keystrokehq_integration_authoring_official0.OfficialIntegrationBundle<"snowflake", z.ZodObject<{
83
- mode: z.ZodEnum<{
84
- keypair: "keypair";
85
- oauth: "oauth";
86
- pat: "pat";
87
- basic: "basic";
88
- }>;
89
- SNOWFLAKE_ACCOUNT: z.ZodString;
90
- SNOWFLAKE_USER: z.ZodOptional<z.ZodString>;
91
- SNOWFLAKE_PRIVATE_KEY: z.ZodOptional<z.ZodString>;
92
- SNOWFLAKE_PRIVATE_KEY_PASSPHRASE: z.ZodOptional<z.ZodString>;
93
- SNOWFLAKE_PAT: z.ZodOptional<z.ZodString>;
94
- SNOWFLAKE_PASSWORD: z.ZodOptional<z.ZodString>;
95
- SNOWFLAKE_OAUTH_ACCESS_TOKEN: z.ZodOptional<z.ZodString>;
96
- SNOWFLAKE_OAUTH_REFRESH_TOKEN: z.ZodOptional<z.ZodString>;
97
- SNOWFLAKE_OAUTH_CLIENT_ID: z.ZodOptional<z.ZodString>;
98
- SNOWFLAKE_OAUTH_CLIENT_SECRET: z.ZodOptional<z.ZodString>;
99
- SNOWFLAKE_OAUTH_TOKEN_URL: z.ZodOptional<z.ZodString>;
100
- SNOWFLAKE_OAUTH_SCOPES: z.ZodOptional<z.ZodString>;
101
- SNOWFLAKE_ROLE: z.ZodOptional<z.ZodString>;
102
- SNOWFLAKE_WAREHOUSE: z.ZodOptional<z.ZodString>;
103
- SNOWFLAKE_DATABASE: z.ZodOptional<z.ZodString>;
104
- SNOWFLAKE_SCHEMA: z.ZodOptional<z.ZodString>;
105
- SNOWFLAKE_HOST: z.ZodOptional<z.ZodString>;
106
- SNOWFLAKE_REGION: z.ZodOptional<z.ZodString>;
107
- SNOWFLAKE_PUBLIC_KEY_FP: z.ZodOptional<z.ZodString>;
108
- }, z.core.$strip>>;
109
- declare const snowflake: _keystrokehq_core0.CredentialSet<"keystroke:snowflake", z.ZodObject<{
110
- mode: z.ZodEnum<{
111
- keypair: "keypair";
112
- oauth: "oauth";
113
- pat: "pat";
114
- basic: "basic";
115
- }>;
116
- SNOWFLAKE_ACCOUNT: z.ZodString;
117
- SNOWFLAKE_USER: z.ZodOptional<z.ZodString>;
118
- SNOWFLAKE_PRIVATE_KEY: z.ZodOptional<z.ZodString>;
119
- SNOWFLAKE_PRIVATE_KEY_PASSPHRASE: z.ZodOptional<z.ZodString>;
120
- SNOWFLAKE_PAT: z.ZodOptional<z.ZodString>;
121
- SNOWFLAKE_PASSWORD: z.ZodOptional<z.ZodString>;
122
- SNOWFLAKE_OAUTH_ACCESS_TOKEN: z.ZodOptional<z.ZodString>;
123
- SNOWFLAKE_OAUTH_REFRESH_TOKEN: z.ZodOptional<z.ZodString>;
124
- SNOWFLAKE_OAUTH_CLIENT_ID: z.ZodOptional<z.ZodString>;
125
- SNOWFLAKE_OAUTH_CLIENT_SECRET: z.ZodOptional<z.ZodString>;
126
- SNOWFLAKE_OAUTH_TOKEN_URL: z.ZodOptional<z.ZodString>;
127
- SNOWFLAKE_OAUTH_SCOPES: z.ZodOptional<z.ZodString>;
128
- SNOWFLAKE_ROLE: z.ZodOptional<z.ZodString>;
129
- SNOWFLAKE_WAREHOUSE: z.ZodOptional<z.ZodString>;
130
- SNOWFLAKE_DATABASE: z.ZodOptional<z.ZodString>;
131
- SNOWFLAKE_SCHEMA: z.ZodOptional<z.ZodString>;
132
- SNOWFLAKE_HOST: z.ZodOptional<z.ZodString>;
133
- SNOWFLAKE_REGION: z.ZodOptional<z.ZodString>;
134
- SNOWFLAKE_PUBLIC_KEY_FP: z.ZodOptional<z.ZodString>;
135
- }, z.core.$strip>>;
136
- type SnowflakeCredentials = InferCredentialSetAuth<typeof snowflake>;
105
+ }[]>;
106
+ type SnowflakeCredentials = InferCredentialSetAuth<typeof snowflakeCredentialSet>;
137
107
  /**
138
108
  * Parse raw credential values through the full refinement pipeline. Callers
139
109
  * (client, operations) should use this instead of the raw object schema so
@@ -141,4 +111,4 @@ type SnowflakeCredentials = InferCredentialSetAuth<typeof snowflake>;
141
111
  */
142
112
  declare function parseSnowflakeCredentials(input: unknown): SnowflakeCredentials;
143
113
  //#endregion
144
- export { snowflakeAuthModeSchema as a, snowflakeOfficialIntegration as c, snowflake as i, SnowflakeCredentials as n, snowflakeAuthSchema as o, parseSnowflakeCredentials as r, snowflakeBundle as s, SnowflakeAuthMode as t };
114
+ export { snowflakeAuthSchema as a, snowflakeAuthModeSchema as i, SnowflakeCredentials as n, snowflakeCredentialSet as o, parseSnowflakeCredentials as r, SnowflakeAuthMode as t };
@@ -0,0 +1,106 @@
1
+ import { CredentialSet } from "@keystrokehq/core";
2
+ import { z } from "zod";
3
+
4
+ //#region src/credential-sets/snowflake.credential-set.ts
5
+ /**
6
+ * Public auth schema for Snowflake connections.
7
+ *
8
+ * Modeled as a discriminated union on `mode`. `connection.kind` is `manual`
9
+ * because Keystroke does not run an interactive Snowflake OAuth dance — OAuth
10
+ * mode accepts a bearer token provided by the caller (external IdP /
11
+ * Snowflake-hosted OAuth).
12
+ */
13
+ const snowflakeAuthModeSchema = z.enum([
14
+ "keypair",
15
+ "oauth",
16
+ "pat",
17
+ "basic"
18
+ ]);
19
+ const baseSnowflakeAuthShape = {
20
+ mode: snowflakeAuthModeSchema,
21
+ SNOWFLAKE_ACCOUNT: z.string().min(1),
22
+ SNOWFLAKE_USER: z.string().min(1).optional(),
23
+ SNOWFLAKE_PRIVATE_KEY: z.string().min(1).optional(),
24
+ SNOWFLAKE_PRIVATE_KEY_PASSPHRASE: z.string().optional(),
25
+ SNOWFLAKE_PAT: z.string().min(1).optional(),
26
+ SNOWFLAKE_PASSWORD: z.string().min(1).optional(),
27
+ SNOWFLAKE_OAUTH_ACCESS_TOKEN: z.string().min(1).optional(),
28
+ SNOWFLAKE_OAUTH_REFRESH_TOKEN: z.string().optional(),
29
+ SNOWFLAKE_OAUTH_CLIENT_ID: z.string().optional(),
30
+ SNOWFLAKE_OAUTH_CLIENT_SECRET: z.string().optional(),
31
+ SNOWFLAKE_OAUTH_TOKEN_URL: z.string().url().optional(),
32
+ SNOWFLAKE_OAUTH_SCOPES: z.string().optional(),
33
+ SNOWFLAKE_ROLE: z.string().optional(),
34
+ SNOWFLAKE_WAREHOUSE: z.string().optional(),
35
+ SNOWFLAKE_DATABASE: z.string().optional(),
36
+ SNOWFLAKE_SCHEMA: z.string().optional(),
37
+ SNOWFLAKE_HOST: z.string().optional(),
38
+ SNOWFLAKE_REGION: z.string().optional(),
39
+ SNOWFLAKE_PUBLIC_KEY_FP: z.string().optional()
40
+ };
41
+ const snowflakeAuthSchema = z.object(baseSnowflakeAuthShape).superRefine((value, ctx) => {
42
+ if (value.mode === "keypair") {
43
+ if (!value.SNOWFLAKE_USER) ctx.addIssue({
44
+ code: z.ZodIssueCode.custom,
45
+ path: ["SNOWFLAKE_USER"],
46
+ message: "SNOWFLAKE_USER is required when mode = \"keypair\""
47
+ });
48
+ if (!value.SNOWFLAKE_PRIVATE_KEY) ctx.addIssue({
49
+ code: z.ZodIssueCode.custom,
50
+ path: ["SNOWFLAKE_PRIVATE_KEY"],
51
+ message: "SNOWFLAKE_PRIVATE_KEY is required when mode = \"keypair\""
52
+ });
53
+ } else if (value.mode === "oauth") {
54
+ if (!value.SNOWFLAKE_OAUTH_ACCESS_TOKEN) ctx.addIssue({
55
+ code: z.ZodIssueCode.custom,
56
+ path: ["SNOWFLAKE_OAUTH_ACCESS_TOKEN"],
57
+ message: "SNOWFLAKE_OAUTH_ACCESS_TOKEN is required when mode = \"oauth\""
58
+ });
59
+ } else if (value.mode === "pat") {
60
+ if (!value.SNOWFLAKE_USER) ctx.addIssue({
61
+ code: z.ZodIssueCode.custom,
62
+ path: ["SNOWFLAKE_USER"],
63
+ message: "SNOWFLAKE_USER is required when mode = \"pat\""
64
+ });
65
+ if (!value.SNOWFLAKE_PAT) ctx.addIssue({
66
+ code: z.ZodIssueCode.custom,
67
+ path: ["SNOWFLAKE_PAT"],
68
+ message: "SNOWFLAKE_PAT is required when mode = \"pat\""
69
+ });
70
+ } else if (value.mode === "basic") {
71
+ if (!value.SNOWFLAKE_USER) ctx.addIssue({
72
+ code: z.ZodIssueCode.custom,
73
+ path: ["SNOWFLAKE_USER"],
74
+ message: "SNOWFLAKE_USER is required when mode = \"basic\""
75
+ });
76
+ if (!value.SNOWFLAKE_PASSWORD) ctx.addIssue({
77
+ code: z.ZodIssueCode.custom,
78
+ path: ["SNOWFLAKE_PASSWORD"],
79
+ message: "SNOWFLAKE_PASSWORD is required when mode = \"basic\""
80
+ });
81
+ }
82
+ });
83
+ const snowflakeAuthObjectSchema = z.object(baseSnowflakeAuthShape);
84
+ const snowflakeCredentialSet = new CredentialSet({
85
+ id: "snowflake",
86
+ name: "Snowflake",
87
+ description: "Snowflake data cloud: SQL API v2, Snowpipe (file + streaming), warehouses, roles, users, grants, shares, streams, tasks, and administration for Keystroke workflows.",
88
+ auth: snowflakeAuthObjectSchema,
89
+ connections: [{
90
+ id: "manual",
91
+ kind: "manual",
92
+ label: "Snowflake credentials",
93
+ input: snowflakeAuthObjectSchema
94
+ }]
95
+ });
96
+ /**
97
+ * Parse raw credential values through the full refinement pipeline. Callers
98
+ * (client, operations) should use this instead of the raw object schema so
99
+ * mode-specific invariants are enforced.
100
+ */
101
+ function parseSnowflakeCredentials(input) {
102
+ return snowflakeAuthSchema.parse(input);
103
+ }
104
+
105
+ //#endregion
106
+ export { snowflakeCredentialSet as i, snowflakeAuthModeSchema as n, snowflakeAuthSchema as r, parseSnowflakeCredentials as t };
@@ -1,6 +1,6 @@
1
- import { SnowflakeClient } from "./client.mjs";
2
- import { a as SubmitStatementInput, d as HydratedRow, f as PartitionResponse, m as ColumnMeta, n as StatementResponse } from "./statements-DJL0qVNA.mjs";
3
- //#region src/sql.d.ts
1
+ import { SnowflakeClient } from "../client/index.mjs";
2
+ import { a as SubmitStatementInput, d as HydratedRow, f as PartitionResponse, m as ColumnMeta, n as StatementResponse } from "../statements-DJL0qVNA.mjs";
3
+ //#region src/sql/index.d.ts
4
4
  interface SubmitOptions {
5
5
  readonly async?: boolean;
6
6
  readonly requestId?: string;
@@ -1,8 +1,8 @@
1
- import { n as SnowflakeSqlError, t as SnowflakeApiError } from "./errors-DKnc9o_a.mjs";
2
- import { a as submitStatementInputSchema, n as statementResponseSchema, o as partitionResponseSchema, r as statementStatus } from "./statements-B2ThF_4b.mjs";
3
- import { hydrateRows } from "./results.mjs";
1
+ import { a as submitStatementInputSchema, n as statementResponseSchema, o as partitionResponseSchema, r as statementStatus } from "../statements-BumhMhN4.mjs";
2
+ import { n as SnowflakeSqlError, t as SnowflakeApiError } from "../errors-60AsF7Su.mjs";
3
+ import { hydrateRows } from "../results/index.mjs";
4
4
 
5
- //#region src/sql.ts
5
+ //#region src/sql/index.ts
6
6
  const STATEMENTS_PATH = "/api/v2/statements";
7
7
  /**
8
8
  * Submit a statement. When `async: true` (or the server chooses async) we
@@ -1,4 +1,4 @@
1
- import { a as quoteLiteral } from "./sql-safety-CywdR3EP.mjs";
1
+ import { a as quoteLiteral } from "./sql-safety-BZpAPsq6.mjs";
2
2
 
3
3
  //#region src/sql-options.ts
4
4
  /**
@@ -1,10 +1,10 @@
1
- import { SnowflakeClient } from "./client.mjs";
2
- import { d as HydratedRow } from "./statements-DJL0qVNA.mjs";
3
- import { ExecuteSqlResult } from "./sql.mjs";
4
- import { t as OptionMap } from "./sql-options-2k5xQ-oS.mjs";
5
- import { CatalogResult, ShowScopedOptions, showStages } from "./catalog.mjs";
1
+ import { SnowflakeClient } from "../client/index.mjs";
2
+ import { d as HydratedRow } from "../statements-DJL0qVNA.mjs";
3
+ import { ExecuteSqlResult } from "../sql/index.mjs";
4
+ import { t as OptionMap } from "../sql-options-2k5xQ-oS.mjs";
5
+ import { CatalogResult, ShowScopedOptions, showStages } from "../catalog/index.mjs";
6
6
 
7
- //#region src/stages.d.ts
7
+ //#region src/stages/index.d.ts
8
8
  interface StageRef {
9
9
  readonly database?: string;
10
10
  readonly schema?: string;
@@ -1,9 +1,9 @@
1
- import { executeSql } from "./sql.mjs";
2
- import { a as quoteLiteral, t as buildFqn } from "./sql-safety-CywdR3EP.mjs";
3
- import { n as renderOptionGroup, t as formatOptions } from "./sql-options-DI-OmLU6.mjs";
4
- import { showStages } from "./catalog.mjs";
1
+ import { executeSql } from "../sql/index.mjs";
2
+ import { a as quoteLiteral, t as buildFqn } from "../sql-safety-BZpAPsq6.mjs";
3
+ import { n as renderOptionGroup, t as formatOptions } from "../sql-options-D6GEa21F.mjs";
4
+ import { showStages } from "../catalog/index.mjs";
5
5
 
6
- //#region src/stages.ts
6
+ //#region src/stages/index.ts
7
7
  function stageFqn(ref) {
8
8
  return buildFqn(ref.database, ref.schema, ref.name);
9
9
  }
@@ -1,4 +1,4 @@
1
- import { c as sqlBindingsSchema, l as statementContextSchema, r as resultSetMetaDataSchema } from "./common-BnKTPQXc.mjs";
1
+ import { c as sqlBindingsSchema, l as statementContextSchema, r as resultSetMetaDataSchema } from "./common-DfpCwJx5.mjs";
2
2
  import { z } from "zod";
3
3
 
4
4
  //#region src/schemas/results.ts
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
 
3
- //#region src/status-page.d.ts
3
+ //#region src/status-page/index.d.ts
4
4
  declare const statusPagePageSchema: z.ZodObject<{
5
5
  id: z.ZodString;
6
6
  name: z.ZodString;
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
 
3
- //#region src/status-page.ts
3
+ //#region src/status-page/index.ts
4
4
  /**
5
5
  * Snowflake status-page client (status.snowflake.com — Statuspage.io surface).
6
6
  *
@@ -1,6 +1,6 @@
1
- import { SnowflakeClient } from "./client.mjs";
1
+ import { SnowflakeClient } from "../client/index.mjs";
2
2
 
3
- //#region src/streaming.d.ts
3
+ //#region src/streaming/index.d.ts
4
4
  interface StreamingChannelRef {
5
5
  readonly database: string;
6
6
  readonly schema: string;
@@ -1,4 +1,4 @@
1
- //#region src/streaming.ts
1
+ //#region src/streaming/index.ts
2
2
  const DEFAULT_PATH_PREFIX = "/v1/streaming";
3
3
  function channelPath(ref) {
4
4
  const prefix = ref.pathPrefix ?? DEFAULT_PATH_PREFIX;
@@ -1,9 +1,9 @@
1
- import { SnowflakeClient } from "./client.mjs";
2
- import { d as HydratedRow } from "./statements-DJL0qVNA.mjs";
3
- import { t as OptionMap } from "./sql-options-2k5xQ-oS.mjs";
4
- import { CatalogResult, ShowScopedOptions, showStreams } from "./catalog.mjs";
1
+ import { SnowflakeClient } from "../client/index.mjs";
2
+ import { d as HydratedRow } from "../statements-DJL0qVNA.mjs";
3
+ import { t as OptionMap } from "../sql-options-2k5xQ-oS.mjs";
4
+ import { CatalogResult, ShowScopedOptions, showStreams } from "../catalog/index.mjs";
5
5
 
6
- //#region src/streams.d.ts
6
+ //#region src/streams/index.d.ts
7
7
  interface StreamRef {
8
8
  readonly database?: string;
9
9
  readonly schema?: string;
@@ -1,9 +1,9 @@
1
- import { executeSql } from "./sql.mjs";
2
- import { a as quoteLiteral, t as buildFqn } from "./sql-safety-CywdR3EP.mjs";
3
- import { t as formatOptions } from "./sql-options-DI-OmLU6.mjs";
4
- import { showStreams } from "./catalog.mjs";
1
+ import { executeSql } from "../sql/index.mjs";
2
+ import { a as quoteLiteral, t as buildFqn } from "../sql-safety-BZpAPsq6.mjs";
3
+ import { t as formatOptions } from "../sql-options-D6GEa21F.mjs";
4
+ import { showStreams } from "../catalog/index.mjs";
5
5
 
6
- //#region src/streams.ts
6
+ //#region src/streams/index.ts
7
7
  function streamFqn(ref) {
8
8
  return buildFqn(ref.database, ref.schema, ref.name);
9
9
  }
@@ -1,2 +1,2 @@
1
- import { CatalogResult, DescribeTableOptions, ExploreColumnsOptions, ExploreColumnsResult, FindTablesOptions, ShowColumnsOptions, ShowTablesOptions, describeTable, exploreColumns, findTables, showColumns, showTables } from "./catalog.mjs";
1
+ import { CatalogResult, DescribeTableOptions, ExploreColumnsOptions, ExploreColumnsResult, FindTablesOptions, ShowColumnsOptions, ShowTablesOptions, describeTable, exploreColumns, findTables, showColumns, showTables } from "../catalog/index.mjs";
2
2
  export { type CatalogResult, type DescribeTableOptions, type ExploreColumnsOptions, type ExploreColumnsResult, type FindTablesOptions, type ShowColumnsOptions, type ShowTablesOptions, describeTable, exploreColumns, findTables, showColumns, showTables };
@@ -1,3 +1,3 @@
1
- import { describeTable, exploreColumns, findTables, showColumns, showTables } from "./catalog.mjs";
1
+ import { describeTable, exploreColumns, findTables, showColumns, showTables } from "../catalog/index.mjs";
2
2
 
3
3
  export { describeTable, exploreColumns, findTables, showColumns, showTables };
@@ -1,9 +1,9 @@
1
- import { SnowflakeClient } from "./client.mjs";
2
- import { d as HydratedRow } from "./statements-DJL0qVNA.mjs";
3
- import { t as OptionMap } from "./sql-options-2k5xQ-oS.mjs";
4
- import { CatalogResult, ShowScopedOptions, showTasks } from "./catalog.mjs";
1
+ import { SnowflakeClient } from "../client/index.mjs";
2
+ import { d as HydratedRow } from "../statements-DJL0qVNA.mjs";
3
+ import { t as OptionMap } from "../sql-options-2k5xQ-oS.mjs";
4
+ import { CatalogResult, ShowScopedOptions, showTasks } from "../catalog/index.mjs";
5
5
 
6
- //#region src/tasks.d.ts
6
+ //#region src/tasks/index.d.ts
7
7
  interface TaskRef {
8
8
  readonly database?: string;
9
9
  readonly schema?: string;
@@ -1,9 +1,9 @@
1
- import { executeSql } from "./sql.mjs";
2
- import { a as quoteLiteral, t as buildFqn } from "./sql-safety-CywdR3EP.mjs";
3
- import { t as formatOptions } from "./sql-options-DI-OmLU6.mjs";
4
- import { showTasks } from "./catalog.mjs";
1
+ import { executeSql } from "../sql/index.mjs";
2
+ import { a as quoteLiteral, t as buildFqn } from "../sql-safety-BZpAPsq6.mjs";
3
+ import { t as formatOptions } from "../sql-options-D6GEa21F.mjs";
4
+ import { showTasks } from "../catalog/index.mjs";
5
5
 
6
- //#region src/tasks.ts
6
+ //#region src/tasks/index.ts
7
7
  function taskFqn(ref) {
8
8
  return buildFqn(ref.database, ref.schema, ref.name);
9
9
  }
@@ -1,15 +1,17 @@
1
- import { i as snowflake } from "./integration-D8I5-1eb.mjs";
2
- import { scheduledDeltaEventSchema, scheduledSqlEventSchema, streamAppendOnlyEventSchema, streamHasDataEventSchema } from "./events.mjs";
3
- import { RowValue } from "./rows.mjs";
4
- import { StatusPageOptions } from "./status-page.mjs";
5
- import { z } from "zod";
1
+ import { o as snowflakeCredentialSet } from "../snowflake.credential-set-BxT7Gf3A.mjs";
2
+ import { scheduledDeltaEventSchema, scheduledSqlEventSchema, streamAppendOnlyEventSchema, streamHasDataEventSchema } from "../events/index.mjs";
3
+ import { RowValue } from "../rows/index.mjs";
4
+ import { StatusPageOptions } from "../status-page/index.mjs";
6
5
  import { BoundTrigger } from "@keystrokehq/core";
7
- import { IntegrationTriggerBindingOptions, createPollingTriggerBindingFactory } from "@keystrokehq/integration-authoring";
6
+ import { z } from "zod";
8
7
  import { PollingTriggerManifest } from "@keystrokehq/core/trigger";
9
8
 
10
- //#region src/triggers.d.ts
9
+ //#region ../../packages/integration-authoring/dist/index.d.mts
10
+ declare function createPollingTriggerBindingFactory(config: any): (options: any) => any;
11
+ //#endregion
12
+ //#region src/triggers/polling.d.ts
11
13
  type Schedule = Parameters<typeof createPollingTriggerBindingFactory>[0]['schedule'];
12
- type SnowflakeCredentialSets = readonly [typeof snowflake];
14
+ type SnowflakeCredentialSets = readonly [typeof snowflakeCredentialSet];
13
15
  type SnowflakePollingBoundTrigger<TResponse extends z.ZodTypeAny, TOutput = z.output<TResponse>> = BoundTrigger<z.output<TResponse>, SnowflakeCredentialSets, PollingTriggerManifest, TOutput>;
14
16
  interface SnowflakePollingBindingOptions<TResponse extends z.ZodTypeAny, TOutput = z.output<TResponse>> extends IntegrationTriggerBindingOptions<z.output<TResponse>, TOutput> {
15
17
  readonly schedule?: Schedule;
@@ -347,7 +349,7 @@ declare const statusPageComponentChangeBatchSchema: z.ZodObject<{
347
349
  * Status-page pollers don't need Snowflake credentials, but they still
348
350
  * flow through the Snowflake binding factory so they show up in the
349
351
  * polling manifest alongside the rest. Credentials are declared but
350
- * unused — the poll callback ignores `ctx.credentials['keystroke:snowflake']`.
352
+ * unused — the poll callback ignores `ctx.credentials['snowflake']`.
351
353
  */
352
354
  declare function statusPageIncident<TOutput = z.output<typeof statusPageIncidentBatchSchema>>(input?: StatusPagePollingParams & SnowflakePollingBindingOptions<typeof statusPageIncidentBatchSchema, TOutput>): SnowflakePollingBoundTrigger<typeof statusPageIncidentBatchSchema, TOutput>;
353
355
  declare function statusPageComponentChanged<TOutput = z.output<typeof statusPageComponentChangeBatchSchema>>(input?: StatusPagePollingParams & SnowflakePollingBindingOptions<typeof statusPageComponentChangeBatchSchema, TOutput>): SnowflakePollingBoundTrigger<typeof statusPageComponentChangeBatchSchema, TOutput>;
@@ -1,14 +1,62 @@
1
- import { n as snowflake } from "./integration-DatCj2fe.mjs";
2
- import { createSnowflakeClient } from "./client.mjs";
3
- import { grantChangedEventSchema, pipeLoadEventSchema, scheduledDeltaEventSchema, scheduledSqlEventSchema, shareChangedEventSchema, snowflakeDiffSnapshotEntrySchema, snowflakeObjectLifecycleEventSchema, statementCompletedEventSchema, statusPageComponentChangeEventSchema, statusPageIncidentEventSchema, streamAppendOnlyEventSchema, streamHasDataEventSchema, taskRunEventSchema, warehouseCreditsEventSchema, warehouseQueueEventSchema } from "./events.mjs";
4
- import { executeSql } from "./sql.mjs";
5
- import { a as quoteLiteral, i as quoteIdentifier, t as buildFqn } from "./sql-safety-CywdR3EP.mjs";
6
- import { BindingBuilder } from "./rows.mjs";
7
- import { getStatusSummary, getUnresolvedIncidents } from "./status-page.mjs";
1
+ import { i as snowflakeCredentialSet } from "../snowflake.credential-set-DE3gXf-a.mjs";
2
+ import { createSnowflakeClient } from "../client/index.mjs";
3
+ import { grantChangedEventSchema, pipeLoadEventSchema, scheduledDeltaEventSchema, scheduledSqlEventSchema, shareChangedEventSchema, snowflakeDiffSnapshotEntrySchema, snowflakeObjectLifecycleEventSchema, statementCompletedEventSchema, statusPageComponentChangeEventSchema, statusPageIncidentEventSchema, streamAppendOnlyEventSchema, streamHasDataEventSchema, taskRunEventSchema, warehouseCreditsEventSchema, warehouseQueueEventSchema } from "../events/index.mjs";
4
+ import { executeSql } from "../sql/index.mjs";
5
+ import { a as quoteLiteral, i as quoteIdentifier, t as buildFqn } from "../sql-safety-BZpAPsq6.mjs";
6
+ import { BindingBuilder } from "../rows/index.mjs";
7
+ import { getStatusSummary, getUnresolvedIncidents } from "../status-page/index.mjs";
8
8
  import { z } from "zod";
9
- import { createPollingTriggerBindingFactory } from "@keystrokehq/integration-authoring";
9
+ import { pollingTrigger } from "@keystrokehq/core/trigger";
10
10
 
11
- //#region src/triggers.ts
11
+ //#region ../../packages/integration-authoring/dist/index.mjs
12
+ const IntegrationConfigSchema = z.object({
13
+ id: z.string().min(1),
14
+ name: z.string().min(1),
15
+ description: z.string().optional()
16
+ });
17
+ function resolveMetadata(metadata, defaults) {
18
+ return {
19
+ id: metadata?.id ?? defaults.defaultId,
20
+ description: metadata?.description ?? defaults.defaultDescription
21
+ };
22
+ }
23
+ function resolveAuthorPayload(payload, mapPayload) {
24
+ if (!mapPayload) return payload;
25
+ return mapPayload(payload);
26
+ }
27
+ function createIntegrationTriggerBindingFactory(config) {
28
+ const bind = (options) => {
29
+ const resolvedMetadata = resolveMetadata(options, config);
30
+ const baseTrigger = config.createBaseTrigger(resolvedMetadata);
31
+ const userTransform = options?.transform;
32
+ return baseTrigger({ transform: userTransform || config.mapPayload ? (runtimePayload, request) => {
33
+ const authorPayload = resolveAuthorPayload(runtimePayload, config.mapPayload);
34
+ if (authorPayload === null) throw new Error(`Trigger "${resolvedMetadata.id}" mapPayload returned null after the trigger filter passed; tighten the trigger filter schema.`);
35
+ if (!userTransform) return authorPayload;
36
+ return userTransform(authorPayload, request);
37
+ } : void 0 });
38
+ };
39
+ return Object.freeze(bind);
40
+ }
41
+ function createPollingTriggerBindingFactory(config) {
42
+ return createIntegrationTriggerBindingFactory({
43
+ defaultId: config.defaultId,
44
+ defaultDescription: config.defaultDescription,
45
+ mapPayload: config.mapPayload,
46
+ createBaseTrigger: (metadata) => pollingTrigger({
47
+ id: metadata.id,
48
+ description: metadata.description,
49
+ schedule: config.schedule,
50
+ response: config.response,
51
+ poll: config.poll,
52
+ ...config.credentialSets ? { credentialSets: config.credentialSets } : {},
53
+ ...config.filter ? { filter: config.filter } : {}
54
+ })
55
+ });
56
+ }
57
+
58
+ //#endregion
59
+ //#region src/triggers/polling.ts
12
60
  function defineSnowflakePollingTrigger(definition) {
13
61
  return definition;
14
62
  }
@@ -31,11 +79,11 @@ function createSnowflakePollingBindingFactory(definition, params, schedule) {
31
79
  defaultId: definition.defaultId,
32
80
  defaultDescription: definition.defaultDescription,
33
81
  schedule: resolveSchedule(schedule, definition.defaultSchedule),
34
- credentialSets: [snowflake],
82
+ credentialSets: [snowflakeCredentialSet],
35
83
  response: definition.responseSchema,
36
84
  poll: (ctx) => {
37
85
  const snowflakeCtx = ctx;
38
- return definition.poll(params, snowflakeCtx.credentials["keystroke:snowflake"], snowflakeCtx);
86
+ return definition.poll(params, snowflakeCtx.credentials.snowflake, snowflakeCtx);
39
87
  }
40
88
  });
41
89
  }
@@ -1015,7 +1063,7 @@ const statusPageComponentChangeDefinition = {
1015
1063
  * Status-page pollers don't need Snowflake credentials, but they still
1016
1064
  * flow through the Snowflake binding factory so they show up in the
1017
1065
  * polling manifest alongside the rest. Credentials are declared but
1018
- * unused — the poll callback ignores `ctx.credentials['keystroke:snowflake']`.
1066
+ * unused — the poll callback ignores `ctx.credentials['snowflake']`.
1019
1067
  */
1020
1068
  function statusPageIncident(input) {
1021
1069
  return bindSnowflakePollingTrigger(statusPageIncidentDefinition, input ?? {}, input);
@@ -1,9 +1,9 @@
1
- import { SnowflakeClient } from "./client.mjs";
2
- import { d as HydratedRow } from "./statements-DJL0qVNA.mjs";
3
- import { t as OptionMap } from "./sql-options-2k5xQ-oS.mjs";
4
- import { CatalogResult, ShowOptions, showUsers } from "./catalog.mjs";
1
+ import { SnowflakeClient } from "../client/index.mjs";
2
+ import { d as HydratedRow } from "../statements-DJL0qVNA.mjs";
3
+ import { t as OptionMap } from "../sql-options-2k5xQ-oS.mjs";
4
+ import { CatalogResult, ShowOptions, showUsers } from "../catalog/index.mjs";
5
5
 
6
- //#region src/users.d.ts
6
+ //#region src/users/index.d.ts
7
7
  interface UserContext {
8
8
  readonly warehouse?: string;
9
9
  readonly role?: string;
@@ -1,9 +1,9 @@
1
- import { executeSql } from "./sql.mjs";
2
- import { a as quoteLiteral, i as quoteIdentifier } from "./sql-safety-CywdR3EP.mjs";
3
- import { t as formatOptions } from "./sql-options-DI-OmLU6.mjs";
4
- import { showUsers } from "./catalog.mjs";
1
+ import { executeSql } from "../sql/index.mjs";
2
+ import { a as quoteLiteral, i as quoteIdentifier } from "../sql-safety-BZpAPsq6.mjs";
3
+ import { t as formatOptions } from "../sql-options-D6GEa21F.mjs";
4
+ import { showUsers } from "../catalog/index.mjs";
5
5
 
6
- //#region src/users.ts
6
+ //#region src/users/index.ts
7
7
  async function createUser(client, options) {
8
8
  const prefix = `CREATE${options.orReplace ? " OR REPLACE" : ""} USER${options.ifNotExists ? " IF NOT EXISTS" : ""}`;
9
9
  const body = options.options && Object.keys(options.options).length > 0 ? ` ${formatOptions(options.options)}` : "";
@@ -1,7 +1,7 @@
1
- import { AzureEventGridEvent, GcsPubSubPush, SnsNotification } from "./events.mjs";
1
+ import { AzureEventGridEvent, GcsPubSubPush, SnsNotification } from "../events/index.mjs";
2
2
  import { z } from "zod";
3
3
 
4
- //#region src/verification.d.ts
4
+ //#region src/verification/index.d.ts
5
5
  /**
6
6
  * Thrown whenever a webhook verifier rejects a request. Includes a
7
7
  * compact `reason` code so callers can distinguish transport problems
@@ -1,8 +1,8 @@
1
- import { azureEventGridEventSchema, gcsPubSubPushSchema, snsNotificationSchema } from "./events.mjs";
1
+ import { azureEventGridEventSchema, gcsPubSubPushSchema, snsNotificationSchema } from "../events/index.mjs";
2
2
  import { z } from "zod";
3
3
  import { X509Certificate, createPublicKey, createVerify } from "node:crypto";
4
4
 
5
- //#region src/verification.ts
5
+ //#region src/verification/index.ts
6
6
  /**
7
7
  * Signature / authenticity verification helpers for the three
8
8
  * Snowflake auto-ingest webhook triggers. Everything here is
@@ -0,0 +1,2 @@
1
+ import { CatalogResult, ShowMaterializedViewsOptions, ShowViewsOptions, showMaterializedViews, showViews } from "../catalog/index.mjs";
2
+ export { type CatalogResult, type ShowMaterializedViewsOptions, type ShowViewsOptions, showMaterializedViews, showViews };
@@ -0,0 +1,3 @@
1
+ import { showMaterializedViews, showViews } from "../catalog/index.mjs";
2
+
3
+ export { showMaterializedViews, showViews };