@keystrokehq/snowflake 0.0.15 → 0.0.16-integration-id-canonicalization.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.
- package/README.md +3 -9
- package/dist/{accounts.d.mts → accounts/index.d.mts} +3 -3
- package/dist/{accounts.mjs → accounts/index.mjs} +3 -3
- package/dist/{bulk.d.mts → bulk/index.d.mts} +6 -6
- package/dist/{bulk.mjs → bulk/index.mjs} +5 -5
- package/dist/{catalog.d.mts → catalog/index.d.mts} +3 -3
- package/dist/{catalog.mjs → catalog/index.mjs} +3 -3
- package/dist/{client.d.mts → client/index.d.mts} +3 -3
- package/dist/{client.mjs → client/index.mjs} +4 -4
- package/dist/credential-sets/index.d.mts +3 -0
- package/dist/credential-sets/index.mjs +4 -0
- package/dist/{databases.d.mts → databases/index.d.mts} +1 -1
- package/dist/databases/index.mjs +3 -0
- package/dist/{events.d.mts → events/index.d.mts} +1 -1
- package/dist/{events.mjs → events/index.mjs} +2 -2
- package/dist/{file-formats.d.mts → file-formats/index.d.mts} +5 -5
- package/dist/{file-formats.mjs → file-formats/index.mjs} +5 -5
- package/dist/{functions.d.mts → functions/index.d.mts} +5 -5
- package/dist/{functions.mjs → functions/index.mjs} +5 -5
- package/dist/{grants.d.mts → grants/index.d.mts} +3 -3
- package/dist/{grants.mjs → grants/index.mjs} +4 -4
- package/dist/index.d.mts +4 -1
- package/dist/index.mjs +6 -1
- package/dist/{org-admin.d.mts → org-admin/index.d.mts} +4 -4
- package/dist/{org-admin.mjs → org-admin/index.mjs} +4 -4
- package/dist/{pipes.d.mts → pipes/index.d.mts} +4 -4
- package/dist/{pipes.mjs → pipes/index.mjs} +4 -4
- package/dist/{procedures.d.mts → procedures/index.d.mts} +7 -7
- package/dist/{procedures.mjs → procedures/index.mjs} +6 -6
- package/dist/{results.d.mts → results/index.d.mts} +2 -2
- package/dist/{results.mjs → results/index.mjs} +1 -1
- package/dist/{roles.d.mts → roles/index.d.mts} +4 -4
- package/dist/{roles.mjs → roles/index.mjs} +5 -5
- package/dist/{rows.d.mts → rows/index.d.mts} +3 -3
- package/dist/{rows.mjs → rows/index.mjs} +3 -3
- package/dist/schemas/index.mjs +2 -2
- package/dist/{schemas-catalog.d.mts → schemas-catalog/index.d.mts} +1 -1
- package/dist/schemas-catalog/index.mjs +3 -0
- package/dist/{shares.d.mts → shares/index.d.mts} +4 -4
- package/dist/{shares.mjs → shares/index.mjs} +4 -4
- package/dist/snowflake-s3-sns-webhook.credential-set-D6bLAWy5.d.mts +50 -0
- package/dist/snowflake-s3-sns-webhook.credential-set-DzR7oWNK.mjs +44 -0
- package/dist/{integration-D8I5-1eb.d.mts → snowflake.credential-set-BxT7Gf3A.d.mts} +37 -67
- package/dist/snowflake.credential-set-DE3gXf-a.mjs +106 -0
- package/dist/{sql.d.mts → sql/index.d.mts} +3 -3
- package/dist/{sql.mjs → sql/index.mjs} +4 -4
- package/dist/{sql-options-DI-OmLU6.mjs → sql-options-D6GEa21F.mjs} +1 -1
- package/dist/{stages.d.mts → stages/index.d.mts} +6 -6
- package/dist/{stages.mjs → stages/index.mjs} +5 -5
- package/dist/{statements-B2ThF_4b.mjs → statements-BumhMhN4.mjs} +1 -1
- package/dist/{status-page.d.mts → status-page/index.d.mts} +1 -1
- package/dist/{status-page.mjs → status-page/index.mjs} +1 -1
- package/dist/{streaming.d.mts → streaming/index.d.mts} +2 -2
- package/dist/{streaming.mjs → streaming/index.mjs} +1 -1
- package/dist/{streams.d.mts → streams/index.d.mts} +5 -5
- package/dist/{streams.mjs → streams/index.mjs} +5 -5
- package/dist/{tables.d.mts → tables/index.d.mts} +1 -1
- package/dist/{tables.mjs → tables/index.mjs} +1 -1
- package/dist/{tasks.d.mts → tasks/index.d.mts} +5 -5
- package/dist/{tasks.mjs → tasks/index.mjs} +5 -5
- package/dist/{triggers.d.mts → triggers/index.d.mts} +11 -9
- package/dist/{triggers.mjs → triggers/index.mjs} +60 -12
- package/dist/{users.d.mts → users/index.d.mts} +5 -5
- package/dist/{users.mjs → users/index.mjs} +5 -5
- package/dist/{verification.d.mts → verification/index.d.mts} +2 -2
- package/dist/{verification.mjs → verification/index.mjs} +2 -2
- package/dist/views/index.d.mts +2 -0
- package/dist/views/index.mjs +3 -0
- package/dist/{warehouses.d.mts → warehouses/index.d.mts} +5 -5
- package/dist/{warehouses.mjs → warehouses/index.mjs} +5 -5
- package/package.json +15 -19
- package/dist/_official/index.d.mts +0 -2
- package/dist/_official/index.mjs +0 -3
- package/dist/connection.d.mts +0 -2
- package/dist/connection.mjs +0 -3
- package/dist/databases.mjs +0 -3
- package/dist/integration-DatCj2fe.mjs +0 -211
- package/dist/schemas-catalog.mjs +0 -3
- package/dist/views.d.mts +0 -2
- package/dist/views.mjs +0 -3
- /package/dist/{common-BnKTPQXc.mjs → common-DfpCwJx5.mjs} +0 -0
- /package/dist/{errors-DKnc9o_a.mjs → errors-60AsF7Su.mjs} +0 -0
- /package/dist/{_runtime → operations}/index.d.mts +0 -0
- /package/dist/{_runtime → operations}/index.mjs +0 -0
- /package/dist/{retry-0hMfb8cC.mjs → retry-B4-9MZIp.mjs} +0 -0
- /package/dist/{sql-safety-CywdR3EP.mjs → sql-safety-BZpAPsq6.mjs} +0 -0
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import
|
|
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/
|
|
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).
|
|
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
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
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 {
|
|
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 "
|
|
2
|
-
import { a as SubmitStatementInput, d as HydratedRow, f as PartitionResponse, m as ColumnMeta, n as StatementResponse } from "
|
|
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
|
|
2
|
-
import {
|
|
3
|
-
import { hydrateRows } from "
|
|
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,10 +1,10 @@
|
|
|
1
|
-
import { SnowflakeClient } from "
|
|
2
|
-
import { d as HydratedRow } from "
|
|
3
|
-
import { ExecuteSqlResult } from "
|
|
4
|
-
import { t as OptionMap } from "
|
|
5
|
-
import { CatalogResult, ShowScopedOptions, showStages } from "
|
|
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 "
|
|
2
|
-
import { a as quoteLiteral, t as buildFqn } from "
|
|
3
|
-
import { n as renderOptionGroup, t as formatOptions } from "
|
|
4
|
-
import { showStages } from "
|
|
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-
|
|
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,9 +1,9 @@
|
|
|
1
|
-
import { SnowflakeClient } from "
|
|
2
|
-
import { d as HydratedRow } from "
|
|
3
|
-
import { t as OptionMap } from "
|
|
4
|
-
import { CatalogResult, ShowScopedOptions, showStreams } from "
|
|
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 "
|
|
2
|
-
import { a as quoteLiteral, t as buildFqn } from "
|
|
3
|
-
import { t as formatOptions } from "
|
|
4
|
-
import { showStreams } from "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
2
|
-
import { d as HydratedRow } from "
|
|
3
|
-
import { t as OptionMap } from "
|
|
4
|
-
import { CatalogResult, ShowScopedOptions, showTasks } from "
|
|
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 "
|
|
2
|
-
import { a as quoteLiteral, t as buildFqn } from "
|
|
3
|
-
import { t as formatOptions } from "
|
|
4
|
-
import { showTasks } from "
|
|
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 {
|
|
2
|
-
import { scheduledDeltaEventSchema, scheduledSqlEventSchema, streamAppendOnlyEventSchema, streamHasDataEventSchema } from "
|
|
3
|
-
import { RowValue } from "
|
|
4
|
-
import { StatusPageOptions } from "
|
|
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 {
|
|
6
|
+
import { z } from "zod";
|
|
8
7
|
import { PollingTriggerManifest } from "@keystrokehq/core/trigger";
|
|
9
8
|
|
|
10
|
-
//#region
|
|
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
|
|
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['
|
|
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 {
|
|
2
|
-
import { createSnowflakeClient } from "
|
|
3
|
-
import { grantChangedEventSchema, pipeLoadEventSchema, scheduledDeltaEventSchema, scheduledSqlEventSchema, shareChangedEventSchema, snowflakeDiffSnapshotEntrySchema, snowflakeObjectLifecycleEventSchema, statementCompletedEventSchema, statusPageComponentChangeEventSchema, statusPageIncidentEventSchema, streamAppendOnlyEventSchema, streamHasDataEventSchema, taskRunEventSchema, warehouseCreditsEventSchema, warehouseQueueEventSchema } from "
|
|
4
|
-
import { executeSql } from "
|
|
5
|
-
import { a as quoteLiteral, i as quoteIdentifier, t as buildFqn } from "
|
|
6
|
-
import { BindingBuilder } from "
|
|
7
|
-
import { getStatusSummary, getUnresolvedIncidents } from "
|
|
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 {
|
|
9
|
+
import { pollingTrigger } from "@keystrokehq/core/trigger";
|
|
10
10
|
|
|
11
|
-
//#region
|
|
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: [
|
|
82
|
+
credentialSets: [snowflakeCredentialSet],
|
|
35
83
|
response: definition.responseSchema,
|
|
36
84
|
poll: (ctx) => {
|
|
37
85
|
const snowflakeCtx = ctx;
|
|
38
|
-
return definition.poll(params, snowflakeCtx.credentials
|
|
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['
|
|
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 "
|
|
2
|
-
import { d as HydratedRow } from "
|
|
3
|
-
import { t as OptionMap } from "
|
|
4
|
-
import { CatalogResult, ShowOptions, showUsers } from "
|
|
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 "
|
|
2
|
-
import { a as quoteLiteral, i as quoteIdentifier } from "
|
|
3
|
-
import { t as formatOptions } from "
|
|
4
|
-
import { showUsers } from "
|
|
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 "
|
|
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 "
|
|
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
|