fivetran-cli 0.1.7__tar.gz → 0.1.9__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.

Potentially problematic release.


This version of fivetran-cli might be problematic. Click here for more details.

@@ -1,4 +1,5 @@
1
1
  exclude AGENTS.md
2
+ exclude DEVELOPMENT.md
2
3
  prune plans
3
4
  global-exclude __pycache__
4
5
  global-exclude *.py[cod]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fivetran-cli
3
- Version: 0.1.7
3
+ Version: 0.1.9
4
4
  Summary: Command line wrapper for the Fivetran REST API and Connector SDK
5
5
  Author: Fivetran
6
6
  License-Expression: MIT
@@ -77,8 +77,13 @@ Destructive commands require `--yes` in non-interactive mode.
77
77
  Core resources:
78
78
 
79
79
  - `account get`
80
+ - `certificate connection list|get|approve|revoke`
81
+ - `certificate destination list|get|approve|revoke`
80
82
  - `connection list|get|create|update|delete|sync|resync|test`
83
+ - `connector-sdk-package list|get|delete`
81
84
  - `destination list|get|create|update|delete|test`
85
+ - `fingerprint connection list|get|approve|revoke`
86
+ - `fingerprint destination list|get|approve|revoke`
82
87
  - `group list|get|create|update|delete`
83
88
  - `group connection list`
84
89
  - `group user list|add|remove`
@@ -111,13 +116,18 @@ Schemas and metadata:
111
116
  Networking:
112
117
 
113
118
  - `hybrid-deployment-agent list|get|create|delete|regenerate-auth|reset-credentials`
119
+ - `log-service list|get|create|update|delete|test`
120
+ - `log-service account get|create|update|delete`
114
121
  - `proxy-agent list|get|create|delete|regenerate-secrets`
115
122
  - `proxy-agent connection list`
116
123
  - `private-link list|get|create|update|delete`
124
+ - `webhook list|get|create-account|create-group|update|delete|test`
117
125
 
118
126
  Transformations:
119
127
 
120
- - `transformation list`
128
+ - `transformation list|get|create|update|delete|run|cancel|upgrade`
129
+ - `transformation package-metadata list|get`
130
+ - `transformation-project list|get|create|update|delete|test`
121
131
 
122
132
  Connector SDK:
123
133
 
@@ -133,55 +143,10 @@ Connector SDK commands are provided by `fivetran-connector-sdk` and remain at th
133
143
 
134
144
  ## Not Included Yet
135
145
 
136
- These API areas are still intentionally not implemented:
146
+ The remaining gaps are intentionally limited to endpoints that need behavior beyond the generic JSON request/response wrapper, or endpoints whose user-facing command shape needs more validation before release.
137
147
 
138
- - Certificates and fingerprints
139
- - REST API endpoints for Connector SDK package upload/download
140
- - Log services
141
- - Webhooks
142
- - Transformation create/get/update/delete/run/cancel/upgrade
143
- - Transformation package metadata
144
- - Transformation projects
148
+ - Connector SDK package create/update/download, because those require file upload/download handling rather than JSON-only request bodies.
145
149
  - Hub registration
146
150
  - Group destination listing, pending confirmation of a supported REST endpoint
147
151
  - Interactive connector setup workflows
148
- - File upload/download handling for Connector SDK packages
149
152
  - High-quality resource-specific pretty views beyond the generic renderer
150
-
151
- ## Build And Publish
152
-
153
- Package artifacts are controlled by `pyproject.toml` and `MANIFEST.in`. The source distribution intentionally excludes local agent/project-planning files:
154
-
155
- - `AGENTS.md`
156
- - `plans/`
157
-
158
- Install local packaging tools with `pipx`:
159
-
160
- ```bash
161
- pipx install build
162
- pipx install twine
163
- ```
164
-
165
- This exposes `pyproject-build` and `twine` on your PATH. If you install these tools into a virtual environment instead, use `python3 -m build` and `python3 -m twine` in place of the commands below.
166
-
167
- Build source and wheel distributions:
168
-
169
- ```bash
170
- pyproject-build
171
- ```
172
-
173
- Validate the generated artifacts:
174
-
175
- ```bash
176
- twine check dist/*
177
- ```
178
-
179
- Upload to PyPI:
180
-
181
- ```bash
182
- twine upload dist/*
183
- ```
184
-
185
- This upload command assumes `~/.pypirc` is configured with the `pypi` repository. If `~/.pypirc` is not configured, set `TWINE_USERNAME=__token__` and `TWINE_PASSWORD=<api-token>` before running `twine upload`.
186
-
187
- PyPI files are immutable for a published version. If an upload is wrong, bump the version in `pyproject.toml`, rebuild, re-check, and upload the new version.
@@ -60,8 +60,13 @@ Destructive commands require `--yes` in non-interactive mode.
60
60
  Core resources:
61
61
 
62
62
  - `account get`
63
+ - `certificate connection list|get|approve|revoke`
64
+ - `certificate destination list|get|approve|revoke`
63
65
  - `connection list|get|create|update|delete|sync|resync|test`
66
+ - `connector-sdk-package list|get|delete`
64
67
  - `destination list|get|create|update|delete|test`
68
+ - `fingerprint connection list|get|approve|revoke`
69
+ - `fingerprint destination list|get|approve|revoke`
65
70
  - `group list|get|create|update|delete`
66
71
  - `group connection list`
67
72
  - `group user list|add|remove`
@@ -94,13 +99,18 @@ Schemas and metadata:
94
99
  Networking:
95
100
 
96
101
  - `hybrid-deployment-agent list|get|create|delete|regenerate-auth|reset-credentials`
102
+ - `log-service list|get|create|update|delete|test`
103
+ - `log-service account get|create|update|delete`
97
104
  - `proxy-agent list|get|create|delete|regenerate-secrets`
98
105
  - `proxy-agent connection list`
99
106
  - `private-link list|get|create|update|delete`
107
+ - `webhook list|get|create-account|create-group|update|delete|test`
100
108
 
101
109
  Transformations:
102
110
 
103
- - `transformation list`
111
+ - `transformation list|get|create|update|delete|run|cancel|upgrade`
112
+ - `transformation package-metadata list|get`
113
+ - `transformation-project list|get|create|update|delete|test`
104
114
 
105
115
  Connector SDK:
106
116
 
@@ -116,55 +126,10 @@ Connector SDK commands are provided by `fivetran-connector-sdk` and remain at th
116
126
 
117
127
  ## Not Included Yet
118
128
 
119
- These API areas are still intentionally not implemented:
129
+ The remaining gaps are intentionally limited to endpoints that need behavior beyond the generic JSON request/response wrapper, or endpoints whose user-facing command shape needs more validation before release.
120
130
 
121
- - Certificates and fingerprints
122
- - REST API endpoints for Connector SDK package upload/download
123
- - Log services
124
- - Webhooks
125
- - Transformation create/get/update/delete/run/cancel/upgrade
126
- - Transformation package metadata
127
- - Transformation projects
131
+ - Connector SDK package create/update/download, because those require file upload/download handling rather than JSON-only request bodies.
128
132
  - Hub registration
129
133
  - Group destination listing, pending confirmation of a supported REST endpoint
130
134
  - Interactive connector setup workflows
131
- - File upload/download handling for Connector SDK packages
132
135
  - High-quality resource-specific pretty views beyond the generic renderer
133
-
134
- ## Build And Publish
135
-
136
- Package artifacts are controlled by `pyproject.toml` and `MANIFEST.in`. The source distribution intentionally excludes local agent/project-planning files:
137
-
138
- - `AGENTS.md`
139
- - `plans/`
140
-
141
- Install local packaging tools with `pipx`:
142
-
143
- ```bash
144
- pipx install build
145
- pipx install twine
146
- ```
147
-
148
- This exposes `pyproject-build` and `twine` on your PATH. If you install these tools into a virtual environment instead, use `python3 -m build` and `python3 -m twine` in place of the commands below.
149
-
150
- Build source and wheel distributions:
151
-
152
- ```bash
153
- pyproject-build
154
- ```
155
-
156
- Validate the generated artifacts:
157
-
158
- ```bash
159
- twine check dist/*
160
- ```
161
-
162
- Upload to PyPI:
163
-
164
- ```bash
165
- twine upload dist/*
166
- ```
167
-
168
- This upload command assumes `~/.pypirc` is configured with the `pypi` repository. If `~/.pypirc` is not configured, set `TWINE_USERNAME=__token__` and `TWINE_PASSWORD=<api-token>` before running `twine upload`.
169
-
170
- PyPI files are immutable for a published version. If an upload is wrong, bump the version in `pyproject.toml`, rebuild, re-check, and upload the new version.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "fivetran-cli"
7
- version = "0.1.7"
7
+ version = "0.1.9"
8
8
  description = "Command line wrapper for the Fivetran REST API and Connector SDK"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -1,3 +1,3 @@
1
1
  """Fivetran CLI package."""
2
2
 
3
- __version__ = "0.1.6"
3
+ __version__ = "0.1.7"
@@ -18,12 +18,16 @@ from .output import emit_output
18
18
  Handler = Callable[[argparse.Namespace, FivetranClient], Any]
19
19
  REST_RESOURCE_NAMES = {
20
20
  "account",
21
+ "certificate",
21
22
  "connection",
22
23
  "connection-schema",
23
24
  "connector-metadata",
25
+ "connector-sdk-package",
24
26
  "destination",
27
+ "fingerprint",
25
28
  "group",
26
29
  "hybrid-deployment-agent",
30
+ "log-service",
27
31
  "private-link",
28
32
  "proxy-agent",
29
33
  "public-connector",
@@ -31,7 +35,9 @@ REST_RESOURCE_NAMES = {
31
35
  "system-key",
32
36
  "team",
33
37
  "transformation",
38
+ "transformation-project",
34
39
  "user",
40
+ "webhook",
35
41
  }
36
42
  SDK_TOP_LEVEL_OPTIONS = {"--version"}
37
43
  GLOBAL_OPTIONS_WITH_VALUES = {
@@ -136,8 +142,10 @@ def build_parser() -> argparse.ArgumentParser:
136
142
 
137
143
  resources = parser.add_subparsers(dest="resource", metavar="<resource>")
138
144
  _add_account(resources)
145
+ _add_certificate(resources)
139
146
  _add_connection(resources)
140
147
  _add_destination(resources)
148
+ _add_fingerprint(resources)
141
149
  _add_group(resources)
142
150
  _add_user(resources)
143
151
  _add_team(resources)
@@ -145,11 +153,15 @@ def build_parser() -> argparse.ArgumentParser:
145
153
  _add_system_key(resources)
146
154
  _add_connection_schema(resources)
147
155
  _add_connector_metadata(resources)
156
+ _add_connector_sdk_package(resources)
148
157
  _add_public_connector(resources)
149
158
  _add_hybrid_deployment_agent(resources)
159
+ _add_log_service(resources)
150
160
  _add_proxy_agent(resources)
151
161
  _add_private_link(resources)
152
162
  _add_transformation(resources)
163
+ _add_transformation_project(resources)
164
+ _add_webhook(resources)
153
165
  _add_sdk_commands(resources)
154
166
  return parser
155
167
 
@@ -302,6 +314,105 @@ def _add_connection(resources: argparse._SubParsersAction[argparse.ArgumentParse
302
314
  )
303
315
 
304
316
 
317
+ def _add_certificate(resources: argparse._SubParsersAction[argparse.ArgumentParser]) -> None:
318
+ _add_credential_resource(
319
+ resources,
320
+ "certificate",
321
+ "certificate",
322
+ "certificates",
323
+ "Manage approved TLS certificates.",
324
+ )
325
+
326
+
327
+ def _add_fingerprint(resources: argparse._SubParsersAction[argparse.ArgumentParser]) -> None:
328
+ _add_credential_resource(
329
+ resources,
330
+ "fingerprint",
331
+ "fingerprint",
332
+ "fingerprints",
333
+ "Manage approved SSH fingerprints.",
334
+ )
335
+
336
+
337
+ def _add_credential_resource(
338
+ resources: argparse._SubParsersAction[argparse.ArgumentParser],
339
+ resource_name: str,
340
+ label: str,
341
+ path_segment: str,
342
+ help_text: str,
343
+ ) -> None:
344
+ parser = resources.add_parser(resource_name, help=help_text, description=help_text)
345
+ scopes = parser.add_subparsers(dest="scope", required=True)
346
+ _add_scoped_credential_commands(
347
+ scopes,
348
+ "connection",
349
+ "connection_id",
350
+ "Connection ID.",
351
+ f"/v1/connections/{{connection_id}}/{path_segment}",
352
+ label,
353
+ )
354
+ _add_scoped_credential_commands(
355
+ scopes,
356
+ "destination",
357
+ "destination_id",
358
+ "Destination ID.",
359
+ f"/v1/destinations/{{destination_id}}/{path_segment}",
360
+ label,
361
+ )
362
+
363
+
364
+ def _add_scoped_credential_commands(
365
+ scopes: argparse._SubParsersAction[argparse.ArgumentParser],
366
+ scope_name: str,
367
+ id_name: str,
368
+ id_help: str,
369
+ collection_path: str,
370
+ label: str,
371
+ ) -> None:
372
+ parser = scopes.add_parser(
373
+ scope_name,
374
+ help=f"Manage {scope_name} {label}s.",
375
+ description=f"Manage {scope_name} {label}s.",
376
+ )
377
+ operations = parser.add_subparsers(dest=f"{scope_name}_operation", required=True)
378
+ _add_endpoint_command(
379
+ operations,
380
+ "list",
381
+ f"List approved {scope_name} {label}s.",
382
+ Endpoint("GET", collection_path, id_args=(id_name,)),
383
+ arguments=((id_name, id_help),),
384
+ )
385
+ _add_endpoint_command(
386
+ operations,
387
+ "get",
388
+ f"Get approved {scope_name} {label} details.",
389
+ Endpoint("GET", f"{collection_path}/{{hash}}", id_args=(id_name, "hash")),
390
+ arguments=((id_name, id_help), ("hash", f"{label.title()} hash.")),
391
+ )
392
+ _add_endpoint_command(
393
+ operations,
394
+ "approve",
395
+ f"Approve a {scope_name} {label}.",
396
+ Endpoint("POST", collection_path, id_args=(id_name,), body_required=True),
397
+ arguments=((id_name, id_help),),
398
+ body=True,
399
+ body_required=True,
400
+ )
401
+ _add_endpoint_command(
402
+ operations,
403
+ "revoke",
404
+ f"Revoke a {scope_name} {label}.",
405
+ Endpoint(
406
+ "DELETE",
407
+ f"{collection_path}/{{hash}}",
408
+ id_args=(id_name, "hash"),
409
+ destructive=True,
410
+ ),
411
+ arguments=((id_name, id_help), ("hash", f"{label.title()} hash.")),
412
+ destructive=True,
413
+ )
414
+
415
+
305
416
  def _add_destination(resources: argparse._SubParsersAction[argparse.ArgumentParser]) -> None:
306
417
  destination = resources.add_parser(
307
418
  "destination",
@@ -975,6 +1086,42 @@ def _add_connector_metadata(resources: argparse._SubParsersAction[argparse.Argum
975
1086
  )
976
1087
 
977
1088
 
1089
+ def _add_connector_sdk_package(resources: argparse._SubParsersAction[argparse.ArgumentParser]) -> None:
1090
+ package = resources.add_parser(
1091
+ "connector-sdk-package",
1092
+ help="Manage Connector SDK packages.",
1093
+ description="Manage Connector SDK packages.",
1094
+ )
1095
+ operations = package.add_subparsers(dest="operation", required=True)
1096
+ _add_endpoint_command(
1097
+ operations,
1098
+ "list",
1099
+ "List Connector SDK packages.",
1100
+ Endpoint("GET", "/v1/connector-sdk/packages", query_args=("limit", "cursor"), paginated=True),
1101
+ pagination=True,
1102
+ )
1103
+ _add_endpoint_command(
1104
+ operations,
1105
+ "get",
1106
+ "Get Connector SDK package details.",
1107
+ Endpoint("GET", "/v1/connector-sdk/packages/{package_id}", id_args=("package_id",)),
1108
+ arguments=(("package_id", "Package ID."),),
1109
+ )
1110
+ _add_endpoint_command(
1111
+ operations,
1112
+ "delete",
1113
+ "Delete a Connector SDK package.",
1114
+ Endpoint(
1115
+ "DELETE",
1116
+ "/v1/connector-sdk/packages/{package_id}",
1117
+ id_args=("package_id",),
1118
+ destructive=True,
1119
+ ),
1120
+ arguments=(("package_id", "Package ID."),),
1121
+ destructive=True,
1122
+ )
1123
+
1124
+
978
1125
  def _add_public_connector(resources: argparse._SubParsersAction[argparse.ArgumentParser]) -> None:
979
1126
  public_connector = resources.add_parser(
980
1127
  "public-connector",
@@ -990,6 +1137,102 @@ def _add_public_connector(resources: argparse._SubParsersAction[argparse.Argumen
990
1137
  )
991
1138
 
992
1139
 
1140
+ def _add_log_service(resources: argparse._SubParsersAction[argparse.ArgumentParser]) -> None:
1141
+ log_service = resources.add_parser(
1142
+ "log-service",
1143
+ help="Manage external log services.",
1144
+ description="Manage external log services.",
1145
+ )
1146
+ operations = log_service.add_subparsers(dest="operation", required=True)
1147
+ _add_endpoint_command(
1148
+ operations,
1149
+ "list",
1150
+ "List group-level log services.",
1151
+ Endpoint("GET", "/v1/external-logging", query_args=("limit", "cursor"), paginated=True),
1152
+ pagination=True,
1153
+ )
1154
+ _add_endpoint_command(
1155
+ operations,
1156
+ "get",
1157
+ "Get group-level log service details.",
1158
+ Endpoint("GET", "/v1/external-logging/{log_id}", id_args=("log_id",)),
1159
+ arguments=(("log_id", "Log service ID."),),
1160
+ )
1161
+ _add_endpoint_command(
1162
+ operations,
1163
+ "create",
1164
+ "Create a group-level log service.",
1165
+ Endpoint("POST", "/v1/external-logging", body_required=True),
1166
+ body=True,
1167
+ body_required=True,
1168
+ )
1169
+ _add_endpoint_command(
1170
+ operations,
1171
+ "update",
1172
+ "Update a group-level log service.",
1173
+ Endpoint("PATCH", "/v1/external-logging/{log_id}", id_args=("log_id",), body_required=True),
1174
+ arguments=(("log_id", "Log service ID."),),
1175
+ body=True,
1176
+ body_required=True,
1177
+ )
1178
+ _add_endpoint_command(
1179
+ operations,
1180
+ "delete",
1181
+ "Delete a group-level log service.",
1182
+ Endpoint("DELETE", "/v1/external-logging/{log_id}", id_args=("log_id",), destructive=True),
1183
+ arguments=(("log_id", "Log service ID."),),
1184
+ destructive=True,
1185
+ )
1186
+ _add_endpoint_command(
1187
+ operations,
1188
+ "test",
1189
+ "Run group-level log service setup tests.",
1190
+ Endpoint("POST", "/v1/external-logging/{log_id}/test", id_args=("log_id",)),
1191
+ arguments=(("log_id", "Log service ID."),),
1192
+ )
1193
+ _add_log_service_account_commands(operations)
1194
+
1195
+
1196
+ def _add_log_service_account_commands(
1197
+ operations: argparse._SubParsersAction[argparse.ArgumentParser],
1198
+ ) -> None:
1199
+ account = operations.add_parser(
1200
+ "account",
1201
+ help="Manage the account-level log service.",
1202
+ description="Manage the account-level log service.",
1203
+ )
1204
+ account_ops = account.add_subparsers(dest="account_operation", required=True)
1205
+ _add_endpoint_command(
1206
+ account_ops,
1207
+ "get",
1208
+ "Get account-level log service details.",
1209
+ Endpoint("GET", "/v1/external-logging/account"),
1210
+ )
1211
+ _add_endpoint_command(
1212
+ account_ops,
1213
+ "create",
1214
+ "Create an account-level log service.",
1215
+ Endpoint("POST", "/v1/external-logging/account", body_required=True),
1216
+ body=True,
1217
+ body_required=True,
1218
+ )
1219
+ _add_endpoint_command(
1220
+ account_ops,
1221
+ "update",
1222
+ "Update the account-level log service.",
1223
+ Endpoint("PATCH", "/v1/external-logging/account", body_required=True),
1224
+ body=True,
1225
+ body_required=True,
1226
+ )
1227
+ _add_endpoint_command(
1228
+ account_ops,
1229
+ "delete",
1230
+ "Delete the account-level log service.",
1231
+ Endpoint("DELETE", "/v1/external-logging/account", destructive=True),
1232
+ destructive=True,
1233
+ )
1234
+
1235
+
993
1236
  def _add_hybrid_deployment_agent(
994
1237
  resources: argparse._SubParsersAction[argparse.ArgumentParser],
995
1238
  ) -> None:
@@ -1200,8 +1443,8 @@ def _add_private_link(resources: argparse._SubParsersAction[argparse.ArgumentPar
1200
1443
  def _add_transformation(resources: argparse._SubParsersAction[argparse.ArgumentParser]) -> None:
1201
1444
  transformation = resources.add_parser(
1202
1445
  "transformation",
1203
- help="List transformations.",
1204
- description="List transformations.",
1446
+ help="Manage transformations.",
1447
+ description="Manage transformations.",
1205
1448
  )
1206
1449
  operations = transformation.add_subparsers(dest="operation", required=True)
1207
1450
  _add_endpoint_command(
@@ -1211,6 +1454,222 @@ def _add_transformation(resources: argparse._SubParsersAction[argparse.ArgumentP
1211
1454
  Endpoint("GET", "/v1/transformations", query_args=("limit", "cursor"), paginated=True),
1212
1455
  pagination=True,
1213
1456
  )
1457
+ _add_endpoint_command(
1458
+ operations,
1459
+ "get",
1460
+ "Get a transformation.",
1461
+ Endpoint("GET", "/v1/transformations/{transformation_id}", id_args=("transformation_id",)),
1462
+ arguments=(("transformation_id", "Transformation ID."),),
1463
+ )
1464
+ _add_endpoint_command(
1465
+ operations,
1466
+ "create",
1467
+ "Create a transformation.",
1468
+ Endpoint("POST", "/v1/transformations", body_required=True),
1469
+ body=True,
1470
+ body_required=True,
1471
+ )
1472
+ _add_endpoint_command(
1473
+ operations,
1474
+ "update",
1475
+ "Update a transformation.",
1476
+ Endpoint(
1477
+ "PATCH",
1478
+ "/v1/transformations/{transformation_id}",
1479
+ id_args=("transformation_id",),
1480
+ body_required=True,
1481
+ ),
1482
+ arguments=(("transformation_id", "Transformation ID."),),
1483
+ body=True,
1484
+ body_required=True,
1485
+ )
1486
+ _add_endpoint_command(
1487
+ operations,
1488
+ "delete",
1489
+ "Delete a transformation.",
1490
+ Endpoint(
1491
+ "DELETE",
1492
+ "/v1/transformations/{transformation_id}",
1493
+ id_args=("transformation_id",),
1494
+ destructive=True,
1495
+ ),
1496
+ arguments=(("transformation_id", "Transformation ID."),),
1497
+ destructive=True,
1498
+ )
1499
+ _add_endpoint_command(
1500
+ operations,
1501
+ "run",
1502
+ "Run a transformation.",
1503
+ Endpoint("POST", "/v1/transformations/{transformation_id}/run", id_args=("transformation_id",)),
1504
+ arguments=(("transformation_id", "Transformation ID."),),
1505
+ )
1506
+ _add_endpoint_command(
1507
+ operations,
1508
+ "cancel",
1509
+ "Cancel a running transformation.",
1510
+ Endpoint("POST", "/v1/transformations/{transformation_id}/cancel", id_args=("transformation_id",)),
1511
+ arguments=(("transformation_id", "Transformation ID."),),
1512
+ )
1513
+ _add_endpoint_command(
1514
+ operations,
1515
+ "upgrade",
1516
+ "Upgrade a Quickstart transformation package.",
1517
+ Endpoint("POST", "/v1/transformations/{transformation_id}/upgrade", id_args=("transformation_id",)),
1518
+ arguments=(("transformation_id", "Transformation ID."),),
1519
+ )
1520
+ _add_transformation_package_metadata_commands(operations)
1521
+
1522
+
1523
+ def _add_transformation_package_metadata_commands(
1524
+ operations: argparse._SubParsersAction[argparse.ArgumentParser],
1525
+ ) -> None:
1526
+ metadata = operations.add_parser(
1527
+ "package-metadata",
1528
+ help="Retrieve Quickstart transformation package metadata.",
1529
+ description="Retrieve Quickstart transformation package metadata.",
1530
+ )
1531
+ metadata_ops = metadata.add_subparsers(dest="package_metadata_operation", required=True)
1532
+ _add_endpoint_command(
1533
+ metadata_ops,
1534
+ "list",
1535
+ "List Quickstart transformation package metadata.",
1536
+ Endpoint("GET", "/v1/transformations/package-metadata"),
1537
+ )
1538
+ _add_endpoint_command(
1539
+ metadata_ops,
1540
+ "get",
1541
+ "Get Quickstart transformation package metadata.",
1542
+ Endpoint(
1543
+ "GET",
1544
+ "/v1/transformations/package-metadata/{package_definition_id}",
1545
+ id_args=("package_definition_id",),
1546
+ ),
1547
+ arguments=(("package_definition_id", "Package definition ID."),),
1548
+ )
1549
+
1550
+
1551
+ def _add_transformation_project(resources: argparse._SubParsersAction[argparse.ArgumentParser]) -> None:
1552
+ project = resources.add_parser(
1553
+ "transformation-project",
1554
+ help="Manage transformation projects.",
1555
+ description="Manage transformation projects.",
1556
+ )
1557
+ operations = project.add_subparsers(dest="operation", required=True)
1558
+ _add_endpoint_command(
1559
+ operations,
1560
+ "list",
1561
+ "List transformation projects.",
1562
+ Endpoint("GET", "/v1/transformation-projects", query_args=("limit", "cursor"), paginated=True),
1563
+ pagination=True,
1564
+ )
1565
+ _add_endpoint_command(
1566
+ operations,
1567
+ "get",
1568
+ "Get a transformation project.",
1569
+ Endpoint("GET", "/v1/transformation-projects/{project_id}", id_args=("project_id",)),
1570
+ arguments=(("project_id", "Transformation project ID."),),
1571
+ )
1572
+ _add_endpoint_command(
1573
+ operations,
1574
+ "create",
1575
+ "Create a transformation project.",
1576
+ Endpoint("POST", "/v1/transformation-projects", body_required=True),
1577
+ body=True,
1578
+ body_required=True,
1579
+ )
1580
+ _add_endpoint_command(
1581
+ operations,
1582
+ "update",
1583
+ "Update a transformation project.",
1584
+ Endpoint("PATCH", "/v1/transformation-projects/{project_id}", id_args=("project_id",), body_required=True),
1585
+ arguments=(("project_id", "Transformation project ID."),),
1586
+ body=True,
1587
+ body_required=True,
1588
+ )
1589
+ _add_endpoint_command(
1590
+ operations,
1591
+ "delete",
1592
+ "Delete a transformation project.",
1593
+ Endpoint(
1594
+ "DELETE",
1595
+ "/v1/transformation-projects/{project_id}",
1596
+ id_args=("project_id",),
1597
+ destructive=True,
1598
+ ),
1599
+ arguments=(("project_id", "Transformation project ID."),),
1600
+ destructive=True,
1601
+ )
1602
+ _add_endpoint_command(
1603
+ operations,
1604
+ "test",
1605
+ "Run transformation project setup tests.",
1606
+ Endpoint("POST", "/v1/transformation-projects/{project_id}/test", id_args=("project_id",)),
1607
+ arguments=(("project_id", "Transformation project ID."),),
1608
+ )
1609
+
1610
+
1611
+ def _add_webhook(resources: argparse._SubParsersAction[argparse.ArgumentParser]) -> None:
1612
+ webhook = resources.add_parser(
1613
+ "webhook",
1614
+ help="Manage webhooks.",
1615
+ description="Manage webhooks.",
1616
+ )
1617
+ operations = webhook.add_subparsers(dest="operation", required=True)
1618
+ _add_endpoint_command(
1619
+ operations,
1620
+ "list",
1621
+ "List webhooks.",
1622
+ Endpoint("GET", "/v1/webhooks", query_args=("limit", "cursor"), paginated=True),
1623
+ pagination=True,
1624
+ )
1625
+ _add_endpoint_command(
1626
+ operations,
1627
+ "get",
1628
+ "Get webhook details.",
1629
+ Endpoint("GET", "/v1/webhooks/{webhook_id}", id_args=("webhook_id",)),
1630
+ arguments=(("webhook_id", "Webhook ID."),),
1631
+ )
1632
+ _add_endpoint_command(
1633
+ operations,
1634
+ "create-account",
1635
+ "Create an account-level webhook.",
1636
+ Endpoint("POST", "/v1/webhooks/account", body_required=True),
1637
+ body=True,
1638
+ body_required=True,
1639
+ )
1640
+ _add_endpoint_command(
1641
+ operations,
1642
+ "create-group",
1643
+ "Create a group-level webhook.",
1644
+ Endpoint("POST", "/v1/webhooks/group/{group_id}", id_args=("group_id",), body_required=True),
1645
+ arguments=(("group_id", "Group ID."),),
1646
+ body=True,
1647
+ body_required=True,
1648
+ )
1649
+ _add_endpoint_command(
1650
+ operations,
1651
+ "update",
1652
+ "Update a webhook.",
1653
+ Endpoint("PATCH", "/v1/webhooks/{webhook_id}", id_args=("webhook_id",), body_required=True),
1654
+ arguments=(("webhook_id", "Webhook ID."),),
1655
+ body=True,
1656
+ body_required=True,
1657
+ )
1658
+ _add_endpoint_command(
1659
+ operations,
1660
+ "delete",
1661
+ "Delete a webhook.",
1662
+ Endpoint("DELETE", "/v1/webhooks/{webhook_id}", id_args=("webhook_id",), destructive=True),
1663
+ arguments=(("webhook_id", "Webhook ID."),),
1664
+ destructive=True,
1665
+ )
1666
+ _add_endpoint_command(
1667
+ operations,
1668
+ "test",
1669
+ "Send a test event to a webhook.",
1670
+ Endpoint("POST", "/v1/webhooks/{webhook_id}/test", id_args=("webhook_id",)),
1671
+ arguments=(("webhook_id", "Webhook ID."),),
1672
+ )
1214
1673
 
1215
1674
 
1216
1675
  def _add_account_role_remove(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fivetran-cli
3
- Version: 0.1.7
3
+ Version: 0.1.9
4
4
  Summary: Command line wrapper for the Fivetran REST API and Connector SDK
5
5
  Author: Fivetran
6
6
  License-Expression: MIT
@@ -77,8 +77,13 @@ Destructive commands require `--yes` in non-interactive mode.
77
77
  Core resources:
78
78
 
79
79
  - `account get`
80
+ - `certificate connection list|get|approve|revoke`
81
+ - `certificate destination list|get|approve|revoke`
80
82
  - `connection list|get|create|update|delete|sync|resync|test`
83
+ - `connector-sdk-package list|get|delete`
81
84
  - `destination list|get|create|update|delete|test`
85
+ - `fingerprint connection list|get|approve|revoke`
86
+ - `fingerprint destination list|get|approve|revoke`
82
87
  - `group list|get|create|update|delete`
83
88
  - `group connection list`
84
89
  - `group user list|add|remove`
@@ -111,13 +116,18 @@ Schemas and metadata:
111
116
  Networking:
112
117
 
113
118
  - `hybrid-deployment-agent list|get|create|delete|regenerate-auth|reset-credentials`
119
+ - `log-service list|get|create|update|delete|test`
120
+ - `log-service account get|create|update|delete`
114
121
  - `proxy-agent list|get|create|delete|regenerate-secrets`
115
122
  - `proxy-agent connection list`
116
123
  - `private-link list|get|create|update|delete`
124
+ - `webhook list|get|create-account|create-group|update|delete|test`
117
125
 
118
126
  Transformations:
119
127
 
120
- - `transformation list`
128
+ - `transformation list|get|create|update|delete|run|cancel|upgrade`
129
+ - `transformation package-metadata list|get`
130
+ - `transformation-project list|get|create|update|delete|test`
121
131
 
122
132
  Connector SDK:
123
133
 
@@ -133,55 +143,10 @@ Connector SDK commands are provided by `fivetran-connector-sdk` and remain at th
133
143
 
134
144
  ## Not Included Yet
135
145
 
136
- These API areas are still intentionally not implemented:
146
+ The remaining gaps are intentionally limited to endpoints that need behavior beyond the generic JSON request/response wrapper, or endpoints whose user-facing command shape needs more validation before release.
137
147
 
138
- - Certificates and fingerprints
139
- - REST API endpoints for Connector SDK package upload/download
140
- - Log services
141
- - Webhooks
142
- - Transformation create/get/update/delete/run/cancel/upgrade
143
- - Transformation package metadata
144
- - Transformation projects
148
+ - Connector SDK package create/update/download, because those require file upload/download handling rather than JSON-only request bodies.
145
149
  - Hub registration
146
150
  - Group destination listing, pending confirmation of a supported REST endpoint
147
151
  - Interactive connector setup workflows
148
- - File upload/download handling for Connector SDK packages
149
152
  - High-quality resource-specific pretty views beyond the generic renderer
150
-
151
- ## Build And Publish
152
-
153
- Package artifacts are controlled by `pyproject.toml` and `MANIFEST.in`. The source distribution intentionally excludes local agent/project-planning files:
154
-
155
- - `AGENTS.md`
156
- - `plans/`
157
-
158
- Install local packaging tools with `pipx`:
159
-
160
- ```bash
161
- pipx install build
162
- pipx install twine
163
- ```
164
-
165
- This exposes `pyproject-build` and `twine` on your PATH. If you install these tools into a virtual environment instead, use `python3 -m build` and `python3 -m twine` in place of the commands below.
166
-
167
- Build source and wheel distributions:
168
-
169
- ```bash
170
- pyproject-build
171
- ```
172
-
173
- Validate the generated artifacts:
174
-
175
- ```bash
176
- twine check dist/*
177
- ```
178
-
179
- Upload to PyPI:
180
-
181
- ```bash
182
- twine upload dist/*
183
- ```
184
-
185
- This upload command assumes `~/.pypirc` is configured with the `pypi` repository. If `~/.pypirc` is not configured, set `TWINE_USERNAME=__token__` and `TWINE_PASSWORD=<api-token>` before running `twine upload`.
186
-
187
- PyPI files are immutable for a published version. If an upload is wrong, bump the version in `pyproject.toml`, rebuild, re-check, and upload the new version.
@@ -540,6 +540,120 @@ class CliTests(unittest.TestCase):
540
540
  self.assertEqual(client.calls[0][0:2], ("GET", "/v1/transformations"))
541
541
  self.assertEqual(json.loads(stdout)["data"]["items"], [{"id": "one"}, {"id": "two"}])
542
542
 
543
+ def test_transformation_actions_map_paths(self):
544
+ code, _, stderr, client = self.run_cli(
545
+ ["--api-key", "key", "transformation", "run", "transformation_id"]
546
+ )
547
+
548
+ self.assertEqual(code, 0, stderr)
549
+ self.assertEqual(client.calls[0][0:2], ("POST", "/v1/transformations/transformation_id/run"))
550
+
551
+ def test_transformation_package_metadata_get_maps_path(self):
552
+ code, _, stderr, client = self.run_cli(
553
+ [
554
+ "--api-key",
555
+ "key",
556
+ "transformation",
557
+ "package-metadata",
558
+ "get",
559
+ "package_definition_id",
560
+ ]
561
+ )
562
+
563
+ self.assertEqual(code, 0, stderr)
564
+ self.assertEqual(
565
+ client.calls[0][0:2],
566
+ ("GET", "/v1/transformations/package-metadata/package_definition_id"),
567
+ )
568
+
569
+ def test_transformation_project_update_maps_patch_body(self):
570
+ code, _, stderr, client = self.run_cli(
571
+ [
572
+ "--api-key",
573
+ "key",
574
+ "transformation-project",
575
+ "update",
576
+ "project_id",
577
+ "--data",
578
+ '{"paused":true}',
579
+ ]
580
+ )
581
+
582
+ self.assertEqual(code, 0, stderr)
583
+ self.assertEqual(client.calls[0][0:2], ("PATCH", "/v1/transformation-projects/project_id"))
584
+ self.assertEqual(client.calls[0][3], {"paused": True})
585
+
586
+ def test_webhook_create_group_maps_nested_path(self):
587
+ code, _, stderr, client = self.run_cli(
588
+ [
589
+ "--api-key",
590
+ "key",
591
+ "webhook",
592
+ "create-group",
593
+ "group_id",
594
+ "--data",
595
+ '{"url":"https://example.test/webhook"}',
596
+ ]
597
+ )
598
+
599
+ self.assertEqual(code, 0, stderr)
600
+ self.assertEqual(client.calls[0][0:2], ("POST", "/v1/webhooks/group/group_id"))
601
+ self.assertEqual(client.calls[0][3], {"url": "https://example.test/webhook"})
602
+
603
+ def test_log_service_account_get_maps_path(self):
604
+ code, _, stderr, client = self.run_cli(
605
+ ["--api-key", "key", "log-service", "account", "get"]
606
+ )
607
+
608
+ self.assertEqual(code, 0, stderr)
609
+ self.assertEqual(client.calls[0][0:2], ("GET", "/v1/external-logging/account"))
610
+
611
+ def test_connector_sdk_package_delete_requires_confirmation(self):
612
+ code, _, stderr, client = self.run_cli(
613
+ ["--api-key", "key", "connector-sdk-package", "delete", "package_id", "--yes"]
614
+ )
615
+
616
+ self.assertEqual(code, 0, stderr)
617
+ self.assertEqual(client.calls[0][0:2], ("DELETE", "/v1/connector-sdk/packages/package_id"))
618
+
619
+ def test_certificate_destination_approve_maps_scoped_path(self):
620
+ code, _, stderr, client = self.run_cli(
621
+ [
622
+ "--api-key",
623
+ "key",
624
+ "certificate",
625
+ "destination",
626
+ "approve",
627
+ "destination_id",
628
+ "--data",
629
+ '{"hash":"abc"}',
630
+ ]
631
+ )
632
+
633
+ self.assertEqual(code, 0, stderr)
634
+ self.assertEqual(client.calls[0][0:2], ("POST", "/v1/destinations/destination_id/certificates"))
635
+ self.assertEqual(client.calls[0][3], {"hash": "abc"})
636
+
637
+ def test_fingerprint_connection_revoke_maps_scoped_path(self):
638
+ code, _, stderr, client = self.run_cli(
639
+ [
640
+ "--api-key",
641
+ "key",
642
+ "fingerprint",
643
+ "connection",
644
+ "revoke",
645
+ "connection_id",
646
+ "hash/value",
647
+ "--yes",
648
+ ]
649
+ )
650
+
651
+ self.assertEqual(code, 0, stderr)
652
+ self.assertEqual(
653
+ client.calls[0][0:2],
654
+ ("DELETE", "/v1/connections/connection_id/fingerprints/hash%2Fvalue"),
655
+ )
656
+
543
657
 
544
658
  if __name__ == "__main__":
545
659
  unittest.main()
File without changes
File without changes