omnata-plugin-devkit 0.2.28__tar.gz → 0.2.30__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.2.28 → omnata_plugin_devkit-0.2.30}/PKG-INFO +2 -2
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/pyproject.toml +2 -2
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/development_session.py +38 -13
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/LICENSE +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/README.md +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/__init__.py +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/airbyte_wrapper.py +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/cli/__init__.py +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/initialiser.py +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/API_LIMITS.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/CONFIGURATION_FORM.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/CONFIGURE_APIS.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/CONNECTION_FORM.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/CONNECTION_TEST.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/CONSTRUCT_FORM_OPTION.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/CREATE_BILLING_EVENTS.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/CREATE_GENERIC_SECRET_OBJECT.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/CREATE_NETWORK_RULE_OBJECT.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/CREATE_OAUTH_SECRET_OBJECT.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/INBOUND_LIST_STREAMS.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/NETWORK_ADDRESSES.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/OUTBOUND_RECORD_VALIDATOR.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/PENDING_API_CONFIGURATION.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/POST_INSTALL_ACTIONS.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/RETRIEVE_NETWORK_RULE_OBJECT.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/RETRIEVE_SECRETS.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/SYNC.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/TEST_CALLBACK.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/TEST_OAUTH_TOKEN_EXISTS.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/UPDATE_API_CONFIGURATION.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/UPDATE_GENERIC_SECRET_OBJECT.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/UPDATE_GENERIC_SECRET_OBJECT_OLD.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/UPDATE_NETWORK_RULE_OBJECT.sql.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/jinja_templates/manifest.yml.jinja +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/native_app_packaging.py +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/plugin_registration.py +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/plugin_template/icon.svg +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/plugin_template/plugin.py +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/plugin_template/requirements.txt +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/plugin_uploader.py +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/streamlit/plugin_configuration.py +0 -0
- {omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/test_step_definitions.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: omnata-plugin-devkit
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.30
|
|
4
4
|
Summary:
|
|
5
5
|
Author: James Weakley
|
|
6
6
|
Author-email: james.weakley@omnata.com
|
|
@@ -10,7 +10,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
10
10
|
Requires-Dist: behave (>=1.2,<2.0)
|
|
11
11
|
Requires-Dist: behave_pandas (>=0.5.0,<0.6.0)
|
|
12
12
|
Requires-Dist: jinja2 (>=3,<4)
|
|
13
|
-
Requires-Dist: omnata-plugin-runtime (>=0.2.
|
|
13
|
+
Requires-Dist: omnata-plugin-runtime (>=0.2.61,<0.3.0)
|
|
14
14
|
Requires-Dist: omnata_cli (>=0.1.12,<0.2.0)
|
|
15
15
|
Requires-Dist: pandas
|
|
16
16
|
Requires-Dist: pydantic (>=1,<2)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "omnata-plugin-devkit"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.30"
|
|
4
4
|
description = ""
|
|
5
5
|
authors = ["James Weakley <james.weakley@omnata.com>"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -9,7 +9,7 @@ packages = [{ include = "omnata_plugin_devkit", from = "src" }]
|
|
|
9
9
|
[tool.poetry.dependencies]
|
|
10
10
|
python = "~3.10"
|
|
11
11
|
omnata_cli = "^0.1.12"
|
|
12
|
-
omnata-plugin-runtime = "^0.2.
|
|
12
|
+
omnata-plugin-runtime = "^0.2.61"
|
|
13
13
|
pandas = "*"
|
|
14
14
|
jinja2 = "^3"
|
|
15
15
|
pydantic = "^1"
|
|
@@ -197,8 +197,8 @@ class DevelopmentSession:
|
|
|
197
197
|
self.sync_slug = sync_slug
|
|
198
198
|
session_run_response = self.session.sql(
|
|
199
199
|
f"""
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
call {self.omnata_app_name}.API.CREATE_DEVELOPMENT_SESSION_RUN('{sync_slug}')
|
|
201
|
+
"""
|
|
202
202
|
).collect()
|
|
203
203
|
response_parsed = json.loads(session_run_response[0][0])
|
|
204
204
|
if response_parsed["success"] is False:
|
|
@@ -236,8 +236,8 @@ class DevelopmentSession:
|
|
|
236
236
|
|
|
237
237
|
secrets_fetch_response = self.session.sql(
|
|
238
238
|
f"""
|
|
239
|
-
|
|
240
|
-
|
|
239
|
+
call {plugin_app_name}.PLUGIN.RETRIEVE_SECRETS({oauth_secret_param},{other_secrets_param})
|
|
240
|
+
"""
|
|
241
241
|
).collect()
|
|
242
242
|
secrets_response_parsed = json.loads(secrets_fetch_response[0][0])
|
|
243
243
|
if secrets_response_parsed["success"] is False:
|
|
@@ -296,6 +296,7 @@ class DevelopmentSession:
|
|
|
296
296
|
sync_request=outbound_sync_request,
|
|
297
297
|
scenario_records=scenario_records,
|
|
298
298
|
)
|
|
299
|
+
self.run_id = outbound_payload.run_id
|
|
299
300
|
outbound_sync_request._prebaked_record_state = scenario_records
|
|
300
301
|
self.plugin_instance._sync_request = outbound_sync_request
|
|
301
302
|
self._start_recording()
|
|
@@ -324,8 +325,8 @@ class DevelopmentSession:
|
|
|
324
325
|
self.sync_slug = sync_slug
|
|
325
326
|
session_run_response = self.session.sql(
|
|
326
327
|
f"""
|
|
327
|
-
|
|
328
|
-
|
|
328
|
+
call {self.omnata_app_name}.API.CREATE_DEVELOPMENT_SESSION_RUN('{sync_slug}')
|
|
329
|
+
"""
|
|
329
330
|
).collect()
|
|
330
331
|
response_parsed = json.loads(session_run_response[0][0])
|
|
331
332
|
if response_parsed["success"] is False:
|
|
@@ -425,11 +426,22 @@ class DevelopmentSession:
|
|
|
425
426
|
sync_request=inbound_sync_request,
|
|
426
427
|
scenario_records=None,
|
|
427
428
|
)
|
|
429
|
+
self.run_id = inbound_payload.run_id
|
|
428
430
|
self.plugin_instance._sync_request = inbound_sync_request
|
|
429
431
|
self._start_recording()
|
|
430
432
|
return configuration_parameters, inbound_sync_request
|
|
433
|
+
|
|
434
|
+
def cancel_scenario(self):
|
|
435
|
+
"""
|
|
436
|
+
Cancels the current scenario, and stops recording traffic.
|
|
437
|
+
"""
|
|
438
|
+
if self.current_scenario is None:
|
|
439
|
+
return "Failed: you need to call prepare_outbound_scenario or prepare_inbound_scenario first"
|
|
440
|
+
self.current_scenario = None
|
|
441
|
+
self._stop_recording()
|
|
442
|
+
print("Success: cancelled scenario")
|
|
431
443
|
|
|
432
|
-
def complete_scenario(self):
|
|
444
|
+
def complete_scenario(self,apply_results:bool=True):
|
|
433
445
|
"""
|
|
434
446
|
Marks the scenario as complete, and stops recording traffic.
|
|
435
447
|
"""
|
|
@@ -438,8 +450,18 @@ class DevelopmentSession:
|
|
|
438
450
|
if self.current_scenario.results is None:
|
|
439
451
|
return "Failed: you need to pass the results back to validate_response() before completing the scenario"
|
|
440
452
|
self.recorded_scenarios.append(self.current_scenario)
|
|
441
|
-
self.current_scenario = None
|
|
442
453
|
self._stop_recording()
|
|
454
|
+
if apply_results:
|
|
455
|
+
self.current_scenario.sync_request.apply_results_queue()
|
|
456
|
+
session_run_response = self.session.sql(
|
|
457
|
+
f"""
|
|
458
|
+
call {self.omnata_app_name}.API.COMPLETE_DEVELOPMENT_SESSION_RUN({self.run_id},{apply_results})
|
|
459
|
+
"""
|
|
460
|
+
).collect()
|
|
461
|
+
response_parsed = json.loads(session_run_response[0][0])
|
|
462
|
+
if response_parsed["success"] is False:
|
|
463
|
+
raise ValueError(f"Failed: {response_parsed['error']}")
|
|
464
|
+
self.current_scenario = None
|
|
443
465
|
print("Success: finished recording scenario")
|
|
444
466
|
|
|
445
467
|
def _stop_recording(self):
|
|
@@ -493,7 +515,7 @@ class DevelopmentSession:
|
|
|
493
515
|
if self.current_scenario is None:
|
|
494
516
|
print("Failed: no active scenario")
|
|
495
517
|
return
|
|
496
|
-
results_dataframe = pandas.concat(outbound_sync_request._apply_results)
|
|
518
|
+
results_dataframe = pandas.concat(outbound_sync_request._apply_results).copy()
|
|
497
519
|
|
|
498
520
|
originally_provided_records = self.current_scenario.scenario_records
|
|
499
521
|
|
|
@@ -544,7 +566,7 @@ class DevelopmentSession:
|
|
|
544
566
|
inbound_sync_request: InboundSyncRequest = sync_request
|
|
545
567
|
if inbound_sync_request._apply_results is None:
|
|
546
568
|
print("Failed: No results were enqueued to the sync request")
|
|
547
|
-
results_dataframe = inbound_sync_request._apply_results
|
|
569
|
+
results_dataframe = inbound_sync_request._apply_results.copy()
|
|
548
570
|
self.current_scenario.results = results_dataframe
|
|
549
571
|
print("Success: results are valid")
|
|
550
572
|
else:
|
|
@@ -744,7 +766,7 @@ class DevelopmentSession:
|
|
|
744
766
|
)
|
|
745
767
|
table_indented = self.dataframe_to_behave_table(
|
|
746
768
|
recorded_scenario.scenario_records[
|
|
747
|
-
["IDENTIFIER", "SYNC_ACTION", "TRANSFORMED_RECORD"]
|
|
769
|
+
["IDENTIFIER", "APP_IDENTIFIER", "RESULT", "SYNC_ACTION", "TRANSFORMED_RECORD"]
|
|
748
770
|
],
|
|
749
771
|
3,
|
|
750
772
|
)
|
|
@@ -756,7 +778,7 @@ class DevelopmentSession:
|
|
|
756
778
|
recorded_scenario.sync_request
|
|
757
779
|
)
|
|
758
780
|
for stream in inbound_sync_request.streams:
|
|
759
|
-
if stream.
|
|
781
|
+
if stream.latest_state is not None:
|
|
760
782
|
f.write(
|
|
761
783
|
f"\t\t\t| {stream.stream_name} | {json.dumps(stream.latest_state,separators=(',', ':'))} | \n"
|
|
762
784
|
)
|
|
@@ -764,7 +786,7 @@ class DevelopmentSession:
|
|
|
764
786
|
f.write(f"\t\t\t| {stream.stream_name} | {{}} | \n")
|
|
765
787
|
if len(self.vcr_filter_query_parameters) > 0:
|
|
766
788
|
f.write(
|
|
767
|
-
f"\t\
|
|
789
|
+
f"\t\tAnd when matching requests, we ignore query parameters {','.join(self.vcr_filter_query_parameters)}\n"
|
|
768
790
|
)
|
|
769
791
|
f.write(
|
|
770
792
|
f"\t\tAnd we use the HTTP recordings from {recorded_scenario.scenario_cassette_file_name}\n"
|
|
@@ -807,8 +829,11 @@ class DevelopmentSession:
|
|
|
807
829
|
f.write(
|
|
808
830
|
f"\t\tAnd the response for the {stream_name} stream will be:\n"
|
|
809
831
|
)
|
|
832
|
+
if recorded_scenario.results[stream_name] is None:
|
|
833
|
+
raise ValueError(f"Recorded results for scenario {recorded_scenario.scenario_name} were None")
|
|
810
834
|
results = pandas.concat(recorded_scenario.results[stream_name])
|
|
811
835
|
results["RECORD_DATA"] = results["RECORD_DATA"].apply(json.dumps)
|
|
836
|
+
results["RECORD_DATA"] = results["RECORD_DATA"].replace("|", "\\|")
|
|
812
837
|
results.loc[
|
|
813
838
|
results["RECORD_DATA"] == '"null"', "RECORD_DATA"
|
|
814
839
|
] = "null"
|
|
File without changes
|
|
File without changes
|
{omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/cli/__init__.py
RENAMED
|
File without changes
|
{omnata_plugin_devkit-0.2.28 → omnata_plugin_devkit-0.2.30}/src/omnata_plugin_devkit/initialiser.py
RENAMED
|
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
|