@aiqadam/qadam-snowflake 0.3.4

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 (102) hide show
  1. package/LICENSE +22 -0
  2. package/NOTICE +6 -0
  3. package/README.md +5 -0
  4. package/package.json +23 -0
  5. package/src/i18n/de.json +120 -0
  6. package/src/i18n/es.json +120 -0
  7. package/src/i18n/fr.json +120 -0
  8. package/src/i18n/ja.json +120 -0
  9. package/src/i18n/nl.json +120 -0
  10. package/src/i18n/pt.json +120 -0
  11. package/src/i18n/ru.json +16 -0
  12. package/src/i18n/translation.json +120 -0
  13. package/src/i18n/vi.json +14 -0
  14. package/src/i18n/zh.json +120 -0
  15. package/src/index.d.ts +11 -0
  16. package/src/index.d.ts.map +1 -0
  17. package/src/index.js +63 -0
  18. package/src/index.js.map +1 -0
  19. package/src/lib/actions/create-dynamic-table.d.ts +45 -0
  20. package/src/lib/actions/create-dynamic-table.d.ts.map +1 -0
  21. package/src/lib/actions/create-dynamic-table.js +82 -0
  22. package/src/lib/actions/create-dynamic-table.js.map +1 -0
  23. package/src/lib/actions/delete-row.d.ts +43 -0
  24. package/src/lib/actions/delete-row.d.ts.map +1 -0
  25. package/src/lib/actions/delete-row.js +50 -0
  26. package/src/lib/actions/delete-row.js.map +1 -0
  27. package/src/lib/actions/execute-stored-procedure.d.ts +43 -0
  28. package/src/lib/actions/execute-stored-procedure.d.ts.map +1 -0
  29. package/src/lib/actions/execute-stored-procedure.js +97 -0
  30. package/src/lib/actions/execute-stored-procedure.js.map +1 -0
  31. package/src/lib/actions/get-row-by-id.d.ts +53 -0
  32. package/src/lib/actions/get-row-by-id.d.ts.map +1 -0
  33. package/src/lib/actions/get-row-by-id.js +72 -0
  34. package/src/lib/actions/get-row-by-id.js.map +1 -0
  35. package/src/lib/actions/get-table-schema.d.ts +42 -0
  36. package/src/lib/actions/get-table-schema.d.ts.map +1 -0
  37. package/src/lib/actions/get-table-schema.js +54 -0
  38. package/src/lib/actions/get-table-schema.js.map +1 -0
  39. package/src/lib/actions/insert-multiple-rows.d.ts +43 -0
  40. package/src/lib/actions/insert-multiple-rows.d.ts.map +1 -0
  41. package/src/lib/actions/insert-multiple-rows.js +86 -0
  42. package/src/lib/actions/insert-multiple-rows.js.map +1 -0
  43. package/src/lib/actions/insert-row.d.ts +52 -0
  44. package/src/lib/actions/insert-row.d.ts.map +1 -0
  45. package/src/lib/actions/insert-row.js +41 -0
  46. package/src/lib/actions/insert-row.js.map +1 -0
  47. package/src/lib/actions/list-tables.d.ts +32 -0
  48. package/src/lib/actions/list-tables.d.ts.map +1 -0
  49. package/src/lib/actions/list-tables.js +52 -0
  50. package/src/lib/actions/list-tables.js.map +1 -0
  51. package/src/lib/actions/load-data-from-stage.d.ts +48 -0
  52. package/src/lib/actions/load-data-from-stage.d.ts.map +1 -0
  53. package/src/lib/actions/load-data-from-stage.js +124 -0
  54. package/src/lib/actions/load-data-from-stage.js.map +1 -0
  55. package/src/lib/actions/run-multiple-queries.d.ts +17 -0
  56. package/src/lib/actions/run-multiple-queries.d.ts.map +1 -0
  57. package/src/lib/actions/run-multiple-queries.js +147 -0
  58. package/src/lib/actions/run-multiple-queries.js.map +1 -0
  59. package/src/lib/actions/run-query.d.ts +16 -0
  60. package/src/lib/actions/run-query.d.ts.map +1 -0
  61. package/src/lib/actions/run-query.js +58 -0
  62. package/src/lib/actions/run-query.js.map +1 -0
  63. package/src/lib/actions/search-rows.d.ts +45 -0
  64. package/src/lib/actions/search-rows.d.ts.map +1 -0
  65. package/src/lib/actions/search-rows.js +63 -0
  66. package/src/lib/actions/search-rows.js.map +1 -0
  67. package/src/lib/actions/update-row.d.ts +53 -0
  68. package/src/lib/actions/update-row.d.ts.map +1 -0
  69. package/src/lib/actions/update-row.js +59 -0
  70. package/src/lib/actions/update-row.js.map +1 -0
  71. package/src/lib/actions/upsert-row.d.ts +62 -0
  72. package/src/lib/actions/upsert-row.d.ts.map +1 -0
  73. package/src/lib/actions/upsert-row.js +98 -0
  74. package/src/lib/actions/upsert-row.js.map +1 -0
  75. package/src/lib/auth.d.ts +22 -0
  76. package/src/lib/auth.d.ts.map +1 -0
  77. package/src/lib/auth.js +246 -0
  78. package/src/lib/auth.js.map +1 -0
  79. package/src/lib/common/index.d.ts +93 -0
  80. package/src/lib/common/index.d.ts.map +1 -0
  81. package/src/lib/common/index.js +319 -0
  82. package/src/lib/common/index.js.map +1 -0
  83. package/src/lib/triggers/new-column.d.ts +163 -0
  84. package/src/lib/triggers/new-column.d.ts.map +1 -0
  85. package/src/lib/triggers/new-column.js +94 -0
  86. package/src/lib/triggers/new-column.js.map +1 -0
  87. package/src/lib/triggers/new-or-updated-row.d.ts +203 -0
  88. package/src/lib/triggers/new-or-updated-row.d.ts.map +1 -0
  89. package/src/lib/triggers/new-or-updated-row.js +108 -0
  90. package/src/lib/triggers/new-or-updated-row.js.map +1 -0
  91. package/src/lib/triggers/new-row.d.ts +203 -0
  92. package/src/lib/triggers/new-row.d.ts.map +1 -0
  93. package/src/lib/triggers/new-row.js +107 -0
  94. package/src/lib/triggers/new-row.js.map +1 -0
  95. package/src/lib/triggers/new-table.d.ts +123 -0
  96. package/src/lib/triggers/new-table.d.ts.map +1 -0
  97. package/src/lib/triggers/new-table.js +94 -0
  98. package/src/lib/triggers/new-table.js.map +1 -0
  99. package/src/lib/triggers/new-view.d.ts +123 -0
  100. package/src/lib/triggers/new-view.d.ts.map +1 -0
  101. package/src/lib/triggers/new-view.js +94 -0
  102. package/src/lib/triggers/new-view.js.map +1 -0
@@ -0,0 +1,14 @@
1
+ {
2
+ "Data warehouse built for the cloud": "Data warehouse built for the cloud",
3
+ "Database": "Database",
4
+ "Warehouse": "Warehouse",
5
+ "Run Query": "Run Query",
6
+ "Run Multiple Queries": "Run Multiple Queries",
7
+ "Insert Row": "Insert Row",
8
+ "Insert a row into a table.": "Insert a row into a table.",
9
+ "Parameters": "Parameters",
10
+ "Use Transaction": "Use Transaction",
11
+ "Schema": "Schema",
12
+ "Table": "Table",
13
+ "Rows": "Rows"
14
+ }
@@ -0,0 +1,120 @@
1
+ {
2
+ "Data warehouse built for the cloud": "Data warehouse built for the cloud",
3
+ "Run Query": "Run Query",
4
+ "Run Multiple Queries": "Run Multiple Queries",
5
+ "Insert Row": "Insert Row",
6
+ "Update Row": "更新行",
7
+ "Delete Row": "删除行",
8
+ "Upsert Row": "Upsert Row",
9
+ "Insert Multiple Rows": "插入多行",
10
+ "Get Row by ID": "Get Row by ID",
11
+ "Search Rows": "Search Rows",
12
+ "Get Table Schema": "Get Table Schema",
13
+ "List Tables": "List Tables",
14
+ "Execute Stored Procedure": "Execute Stored Procedure",
15
+ "Create / Refresh Dynamic Table": "Create / Refresh Dynamic Table",
16
+ "Load Data from Stage": "Load Data from Stage",
17
+ "Execute a SQL query against your Snowflake database and return the results as rows.": "Execute a SQL query against your Snowflake database and return the results as rows.",
18
+ "Execute multiple SQL statements in sequence against your Snowflake database. Optionally wrap them in a transaction so all changes are rolled back if any statement fails.": "Execute multiple SQL statements in sequence against your Snowflake database. Optionally wrap them in a transaction so all changes are rolled back if any statement fails.",
19
+ "Insert a row into a table.": "Insert a row into a table.",
20
+ "Update one or more rows in a Snowflake table that match a WHERE condition.": "Update one or more rows in a Snowflake table that match a WHERE condition.",
21
+ "Delete one or more rows from a Snowflake table that match a WHERE condition.": "Delete one or more rows from a Snowflake table that match a WHERE condition.",
22
+ "Insert a new row or update an existing one if a row with the same match column value already exists (MERGE INTO).": "Insert a new row or update an existing one if a row with the same match column value already exists (MERGE INTO).",
23
+ "Insert multiple rows into a Snowflake table in a single operation.": "Insert multiple rows into a Snowflake table in a single operation.",
24
+ "Retrieve a single row from a Snowflake table by matching a column value.": "Retrieve a single row from a Snowflake table by matching a column value.",
25
+ "Search for rows in a Snowflake table using an optional WHERE condition, ordering, and row limit.": "Search for rows in a Snowflake table using an optional WHERE condition, ordering, and row limit.",
26
+ "Retrieve the column definitions (name, data type, nullability, default) for a Snowflake table.": "Retrieve the column definitions (name, data type, nullability, default) for a Snowflake table.",
27
+ "List all tables in a Snowflake schema.": "List all tables in a Snowflake schema.",
28
+ "Call a stored procedure in Snowflake and return its result.": "Call a stored procedure in Snowflake and return its result.",
29
+ "Create or replace a Snowflake Dynamic Table that automatically refreshes based on a query. Dynamic Tables are a declarative way to define a table whose content is derived from a query, updated on a schedule.": "Create or replace a Snowflake Dynamic Table that automatically refreshes based on a query. Dynamic Tables are a declarative way to define a table whose content is derived from a query, updated on a schedule.",
30
+ "Load data into a Snowflake table from a named internal or external stage using COPY INTO.": "Load data into a Snowflake table from a named internal or external stage using COPY INTO.",
31
+ "SQL Query": "SQL Query",
32
+ "Parameters": "Parameters",
33
+ "Query Timeout (ms)": "Query Timeout (ms)",
34
+ "Application Name": "Application Name",
35
+ "SQL Queries": "SQL Queries",
36
+ "Use Transaction": "Use Transaction",
37
+ "Database": "Database",
38
+ "Schema": "Schema",
39
+ "Table": "表",
40
+ "Row Data": "Row Data",
41
+ "Columns to Update": "Columns to Update",
42
+ "WHERE Condition": "WHERE Condition",
43
+ "Match Column": "Match Column",
44
+ "Rows": "Rows",
45
+ "ID Column": "ID Column",
46
+ "ID Value": "ID Value",
47
+ "Filter Condition": "Filter Condition",
48
+ "Sort By": "Sort By",
49
+ "Row Limit": "Row Limit",
50
+ "Stored Procedure": "Stored Procedure",
51
+ "Arguments": "Arguments",
52
+ "Dynamic Table Name": "Dynamic Table Name",
53
+ "Refresh Interval": "Refresh Interval",
54
+ "Warehouse": "Warehouse",
55
+ "Source Query": "Source Query",
56
+ "Stage Path": "Stage Path",
57
+ "File Format": "File Format",
58
+ "File Pattern": "File Pattern",
59
+ "Skip Header Rows": "Skip Header Rows",
60
+ "Fail on Column Count Mismatch": "Fail on Column Count Mismatch",
61
+ "On Error": "On Error",
62
+ "The SQL statement to execute. Use `:1`, `:2`… or `?` as placeholders for the **Parameters** values below to safely pass dynamic values without SQL injection risk.": "The SQL statement to execute. Use `:1`, `:2`… or `?` as placeholders for the **Parameters** values below to safely pass dynamic values without SQL injection risk.",
63
+ "Values to bind to the placeholders (`:1`, `:2`…, or `?`) in the SQL query. Provide them in the same order they appear in the query. Using parameters is the safe way to pass dynamic values — never concatenate user input directly into the SQL.": "Values to bind to the placeholders (`:1`, `:2`…, or `?`) in the SQL query. Provide them in the same order they appear in the query. Using parameters is the safe way to pass dynamic values — never concatenate user input directly into the SQL.",
64
+ "Maximum time in milliseconds to wait for the query to complete before cancelling it. Defaults to 30 000 ms (30 seconds).": "Maximum time in milliseconds to wait for the query to complete before cancelling it. Defaults to 30 000 ms (30 seconds).",
65
+ "An optional label sent to Snowflake to identify this client. Visible in query history under **Monitoring → Query History → Client Application**. Useful for auditing which automation triggered a query.": "An optional label sent to Snowflake to identify this client. Visible in query history under **Monitoring → Query History → Client Application**. Useful for auditing which automation triggered a query.",
66
+ "List of SQL statements to run in order. Use `:1`, `:2`… placeholders to reference shared **Parameters** values. Avoid `?` placeholders when running multiple queries — use numbered placeholders instead to prevent unexpected behaviour.": "List of SQL statements to run in order. Use `:1`, `:2`… placeholders to reference shared **Parameters** values. Avoid `?` placeholders when running multiple queries — use numbered placeholders instead to prevent unexpected behaviour.",
67
+ "Values shared across all queries for the numbered placeholders (`:1`, `:2`…). Provide them in order. Unused parameters are allowed.": "Values shared across all queries for the numbered placeholders (`:1`, `:2`…). Provide them in order. Unused parameters are allowed.",
68
+ "When enabled, all queries run inside a single transaction. If any query fails, every preceding change in this batch is rolled back automatically.": "When enabled, all queries run inside a single transaction. If any query fails, every preceding change in this batch is rolled back automatically.",
69
+ "Maximum time in milliseconds to wait for each query to complete before cancelling it. Defaults to 30 000 ms (30 seconds).": "Maximum time in milliseconds to wait for each query to complete before cancelling it. Defaults to 30 000 ms (30 seconds).",
70
+ "An optional label sent to Snowflake to identify this client. Visible in query history under **Monitoring → Query History → Client Application**.": "An optional label sent to Snowflake to identify this client. Visible in query history under **Monitoring → Query History → Client Application**.",
71
+ "Select the Snowflake database to use. Databases are listed under **Data → Databases** in the Snowflake console.": "Select the Snowflake database to use. Databases are listed under **Data → Databases** in the Snowflake console.",
72
+ "Select the schema within the chosen database. Schemas are listed under **Data → Databases → [your database]** in the Snowflake console.": "Select the schema within the chosen database. Schemas are listed under **Data → Databases → [your database]** in the Snowflake console.",
73
+ "Select the table to work with.": "Select the table to work with.",
74
+ "Enter the value for each column in the new row.": "Enter the value for each column in the new row.",
75
+ "Only filled columns will be updated. Leave a column empty to keep its existing value.": "Only filled columns will be updated. Leave a column empty to keep its existing value.",
76
+ "A SQL condition to filter which rows to update (e.g. `id = 42` or `status = 'active'`). Leave empty to update ALL rows in the table (use with caution). **Security note:** this value is embedded directly in SQL. Only use static values or data from trusted, internal steps — never pass unvalidated end-user input here.": "A SQL condition to filter which rows to update (e.g. `id = 42` or `status = 'active'`). Leave empty to update ALL rows in the table (use with caution). **Security note:** this value is embedded directly in SQL. Only use static values or data from trusted, internal steps — never pass unvalidated end-user input here.",
77
+ "A SQL condition to filter which rows to delete (e.g. `id = 42` or `status = 'archived'`). This field is required to prevent accidental deletion of all rows. **Security note:** this value is embedded directly in SQL. Only use static values or data from trusted, internal steps — never pass unvalidated end-user input here.": "A SQL condition to filter which rows to delete (e.g. `id = 42` or `status = 'archived'`). This field is required to prevent accidental deletion of all rows. **Security note:** this value is embedded directly in SQL. Only use static values or data from trusted, internal steps — never pass unvalidated end-user input here.",
78
+ "The column used to identify whether a row already exists (e.g. the primary key or a unique identifier column).": "The column used to identify whether a row already exists (e.g. the primary key or a unique identifier column).",
79
+ "One item per row. Each item must be a JSON object with column names as keys. Example: `{\"name\": \"Alice\", \"age\": 30}`. When mapping from a previous step, pass the entire array directly.": "One item per row. Each item must be a JSON object with column names as keys. Example: `{\"name\": \"Alice\", \"age\": 30}`. When mapping from a previous step, pass the entire array directly.",
80
+ "The column to search in (e.g. the primary key or unique identifier column).": "The column to search in (e.g. the primary key or unique identifier column).",
81
+ "The value to look up in the ID column.": "The value to look up in the ID column.",
82
+ "Optional SQL WHERE condition to narrow down results (e.g. `status = 'active' AND age > 18`). Leave empty to return all rows (subject to the row limit). **Security note:** this value is embedded directly in SQL. Only use static values or data from trusted, internal steps — never pass unvalidated end-user input here.": "Optional SQL WHERE condition to narrow down results (e.g. `status = 'active' AND age > 18`). Leave empty to return all rows (subject to the row limit). **Security note:** this value is embedded directly in SQL. Only use static values or data from trusted, internal steps — never pass unvalidated end-user input here.",
83
+ "Optional column(s) to sort results by (SQL ORDER BY clause). Examples: `created_at DESC` sorts newest first; `name ASC, age DESC` sorts by name then age. **Security note:** this value is embedded directly in SQL. Only use static values or data from trusted, internal steps — never pass unvalidated end-user input here.": "Optional column(s) to sort results by (SQL ORDER BY clause). Examples: `created_at DESC` sorts newest first; `name ASC, age DESC` sorts by name then age. **Security note:** this value is embedded directly in SQL. Only use static values or data from trusted, internal steps — never pass unvalidated end-user input here.",
84
+ "Maximum number of rows to return. Defaults to 100.": "Maximum number of rows to return. Defaults to 100.",
85
+ "Select the stored procedure to call.": "Select the stored procedure to call.",
86
+ "Positional arguments to pass to the stored procedure in order. Leave empty if the procedure takes no arguments.": "Positional arguments to pass to the stored procedure in order. Leave empty if the procedure takes no arguments.",
87
+ "The name for the new dynamic table (e.g. `DAILY_SALES_SUMMARY`). Only letters, digits, underscores, and `$` are allowed.": "The name for the new dynamic table (e.g. `DAILY_SALES_SUMMARY`). Only letters, digits, underscores, and `$` are allowed.",
88
+ "How up-to-date the dynamic table data should be (called **Target Lag** in Snowflake). Examples: `1 minute`, `5 minutes`, `1 hour`. Use `DOWNSTREAM` to only refresh when a downstream object explicitly requests it.": "How up-to-date the dynamic table data should be (called **Target Lag** in Snowflake). Examples: `1 minute`, `5 minutes`, `1 hour`. Use `DOWNSTREAM` to only refresh when a downstream object explicitly requests it.",
89
+ "Select the virtual warehouse to use for this operation. Warehouses are listed under **Admin → Warehouses** in the Snowflake console. Leave empty to use the warehouse set in your connection.": "Select the virtual warehouse to use for this operation. Warehouses are listed under **Admin → Warehouses** in the Snowflake console. Leave empty to use the warehouse set in your connection.",
90
+ "The SELECT statement that defines the content of the dynamic table. Example: `SELECT user_id, SUM(amount) AS total FROM orders GROUP BY user_id`": "The SELECT statement that defines the content of the dynamic table. Example: `SELECT user_id, SUM(amount) AS total FROM orders GROUP BY user_id`",
91
+ "Path to the Snowflake stage (a staging area that holds files before loading). For **internal stages**: use `@stage_name` or `@schema.stage_name/folder/`. For **external stages** (S3, GCS, Azure): use `@schema.stage_name/prefix/`. Example: `@my_stage/data/`. You can find your stage names under **Data → Databases → [your database] → Stages**.": "Path to the Snowflake stage (a staging area that holds files before loading). For **internal stages**: use `@stage_name` or `@schema.stage_name/folder/`. For **external stages** (S3, GCS, Azure): use `@schema.stage_name/prefix/`. Example: `@my_stage/data/`. You can find your stage names under **Data → Databases → [your database] → Stages**.",
92
+ "The file format of the data files in the stage.": "The file format of the data files in the stage.",
93
+ "Optional regular expression to load only files whose names match the pattern (e.g. `.*\\.csv` loads only `.csv` files, `sales_2024.*` loads files that start with `sales_2024`). Leave empty to load all files in the stage path.": "Optional regular expression to load only files whose names match the pattern (e.g. `.*\\.csv` loads only `.csv` files, `sales_2024.*` loads files that start with `sales_2024`). Leave empty to load all files in the stage path.",
94
+ "Number of rows to skip at the top of each CSV file (e.g. `1` to skip a column-header row). Only applies to CSV files. Defaults to 0.": "Number of rows to skip at the top of each CSV file (e.g. `1` to skip a column-header row). Only applies to CSV files. Defaults to 0.",
95
+ "When enabled, the load fails if the number of columns in a file does not match the number of columns in the target table. Disable to allow files with fewer columns.": "When enabled, the load fails if the number of columns in a file does not match the number of columns in the target table. Disable to allow files with fewer columns.",
96
+ "What to do when a row fails validation during loading.": "What to do when a row fails validation during loading.",
97
+ "CSV": "CSV",
98
+ "JSON": "JSON",
99
+ "PARQUET": "PARQUET",
100
+ "AVRO": "AVRO",
101
+ "ORC": "ORC",
102
+ "XML": "XML",
103
+ "Abort statement (default)": "Abort statement (default)",
104
+ "Continue (skip bad rows)": "Continue (skip bad rows)",
105
+ "Skip file": "Skip file",
106
+ "New Row": "New Row",
107
+ "New or Updated Row": "新建或更新行",
108
+ "New Column": "New Column",
109
+ "New Table": "新建表",
110
+ "New View": "New View",
111
+ "Triggers when a new row is inserted into the selected table. Uses a timestamp column you choose to detect rows added since the last check.": "Triggers when a new row is inserted into the selected table. Uses a timestamp column you choose to detect rows added since the last check.",
112
+ "Triggers when a row is inserted or updated in the selected table. Uses an \"updated at\" timestamp column you choose — any row whose timestamp is newer than the last check will fire the trigger.": "Triggers when a row is inserted or updated in the selected table. Uses an \"updated at\" timestamp column you choose — any row whose timestamp is newer than the last check will fire the trigger.",
113
+ "Triggers when a new column is added to the selected table. Checked by polling every few minutes.": "Triggers when a new column is added to the selected table. Checked by polling every few minutes.",
114
+ "Triggers when a new table is created in the selected schema. Checked by polling every few minutes.": "Triggers when a new table is created in the selected schema. Checked by polling every few minutes.",
115
+ "Triggers when a new view is created in the selected schema. Checked by polling every few minutes.": "Triggers when a new view is created in the selected schema. Checked by polling every few minutes.",
116
+ "Created At Column": "Created At Column",
117
+ "Updated At Column": "Updated At Column",
118
+ "Select the column that stores when each row was inserted (e.g. `CREATED_AT`, `INSERT_TIME`). Only rows with a timestamp in this column newer than the last check will fire the trigger.": "Select the column that stores when each row was inserted (e.g. `CREATED_AT`, `INSERT_TIME`). Only rows with a timestamp in this column newer than the last check will fire the trigger.",
119
+ "Select the column that stores when each row was last modified (e.g. `UPDATED_AT`, `LAST_MODIFIED_TIME`). Both new rows and rows updated after the last check will fire the trigger. The column must be updated by your application or a DEFAULT clause every time a row changes.": "Select the column that stores when each row was last modified (e.g. `UPDATED_AT`, `LAST_MODIFIED_TIME`). Both new rows and rows updated after the last check will fire the trigger. The column must be updated by your application or a DEFAULT clause every time a row changes."
120
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ export declare const snowflake: import("@aiqadam/qadams-framework").Qadam<(import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
2
+ account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
3
+ username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
4
+ password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
5
+ privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
6
+ privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
7
+ database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
8
+ role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
9
+ warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
10
+ }>)[]>;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,SAAS;;;;;;;;;MAqCpB,CAAC"}
package/src/index.js ADDED
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.snowflake = void 0;
4
+ const qadams_framework_1 = require("@aiqadam/qadams-framework");
5
+ const run_multiple_queries_1 = require("./lib/actions/run-multiple-queries");
6
+ const run_query_1 = require("./lib/actions/run-query");
7
+ const shared_1 = require("@aiqadam/shared");
8
+ const insert_row_1 = require("./lib/actions/insert-row");
9
+ const update_row_1 = require("./lib/actions/update-row");
10
+ const delete_row_1 = require("./lib/actions/delete-row");
11
+ const upsert_row_1 = require("./lib/actions/upsert-row");
12
+ const insert_multiple_rows_1 = require("./lib/actions/insert-multiple-rows");
13
+ const get_row_by_id_1 = require("./lib/actions/get-row-by-id");
14
+ const search_rows_1 = require("./lib/actions/search-rows");
15
+ const get_table_schema_1 = require("./lib/actions/get-table-schema");
16
+ const list_tables_1 = require("./lib/actions/list-tables");
17
+ const execute_stored_procedure_1 = require("./lib/actions/execute-stored-procedure");
18
+ const create_dynamic_table_1 = require("./lib/actions/create-dynamic-table");
19
+ const load_data_from_stage_1 = require("./lib/actions/load-data-from-stage");
20
+ const auth_1 = require("./lib/auth");
21
+ const new_column_1 = require("./lib/triggers/new-column");
22
+ const new_table_1 = require("./lib/triggers/new-table");
23
+ const new_view_1 = require("./lib/triggers/new-view");
24
+ const new_row_1 = require("./lib/triggers/new-row");
25
+ const new_or_updated_row_1 = require("./lib/triggers/new-or-updated-row");
26
+ exports.snowflake = (0, qadams_framework_1.createQadam)({
27
+ displayName: 'Snowflake',
28
+ description: 'Data warehouse built for the cloud',
29
+ auth: auth_1.snowflakeAuth,
30
+ minimumSupportedRelease: '0.0.0',
31
+ logoUrl: '/assets/qadams/snowflake.png',
32
+ categories: [shared_1.QadamCategory.DEVELOPER_TOOLS],
33
+ authors: [
34
+ 'AdamSelene',
35
+ 'abuaboud',
36
+ 'valentin-mourtialon',
37
+ 'onyedikachi-david',
38
+ ],
39
+ actions: [
40
+ run_query_1.runQuery,
41
+ run_multiple_queries_1.runMultipleQueries,
42
+ insert_row_1.insertRowAction,
43
+ update_row_1.updateRowAction,
44
+ delete_row_1.deleteRowAction,
45
+ upsert_row_1.upsertRowAction,
46
+ insert_multiple_rows_1.insertMultipleRowsAction,
47
+ get_row_by_id_1.getRowByIdAction,
48
+ search_rows_1.searchRowsAction,
49
+ get_table_schema_1.getTableSchemaAction,
50
+ list_tables_1.listTablesAction,
51
+ execute_stored_procedure_1.executeStoredProcedureAction,
52
+ create_dynamic_table_1.createDynamicTableAction,
53
+ load_data_from_stage_1.loadDataFromStageAction,
54
+ ],
55
+ triggers: [
56
+ new_row_1.newRowTrigger,
57
+ new_or_updated_row_1.newOrUpdatedRowTrigger,
58
+ new_column_1.newColumnTrigger,
59
+ new_table_1.newTableTrigger,
60
+ new_view_1.newViewTrigger,
61
+ ],
62
+ });
63
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,gEAAwD;AACxD,6EAAwE;AACxE,uDAAmD;AACnD,4CAAgD;AAChD,yDAA2D;AAC3D,yDAA2D;AAC3D,yDAA2D;AAC3D,yDAA2D;AAC3D,6EAA8E;AAC9E,+DAA+D;AAC/D,2DAA6D;AAC7D,qEAAsE;AACtE,2DAA6D;AAC7D,qFAAsF;AACtF,6EAA8E;AAC9E,6EAA6E;AAC7E,qCAA2C;AAC3C,0DAA6D;AAC7D,wDAA2D;AAC3D,sDAAyD;AACzD,oDAAuD;AACvD,0EAA2E;AAE9D,QAAA,SAAS,GAAG,IAAA,8BAAW,EAAC;IACnC,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,oCAAoC;IAEjD,IAAI,EAAE,oBAAa;IACnB,uBAAuB,EAAE,OAAO;IAChC,OAAO,EAAE,8BAA8B;IACvC,UAAU,EAAE,CAAC,sBAAa,CAAC,eAAe,CAAC;IAC3C,OAAO,EAAE;QACP,YAAY;QACZ,UAAU;QACV,qBAAqB;QACrB,mBAAmB;KACpB;IACD,OAAO,EAAE;QACP,oBAAQ;QACR,yCAAkB;QAClB,4BAAe;QACf,4BAAe;QACf,4BAAe;QACf,4BAAe;QACf,+CAAwB;QACxB,gCAAgB;QAChB,8BAAgB;QAChB,uCAAoB;QACpB,8BAAgB;QAChB,uDAA4B;QAC5B,+CAAwB;QACxB,8CAAuB;KACxB;IACD,QAAQ,EAAE;QACR,uBAAa;QACb,2CAAsB;QACtB,6BAAgB;QAChB,2BAAe;QACf,yBAAc;KACf;CACF,CAAC,CAAC"}
@@ -0,0 +1,45 @@
1
+ export declare const createDynamicTableAction: import("@aiqadam/qadams-framework").IAction<(import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
2
+ account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
3
+ username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
4
+ password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
5
+ privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
6
+ privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
7
+ database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
8
+ role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
9
+ warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
10
+ }>)[], {
11
+ database: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
12
+ account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
13
+ username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
14
+ password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
15
+ privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
16
+ privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
17
+ database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
18
+ role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
19
+ warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
20
+ }>)[]>;
21
+ schema: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
22
+ account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
23
+ username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
24
+ password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
25
+ privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
26
+ privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
27
+ database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
28
+ role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
29
+ warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
30
+ }>)[]>;
31
+ table_name: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
32
+ target_lag: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
33
+ warehouse: import("@aiqadam/qadams-framework").DropdownProperty<string, false, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
34
+ account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
35
+ username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
36
+ password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
37
+ privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
38
+ privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
39
+ database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
40
+ role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
41
+ warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
42
+ }>)[]>;
43
+ query: import("@aiqadam/qadams-framework").LongTextProperty<true>;
44
+ }>;
45
+ //# sourceMappingURL=create-dynamic-table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-dynamic-table.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-dynamic-table.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwFnC,CAAC"}
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createDynamicTableAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const qadams_framework_1 = require("@aiqadam/qadams-framework");
6
+ const auth_1 = require("../auth");
7
+ const common_1 = require("../common");
8
+ exports.createDynamicTableAction = (0, qadams_framework_1.createAction)({
9
+ name: 'create_dynamic_table',
10
+ displayName: 'Create / Refresh Dynamic Table',
11
+ description: 'Create or replace a Snowflake Dynamic Table that automatically refreshes based on a query. ' +
12
+ 'Dynamic Tables are a declarative way to define a table whose content is derived from a query, updated on a schedule.',
13
+ audience: 'both',
14
+ aiMetadata: {
15
+ description: 'Creates or replaces a Snowflake Dynamic Table whose contents are derived from a SELECT query and auto-refresh on a target-lag schedule, using a specified warehouse. Use to set up or redefine a declarative, self-refreshing derived table. Effectively idempotent in result via CREATE OR REPLACE (re-running with the same inputs yields the same table definition), though REPLACE drops and recreates the object.',
16
+ idempotent: true,
17
+ },
18
+ auth: auth_1.snowflakeAuth,
19
+ props: {
20
+ database: common_1.snowflakeCommonProps.database,
21
+ schema: common_1.snowflakeCommonProps.schema,
22
+ table_name: qadams_framework_1.Property.ShortText({
23
+ displayName: 'Dynamic Table Name',
24
+ description: 'The name for the new dynamic table (e.g. `DAILY_SALES_SUMMARY`). Only letters, digits, underscores, and `$` are allowed.',
25
+ required: true,
26
+ }),
27
+ target_lag: qadams_framework_1.Property.ShortText({
28
+ displayName: 'Refresh Interval',
29
+ description: 'How up-to-date the dynamic table data should be (called **Target Lag** in Snowflake). Examples: `1 minute`, `5 minutes`, `1 hour`. Use `DOWNSTREAM` to only refresh when a downstream object explicitly requests it.',
30
+ required: true,
31
+ defaultValue: '1 hour',
32
+ }),
33
+ warehouse: common_1.snowflakeCommonProps.warehouse,
34
+ query: qadams_framework_1.Property.LongText({
35
+ displayName: 'Source Query',
36
+ description: 'The SELECT statement that defines the content of the dynamic table. ' +
37
+ 'Example: `SELECT user_id, SUM(amount) AS total FROM orders GROUP BY user_id`',
38
+ required: true,
39
+ }),
40
+ },
41
+ run(context) {
42
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
43
+ var _a;
44
+ const { database, schema, table_name, target_lag, warehouse, query } = context.propsValue;
45
+ const identifierRegex = /^[A-Za-z_][A-Za-z0-9_$]*$/;
46
+ if (!identifierRegex.test(table_name)) {
47
+ throw new Error('Invalid table name: only letters, digits, underscores, and $ are allowed.');
48
+ }
49
+ if (target_lag.includes("'")) {
50
+ throw new Error('Invalid target_lag value: single quotes are not allowed.');
51
+ }
52
+ const effectiveWarehouse = warehouse || ((_a = context.auth.props) === null || _a === void 0 ? void 0 : _a.warehouse);
53
+ if (!effectiveWarehouse) {
54
+ throw new Error('A warehouse is required. Provide it in the action props or set a default in your connection.');
55
+ }
56
+ if (!identifierRegex.test(effectiveWarehouse)) {
57
+ throw new Error('Invalid warehouse name: only letters, digits, underscores, and $ are allowed.');
58
+ }
59
+ const sql = `
60
+ CREATE OR REPLACE DYNAMIC TABLE ${database}.${schema}.${table_name}
61
+ TARGET_LAG = '${target_lag}'
62
+ WAREHOUSE = ${effectiveWarehouse}
63
+ AS ${query}
64
+ `.trim();
65
+ const connection = (0, common_1.configureConnection)(context.auth);
66
+ yield (0, common_1.connect)(connection);
67
+ try {
68
+ yield (0, common_1.execute)(connection, sql, []);
69
+ return {
70
+ success: true,
71
+ table: `${database}.${schema}.${table_name}`,
72
+ target_lag,
73
+ warehouse: effectiveWarehouse,
74
+ };
75
+ }
76
+ finally {
77
+ yield (0, common_1.destroy)(connection);
78
+ }
79
+ });
80
+ },
81
+ });
82
+ //# sourceMappingURL=create-dynamic-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-dynamic-table.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-dynamic-table.ts"],"names":[],"mappings":";;;;AAAA,gEAAmE;AACnE,kCAAwC;AACxC,sCAOmB;AAEN,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,gCAAgC;IAC7C,WAAW,EACT,6FAA6F;QAC7F,sHAAsH;IACxH,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,wZAAwZ;QAC1Z,UAAU,EAAE,IAAI;KACjB;IACD,IAAI,EAAE,oBAAa;IACnB,KAAK,EAAE;QACL,QAAQ,EAAE,6BAAoB,CAAC,QAAQ;QACvC,MAAM,EAAE,6BAAoB,CAAC,MAAM;QACnC,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,oBAAoB;YACjC,WAAW,EACT,0HAA0H;YAC5H,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EACT,sNAAsN;YACxN,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,QAAQ;SACvB,CAAC;QACF,SAAS,EAAE,6BAAoB,CAAC,SAAS;QACzC,KAAK,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACvB,WAAW,EAAE,cAAc;YAC3B,WAAW,EACT,sEAAsE;gBACtE,8EAA8E;YAChF,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,GAClE,OAAO,CAAC,UAAU,CAAC;YAErB,MAAM,eAAe,GAAG,2BAA2B,CAAC;YACpD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;gBACtC,MAAM,IAAI,KAAK,CACb,2EAA2E,CAC5E,CAAC;YACJ,CAAC;YACD,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC7B,MAAM,IAAI,KAAK,CACb,0DAA0D,CAC3D,CAAC;YACJ,CAAC;YAED,MAAM,kBAAkB,GACtB,SAAS,KAAI,MAAC,OAAO,CAAC,IAA2B,CAAC,KAAK,0CAAE,SAAS,CAAA,CAAC;YACrE,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBACxB,MAAM,IAAI,KAAK,CACb,8FAA8F,CAC/F,CAAC;YACJ,CAAC;YACD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC;gBAC9C,MAAM,IAAI,KAAK,CACb,+EAA+E,CAChF,CAAC;YACJ,CAAC;YAED,MAAM,GAAG,GAAG;kCACkB,QAAQ,IAAI,MAAM,IAAI,UAAU;kBAChD,UAAU;gBACZ,kBAAkB;OAC3B,KAAK;KACP,CAAC,IAAI,EAAE,CAAC;YAET,MAAM,UAAU,GAAG,IAAA,4BAAmB,EAAC,OAAO,CAAC,IAA0B,CAAC,CAAC;YAC3E,MAAM,IAAA,gBAAO,EAAC,UAAU,CAAC,CAAC;YAC1B,IAAI,CAAC;gBACH,MAAM,IAAA,gBAAO,EAAC,UAAU,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;gBACnC,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,KAAK,EAAE,GAAG,QAAQ,IAAI,MAAM,IAAI,UAAU,EAAE;oBAC5C,UAAU;oBACV,SAAS,EAAE,kBAAkB;iBAC9B,CAAC;YACJ,CAAC;oBAAS,CAAC;gBACT,MAAM,IAAA,gBAAO,EAAC,UAAU,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,43 @@
1
+ export declare const deleteRowAction: import("@aiqadam/qadams-framework").IAction<(import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
2
+ account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
3
+ username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
4
+ password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
5
+ privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
6
+ privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
7
+ database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
8
+ role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
9
+ warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
10
+ }>)[], {
11
+ database: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
12
+ account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
13
+ username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
14
+ password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
15
+ privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
16
+ privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
17
+ database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
18
+ role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
19
+ warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
20
+ }>)[]>;
21
+ schema: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
22
+ account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
23
+ username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
24
+ password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
25
+ privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
26
+ privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
27
+ database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
28
+ role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
29
+ warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
30
+ }>)[]>;
31
+ table: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
32
+ account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
33
+ username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
34
+ password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
35
+ privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
36
+ privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
37
+ database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
38
+ role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
39
+ warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
40
+ }>)[]>;
41
+ where_clause: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
42
+ }>;
43
+ //# sourceMappingURL=delete-row.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-row.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/delete-row.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0C1B,CAAC"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteRowAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const qadams_framework_1 = require("@aiqadam/qadams-framework");
6
+ const auth_1 = require("../auth");
7
+ const common_1 = require("../common");
8
+ exports.deleteRowAction = (0, qadams_framework_1.createAction)({
9
+ name: 'delete_row',
10
+ displayName: 'Delete Row',
11
+ description: 'Delete one or more rows from a Snowflake table that match a WHERE condition.',
12
+ audience: 'both',
13
+ aiMetadata: {
14
+ description: 'Runs a DELETE on a Snowflake table, removing every row matching the required WHERE condition. Use to remove records; the condition is mandatory to guard against wiping the whole table, and it is embedded directly into SQL so pass only trusted values. Re-running after the matching rows are gone deletes nothing further, but treat this as a destructive mutating operation.',
15
+ idempotent: false,
16
+ },
17
+ auth: auth_1.snowflakeAuth,
18
+ props: {
19
+ database: common_1.snowflakeCommonProps.database,
20
+ schema: common_1.snowflakeCommonProps.schema,
21
+ table: common_1.snowflakeCommonProps.table,
22
+ where_clause: qadams_framework_1.Property.ShortText({
23
+ displayName: 'WHERE Condition',
24
+ description: "A SQL condition to filter which rows to delete (e.g. `id = 42` or `status = 'archived'`). " +
25
+ 'This field is required to prevent accidental deletion of all rows. ' +
26
+ '**Security note:** this value is embedded directly in SQL. Only use static values or data from trusted, internal steps — never pass unvalidated end-user input here.',
27
+ required: true,
28
+ }),
29
+ },
30
+ run(context) {
31
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
32
+ var _a, _b;
33
+ const { table, where_clause } = context.propsValue;
34
+ const sql = `DELETE FROM ${table} WHERE ${where_clause}`;
35
+ const connection = (0, common_1.configureConnection)(context.auth);
36
+ yield (0, common_1.connect)(connection);
37
+ try {
38
+ const result = yield (0, common_1.execute)(connection, sql, []);
39
+ return {
40
+ success: true,
41
+ rows_deleted: (_b = (_a = result === null || result === void 0 ? void 0 : result[0]) === null || _a === void 0 ? void 0 : _a['number of rows deleted']) !== null && _b !== void 0 ? _b : null,
42
+ };
43
+ }
44
+ finally {
45
+ yield (0, common_1.destroy)(connection);
46
+ }
47
+ });
48
+ },
49
+ });
50
+ //# sourceMappingURL=delete-row.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-row.js","sourceRoot":"","sources":["../../../../src/lib/actions/delete-row.ts"],"names":[],"mappings":";;;;AAAA,gEAAmE;AACnE,kCAAwC;AACxC,sCAOmB;AAEN,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,YAAY;IACzB,WAAW,EACT,8EAA8E;IAChF,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,qXAAqX;QACvX,UAAU,EAAE,KAAK;KAClB;IACD,IAAI,EAAE,oBAAa;IACnB,KAAK,EAAE;QACL,QAAQ,EAAE,6BAAoB,CAAC,QAAQ;QACvC,MAAM,EAAE,6BAAoB,CAAC,MAAM;QACnC,KAAK,EAAE,6BAAoB,CAAC,KAAK;QACjC,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,iBAAiB;YAC9B,WAAW,EACT,4FAA4F;gBAC5F,qEAAqE;gBACrE,sKAAsK;YACxK,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEnD,MAAM,GAAG,GAAG,eAAe,KAAK,UAAU,YAAY,EAAE,CAAC;YAEzD,MAAM,UAAU,GAAG,IAAA,4BAAmB,EAAC,OAAO,CAAC,IAA0B,CAAC,CAAC;YAC3E,MAAM,IAAA,gBAAO,EAAC,UAAU,CAAC,CAAC;YAC1B,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,IAAA,gBAAO,EAAC,UAAU,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;gBAClD,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,YAAY,EAAE,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAG,CAAC,CAAC,0CAAG,wBAAwB,CAAC,mCAAI,IAAI;iBAC9D,CAAC;YACJ,CAAC;oBAAS,CAAC;gBACT,MAAM,IAAA,gBAAO,EAAC,UAAU,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,43 @@
1
+ export declare const executeStoredProcedureAction: import("@aiqadam/qadams-framework").IAction<(import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
2
+ account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
3
+ username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
4
+ password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
5
+ privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
6
+ privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
7
+ database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
8
+ role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
9
+ warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
10
+ }>)[], {
11
+ database: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
12
+ account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
13
+ username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
14
+ password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
15
+ privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
16
+ privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
17
+ database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
18
+ role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
19
+ warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
20
+ }>)[]>;
21
+ schema: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
22
+ account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
23
+ username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
24
+ password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
25
+ privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
26
+ privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
27
+ database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
28
+ role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
29
+ warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
30
+ }>)[]>;
31
+ procedure_name: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
32
+ account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
33
+ username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
34
+ password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
35
+ privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
36
+ privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
37
+ database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
38
+ role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
39
+ warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
40
+ }>)[]>;
41
+ arguments: import("@aiqadam/qadams-framework").ArrayProperty<false>;
42
+ }>;
43
+ //# sourceMappingURL=execute-stored-procedure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute-stored-procedure.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/execute-stored-procedure.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiGvC,CAAC"}