@credal/actions 0.1.47 → 0.1.48

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.
@@ -1346,10 +1346,6 @@ exports.snowflakeGetRowByFieldValueDefinition = {
1346
1346
  type: "string",
1347
1347
  description: "The name of the Snowflake account",
1348
1348
  },
1349
- user: {
1350
- type: "string",
1351
- description: "The user to authenticate with",
1352
- },
1353
1349
  warehouse: {
1354
1350
  type: "string",
1355
1351
  description: "The warehouse to use",
@@ -1384,7 +1380,7 @@ exports.snowflakeRunSnowflakeQueryDefinition = {
1384
1380
  scopes: [],
1385
1381
  parameters: {
1386
1382
  type: "object",
1387
- required: ["databaseName", "warehouse", "query", "user", "accountName"],
1383
+ required: ["databaseName", "warehouse", "query", "accountName"],
1388
1384
  properties: {
1389
1385
  databaseName: {
1390
1386
  type: "string",
@@ -1398,10 +1394,6 @@ exports.snowflakeRunSnowflakeQueryDefinition = {
1398
1394
  type: "string",
1399
1395
  description: "The SQL query to execute",
1400
1396
  },
1401
- user: {
1402
- type: "string",
1403
- description: "The username to authenticate with",
1404
- },
1405
1397
  accountName: {
1406
1398
  type: "string",
1407
1399
  description: "The name of the Snowflake account",
@@ -1181,13 +1181,11 @@ export declare const snowflakeGetRowByFieldValueParamsSchema: z.ZodObject<{
1181
1181
  fieldName: z.ZodString;
1182
1182
  fieldValue: z.ZodString;
1183
1183
  accountName: z.ZodOptional<z.ZodString>;
1184
- user: z.ZodOptional<z.ZodString>;
1185
1184
  warehouse: z.ZodOptional<z.ZodString>;
1186
1185
  }, "strip", z.ZodTypeAny, {
1187
1186
  tableName: string;
1188
1187
  fieldName: string;
1189
1188
  fieldValue: string;
1190
- user?: string | undefined;
1191
1189
  databaseName?: string | undefined;
1192
1190
  accountName?: string | undefined;
1193
1191
  warehouse?: string | undefined;
@@ -1195,7 +1193,6 @@ export declare const snowflakeGetRowByFieldValueParamsSchema: z.ZodObject<{
1195
1193
  tableName: string;
1196
1194
  fieldName: string;
1197
1195
  fieldValue: string;
1198
- user?: string | undefined;
1199
1196
  databaseName?: string | undefined;
1200
1197
  accountName?: string | undefined;
1201
1198
  warehouse?: string | undefined;
@@ -1229,18 +1226,15 @@ export declare const snowflakeRunSnowflakeQueryParamsSchema: z.ZodObject<{
1229
1226
  databaseName: z.ZodString;
1230
1227
  warehouse: z.ZodString;
1231
1228
  query: z.ZodString;
1232
- user: z.ZodString;
1233
1229
  accountName: z.ZodString;
1234
1230
  outputFormat: z.ZodOptional<z.ZodEnum<["json", "csv"]>>;
1235
1231
  }, "strip", z.ZodTypeAny, {
1236
- user: string;
1237
1232
  query: string;
1238
1233
  databaseName: string;
1239
1234
  accountName: string;
1240
1235
  warehouse: string;
1241
1236
  outputFormat?: "json" | "csv" | undefined;
1242
1237
  }, {
1243
- user: string;
1244
1238
  query: string;
1245
1239
  databaseName: string;
1246
1240
  accountName: string;
@@ -410,7 +410,6 @@ exports.snowflakeGetRowByFieldValueParamsSchema = zod_1.z.object({
410
410
  fieldName: zod_1.z.string().describe("The name of the field to query"),
411
411
  fieldValue: zod_1.z.string().describe("The value of the field to query"),
412
412
  accountName: zod_1.z.string().describe("The name of the Snowflake account").optional(),
413
- user: zod_1.z.string().describe("The user to authenticate with").optional(),
414
413
  warehouse: zod_1.z.string().describe("The warehouse to use").optional(),
415
414
  });
416
415
  exports.snowflakeGetRowByFieldValueOutputSchema = zod_1.z.object({
@@ -425,7 +424,6 @@ exports.snowflakeRunSnowflakeQueryParamsSchema = zod_1.z.object({
425
424
  databaseName: zod_1.z.string().describe("The name of the database to query"),
426
425
  warehouse: zod_1.z.string().describe("The warehouse to use for executing the query"),
427
426
  query: zod_1.z.string().describe("The SQL query to execute"),
428
- user: zod_1.z.string().describe("The username to authenticate with"),
429
427
  accountName: zod_1.z.string().describe("The name of the Snowflake account"),
430
428
  outputFormat: zod_1.z.enum(["json", "csv"]).describe("The format of the output").optional(),
431
429
  });
@@ -11,14 +11,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  const getSnowflakeConnection_1 = require("./auth/getSnowflakeConnection");
13
13
  const getRowByFieldValue = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
14
- const { databaseName, tableName, fieldName, warehouse, fieldValue, user, accountName } = params;
15
- if (!accountName || !user || !databaseName || !warehouse || !tableName || !fieldName || !fieldValue) {
14
+ const { databaseName, tableName, fieldName, warehouse, fieldValue, accountName } = params;
15
+ if (!accountName || !databaseName || !warehouse || !tableName || !fieldName || !fieldValue) {
16
16
  throw new Error("Account name and user are required");
17
17
  }
18
18
  // Set up a connection using snowflake-sdk
19
19
  const connection = (0, getSnowflakeConnection_1.getSnowflakeConnection)({
20
20
  account: accountName,
21
- username: user,
21
+ username: authParams.username || "CREDAL_USER",
22
22
  warehouse: warehouse,
23
23
  database: databaseName,
24
24
  }, {
@@ -17,8 +17,8 @@ const getSnowflakeConnection_1 = require("./auth/getSnowflakeConnection");
17
17
  const formatDataForCodeInterpreter_1 = require("../../util/formatDataForCodeInterpreter");
18
18
  snowflake_sdk_1.default.configure({ logLevel: "ERROR" });
19
19
  const runSnowflakeQuery = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
20
- const { databaseName, warehouse, query, user, accountName, outputFormat = "json" } = params;
21
- if (!accountName || !user || !databaseName || !warehouse || !query) {
20
+ const { databaseName, warehouse, query, accountName, outputFormat = "json" } = params;
21
+ if (!accountName || !databaseName || !warehouse || !query) {
22
22
  throw new Error("Missing required parameters for Snowflake query");
23
23
  }
24
24
  const executeQueryAndFormatData = () => __awaiter(void 0, void 0, void 0, function* () {
@@ -42,7 +42,7 @@ const runSnowflakeQuery = (_a) => __awaiter(void 0, [_a], void 0, function* ({ p
42
42
  // Set up a connection using snowflake-sdk
43
43
  const connection = (0, getSnowflakeConnection_1.getSnowflakeConnection)({
44
44
  account: accountName,
45
- username: user,
45
+ username: authParams.username || "CREDAL_USER",
46
46
  warehouse: warehouse,
47
47
  database: databaseName,
48
48
  }, { authToken: authParams.authToken, apiKey: authParams.apiKey });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credal/actions",
3
- "version": "0.1.47",
3
+ "version": "0.1.48",
4
4
  "description": "AI Actions by Credal AI",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",