omnata-plugin-devkit 0.10.12a96__tar.gz → 0.10.24__tar.gz
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.
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/PKG-INFO +5 -4
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/pyproject.toml +3 -3
- omnata_plugin_devkit-0.10.24/src/omnata_plugin_devkit/development.ipynb +64 -0
- omnata_plugin_devkit-0.10.24/src/omnata_plugin_devkit/jinja_templates/FETCH_CONNECTIONS.sql.jinja +26 -0
- omnata_plugin_devkit-0.10.24/src/omnata_plugin_devkit/jinja_templates/FETCH_SYNCS.sql.jinja +26 -0
- omnata_plugin_devkit-0.10.24/src/omnata_plugin_devkit/jinja_templates/FETCH_SYNC_BRANCHES.sql.jinja +26 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/TUNNEL_TEST.sql.jinja +1 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/manifest.yml.jinja +6 -3
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/native_app_packaging.py +3 -3
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/plugin_uploader.py +46 -2
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/LICENSE +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/README.md +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/__init__.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/airbyte_wrapper.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/cli/__init__.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/development_session.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/initialiser.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/API_LIMITS.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/ASSIGN_OUTBOUND_TARGET_TYPE.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/CONFIGURATION_FORM.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/CONFIGURE_APIS.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/CONNECTION_FORM.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/CONNECTION_TEST.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/CONSTRUCT_FORM_OPTION.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/CREATE_BILLING_EVENTS.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/CREATE_GENERIC_SECRET_OBJECT.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/CREATE_GENERIC_SECRET_OBJECT_FROM_EXISTING.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/CREATE_NETWORK_RULE_OBJECT.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/CREATE_NETWORK_RULE_OBJECT_FROM_EXISTING.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/CREATE_OAUTH_SECRET_OBJECT.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/INBOUND_LIST_STREAMS.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/LIST_STAGES.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/NETWORK_ADDRESSES.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/NGROK_POST_TUNNEL_FIELDS.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/OUTBOUND_RECORD_VALIDATOR.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/PENDING_API_CONFIGURATION.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/POST_INSTALL_ACTIONS.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/RENAME_CONNECTION_METHODS.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/RETRIEVE_NETWORK_RULE_OBJECT.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/RETRIEVE_SECRETS.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/RETRIEVE_SECRETS_UDF.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/SYNC.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/TEST_CALLBACK.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/TEST_OAUTH_TOKEN_EXISTS.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/UPDATE_API_CONFIGURATION.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/UPDATE_GENERIC_SECRET_OBJECT.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/UPDATE_GENERIC_SECRET_OBJECT_OLD.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/jinja_templates/UPDATE_NETWORK_RULE_OBJECT.sql.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/plugin_registration.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/plugin_template/icon.svg +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/plugin_template/plugin.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/plugin_template/plugin_development.ipynb +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/plugin_template/requirements.txt +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/snowcli/__init__.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/snowcli/cli/__init__.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/snowcli/cli/api/__init__.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/snowcli/cli/api/config.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/snowcli/cli/api/constants.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/snowcli/cli/api/exceptions.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/snowcli/cli/api/secure_path.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/snowcli/cli/api/secure_utils.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/snowcli/cli/api/utils/__init__.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/snowcli/cli/api/utils/types.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/snowcli/cli/app/__init__.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/snowcli/cli/app/snow_connector.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/snowcli/cli/plugins/__init__.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/snowcli/cli/plugins/snowpark/__init__.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/snowcli/cli/plugins/snowpark/models.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/snowcli/cli/plugins/snowpark/package/__init__.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/snowcli/cli/plugins/snowpark/package_utils.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/snowcli/cli/plugins/snowpark/snowpark_shared.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/snowcli/cli/plugins/snowpark/venv.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/snowcli/cli/plugins/snowpark/zipper.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/snowcli/cli/templates/environment.yml.jinja +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/streamlit/plugin_configuration.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/test_step_definitions.py +0 -0
- {omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/utils.py +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: omnata-plugin-devkit
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.24
|
|
4
4
|
Summary:
|
|
5
|
+
License-File: LICENSE
|
|
5
6
|
Author: James Weakley
|
|
6
7
|
Author-email: james.weakley@omnata.com
|
|
7
8
|
Requires-Python: >=3.10,<3.11
|
|
@@ -11,8 +12,8 @@ Requires-Dist: behave (>=1.2,<2.0)
|
|
|
11
12
|
Requires-Dist: behave_pandas (>=0.5.0,<0.6.0)
|
|
12
13
|
Requires-Dist: jinja2 (>=3,<=3.1.4)
|
|
13
14
|
Requires-Dist: numpy (<=1.27.0)
|
|
14
|
-
Requires-Dist: omnata-plugin-runtime (
|
|
15
|
-
Requires-Dist: omnata_cli (>=0.2.
|
|
15
|
+
Requires-Dist: omnata-plugin-runtime (>=0.10.20)
|
|
16
|
+
Requires-Dist: omnata_cli (>=0.2.3,<0.3.0)
|
|
16
17
|
Requires-Dist: pandas (>=2,<=2.1.4)
|
|
17
18
|
Requires-Dist: pyparsing (>=3.0)
|
|
18
19
|
Requires-Dist: python-slugify (>=8,<9)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "omnata-plugin-devkit"
|
|
3
|
-
version = "0.10.
|
|
3
|
+
version = "0.10.24"
|
|
4
4
|
description = ""
|
|
5
5
|
authors = ["James Weakley <james.weakley@omnata.com>"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -8,8 +8,8 @@ packages = [{ include = "omnata_plugin_devkit", from = "src" }]
|
|
|
8
8
|
|
|
9
9
|
[tool.poetry.dependencies]
|
|
10
10
|
python = "~3.10"
|
|
11
|
-
omnata_cli = "^0.2.
|
|
12
|
-
omnata-plugin-runtime = "
|
|
11
|
+
omnata_cli = "^0.2.3"
|
|
12
|
+
omnata-plugin-runtime = ">=0.10.20"
|
|
13
13
|
pandas = "^2,<=2.1.4"
|
|
14
14
|
numpy = "<=1.27.0"
|
|
15
15
|
jinja2 = "^3,<=3.1.4"
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cells": [
|
|
3
|
+
{
|
|
4
|
+
"cell_type": "code",
|
|
5
|
+
"execution_count": null,
|
|
6
|
+
"id": "6ebeeb79",
|
|
7
|
+
"metadata": {},
|
|
8
|
+
"outputs": [],
|
|
9
|
+
"source": [
|
|
10
|
+
"from snowflake.snowpark import Session\n",
|
|
11
|
+
"from snowcli.cli.app.snow_connector import connect_to_snowflake\n",
|
|
12
|
+
"import os\n",
|
|
13
|
+
"os.chdir('/home/vscode')\n",
|
|
14
|
+
"snowflake_connector = connect_to_snowflake(\n",
|
|
15
|
+
" connection_name='dev'\n",
|
|
16
|
+
")\n",
|
|
17
|
+
"builder = Session.builder\n",
|
|
18
|
+
"builder._options[\"connection\"] = snowflake_connector\n",
|
|
19
|
+
"session: Session = builder.create()"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"cell_type": "code",
|
|
24
|
+
"execution_count": null,
|
|
25
|
+
"id": "f2b8d34d",
|
|
26
|
+
"metadata": {},
|
|
27
|
+
"outputs": [],
|
|
28
|
+
"source": [
|
|
29
|
+
"results = session.sql('show stages in account').collect()"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"cell_type": "code",
|
|
34
|
+
"execution_count": null,
|
|
35
|
+
"id": "ce9da37c",
|
|
36
|
+
"metadata": {},
|
|
37
|
+
"outputs": [],
|
|
38
|
+
"source": [
|
|
39
|
+
"[r.as_dict() for r in results]"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"metadata": {
|
|
44
|
+
"kernelspec": {
|
|
45
|
+
"display_name": "Python 3",
|
|
46
|
+
"language": "python",
|
|
47
|
+
"name": "python3"
|
|
48
|
+
},
|
|
49
|
+
"language_info": {
|
|
50
|
+
"codemirror_mode": {
|
|
51
|
+
"name": "ipython",
|
|
52
|
+
"version": 3
|
|
53
|
+
},
|
|
54
|
+
"file_extension": ".py",
|
|
55
|
+
"mimetype": "text/x-python",
|
|
56
|
+
"name": "python",
|
|
57
|
+
"nbconvert_exporter": "python",
|
|
58
|
+
"pygments_lexer": "ipython3",
|
|
59
|
+
"version": "3.10.16"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"nbformat": 4,
|
|
63
|
+
"nbformat_minor": 5
|
|
64
|
+
}
|
omnata_plugin_devkit-0.10.24/src/omnata_plugin_devkit/jinja_templates/FETCH_CONNECTIONS.sql.jinja
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
CREATE or replace PROCEDURE PLUGIN.FETCH_CONNECTIONS()
|
|
2
|
+
RETURNS TABLE()
|
|
3
|
+
LANGUAGE SQL
|
|
4
|
+
as
|
|
5
|
+
DECLARE
|
|
6
|
+
|
|
7
|
+
CONNECTIONS resultset;
|
|
8
|
+
SYNC_ENGINE_DATABASE_NAME varchar;
|
|
9
|
+
PROC_NAME varchar;
|
|
10
|
+
PLUGIN_REGISTRATION_EXCEPTION EXCEPTION (-20001, 'Plugin is not registered to a sync engine instance');
|
|
11
|
+
c1 CURSOR FOR select min(APPLICATION_NAME) from DATA.OMNATA_REGISTRATION;
|
|
12
|
+
BEGIN
|
|
13
|
+
|
|
14
|
+
OPEN c1;
|
|
15
|
+
FETCH c1 INTO SYNC_ENGINE_DATABASE_NAME;
|
|
16
|
+
IF (:SYNC_ENGINE_DATABASE_NAME = null) THEN
|
|
17
|
+
RAISE PLUGIN_REGISTRATION_EXCEPTION;
|
|
18
|
+
END IF;
|
|
19
|
+
|
|
20
|
+
select CONCAT(:SYNC_ENGINE_DATABASE_NAME,'.API.PLUGIN_FETCH_CONNECTIONS') into :PROC_NAME;
|
|
21
|
+
|
|
22
|
+
CONNECTIONS:= (call IDENTIFIER(:PROC_NAME)(current_database(),PLUGIN.TOKEN()));
|
|
23
|
+
|
|
24
|
+
RETURN TABLE(CONNECTIONS);
|
|
25
|
+
|
|
26
|
+
END;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
CREATE or replace PROCEDURE PLUGIN.FETCH_SYNCS(CONNECTION_ID NUMERIC(38,0) DEFAULT NULL)
|
|
2
|
+
RETURNS TABLE()
|
|
3
|
+
LANGUAGE SQL
|
|
4
|
+
as
|
|
5
|
+
DECLARE
|
|
6
|
+
|
|
7
|
+
SYNCS resultset;
|
|
8
|
+
SYNC_ENGINE_DATABASE_NAME varchar;
|
|
9
|
+
PROC_NAME varchar;
|
|
10
|
+
PLUGIN_REGISTRATION_EXCEPTION EXCEPTION (-20001, 'Plugin is not registered to a sync engine instance');
|
|
11
|
+
c1 CURSOR FOR select min(APPLICATION_NAME) from DATA.OMNATA_REGISTRATION;
|
|
12
|
+
BEGIN
|
|
13
|
+
|
|
14
|
+
OPEN c1;
|
|
15
|
+
FETCH c1 INTO SYNC_ENGINE_DATABASE_NAME;
|
|
16
|
+
IF (:SYNC_ENGINE_DATABASE_NAME = null) THEN
|
|
17
|
+
RAISE PLUGIN_REGISTRATION_EXCEPTION;
|
|
18
|
+
END IF;
|
|
19
|
+
|
|
20
|
+
select CONCAT(:SYNC_ENGINE_DATABASE_NAME,'.API.PLUGIN_FETCH_SYNCS') into :PROC_NAME;
|
|
21
|
+
|
|
22
|
+
SYNCS:= (call IDENTIFIER(:PROC_NAME)(current_database(),PLUGIN.TOKEN(),:CONNECTION_ID));
|
|
23
|
+
|
|
24
|
+
RETURN TABLE(SYNCS);
|
|
25
|
+
|
|
26
|
+
END;
|
omnata_plugin_devkit-0.10.24/src/omnata_plugin_devkit/jinja_templates/FETCH_SYNC_BRANCHES.sql.jinja
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
CREATE or replace PROCEDURE PLUGIN.FETCH_SYNC_BRANCHES(SYNC_ID numeric)
|
|
2
|
+
RETURNS TABLE()
|
|
3
|
+
LANGUAGE SQL
|
|
4
|
+
as
|
|
5
|
+
DECLARE
|
|
6
|
+
|
|
7
|
+
SYNC_BRANCHES resultset;
|
|
8
|
+
SYNC_ENGINE_DATABASE_NAME varchar;
|
|
9
|
+
PROC_NAME varchar;
|
|
10
|
+
PLUGIN_REGISTRATION_EXCEPTION EXCEPTION (-20001, 'Plugin is not registered to a sync engine instance');
|
|
11
|
+
c1 CURSOR FOR select min(APPLICATION_NAME) from DATA.OMNATA_REGISTRATION;
|
|
12
|
+
BEGIN
|
|
13
|
+
|
|
14
|
+
OPEN c1;
|
|
15
|
+
FETCH c1 INTO SYNC_ENGINE_DATABASE_NAME;
|
|
16
|
+
IF (:SYNC_ENGINE_DATABASE_NAME = null) THEN
|
|
17
|
+
RAISE PLUGIN_REGISTRATION_EXCEPTION;
|
|
18
|
+
END IF;
|
|
19
|
+
|
|
20
|
+
select CONCAT(:SYNC_ENGINE_DATABASE_NAME,'.API.PLUGIN_FETCH_SYNC_BRANCHES') into :PROC_NAME;
|
|
21
|
+
|
|
22
|
+
SYNC_BRANCHES:= (call IDENTIFIER(:PROC_NAME)(current_database(),PLUGIN.TOKEN(),:SYNC_ID));
|
|
23
|
+
|
|
24
|
+
RETURN TABLE(SYNC_BRANCHES);
|
|
25
|
+
|
|
26
|
+
END;
|
|
@@ -48,6 +48,7 @@ def run(session,tunnel_type:str,other_secrets_name:str):
|
|
|
48
48
|
url = f'https://{ngrok_endpoint_host}/'
|
|
49
49
|
try:
|
|
50
50
|
response=http.request('GET',url)
|
|
51
|
+
return_data['mtls_success'] = True
|
|
51
52
|
except urllib3.exceptions.MaxRetryError as max_retry_error:
|
|
52
53
|
if isinstance(max_retry_error.reason, urllib3.exceptions.SSLError):
|
|
53
54
|
ssl_error:urllib3.exceptions.SSLError = max_retry_error.reason
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
manifest_version:
|
|
1
|
+
manifest_version: 2
|
|
2
2
|
|
|
3
3
|
version:
|
|
4
4
|
comment: |
|
|
@@ -14,7 +14,8 @@ artifacts:
|
|
|
14
14
|
#runtime configuration for this version
|
|
15
15
|
configuration:
|
|
16
16
|
log_level: {{log_level}}
|
|
17
|
-
trace_level:
|
|
17
|
+
trace_level: ON_EVENT
|
|
18
|
+
metric_level: ALL
|
|
18
19
|
telemetry_event_definitions:
|
|
19
20
|
- type: ERRORS_AND_WARNINGS
|
|
20
21
|
sharing: MANDATORY
|
|
@@ -24,4 +25,6 @@ configuration:
|
|
|
24
25
|
sharing: OPTIONAL
|
|
25
26
|
- type: DEBUG_LOGS
|
|
26
27
|
sharing: OPTIONAL
|
|
27
|
-
|
|
28
|
+
- type: METRICS
|
|
29
|
+
sharing: OPTIONAL
|
|
30
|
+
|
|
@@ -27,6 +27,7 @@ class NativeAppPackaging:
|
|
|
27
27
|
self,
|
|
28
28
|
developer_role: Optional[str] = None,
|
|
29
29
|
distribution: Literal["INTERNAL", "EXTERNAL"] = "INTERNAL",
|
|
30
|
+
enable_release_channels: bool = False,
|
|
30
31
|
) -> bool:
|
|
31
32
|
"""
|
|
32
33
|
Creates a native application package in Snowflake.
|
|
@@ -39,7 +40,8 @@ class NativeAppPackaging:
|
|
|
39
40
|
if len(app_packages) == 0:
|
|
40
41
|
self.session.sql(
|
|
41
42
|
f"""CREATE APPLICATION PACKAGE {self.package_name}
|
|
42
|
-
DISTRIBUTION={distribution}
|
|
43
|
+
DISTRIBUTION={distribution}
|
|
44
|
+
ENABLE_RELEASE_CHANNELS={str(enable_release_channels).upper()}"""
|
|
43
45
|
).collect()
|
|
44
46
|
if developer_role is not None:
|
|
45
47
|
self.session.sql(
|
|
@@ -79,7 +81,6 @@ class NativeAppPackaging:
|
|
|
79
81
|
application_name: str,
|
|
80
82
|
version_name: str,
|
|
81
83
|
patch_number: Optional[int] = None,
|
|
82
|
-
debug_mode: bool = True,
|
|
83
84
|
authorize_telemetry_event_sharing: bool = True,
|
|
84
85
|
) -> bool:
|
|
85
86
|
"""
|
|
@@ -107,7 +108,6 @@ class NativeAppPackaging:
|
|
|
107
108
|
f"""CREATE APPLICATION {application_name}
|
|
108
109
|
FROM APPLICATION PACKAGE {self.package_name}
|
|
109
110
|
USING VERSION {version_name} patch {patch_number}
|
|
110
|
-
DEBUG_MODE={str(debug_mode).upper()}
|
|
111
111
|
AUTHORIZE_TELEMETRY_EVENT_SHARING={str(authorize_telemetry_event_sharing).upper()}"""
|
|
112
112
|
).collect()
|
|
113
113
|
return True
|
|
@@ -20,6 +20,7 @@ import sys
|
|
|
20
20
|
import typing
|
|
21
21
|
import zipfile
|
|
22
22
|
import copy
|
|
23
|
+
import uuid
|
|
23
24
|
from pathlib import Path
|
|
24
25
|
from typing import Any, Dict, List, Literal, Optional
|
|
25
26
|
|
|
@@ -260,6 +261,7 @@ class PluginUploader:
|
|
|
260
261
|
# some packages are named inconsistently which makes them hard to remove from the artifact
|
|
261
262
|
for item in zip_read.infolist():
|
|
262
263
|
if not item.filename.startswith('.packages') and \
|
|
264
|
+
not item.filename.startswith('udf_direct_imports') and \
|
|
263
265
|
not item.filename.startswith('pydantic_core'):
|
|
264
266
|
if item.filename.endswith('.so'):
|
|
265
267
|
raise ValueError(f"Native library found in package: {item.filename}")
|
|
@@ -468,6 +470,9 @@ class PluginUploader:
|
|
|
468
470
|
"CONFIGURE_APIS",
|
|
469
471
|
"UPDATE_API_CONFIGURATION",
|
|
470
472
|
"PENDING_API_CONFIGURATION",
|
|
473
|
+
"FETCH_CONNECTIONS",
|
|
474
|
+
"FETCH_SYNCS",
|
|
475
|
+
"FETCH_SYNC_BRANCHES",
|
|
471
476
|
"TEST_CALLBACK",
|
|
472
477
|
"LIST_STAGES",
|
|
473
478
|
"CREATE_GENERIC_SECRET_OBJECT",
|
|
@@ -508,6 +513,9 @@ $${}$$;
|
|
|
508
513
|
|
|
509
514
|
|
|
510
515
|
setup_script.write("grant usage on schema UDFS to application role CONSUMER_FUNCTION_CALLER;\n")
|
|
516
|
+
setup_script.write(
|
|
517
|
+
"grant usage on schema UDFS to application role OMNATA_MANAGEMENT;\n"
|
|
518
|
+
)
|
|
511
519
|
udf_search_directory = plugin_directory
|
|
512
520
|
# if there is a folder called 'udfs' or 'consumer_udfs', we'll use that as the source of UDFs
|
|
513
521
|
top_level_modules = None
|
|
@@ -570,9 +578,14 @@ $${}$$;
|
|
|
570
578
|
os.chdir(direct_imports_path)
|
|
571
579
|
# upload all files in the directory to the stage
|
|
572
580
|
for path in sorted(Path(".").rglob("*")):
|
|
573
|
-
|
|
581
|
+
# don't try to upload directories, only files
|
|
582
|
+
if path.is_dir():
|
|
583
|
+
continue
|
|
584
|
+
# figure out the path
|
|
585
|
+
relative_path = str(f"/{path.parent}") if path.parent != Path(".") else ""
|
|
586
|
+
print(f"Uploading {path} to stage under {relative_path}")
|
|
574
587
|
self.session.sql(
|
|
575
|
-
f"put file://{path} @{database_name}.{schema_name}.{stage_name} AUTO_COMPRESS=FALSE OVERWRITE=TRUE"
|
|
588
|
+
f"put file://{path} @{database_name}.{schema_name}.{stage_name}{relative_path} AUTO_COMPRESS=FALSE OVERWRITE=TRUE"
|
|
576
589
|
).collect()
|
|
577
590
|
os.chdir(cwd)
|
|
578
591
|
|
|
@@ -614,6 +627,28 @@ $${}$$;
|
|
|
614
627
|
FROM '/streamlit'
|
|
615
628
|
MAIN_FILE = '/plugin_configuration.py';"""
|
|
616
629
|
)
|
|
630
|
+
|
|
631
|
+
setup_script.write("""
|
|
632
|
+
WITH CREATE_TOKEN_FUNCTION AS PROCEDURE()
|
|
633
|
+
RETURNS BOOLEAN
|
|
634
|
+
LANGUAGE JAVASCRIPT
|
|
635
|
+
AS
|
|
636
|
+
$$
|
|
637
|
+
var uuidStatement = snowflake.createStatement({ sqlText:
|
|
638
|
+
`select UUID_STRING();`
|
|
639
|
+
});
|
|
640
|
+
var uuidResult = uuidStatement.execute();
|
|
641
|
+
uuidResult.next();
|
|
642
|
+
var uuid = uuidResult.getColumnValue(1);
|
|
643
|
+
var twoDollars='$' + '$';
|
|
644
|
+
snowflake.createStatement({ sqlText:
|
|
645
|
+
`create or replace function PLUGIN.TOKEN() returns string as ${twoDollars}'${uuid}'${twoDollars} `
|
|
646
|
+
}).execute();
|
|
647
|
+
return true;
|
|
648
|
+
$$
|
|
649
|
+
CALL CREATE_TOKEN_FUNCTION();
|
|
650
|
+
GRANT USAGE ON FUNCTION PLUGIN.TOKEN() TO application role OMNATA_MANAGEMENT;
|
|
651
|
+
""")
|
|
617
652
|
|
|
618
653
|
setup_script.write(
|
|
619
654
|
"""GRANT USAGE ON STREAMLIT UI."Plugin Configuration" TO application role OMNATA_MANAGEMENT;\n"""
|
|
@@ -648,6 +683,15 @@ MAIN_FILE = '/plugin_configuration.py';"""
|
|
|
648
683
|
}
|
|
649
684
|
)
|
|
650
685
|
manifest_file.write(content)
|
|
686
|
+
custom_manifest_privileges = os.path.join(plugin_directory, "custom_manifest_section.yml")
|
|
687
|
+
if os.path.exists(custom_manifest_privileges):
|
|
688
|
+
print("Adding manifest privileges from custom_manifest_section.yml")
|
|
689
|
+
with open(
|
|
690
|
+
custom_manifest_privileges, "r", encoding="utf-8"
|
|
691
|
+
) as custom_manifest_privileges_stream:
|
|
692
|
+
manifest_file.write(custom_manifest_privileges_stream.read() + "\n")
|
|
693
|
+
|
|
694
|
+
|
|
651
695
|
print("Uploading app manifest to stage")
|
|
652
696
|
self.session.sql(
|
|
653
697
|
(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{omnata_plugin_devkit-0.10.12a96 → omnata_plugin_devkit-0.10.24}/src/omnata_plugin_devkit/utils.py
RENAMED
|
File without changes
|