@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.
- package/LICENSE +22 -0
- package/NOTICE +6 -0
- package/README.md +5 -0
- package/package.json +23 -0
- package/src/i18n/de.json +120 -0
- package/src/i18n/es.json +120 -0
- package/src/i18n/fr.json +120 -0
- package/src/i18n/ja.json +120 -0
- package/src/i18n/nl.json +120 -0
- package/src/i18n/pt.json +120 -0
- package/src/i18n/ru.json +16 -0
- package/src/i18n/translation.json +120 -0
- package/src/i18n/vi.json +14 -0
- package/src/i18n/zh.json +120 -0
- package/src/index.d.ts +11 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +63 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/create-dynamic-table.d.ts +45 -0
- package/src/lib/actions/create-dynamic-table.d.ts.map +1 -0
- package/src/lib/actions/create-dynamic-table.js +82 -0
- package/src/lib/actions/create-dynamic-table.js.map +1 -0
- package/src/lib/actions/delete-row.d.ts +43 -0
- package/src/lib/actions/delete-row.d.ts.map +1 -0
- package/src/lib/actions/delete-row.js +50 -0
- package/src/lib/actions/delete-row.js.map +1 -0
- package/src/lib/actions/execute-stored-procedure.d.ts +43 -0
- package/src/lib/actions/execute-stored-procedure.d.ts.map +1 -0
- package/src/lib/actions/execute-stored-procedure.js +97 -0
- package/src/lib/actions/execute-stored-procedure.js.map +1 -0
- package/src/lib/actions/get-row-by-id.d.ts +53 -0
- package/src/lib/actions/get-row-by-id.d.ts.map +1 -0
- package/src/lib/actions/get-row-by-id.js +72 -0
- package/src/lib/actions/get-row-by-id.js.map +1 -0
- package/src/lib/actions/get-table-schema.d.ts +42 -0
- package/src/lib/actions/get-table-schema.d.ts.map +1 -0
- package/src/lib/actions/get-table-schema.js +54 -0
- package/src/lib/actions/get-table-schema.js.map +1 -0
- package/src/lib/actions/insert-multiple-rows.d.ts +43 -0
- package/src/lib/actions/insert-multiple-rows.d.ts.map +1 -0
- package/src/lib/actions/insert-multiple-rows.js +86 -0
- package/src/lib/actions/insert-multiple-rows.js.map +1 -0
- package/src/lib/actions/insert-row.d.ts +52 -0
- package/src/lib/actions/insert-row.d.ts.map +1 -0
- package/src/lib/actions/insert-row.js +41 -0
- package/src/lib/actions/insert-row.js.map +1 -0
- package/src/lib/actions/list-tables.d.ts +32 -0
- package/src/lib/actions/list-tables.d.ts.map +1 -0
- package/src/lib/actions/list-tables.js +52 -0
- package/src/lib/actions/list-tables.js.map +1 -0
- package/src/lib/actions/load-data-from-stage.d.ts +48 -0
- package/src/lib/actions/load-data-from-stage.d.ts.map +1 -0
- package/src/lib/actions/load-data-from-stage.js +124 -0
- package/src/lib/actions/load-data-from-stage.js.map +1 -0
- package/src/lib/actions/run-multiple-queries.d.ts +17 -0
- package/src/lib/actions/run-multiple-queries.d.ts.map +1 -0
- package/src/lib/actions/run-multiple-queries.js +147 -0
- package/src/lib/actions/run-multiple-queries.js.map +1 -0
- package/src/lib/actions/run-query.d.ts +16 -0
- package/src/lib/actions/run-query.d.ts.map +1 -0
- package/src/lib/actions/run-query.js +58 -0
- package/src/lib/actions/run-query.js.map +1 -0
- package/src/lib/actions/search-rows.d.ts +45 -0
- package/src/lib/actions/search-rows.d.ts.map +1 -0
- package/src/lib/actions/search-rows.js +63 -0
- package/src/lib/actions/search-rows.js.map +1 -0
- package/src/lib/actions/update-row.d.ts +53 -0
- package/src/lib/actions/update-row.d.ts.map +1 -0
- package/src/lib/actions/update-row.js +59 -0
- package/src/lib/actions/update-row.js.map +1 -0
- package/src/lib/actions/upsert-row.d.ts +62 -0
- package/src/lib/actions/upsert-row.d.ts.map +1 -0
- package/src/lib/actions/upsert-row.js +98 -0
- package/src/lib/actions/upsert-row.js.map +1 -0
- package/src/lib/auth.d.ts +22 -0
- package/src/lib/auth.d.ts.map +1 -0
- package/src/lib/auth.js +246 -0
- package/src/lib/auth.js.map +1 -0
- package/src/lib/common/index.d.ts +93 -0
- package/src/lib/common/index.d.ts.map +1 -0
- package/src/lib/common/index.js +319 -0
- package/src/lib/common/index.js.map +1 -0
- package/src/lib/triggers/new-column.d.ts +163 -0
- package/src/lib/triggers/new-column.d.ts.map +1 -0
- package/src/lib/triggers/new-column.js +94 -0
- package/src/lib/triggers/new-column.js.map +1 -0
- package/src/lib/triggers/new-or-updated-row.d.ts +203 -0
- package/src/lib/triggers/new-or-updated-row.d.ts.map +1 -0
- package/src/lib/triggers/new-or-updated-row.js +108 -0
- package/src/lib/triggers/new-or-updated-row.js.map +1 -0
- package/src/lib/triggers/new-row.d.ts +203 -0
- package/src/lib/triggers/new-row.d.ts.map +1 -0
- package/src/lib/triggers/new-row.js +107 -0
- package/src/lib/triggers/new-row.js.map +1 -0
- package/src/lib/triggers/new-table.d.ts +123 -0
- package/src/lib/triggers/new-table.d.ts.map +1 -0
- package/src/lib/triggers/new-table.js +94 -0
- package/src/lib/triggers/new-table.js.map +1 -0
- package/src/lib/triggers/new-view.d.ts +123 -0
- package/src/lib/triggers/new-view.d.ts.map +1 -0
- package/src/lib/triggers/new-view.js +94 -0
- package/src/lib/triggers/new-view.js.map +1 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@aiqadam/qadams-framework';
|
|
2
|
+
export declare const newRowTrigger: import("@aiqadam/qadams-framework").ITrigger<TriggerStrategy.WEBHOOK, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
3
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
4
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
5
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
6
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
7
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
8
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
9
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
10
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
11
|
+
}>)[], {
|
|
12
|
+
database: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
13
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
14
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
15
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
16
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
17
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
18
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
19
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
20
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
21
|
+
}>)[]>;
|
|
22
|
+
schema: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
23
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
24
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
25
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
26
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
27
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
28
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
29
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
30
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
31
|
+
}>)[]>;
|
|
32
|
+
table: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
33
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
34
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
35
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
36
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
37
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
38
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
39
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
40
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
41
|
+
}>)[]>;
|
|
42
|
+
created_at_column: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
43
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
44
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
45
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
46
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
47
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
48
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
49
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
50
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
51
|
+
}>)[]>;
|
|
52
|
+
}> | import("@aiqadam/qadams-framework").ITrigger<TriggerStrategy.POLLING, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
53
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
54
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
55
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
56
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
57
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
58
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
59
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
60
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
61
|
+
}>)[], {
|
|
62
|
+
database: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
63
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
64
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
65
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
66
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
67
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
68
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
69
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
70
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
71
|
+
}>)[]>;
|
|
72
|
+
schema: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
73
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
74
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
75
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
76
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
77
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
78
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
79
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
80
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
81
|
+
}>)[]>;
|
|
82
|
+
table: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
83
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
84
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
85
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
86
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
87
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
88
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
89
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
90
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
91
|
+
}>)[]>;
|
|
92
|
+
created_at_column: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
93
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
94
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
95
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
96
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
97
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
98
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
99
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
100
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
101
|
+
}>)[]>;
|
|
102
|
+
}> | import("@aiqadam/qadams-framework").ITrigger<TriggerStrategy.MANUAL, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
103
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
104
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
105
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
106
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
107
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
108
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
109
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
110
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
111
|
+
}>)[], {
|
|
112
|
+
database: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
113
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
114
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
115
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
116
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
117
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
118
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
119
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
120
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
121
|
+
}>)[]>;
|
|
122
|
+
schema: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
123
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
124
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
125
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
126
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
127
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
128
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
129
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
130
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
131
|
+
}>)[]>;
|
|
132
|
+
table: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
133
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
134
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
135
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
136
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
137
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
138
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
139
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
140
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
141
|
+
}>)[]>;
|
|
142
|
+
created_at_column: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
143
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
144
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
145
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
146
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
147
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
148
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
149
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
150
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
151
|
+
}>)[]>;
|
|
152
|
+
}> | import("@aiqadam/qadams-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
153
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
154
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
155
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
156
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
157
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
158
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
159
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
160
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
161
|
+
}>)[], {
|
|
162
|
+
database: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
163
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
164
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
165
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
166
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
167
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
168
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
169
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
170
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
171
|
+
}>)[]>;
|
|
172
|
+
schema: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
173
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
174
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
175
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
176
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
177
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
178
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
179
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
180
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
181
|
+
}>)[]>;
|
|
182
|
+
table: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
183
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
184
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
185
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
186
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
187
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
188
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
189
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
190
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
191
|
+
}>)[]>;
|
|
192
|
+
created_at_column: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
193
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
194
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
195
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
196
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
197
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
198
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
199
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
200
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
201
|
+
}>)[]>;
|
|
202
|
+
}>;
|
|
203
|
+
//# sourceMappingURL=new-row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-row.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-row.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAGhB,MAAM,2BAA2B,CAAC;AA0FnC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BxB,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.newRowTrigger = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const qadams_framework_1 = require("@aiqadam/qadams-framework");
|
|
6
|
+
const qadams_common_1 = require("@aiqadam/qadams-common");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
const props = {
|
|
10
|
+
database: common_1.snowflakeCommonProps.database,
|
|
11
|
+
schema: common_1.snowflakeCommonProps.schema,
|
|
12
|
+
table: common_1.snowflakeCommonProps.table,
|
|
13
|
+
created_at_column: qadams_framework_1.Property.Dropdown({
|
|
14
|
+
auth: auth_1.snowflakeAuth,
|
|
15
|
+
displayName: 'Created At Column',
|
|
16
|
+
description: 'Select the column that stores when each row was inserted (e.g. `CREATED_AT`, `INSERT_TIME`). ' +
|
|
17
|
+
'Only rows with a timestamp in this column newer than the last check will fire the trigger.',
|
|
18
|
+
refreshers: ['table'],
|
|
19
|
+
required: true,
|
|
20
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, table }) {
|
|
21
|
+
if (!auth) {
|
|
22
|
+
return {
|
|
23
|
+
disabled: true,
|
|
24
|
+
options: [],
|
|
25
|
+
placeholder: 'Please connect your account first',
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
if (!table) {
|
|
29
|
+
return {
|
|
30
|
+
disabled: true,
|
|
31
|
+
options: [],
|
|
32
|
+
placeholder: 'Please select a table first',
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return (0, common_1.getTableColumnOptions)(auth, table);
|
|
36
|
+
}),
|
|
37
|
+
}),
|
|
38
|
+
};
|
|
39
|
+
function toEpochMs(value) {
|
|
40
|
+
if (value instanceof Date)
|
|
41
|
+
return value.getTime();
|
|
42
|
+
if (typeof value === 'string')
|
|
43
|
+
return new Date(value).getTime();
|
|
44
|
+
return 0;
|
|
45
|
+
}
|
|
46
|
+
const polling = {
|
|
47
|
+
strategy: qadams_common_1.DedupeStrategy.TIMEBASED,
|
|
48
|
+
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, propsValue }) {
|
|
49
|
+
const { table, created_at_column } = propsValue;
|
|
50
|
+
if (!table || !created_at_column)
|
|
51
|
+
return [];
|
|
52
|
+
const connection = (0, common_1.configureConnection)(auth);
|
|
53
|
+
yield (0, common_1.connect)(connection);
|
|
54
|
+
try {
|
|
55
|
+
// Fetch the 100 most-recently inserted rows. pollingHelper keeps only
|
|
56
|
+
// rows whose timestamp exceeds the last stored watermark.
|
|
57
|
+
const result = yield (0, common_1.execute)(connection, `SELECT * FROM ${table} ORDER BY ${created_at_column} DESC LIMIT 100`, []);
|
|
58
|
+
if (!result)
|
|
59
|
+
return [];
|
|
60
|
+
return result.map((row) => ({
|
|
61
|
+
epochMilliSeconds: toEpochMs(row[created_at_column]),
|
|
62
|
+
data: row,
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
finally {
|
|
66
|
+
yield (0, common_1.destroy)(connection);
|
|
67
|
+
}
|
|
68
|
+
}),
|
|
69
|
+
};
|
|
70
|
+
exports.newRowTrigger = (0, qadams_framework_1.createTrigger)({
|
|
71
|
+
auth: auth_1.snowflakeAuth,
|
|
72
|
+
name: 'new_row',
|
|
73
|
+
displayName: 'New Row',
|
|
74
|
+
description: '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.',
|
|
75
|
+
aiMetadata: {
|
|
76
|
+
description: 'Fires for each newly inserted row in the selected Snowflake table, detected by polling and comparing a chosen "created at" timestamp column against the last-seen watermark. Each new row whose timestamp is later than the previous poll produces one event.',
|
|
77
|
+
},
|
|
78
|
+
props,
|
|
79
|
+
sampleData: {
|
|
80
|
+
ID: 1001,
|
|
81
|
+
NAME: 'Jane Doe',
|
|
82
|
+
EMAIL: 'jane.doe@example.com',
|
|
83
|
+
CREATED_AT: '2024-01-15T10:30:00.000Z',
|
|
84
|
+
},
|
|
85
|
+
type: qadams_framework_1.TriggerStrategy.POLLING,
|
|
86
|
+
test(context) {
|
|
87
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
return yield qadams_common_1.pollingHelper.test(polling, context);
|
|
89
|
+
});
|
|
90
|
+
},
|
|
91
|
+
onEnable(context) {
|
|
92
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
yield qadams_common_1.pollingHelper.onEnable(polling, context);
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
onDisable(context) {
|
|
97
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
yield qadams_common_1.pollingHelper.onDisable(polling, context);
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
run(context) {
|
|
102
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
103
|
+
return yield qadams_common_1.pollingHelper.poll(polling, context);
|
|
104
|
+
});
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
//# sourceMappingURL=new-row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-row.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-row.ts"],"names":[],"mappings":";;;;AAAA,gEAKmC;AACnC,0DAAgF;AAChF,kCAAwC;AACxC,sCAQmB;AASnB,MAAM,KAAK,GAAG;IACZ,QAAQ,EAAE,6BAAoB,CAAC,QAAQ;IACvC,MAAM,EAAE,6BAAoB,CAAC,MAAM;IACnC,KAAK,EAAE,6BAAoB,CAAC,KAAK;IACjC,iBAAiB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;QACnC,IAAI,EAAE,oBAAa;QACnB,WAAW,EAAE,mBAAmB;QAChC,WAAW,EACT,+FAA+F;YAC/F,4FAA4F;QAC9F,UAAU,EAAE,CAAC,OAAO,CAAC;QACrB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,KAAwB,EAAE,oDAAnB,EAAE,IAAI,EAAE,KAAK,EAAE;YAC7B,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO;oBACL,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,mCAAmC;iBACjD,CAAC;YACJ,CAAC;YACD,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,OAAO;oBACL,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,6BAA6B;iBAC3C,CAAC;YACJ,CAAC;YACD,OAAO,IAAA,8BAAqB,EAAC,IAA0B,EAAE,KAAe,CAAC,CAAC;QAC5E,CAAC,CAAA;KACF,CAAC;CACH,CAAC;AAEF,SAAS,SAAS,CAAC,KAAc;IAC/B,IAAI,KAAK,YAAY,IAAI;QAAE,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;IAClD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;I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AU,EAAE,0BAA0B;KACvC;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,IAAI,CAAC,OAAO;;YAChB,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;IACK,QAAQ,CAAC,OAAO;;YACpB,MAAM,6BAAa,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjD,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,MAAM,6BAAa,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@aiqadam/qadams-framework';
|
|
2
|
+
export declare const newTableTrigger: import("@aiqadam/qadams-framework").ITrigger<TriggerStrategy.WEBHOOK, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
3
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
4
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
5
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
6
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
7
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
8
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
9
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
10
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
11
|
+
}>)[], {
|
|
12
|
+
database: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
13
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
14
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
15
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
16
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
17
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
18
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
19
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
20
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
21
|
+
}>)[]>;
|
|
22
|
+
schema: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
23
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
24
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
25
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
26
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
27
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
28
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
29
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
30
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
31
|
+
}>)[]>;
|
|
32
|
+
}> | import("@aiqadam/qadams-framework").ITrigger<TriggerStrategy.POLLING, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
33
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
34
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
35
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
36
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
37
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
38
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
39
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
40
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
41
|
+
}>)[], {
|
|
42
|
+
database: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
43
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
44
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
45
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
46
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
47
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
48
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
49
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
50
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
51
|
+
}>)[]>;
|
|
52
|
+
schema: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
53
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
54
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
55
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
56
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
57
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
58
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
59
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
60
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
61
|
+
}>)[]>;
|
|
62
|
+
}> | import("@aiqadam/qadams-framework").ITrigger<TriggerStrategy.MANUAL, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
63
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
64
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
65
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
66
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
67
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
68
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
69
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
70
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
71
|
+
}>)[], {
|
|
72
|
+
database: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
73
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
74
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
75
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
76
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
77
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
78
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
79
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
80
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
81
|
+
}>)[]>;
|
|
82
|
+
schema: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
83
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
84
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
85
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
86
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
87
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
88
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
89
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
90
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
91
|
+
}>)[]>;
|
|
92
|
+
}> | import("@aiqadam/qadams-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
93
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
94
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
95
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
96
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
97
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
98
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
99
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
100
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
101
|
+
}>)[], {
|
|
102
|
+
database: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
103
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
104
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
105
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
106
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
107
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
108
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
109
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
110
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
111
|
+
}>)[]>;
|
|
112
|
+
schema: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
113
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
114
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
115
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
116
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
117
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
118
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
119
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
120
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
121
|
+
}>)[]>;
|
|
122
|
+
}>;
|
|
123
|
+
//# sourceMappingURL=new-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-table.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-table.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,2BAA2B,CAAC;AAoEnC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmC1B,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.newTableTrigger = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const qadams_framework_1 = require("@aiqadam/qadams-framework");
|
|
6
|
+
const qadams_common_1 = require("@aiqadam/qadams-common");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
const props = {
|
|
10
|
+
database: common_1.snowflakeCommonProps.database,
|
|
11
|
+
schema: common_1.snowflakeCommonProps.schema,
|
|
12
|
+
};
|
|
13
|
+
function toEpochMs(value) {
|
|
14
|
+
if (value instanceof Date)
|
|
15
|
+
return value.getTime();
|
|
16
|
+
if (typeof value === 'string')
|
|
17
|
+
return new Date(value).getTime();
|
|
18
|
+
return 0;
|
|
19
|
+
}
|
|
20
|
+
const polling = {
|
|
21
|
+
strategy: qadams_common_1.DedupeStrategy.TIMEBASED,
|
|
22
|
+
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, propsValue }) {
|
|
23
|
+
const { database, schema } = propsValue;
|
|
24
|
+
if (!database || !schema)
|
|
25
|
+
return [];
|
|
26
|
+
const connection = (0, common_1.configureConnection)(auth);
|
|
27
|
+
yield (0, common_1.connect)(connection);
|
|
28
|
+
try {
|
|
29
|
+
const result = yield (0, common_1.execute)(connection, `SHOW TABLES IN SCHEMA ${database}.${schema}`, []);
|
|
30
|
+
if (!result)
|
|
31
|
+
return [];
|
|
32
|
+
return result.map((table) => ({
|
|
33
|
+
epochMilliSeconds: toEpochMs(table['created_on']),
|
|
34
|
+
data: {
|
|
35
|
+
table_name: table['name'],
|
|
36
|
+
database_name: table['database_name'],
|
|
37
|
+
schema_name: table['schema_name'],
|
|
38
|
+
kind: table['kind'],
|
|
39
|
+
rows: table['rows'],
|
|
40
|
+
bytes: table['bytes'],
|
|
41
|
+
owner: table['owner'],
|
|
42
|
+
comment: table['comment'],
|
|
43
|
+
created_on: table['created_on'],
|
|
44
|
+
},
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
finally {
|
|
48
|
+
yield (0, common_1.destroy)(connection);
|
|
49
|
+
}
|
|
50
|
+
}),
|
|
51
|
+
};
|
|
52
|
+
exports.newTableTrigger = (0, qadams_framework_1.createTrigger)({
|
|
53
|
+
auth: auth_1.snowflakeAuth,
|
|
54
|
+
name: 'new_table',
|
|
55
|
+
displayName: 'New Table',
|
|
56
|
+
description: 'Triggers when a new table is created in the selected schema. Checked by polling every few minutes.',
|
|
57
|
+
aiMetadata: {
|
|
58
|
+
description: "Fires when a new table is created in the selected Snowflake database and schema, detected by polling and comparing each table's creation time against the last-seen watermark. Each newly created table produces one event with its name, kind, owner, and metadata.",
|
|
59
|
+
},
|
|
60
|
+
props,
|
|
61
|
+
sampleData: {
|
|
62
|
+
table_name: 'ORDERS',
|
|
63
|
+
database_name: 'MY_DATABASE',
|
|
64
|
+
schema_name: 'PUBLIC',
|
|
65
|
+
kind: 'TABLE',
|
|
66
|
+
rows: 0,
|
|
67
|
+
bytes: 0,
|
|
68
|
+
owner: 'SYSADMIN',
|
|
69
|
+
comment: '',
|
|
70
|
+
created_on: '2024-01-15T10:30:00.000Z',
|
|
71
|
+
},
|
|
72
|
+
type: qadams_framework_1.TriggerStrategy.POLLING,
|
|
73
|
+
test(context) {
|
|
74
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
return yield qadams_common_1.pollingHelper.test(polling, context);
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
onEnable(context) {
|
|
79
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
yield qadams_common_1.pollingHelper.onEnable(polling, context);
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
onDisable(context) {
|
|
84
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
yield qadams_common_1.pollingHelper.onDisable(polling, context);
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
run(context) {
|
|
89
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
return yield qadams_common_1.pollingHelper.poll(polling, context);
|
|
91
|
+
});
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
//# sourceMappingURL=new-table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-table.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-table.ts"],"names":[],"mappings":";;;;AAAA,gEAImC;AACnC,0DAAgF;AAChF,kCAAwC;AACxC,sCAOmB;AAOnB,MAAM,KAAK,GAAG;IACZ,QAAQ,EAAE,6BAAoB,CAAC,QAAQ;IACvC,MAAM,EAAE,6BAAoB,CAAC,MAAM;CACpC,CAAC;AAEF,SAAS,SAAS,CAAC,KAAc;IAC/B,IAAI,KAAK,YAAY,IAAI;QAAE,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;IAClD,IAAI,OAAO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