@keystrokehq/snowflake 0.0.9 → 0.0.15

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.
@@ -1,2 +1,2 @@
1
- import { c as snowflakeOfficialIntegration, i as snowflake, s as snowflakeBundle } from "../integration-86b6WaJF.mjs";
1
+ import { c as snowflakeOfficialIntegration, i as snowflake, s as snowflakeBundle } from "../integration-D8I5-1eb.mjs";
2
2
  export { snowflake, snowflakeBundle, snowflakeOfficialIntegration };
@@ -1,3 +1,3 @@
1
- import { a as snowflakeBundle, n as snowflake, o as snowflakeOfficialIntegration } from "../integration-DNMbfXEy.mjs";
1
+ import { a as snowflakeBundle, n as snowflake, o as snowflakeOfficialIntegration } from "../integration-DatCj2fe.mjs";
2
2
 
3
3
  export { snowflake, snowflakeBundle, snowflakeOfficialIntegration };
package/dist/client.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as SnowflakeCredentials } from "./integration-86b6WaJF.mjs";
1
+ import { n as SnowflakeCredentials } from "./integration-D8I5-1eb.mjs";
2
2
  import { t as RetryPolicy } from "./retry-w7cTp1QL.mjs";
3
3
 
4
4
  //#region src/client.d.ts
package/dist/client.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as parseSnowflakeCredentials } from "./integration-DNMbfXEy.mjs";
1
+ import { t as parseSnowflakeCredentials } from "./integration-DatCj2fe.mjs";
2
2
  import { a as extractSnowflakeMessage, c as parseRetryAfterHeader, i as extractSnowflakeCode, n as SnowflakeSqlError, o as extractSnowflakeSqlState, r as classifySnowflakeHttpStatus, s as extractSnowflakeStatementHandle, t as SnowflakeApiError } from "./errors-DKnc9o_a.mjs";
3
3
  import { a as createSnowflakeJwt, i as shouldRetry, n as computeBackoffMs, r as defaultSleep, t as DEFAULT_RETRY_POLICY } from "./retry-0hMfb8cC.mjs";
4
4
 
@@ -1,2 +1,2 @@
1
- import { a as snowflakeAuthModeSchema, c as snowflakeOfficialIntegration, i as snowflake, n as SnowflakeCredentials, o as snowflakeAuthSchema, r as parseSnowflakeCredentials, s as snowflakeBundle, t as SnowflakeAuthMode } from "./integration-86b6WaJF.mjs";
1
+ import { a as snowflakeAuthModeSchema, c as snowflakeOfficialIntegration, i as snowflake, n as SnowflakeCredentials, o as snowflakeAuthSchema, r as parseSnowflakeCredentials, s as snowflakeBundle, t as SnowflakeAuthMode } from "./integration-D8I5-1eb.mjs";
2
2
  export { type SnowflakeAuthMode, type SnowflakeCredentials, parseSnowflakeCredentials, snowflake, snowflakeAuthModeSchema, snowflakeAuthSchema, snowflakeBundle, snowflakeOfficialIntegration };
@@ -1,3 +1,3 @@
1
- import { a as snowflakeBundle, i as snowflakeAuthSchema, n as snowflake, o as snowflakeOfficialIntegration, r as snowflakeAuthModeSchema, t as parseSnowflakeCredentials } from "./integration-DNMbfXEy.mjs";
1
+ import { a as snowflakeBundle, i as snowflakeAuthSchema, n as snowflake, o as snowflakeOfficialIntegration, r as snowflakeAuthModeSchema, t as parseSnowflakeCredentials } from "./integration-DatCj2fe.mjs";
2
2
 
3
3
  export { parseSnowflakeCredentials, snowflake, snowflakeAuthModeSchema, snowflakeAuthSchema, snowflakeBundle, snowflakeOfficialIntegration };
@@ -1,7 +1,6 @@
1
- import * as _keystrokehq_core0 from "@keystrokehq/core";
2
- import { CredentialSet } from "@keystrokehq/core";
1
+ import * as _keystrokehq_integration_authoring_official0 from "@keystrokehq/integration-authoring/official";
3
2
  import { z } from "zod";
4
- import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
3
+ import * as _keystrokehq_core0 from "@keystrokehq/core";
5
4
  import { InferCredentialSetAuth } from "@keystrokehq/core/credential-set";
6
5
 
7
6
  //#region src/integration.d.ts
@@ -51,6 +50,7 @@ declare const snowflakeOfficialIntegration: {
51
50
  id: "snowflake";
52
51
  name: string;
53
52
  description: string;
53
+ credentialType: "manual";
54
54
  auth: z.ZodObject<{
55
55
  mode: z.ZodEnum<{
56
56
  keypair: "keypair";
@@ -79,7 +79,7 @@ declare const snowflakeOfficialIntegration: {
79
79
  SNOWFLAKE_PUBLIC_KEY_FP: z.ZodOptional<z.ZodString>;
80
80
  }, z.core.$strip>;
81
81
  };
82
- declare const snowflakeBundle: undefined<"snowflake", z.ZodObject<{
82
+ declare const snowflakeBundle: _keystrokehq_integration_authoring_official0.OfficialIntegrationBundle<"snowflake", z.ZodObject<{
83
83
  mode: z.ZodEnum<{
84
84
  keypair: "keypair";
85
85
  oauth: "oauth";
@@ -106,33 +106,7 @@ declare const snowflakeBundle: undefined<"snowflake", z.ZodObject<{
106
106
  SNOWFLAKE_REGION: z.ZodOptional<z.ZodString>;
107
107
  SNOWFLAKE_PUBLIC_KEY_FP: z.ZodOptional<z.ZodString>;
108
108
  }, z.core.$strip>>;
109
- declare const snowflake: _keystrokehq_core0.CredentialSet<"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>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
109
+ declare const snowflake: _keystrokehq_core0.CredentialSet<"keystroke:snowflake", z.ZodObject<{
136
110
  mode: z.ZodEnum<{
137
111
  keypair: "keypair";
138
112
  oauth: "oauth";
@@ -158,7 +132,7 @@ declare const snowflake: _keystrokehq_core0.CredentialSet<"snowflake", z.ZodObje
158
132
  SNOWFLAKE_HOST: z.ZodOptional<z.ZodString>;
159
133
  SNOWFLAKE_REGION: z.ZodOptional<z.ZodString>;
160
134
  SNOWFLAKE_PUBLIC_KEY_FP: z.ZodOptional<z.ZodString>;
161
- }, z.core.$strip>>[] | undefined>;
135
+ }, z.core.$strip>>;
162
136
  type SnowflakeCredentials = InferCredentialSetAuth<typeof snowflake>;
163
137
  /**
164
138
  * Parse raw credential values through the full refinement pipeline. Callers
@@ -1,51 +1,7 @@
1
- import { CredentialSet } from "@keystrokehq/core";
1
+ import { defineOfficialIntegration, officialCredentialSetId } from "@keystrokehq/integration-authoring/official";
2
2
  import { z } from "zod";
3
+ import { CredentialSet } from "@keystrokehq/core";
3
4
 
4
- //#region ../../packages/integration-authoring/dist/official/index.mjs
5
- const OFFICIAL_CREDENTIAL_SET_ID_PREFIX = "keystroke:";
6
- function officialCredentialSetId(id) {
7
- return `${OFFICIAL_CREDENTIAL_SET_ID_PREFIX}${id}`;
8
- }
9
- /**
10
- * Creates an official integration bundle from a single config object.
11
- *
12
- * - Creates the public `CredentialSet` internally.
13
- * - Accepts optional `internal` fields for Keystroke-owned platform credentials.
14
- */
15
- function defineOfficialIntegration(config) {
16
- const internalCredentialSets = config.internal ?? {};
17
- const allInternalCredentialSets = [
18
- ...internalCredentialSets.providerApp ? [internalCredentialSets.providerApp] : [],
19
- ...internalCredentialSets.providerAppVariants ?? [],
20
- ...internalCredentialSets.webhookVerification ? [internalCredentialSets.webhookVerification] : [],
21
- ...internalCredentialSets.other ?? []
22
- ];
23
- const credentialSet = new CredentialSet({
24
- id: config.id,
25
- name: config.name,
26
- description: config.description,
27
- auth: config.auth,
28
- ...config.connections ? { connections: config.connections } : {},
29
- ...config.proxy ? { proxy: config.proxy } : {},
30
- ...config.needsRawSecret === true ? { needsRawSecret: true } : {}
31
- });
32
- return Object.freeze({
33
- integration: {
34
- id: config.id,
35
- name: config.name,
36
- ...config.description !== void 0 ? { description: config.description } : {},
37
- auth: config.auth,
38
- ...config.proxy ? { proxy: config.proxy } : {},
39
- ...config.needsRawSecret === true ? { needsRawSecret: true } : {},
40
- ...config.connections ? { connections: config.connections } : {}
41
- },
42
- credentialSet,
43
- internalCredentialSets,
44
- allInternalCredentialSets
45
- });
46
- }
47
-
48
- //#endregion
49
5
  //#region src/webhook-credentials.ts
50
6
  /**
51
7
  * Webhook credential sets for the Snowflake auto-ingest triggers.
@@ -73,6 +29,7 @@ function defineOfficialIntegration(config) {
73
29
  */
74
30
  const snowflakeS3SnsWebhookCredentialSet = new CredentialSet({
75
31
  id: officialCredentialSetId("snowflake-s3-sns-webhook"),
32
+ credentialType: "manual",
76
33
  exposure: "platform-only",
77
34
  name: "Snowflake Auto-Ingest — AWS SNS",
78
35
  auth: z.object({
@@ -96,6 +53,7 @@ const snowflakeS3SnsWebhookCredentialSet = new CredentialSet({
96
53
  */
97
54
  const snowflakeGcsPubSubWebhookCredentialSet = new CredentialSet({
98
55
  id: officialCredentialSetId("snowflake-gcs-pubsub-webhook"),
56
+ credentialType: "manual",
99
57
  exposure: "platform-only",
100
58
  name: "Snowflake Auto-Ingest — GCS Pub/Sub",
101
59
  auth: z.object({
@@ -119,6 +77,7 @@ const snowflakeGcsPubSubWebhookCredentialSet = new CredentialSet({
119
77
  */
120
78
  const snowflakeAzureEventGridWebhookCredentialSet = new CredentialSet({
121
79
  id: officialCredentialSetId("snowflake-azure-eventgrid-webhook"),
80
+ credentialType: "manual",
122
81
  exposure: "platform-only",
123
82
  name: "Snowflake Auto-Ingest — Azure Event Grid",
124
83
  auth: z.object({
@@ -227,6 +186,7 @@ const snowflakeOfficialIntegration = {
227
186
  id: "snowflake",
228
187
  name: "Snowflake",
229
188
  description: "Snowflake data cloud: SQL API v2, Snowpipe (file + streaming), warehouses, roles, users, grants, shares, streams, tasks, and administration for Keystroke workflows.",
189
+ credentialType: "manual",
230
190
  auth: snowflakeAuthObjectSchema
231
191
  };
232
192
  const snowflakeBundle = defineOfficialIntegration({
@@ -1,14 +1,12 @@
1
- import { i as snowflake } from "./integration-86b6WaJF.mjs";
1
+ import { i as snowflake } from "./integration-D8I5-1eb.mjs";
2
2
  import { scheduledDeltaEventSchema, scheduledSqlEventSchema, streamAppendOnlyEventSchema, streamHasDataEventSchema } from "./events.mjs";
3
3
  import { RowValue } from "./rows.mjs";
4
4
  import { StatusPageOptions } from "./status-page.mjs";
5
- import { BoundTrigger } from "@keystrokehq/core";
6
5
  import { z } from "zod";
6
+ import { BoundTrigger } from "@keystrokehq/core";
7
+ import { IntegrationTriggerBindingOptions, createPollingTriggerBindingFactory } from "@keystrokehq/integration-authoring";
7
8
  import { PollingTriggerManifest } from "@keystrokehq/core/trigger";
8
9
 
9
- //#region ../../packages/integration-authoring/dist/index.d.mts
10
- declare function createPollingTriggerBindingFactory(config: any): (options: any) => any;
11
- //#endregion
12
10
  //#region src/triggers.d.ts
13
11
  type Schedule = Parameters<typeof createPollingTriggerBindingFactory>[0]['schedule'];
14
12
  type SnowflakeCredentialSets = readonly [typeof snowflake];
@@ -349,7 +347,7 @@ declare const statusPageComponentChangeBatchSchema: z.ZodObject<{
349
347
  * Status-page pollers don't need Snowflake credentials, but they still
350
348
  * flow through the Snowflake binding factory so they show up in the
351
349
  * polling manifest alongside the rest. Credentials are declared but
352
- * unused — the poll callback ignores `ctx.credentials['snowflake']`.
350
+ * unused — the poll callback ignores `ctx.credentials['keystroke:snowflake']`.
353
351
  */
354
352
  declare function statusPageIncident<TOutput = z.output<typeof statusPageIncidentBatchSchema>>(input?: StatusPagePollingParams & SnowflakePollingBindingOptions<typeof statusPageIncidentBatchSchema, TOutput>): SnowflakePollingBoundTrigger<typeof statusPageIncidentBatchSchema, TOutput>;
355
353
  declare function statusPageComponentChanged<TOutput = z.output<typeof statusPageComponentChangeBatchSchema>>(input?: StatusPagePollingParams & SnowflakePollingBindingOptions<typeof statusPageComponentChangeBatchSchema, TOutput>): SnowflakePollingBoundTrigger<typeof statusPageComponentChangeBatchSchema, TOutput>;
package/dist/triggers.mjs CHANGED
@@ -1,62 +1,13 @@
1
- import { n as snowflake } from "./integration-DNMbfXEy.mjs";
1
+ import { n as snowflake } from "./integration-DatCj2fe.mjs";
2
2
  import { createSnowflakeClient } from "./client.mjs";
3
3
  import { grantChangedEventSchema, pipeLoadEventSchema, scheduledDeltaEventSchema, scheduledSqlEventSchema, shareChangedEventSchema, snowflakeDiffSnapshotEntrySchema, snowflakeObjectLifecycleEventSchema, statementCompletedEventSchema, statusPageComponentChangeEventSchema, statusPageIncidentEventSchema, streamAppendOnlyEventSchema, streamHasDataEventSchema, taskRunEventSchema, warehouseCreditsEventSchema, warehouseQueueEventSchema } from "./events.mjs";
4
4
  import { executeSql } from "./sql.mjs";
5
5
  import { a as quoteLiteral, i as quoteIdentifier, t as buildFqn } from "./sql-safety-CywdR3EP.mjs";
6
6
  import { BindingBuilder } from "./rows.mjs";
7
7
  import { getStatusSummary, getUnresolvedIncidents } from "./status-page.mjs";
8
- import "@keystrokehq/core";
9
8
  import { z } from "zod";
10
- import { pollingTrigger } from "@keystrokehq/core/trigger";
9
+ import { createPollingTriggerBindingFactory } from "@keystrokehq/integration-authoring";
11
10
 
12
- //#region ../../packages/integration-authoring/dist/index.mjs
13
- const IntegrationConfigSchema = z.object({
14
- id: z.string().min(1),
15
- name: z.string().min(1),
16
- description: z.string().optional()
17
- });
18
- function resolveMetadata(metadata, defaults) {
19
- return {
20
- id: metadata?.id ?? defaults.defaultId,
21
- description: metadata?.description ?? defaults.defaultDescription
22
- };
23
- }
24
- function resolveAuthorPayload(payload, mapPayload) {
25
- if (!mapPayload) return payload;
26
- return mapPayload(payload);
27
- }
28
- function createIntegrationTriggerBindingFactory(config) {
29
- const bind = (options) => {
30
- const resolvedMetadata = resolveMetadata(options, config);
31
- const baseTrigger = config.createBaseTrigger(resolvedMetadata);
32
- const userTransform = options?.transform;
33
- return baseTrigger({ transform: userTransform || config.mapPayload ? (runtimePayload, request) => {
34
- const authorPayload = resolveAuthorPayload(runtimePayload, config.mapPayload);
35
- if (authorPayload === null) throw new Error(`Trigger "${resolvedMetadata.id}" mapPayload returned null after the trigger filter passed; tighten the trigger filter schema.`);
36
- if (!userTransform) return authorPayload;
37
- return userTransform(authorPayload, request);
38
- } : void 0 });
39
- };
40
- return Object.freeze(bind);
41
- }
42
- function createPollingTriggerBindingFactory(config) {
43
- return createIntegrationTriggerBindingFactory({
44
- defaultId: config.defaultId,
45
- defaultDescription: config.defaultDescription,
46
- mapPayload: config.mapPayload,
47
- createBaseTrigger: (metadata) => pollingTrigger({
48
- id: metadata.id,
49
- description: metadata.description,
50
- schedule: config.schedule,
51
- response: config.response,
52
- poll: config.poll,
53
- ...config.credentialSets ? { credentialSets: config.credentialSets } : {},
54
- ...config.filter ? { filter: config.filter } : {}
55
- })
56
- });
57
- }
58
-
59
- //#endregion
60
11
  //#region src/triggers.ts
61
12
  function defineSnowflakePollingTrigger(definition) {
62
13
  return definition;
@@ -84,7 +35,7 @@ function createSnowflakePollingBindingFactory(definition, params, schedule) {
84
35
  response: definition.responseSchema,
85
36
  poll: (ctx) => {
86
37
  const snowflakeCtx = ctx;
87
- return definition.poll(params, snowflakeCtx.credentials["snowflake"], snowflakeCtx);
38
+ return definition.poll(params, snowflakeCtx.credentials["keystroke:snowflake"], snowflakeCtx);
88
39
  }
89
40
  });
90
41
  }
@@ -1064,7 +1015,7 @@ const statusPageComponentChangeDefinition = {
1064
1015
  * Status-page pollers don't need Snowflake credentials, but they still
1065
1016
  * flow through the Snowflake binding factory so they show up in the
1066
1017
  * polling manifest alongside the rest. Credentials are declared but
1067
- * unused — the poll callback ignores `ctx.credentials['snowflake']`.
1018
+ * unused — the poll callback ignores `ctx.credentials['keystroke:snowflake']`.
1068
1019
  */
1069
1020
  function statusPageIncident(input) {
1070
1021
  return bindSnowflakePollingTrigger(statusPageIncidentDefinition, input ?? {}, input);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keystrokehq/snowflake",
3
- "version": "0.0.9",
3
+ "version": "0.0.15",
4
4
  "private": false,
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -148,20 +148,20 @@
148
148
  "LICENSE"
149
149
  ],
150
150
  "dependencies": {
151
+ "@keystrokehq/integration-authoring": "^0.0.9",
151
152
  "zod": "^4.3.6"
152
153
  },
153
154
  "peerDependencies": {
154
- "@keystrokehq/core": ">=0.0.8 <0.1.0"
155
+ "@keystrokehq/core": ">=0.0.13 <0.1.0"
155
156
  },
156
157
  "devDependencies": {
157
158
  "@types/node": "^22.19.11",
158
159
  "tsdown": "^0.20.3",
159
160
  "typescript": "^5.9.3",
160
161
  "vitest": "^4.0.18",
161
- "@keystrokehq/core": "^0.0.12",
162
+ "@keystrokehq/core": "^0.0.13",
162
163
  "@keystrokehq/test-utils": "0.0.0",
163
- "@keystrokehq/typescript-config": "0.0.0",
164
- "@keystrokehq/integration-authoring": "0.0.9"
164
+ "@keystrokehq/typescript-config": "0.0.0"
165
165
  },
166
166
  "keywords": [
167
167
  "snowflake",