@pantechdynamic/sdk 0.4.0 → 0.6.0
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/CHANGELOG.md +45 -0
- package/README.md +144 -10
- package/dist/index.cjs +483 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18209 -10769
- package/dist/index.d.ts +18209 -10769
- package/dist/index.js +483 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -327,7 +327,7 @@ async function* paginate(fetchPage, startCursor) {
|
|
|
327
327
|
}
|
|
328
328
|
|
|
329
329
|
// src/resource.ts
|
|
330
|
-
var SECRET_FIELDS = ["secret", "private_key_pem"];
|
|
330
|
+
var SECRET_FIELDS = ["secret", "private_key_pem", "secret_access_key"];
|
|
331
331
|
function hideSecrets(value) {
|
|
332
332
|
if (value && typeof value === "object") {
|
|
333
333
|
for (const field of SECRET_FIELDS) {
|
|
@@ -702,6 +702,12 @@ var Databases = class extends APIResource {
|
|
|
702
702
|
resizeStorage(databaseId, body, options) {
|
|
703
703
|
return this._post(path`/databases/${databaseId}/resize-storage`, body, options);
|
|
704
704
|
}
|
|
705
|
+
getSnapshotSchedule(databaseId, options) {
|
|
706
|
+
return this._get(path`/databases/${databaseId}/snapshot-schedule`, void 0, options);
|
|
707
|
+
}
|
|
708
|
+
setSnapshotSchedule(databaseId, body, options) {
|
|
709
|
+
return this._put(path`/databases/${databaseId}/snapshot-schedule`, body, options);
|
|
710
|
+
}
|
|
705
711
|
};
|
|
706
712
|
var DatabaseSnapshots = class extends APIResource {
|
|
707
713
|
list(databaseId, params = {}, options) {
|
|
@@ -903,13 +909,18 @@ var Domains = class extends APIResource {
|
|
|
903
909
|
}
|
|
904
910
|
/**
|
|
905
911
|
* Buys the domain for `years` (1 to 10), paid from your credit first; a
|
|
906
|
-
* failed order is refunded. `accept_terms` must be true
|
|
907
|
-
*
|
|
912
|
+
* failed order is refunded. `accept_terms` must be true: the registrant has
|
|
913
|
+
* accepted the Domain Registration Agreement
|
|
914
|
+
* (https://pantechdynamics.com/legal/domain-registration). Follow the order with
|
|
915
|
+
* `orders.wait(result)`.
|
|
908
916
|
*/
|
|
909
917
|
register(body, options) {
|
|
910
918
|
return this._post("/domains", body, options);
|
|
911
919
|
}
|
|
912
|
-
/**
|
|
920
|
+
/**
|
|
921
|
+
* Moves a domain to Pantech with its auth code, adding `years` to its term.
|
|
922
|
+
* `accept_terms` must be true, as for `register`. Follow it with `orders.wait`.
|
|
923
|
+
*/
|
|
913
924
|
transfer(body, options) {
|
|
914
925
|
return this._post("/domains/transfers", body, options);
|
|
915
926
|
}
|
|
@@ -1144,6 +1155,8 @@ var Instances = class extends APIResource {
|
|
|
1144
1155
|
snapshots = new InstanceSnapshots(this._client);
|
|
1145
1156
|
/** Short-lived SSH access grants through the browser terminal relay. */
|
|
1146
1157
|
sshAccess = new InstanceSshAccess(this._client);
|
|
1158
|
+
/** Dynamic IP: a public outbound address that rotates on a schedule or on demand. */
|
|
1159
|
+
dynamicIp = new InstanceDynamicIp(this._client);
|
|
1147
1160
|
/** One page of your instances. */
|
|
1148
1161
|
list(params = {}, options) {
|
|
1149
1162
|
return this._get("/instances", params, options);
|
|
@@ -1251,6 +1264,24 @@ var InstanceSshAccess = class extends APIResource {
|
|
|
1251
1264
|
return this._delete(path`/instances/${instanceId}/ssh-access/${grantId}`, options);
|
|
1252
1265
|
}
|
|
1253
1266
|
};
|
|
1267
|
+
var InstanceDynamicIp = class extends APIResource {
|
|
1268
|
+
/** Whether the instance has a dynamic IP, its schedule, current address and recent changes. */
|
|
1269
|
+
get(instanceId, options) {
|
|
1270
|
+
return this._get(path`/instances/${instanceId}/address-rotation`, void 0, options);
|
|
1271
|
+
}
|
|
1272
|
+
/** Turns on or changes dynamic IP settings for the instance. */
|
|
1273
|
+
set(instanceId, body, options) {
|
|
1274
|
+
return this._put(path`/instances/${instanceId}/address-rotation`, body, options);
|
|
1275
|
+
}
|
|
1276
|
+
/** Turns off dynamic IP for the instance and stops its surcharge. */
|
|
1277
|
+
disable(instanceId, options) {
|
|
1278
|
+
return this._delete(path`/instances/${instanceId}/address-rotation`, options);
|
|
1279
|
+
}
|
|
1280
|
+
/** Gives the instance a new dynamic IP now, outside its schedule. Sent once: the API does not replay it. */
|
|
1281
|
+
rotate(instanceId, options) {
|
|
1282
|
+
return this._post(path`/instances/${instanceId}/address-rotation/rotate`, void 0, options, { noRetry: true });
|
|
1283
|
+
}
|
|
1284
|
+
};
|
|
1254
1285
|
var InstanceOrders = class extends APIResource {
|
|
1255
1286
|
list(params = {}, options) {
|
|
1256
1287
|
return this._get("/instance-orders", params, options);
|
|
@@ -1425,12 +1456,33 @@ function cloudFailed(kind, id, failure, resource) {
|
|
|
1425
1456
|
);
|
|
1426
1457
|
}
|
|
1427
1458
|
var Migrate = class extends APIResource {
|
|
1428
|
-
/**
|
|
1459
|
+
/** The clouds Migrate can connect, and how it reads each. */
|
|
1460
|
+
providers = new CloudProviders(this._client);
|
|
1461
|
+
/** Read-only connections to your accounts in other clouds. */
|
|
1429
1462
|
connections = new CloudConnections(this._client);
|
|
1430
|
-
/** Reads of everything a connection
|
|
1463
|
+
/** Reads of everything a connection can see. */
|
|
1431
1464
|
scans = new CloudScans(this._client);
|
|
1432
|
-
/** Plans to move what a scan found to Pantech. Nothing is created until you apply the Terraform. */
|
|
1465
|
+
/** Plans to move what a scan found to Pantech. Nothing is created until you apply the Terraform or start a copy. */
|
|
1433
1466
|
migrations = new Migrations(this._client);
|
|
1467
|
+
/** A connection's opt-in copy access: the buckets Pantech may copy, through a separate copy role. */
|
|
1468
|
+
copyAccess = new CopyAccessResource(this._client);
|
|
1469
|
+
/** Copies of a source bucket's objects into a Pantech bucket. */
|
|
1470
|
+
bucketImports = new BucketImports(this._client);
|
|
1471
|
+
/** Copies of a planned server's disks into a new Pantech instance. */
|
|
1472
|
+
serverCopies = new ServerCopies(this._client);
|
|
1473
|
+
/** Moves of a planned database into one of your Pantech databases, through the Migrate agent. */
|
|
1474
|
+
databaseImports = new DatabaseImports(this._client);
|
|
1475
|
+
/** Moves of a planned Kubernetes cluster into one of your Pantech clusters. */
|
|
1476
|
+
kubernetesMoves = new KubernetesMoves(this._client);
|
|
1477
|
+
};
|
|
1478
|
+
var CloudProviders = class extends APIResource {
|
|
1479
|
+
/**
|
|
1480
|
+
* Every cloud Migrate can connect: how it reads each (`federated` or
|
|
1481
|
+
* `agent`), and whether a scan reads its spend and its people.
|
|
1482
|
+
*/
|
|
1483
|
+
list(options) {
|
|
1484
|
+
return this._get("/cloud-providers", void 0, options);
|
|
1485
|
+
}
|
|
1434
1486
|
};
|
|
1435
1487
|
var CloudConnections = class extends APIResource {
|
|
1436
1488
|
list(params = {}, options) {
|
|
@@ -1440,9 +1492,13 @@ var CloudConnections = class extends APIResource {
|
|
|
1440
1492
|
return this._listAll("/cloud-connections", params, options);
|
|
1441
1493
|
}
|
|
1442
1494
|
/**
|
|
1443
|
-
* Starts a connection
|
|
1495
|
+
* Starts a connection to `provider` (`aws` when left out). Its `setup` says
|
|
1496
|
+
* what to run in your cloud: for AWS, the CloudFormation template (and,
|
|
1444
1497
|
* when offered, a one-click `quick_create_url`) that creates the read-only
|
|
1445
|
-
* role
|
|
1498
|
+
* role, whose `RoleArn` output you send with `update`; for Google Cloud,
|
|
1499
|
+
* Azure and Huawei Cloud, a script whose output you send as `gcp`, `azure`
|
|
1500
|
+
* or `huawei` with `update`; for agent providers, how to make a read-only
|
|
1501
|
+
* token, then `enrollAgent`.
|
|
1446
1502
|
*/
|
|
1447
1503
|
create(body, options) {
|
|
1448
1504
|
return this._post("/cloud-connections", body, options);
|
|
@@ -1450,7 +1506,10 @@ var CloudConnections = class extends APIResource {
|
|
|
1450
1506
|
get(connectionId, options) {
|
|
1451
1507
|
return this._get(path`/cloud-connections/${connectionId}`, void 0, options);
|
|
1452
1508
|
}
|
|
1453
|
-
/**
|
|
1509
|
+
/**
|
|
1510
|
+
* Renames the connection, sets its `role_arn` (AWS) or its `gcp`, `azure`
|
|
1511
|
+
* or `huawei` federation details, or retries a failed check (`retry: true`).
|
|
1512
|
+
*/
|
|
1454
1513
|
update(connectionId, body, options) {
|
|
1455
1514
|
return this._patch(path`/cloud-connections/${connectionId}`, body, options);
|
|
1456
1515
|
}
|
|
@@ -1458,10 +1517,26 @@ var CloudConnections = class extends APIResource {
|
|
|
1458
1517
|
delete(connectionId, options) {
|
|
1459
1518
|
return this._delete(path`/cloud-connections/${connectionId}`, options);
|
|
1460
1519
|
}
|
|
1520
|
+
/**
|
|
1521
|
+
* For a connection read by the Pantech Migrate agent: a one-time enrollment
|
|
1522
|
+
* code, valid once for an hour and shown only in this response. Run its
|
|
1523
|
+
* `enroll_command` where the agent will run. Each call issues a new code
|
|
1524
|
+
* (replacing any unused one), so it is sent once and not retried.
|
|
1525
|
+
*/
|
|
1526
|
+
enrollAgent(connectionId, options) {
|
|
1527
|
+
return this._post(path`/cloud-connections/${connectionId}/agent-enrollments`, void 0, options, {
|
|
1528
|
+
noRetry: true
|
|
1529
|
+
});
|
|
1530
|
+
}
|
|
1531
|
+
/** Ends the connection's agent at once; the connection waits for a new one. Revoking again changes nothing. */
|
|
1532
|
+
revokeAgent(connectionId, options) {
|
|
1533
|
+
return this._delete(path`/cloud-connections/${connectionId}/agent`, options);
|
|
1534
|
+
}
|
|
1461
1535
|
/**
|
|
1462
1536
|
* Polls the connection until it is `connected` (resolves with it) or its
|
|
1463
|
-
* check fails (rejects with CloudFailedError). Set the role ARN
|
|
1464
|
-
* `update
|
|
1537
|
+
* check fails (rejects with CloudFailedError). Set the role ARN or the
|
|
1538
|
+
* federation details with `update`, or enroll the agent, first. Default
|
|
1539
|
+
* timeout 10 minutes, polling every 5 seconds.
|
|
1465
1540
|
*/
|
|
1466
1541
|
wait(connectionId, options = {}) {
|
|
1467
1542
|
return poll(
|
|
@@ -1539,6 +1614,199 @@ var Migrations = class extends APIResource {
|
|
|
1539
1614
|
exportTerraform(migrationId, options) {
|
|
1540
1615
|
return this._get(path`/migrations/${migrationId}/terraform`, void 0, options);
|
|
1541
1616
|
}
|
|
1617
|
+
/**
|
|
1618
|
+
* Sends Pantech invites to the people the plan lists (items of kind
|
|
1619
|
+
* `user`), by key, each with its item's role. Safe to repeat: anyone
|
|
1620
|
+
* already invited or already a member is reported, never invited twice.
|
|
1621
|
+
*/
|
|
1622
|
+
sendInvites(migrationId, body, options) {
|
|
1623
|
+
return this._post(path`/migrations/${migrationId}/invites`, body, options);
|
|
1624
|
+
}
|
|
1625
|
+
};
|
|
1626
|
+
var CopyAccessResource = class extends APIResource {
|
|
1627
|
+
/** The connection's copy access: the chosen buckets, the copy role and its last verification, and its template. */
|
|
1628
|
+
get(connectionId, options) {
|
|
1629
|
+
return this._get(path`/cloud-connections/${connectionId}/copy-access`, void 0, options);
|
|
1630
|
+
}
|
|
1631
|
+
/**
|
|
1632
|
+
* Chooses the buckets Pantech may copy (`buckets`, needed the first time)
|
|
1633
|
+
* and returns the CloudFormation template for a copy role that may read
|
|
1634
|
+
* only those. Deploy it, then set `role_arn` to its `CopyRoleArn` output;
|
|
1635
|
+
* `retry: true` verifies again.
|
|
1636
|
+
*/
|
|
1637
|
+
set(connectionId, body, options) {
|
|
1638
|
+
return this._put(path`/cloud-connections/${connectionId}/copy-access`, body, options);
|
|
1639
|
+
}
|
|
1640
|
+
};
|
|
1641
|
+
var BucketImports = class extends APIResource {
|
|
1642
|
+
/** The organization's bucket imports, newest first. */
|
|
1643
|
+
list(params = {}, options) {
|
|
1644
|
+
return this._get("/bucket-imports", params, options);
|
|
1645
|
+
}
|
|
1646
|
+
listAll(params = {}, options) {
|
|
1647
|
+
return this._listAll("/bucket-imports", params, options);
|
|
1648
|
+
}
|
|
1649
|
+
/**
|
|
1650
|
+
* Copies one source bucket (with verified copy access) into a new Pantech
|
|
1651
|
+
* bucket (`destination_bucket_name`) or one you have (`destination_bucket_id`).
|
|
1652
|
+
* Nothing is deleted on either side. Follow it with `get`.
|
|
1653
|
+
*/
|
|
1654
|
+
start(body, options) {
|
|
1655
|
+
return this._post("/bucket-imports", body, options);
|
|
1656
|
+
}
|
|
1657
|
+
/** An import's status and progress, the first objects that failed it, and its audit trail. */
|
|
1658
|
+
get(importId, options) {
|
|
1659
|
+
return this._get(path`/bucket-imports/${importId}`, void 0, options);
|
|
1660
|
+
}
|
|
1661
|
+
/** Stops the import: a queued one at once, a running one at its next checkpoint. Objects already copied stay. */
|
|
1662
|
+
cancel(importId, options) {
|
|
1663
|
+
return this._post(path`/bucket-imports/${importId}/cancel`, void 0, options);
|
|
1664
|
+
}
|
|
1665
|
+
/**
|
|
1666
|
+
* Queues another pass that copies only what changed. `mirror_deletes: true`
|
|
1667
|
+
* (that pass only, needs the `delete` scope) also deletes the objects this
|
|
1668
|
+
* import copied that the source no longer has.
|
|
1669
|
+
*/
|
|
1670
|
+
resync(importId, body = {}, options) {
|
|
1671
|
+
return this._post(path`/bucket-imports/${importId}/resync`, body, options);
|
|
1672
|
+
}
|
|
1673
|
+
};
|
|
1674
|
+
var ServerCopies = class extends APIResource {
|
|
1675
|
+
/** Every server copy in your organization, newest first, with its progress. */
|
|
1676
|
+
list(params = {}, options) {
|
|
1677
|
+
return this._get("/server-copies", params, options);
|
|
1678
|
+
}
|
|
1679
|
+
listAll(params = {}, options) {
|
|
1680
|
+
return this._listAll("/server-copies", params, options);
|
|
1681
|
+
}
|
|
1682
|
+
/**
|
|
1683
|
+
* Starts copying one planned server's disks (`item_key`) into a new Pantech
|
|
1684
|
+
* instance. The first pass copies every disk; `sync` copies what changed and
|
|
1685
|
+
* `cutOver` runs the last pass and builds the instance. `source` is `agent`
|
|
1686
|
+
* (the default) or `aws_snapshot`, with a copy role from `getTemplate`.
|
|
1687
|
+
*/
|
|
1688
|
+
start(migrationId, body, options) {
|
|
1689
|
+
return this._post(path`/migrations/${migrationId}/server-copies`, body, options);
|
|
1690
|
+
}
|
|
1691
|
+
/**
|
|
1692
|
+
* The CloudFormation template of the AWS copy role for one planned server
|
|
1693
|
+
* (`item_key`); with `create_snapshots: true` it may also snapshot that
|
|
1694
|
+
* server's own volumes.
|
|
1695
|
+
*/
|
|
1696
|
+
getTemplate(migrationId, params, options) {
|
|
1697
|
+
return this._get(path`/migrations/${migrationId}/server-copy-template`, params, options);
|
|
1698
|
+
}
|
|
1699
|
+
/** A copy's status, pre-flight findings, running pass and progress, and the instance once it is being created. */
|
|
1700
|
+
get(copyId, options) {
|
|
1701
|
+
return this._get(path`/server-copies/${copyId}`, void 0, options);
|
|
1702
|
+
}
|
|
1703
|
+
/** Asks for a pass that copies only what changed. An AWS copy that makes no snapshots names each disk's new one in `snapshots`. */
|
|
1704
|
+
sync(copyId, body = {}, options) {
|
|
1705
|
+
return this._post(path`/server-copies/${copyId}/sync`, body, options);
|
|
1706
|
+
}
|
|
1707
|
+
/** Asks for the last pass, then builds the instance. Stop the application first. */
|
|
1708
|
+
cutOver(copyId, body = {}, options) {
|
|
1709
|
+
return this._post(path`/server-copies/${copyId}/cutover`, body, options);
|
|
1710
|
+
}
|
|
1711
|
+
/** Stops the copy and deletes what Pantech staged for it. Refused once the instance is being created. */
|
|
1712
|
+
cancel(copyId, body = {}, options) {
|
|
1713
|
+
return this._post(path`/server-copies/${copyId}/cancel`, body, options);
|
|
1714
|
+
}
|
|
1715
|
+
};
|
|
1716
|
+
var DatabaseImports = class extends APIResource {
|
|
1717
|
+
/** Your organization's database imports, newest first, without their tables. */
|
|
1718
|
+
list(params = {}, options) {
|
|
1719
|
+
return this._get("/database-imports", params, options);
|
|
1720
|
+
}
|
|
1721
|
+
listAll(params = {}, options) {
|
|
1722
|
+
return this._listAll("/database-imports", params, options);
|
|
1723
|
+
}
|
|
1724
|
+
/**
|
|
1725
|
+
* Starts moving one of the plan's databases (`item_key`) into one of your
|
|
1726
|
+
* Pantech databases, through the Migrate agent, which keeps the source's
|
|
1727
|
+
* credentials. `dump` copies once; `replicate` (PostgreSQL) follows changes
|
|
1728
|
+
* until you cut over.
|
|
1729
|
+
*/
|
|
1730
|
+
start(migrationId, body, options) {
|
|
1731
|
+
return this._post(path`/migrations/${migrationId}/database-imports`, body, options);
|
|
1732
|
+
}
|
|
1733
|
+
/** An import with its readiness report, per-table progress and verification. */
|
|
1734
|
+
get(importId, options) {
|
|
1735
|
+
return this._get(path`/database-imports/${importId}`, void 0, options);
|
|
1736
|
+
}
|
|
1737
|
+
/** Runs the pre-flight again, for example after fixing what it reported. Allowed before the copy starts. */
|
|
1738
|
+
checkReadiness(importId, options) {
|
|
1739
|
+
return this._post(path`/database-imports/${importId}/readiness`, void 0, options);
|
|
1740
|
+
}
|
|
1741
|
+
/** Finishes the import. For `replicate`, stop writes to the source first. */
|
|
1742
|
+
cutOver(importId, options) {
|
|
1743
|
+
return this._post(path`/database-imports/${importId}/cutover`, void 0, options);
|
|
1744
|
+
}
|
|
1745
|
+
/** Stops the import and removes its access to your Pantech database. What was copied stays. */
|
|
1746
|
+
cancel(importId, options) {
|
|
1747
|
+
return this._post(path`/database-imports/${importId}/cancel`, void 0, options);
|
|
1748
|
+
}
|
|
1749
|
+
/** Removes the import's login and access from your Pantech database now, keeping the data. */
|
|
1750
|
+
revokeAccess(importId, options) {
|
|
1751
|
+
return this._post(path`/database-imports/${importId}/revoke-access`, void 0, options);
|
|
1752
|
+
}
|
|
1753
|
+
};
|
|
1754
|
+
var KubernetesMoves = class extends APIResource {
|
|
1755
|
+
/** Your organization's moves, newest first, without their resources and volumes. */
|
|
1756
|
+
list(params = {}, options) {
|
|
1757
|
+
return this._get("/kubernetes-moves", params, options);
|
|
1758
|
+
}
|
|
1759
|
+
listAll(params = {}, options) {
|
|
1760
|
+
return this._listAll("/kubernetes-moves", params, options);
|
|
1761
|
+
}
|
|
1762
|
+
/**
|
|
1763
|
+
* Starts moving a plan's `kubernetes_cluster` item into one of your running
|
|
1764
|
+
* Pantech clusters. Secrets move only with `include_secrets`, volume data
|
|
1765
|
+
* only with `copy_volumes`. Then `preview`, `apply`, and `cutOver`.
|
|
1766
|
+
*/
|
|
1767
|
+
start(migrationId, body, options) {
|
|
1768
|
+
return this._post(path`/migrations/${migrationId}/kubernetes-moves`, body, options);
|
|
1769
|
+
}
|
|
1770
|
+
/** The manifests to apply to the source cluster: a read-only reader, and optional Secrets reader and volume copier roles. */
|
|
1771
|
+
getSourceAccess(options) {
|
|
1772
|
+
return this._get("/kubernetes-moves/source-access", void 0, options);
|
|
1773
|
+
}
|
|
1774
|
+
/** A move with its report: every source object and what the move does with it, the volumes, images and held workloads. */
|
|
1775
|
+
get(moveId, options) {
|
|
1776
|
+
return this._get(path`/kubernetes-moves/${moveId}`, void 0, options);
|
|
1777
|
+
}
|
|
1778
|
+
/** Queues a server-side dry run against the target cluster. `allow_privileged` names refused workloads to include anyway. */
|
|
1779
|
+
preview(moveId, body = {}, options) {
|
|
1780
|
+
return this._post(path`/kubernetes-moves/${moveId}/preview`, body, options);
|
|
1781
|
+
}
|
|
1782
|
+
/** Queues the apply of what the last successful preview checked. */
|
|
1783
|
+
apply(moveId, options) {
|
|
1784
|
+
return this._post(path`/kubernetes-moves/${moveId}/apply`, void 0, options);
|
|
1785
|
+
}
|
|
1786
|
+
/** Queues the next copy of every volume; only what changed is sent. */
|
|
1787
|
+
syncVolumes(moveId, options) {
|
|
1788
|
+
return this._post(path`/kubernetes-moves/${moveId}/sync-volumes`, void 0, options);
|
|
1789
|
+
}
|
|
1790
|
+
/**
|
|
1791
|
+
* Once writes on the source have stopped (`source_writes_stopped: true`),
|
|
1792
|
+
* takes the final copy of every volume and scales the held workloads up.
|
|
1793
|
+
*/
|
|
1794
|
+
cutOver(moveId, body, options) {
|
|
1795
|
+
return this._post(path`/kubernetes-moves/${moveId}/cutover`, body, options);
|
|
1796
|
+
}
|
|
1797
|
+
/** Stops the move and removes its copy pods, staged data and export. Objects already applied stay. */
|
|
1798
|
+
cancel(moveId, options) {
|
|
1799
|
+
return this._post(path`/kubernetes-moves/${moveId}/cancel`, void 0, options);
|
|
1800
|
+
}
|
|
1801
|
+
/** The transformed manifests as one YAML file, for GitOps. Secret values are never included. */
|
|
1802
|
+
downloadManifests(moveId, options) {
|
|
1803
|
+
return this._request(
|
|
1804
|
+
"GET",
|
|
1805
|
+
path`/kubernetes-moves/${moveId}/manifests`,
|
|
1806
|
+
{ responseType: "text" },
|
|
1807
|
+
{ ...options, headers: { Accept: "application/yaml", ...options?.headers } }
|
|
1808
|
+
);
|
|
1809
|
+
}
|
|
1542
1810
|
};
|
|
1543
1811
|
|
|
1544
1812
|
// src/resources/networks.ts
|
|
@@ -1604,6 +1872,192 @@ var FirewallRules = class extends APIResource {
|
|
|
1604
1872
|
}
|
|
1605
1873
|
};
|
|
1606
1874
|
|
|
1875
|
+
// src/resources/object-storage.ts
|
|
1876
|
+
var ObjectStorage = class extends APIResource {
|
|
1877
|
+
/** S3 access keys for your organization. */
|
|
1878
|
+
keys = new ObjectStorageKeys(this._client);
|
|
1879
|
+
/** Whether object storage is available, with endpoints and regional pricing. */
|
|
1880
|
+
getStatus(options) {
|
|
1881
|
+
return this._get("/object-storage", void 0, options);
|
|
1882
|
+
}
|
|
1883
|
+
/** Hourly object storage traffic and operations for your organization. */
|
|
1884
|
+
getUsage(params = {}, options) {
|
|
1885
|
+
return this._get("/object-storage/usage", params, options);
|
|
1886
|
+
}
|
|
1887
|
+
};
|
|
1888
|
+
var ObjectStorageKeys = class extends APIResource {
|
|
1889
|
+
/** Lists your S3 access keys without their secrets. */
|
|
1890
|
+
list(params = {}, options) {
|
|
1891
|
+
return this._get("/object-storage/keys", params, options);
|
|
1892
|
+
}
|
|
1893
|
+
/**
|
|
1894
|
+
* Creates an S3 access key. Its `secret_access_key` is returned once and
|
|
1895
|
+
* never replayed; it is non-enumerable so `console.log` and `JSON.stringify`
|
|
1896
|
+
* leave it out while `key.secret_access_key` reads it.
|
|
1897
|
+
*/
|
|
1898
|
+
async create(body, options) {
|
|
1899
|
+
return hideSecrets(
|
|
1900
|
+
await this._post("/object-storage/keys", body, options, { noRetry: true })
|
|
1901
|
+
);
|
|
1902
|
+
}
|
|
1903
|
+
/** Revokes an S3 access key at once. */
|
|
1904
|
+
revoke(storageKeyId, options) {
|
|
1905
|
+
return this._delete(path`/object-storage/keys/${storageKeyId}`, options);
|
|
1906
|
+
}
|
|
1907
|
+
};
|
|
1908
|
+
var Buckets = class extends APIResource {
|
|
1909
|
+
/** Objects and folders inside a bucket. */
|
|
1910
|
+
objects = new BucketObjects(this._client);
|
|
1911
|
+
/** Multipart uploads for large objects. */
|
|
1912
|
+
multipart = new BucketMultipart(this._client);
|
|
1913
|
+
/** Lists every bucket in your organization. */
|
|
1914
|
+
list(options) {
|
|
1915
|
+
return this._get("/buckets", void 0, options);
|
|
1916
|
+
}
|
|
1917
|
+
/** Creates a new bucket. */
|
|
1918
|
+
create(body, options) {
|
|
1919
|
+
return this._post("/buckets", body, options);
|
|
1920
|
+
}
|
|
1921
|
+
/** Gets one bucket's settings and endpoints. */
|
|
1922
|
+
get(bucketId, options) {
|
|
1923
|
+
return this._get(path`/buckets/${bucketId}`, void 0, options);
|
|
1924
|
+
}
|
|
1925
|
+
/** Updates a bucket's versioning, access policy, or public prefixes. */
|
|
1926
|
+
update(bucketId, body, options) {
|
|
1927
|
+
return this._patch(path`/buckets/${bucketId}`, body, options);
|
|
1928
|
+
}
|
|
1929
|
+
/** Deletes a bucket. Pass `{ force: true }` to empty it before removal. */
|
|
1930
|
+
delete(bucketId, params = {}, options) {
|
|
1931
|
+
return this._request("DELETE", path`/buckets/${bucketId}`, { query: params }, options);
|
|
1932
|
+
}
|
|
1933
|
+
/** Live total size and object count of a bucket. */
|
|
1934
|
+
stats(bucketId, options) {
|
|
1935
|
+
return this._get(path`/buckets/${bucketId}/stats`, void 0, options);
|
|
1936
|
+
}
|
|
1937
|
+
/** Deletes all objects, versions, and active multipart uploads in a bucket. Sent once: not retried on error. */
|
|
1938
|
+
empty(bucketId, options) {
|
|
1939
|
+
return this._post(path`/buckets/${bucketId}/empty`, void 0, options, { noRetry: true });
|
|
1940
|
+
}
|
|
1941
|
+
/** Reads the bucket's CORS rules. */
|
|
1942
|
+
getCors(bucketId, options) {
|
|
1943
|
+
return this._get(path`/buckets/${bucketId}/cors`, void 0, options);
|
|
1944
|
+
}
|
|
1945
|
+
/** Replaces the bucket's CORS rules (an empty list clears them). */
|
|
1946
|
+
setCors(bucketId, body, options) {
|
|
1947
|
+
return this._put(path`/buckets/${bucketId}/cors`, body, options);
|
|
1948
|
+
}
|
|
1949
|
+
/** Reads the bucket's lifecycle rules. */
|
|
1950
|
+
getLifecycle(bucketId, options) {
|
|
1951
|
+
return this._get(path`/buckets/${bucketId}/lifecycle`, void 0, options);
|
|
1952
|
+
}
|
|
1953
|
+
/** Replaces the bucket's lifecycle rules (an empty list clears them). */
|
|
1954
|
+
setLifecycle(bucketId, body, options) {
|
|
1955
|
+
return this._put(path`/buckets/${bucketId}/lifecycle`, body, options);
|
|
1956
|
+
}
|
|
1957
|
+
/** Reads the bucket's tags. */
|
|
1958
|
+
getTags(bucketId, options) {
|
|
1959
|
+
return this._get(path`/buckets/${bucketId}/tags`, void 0, options);
|
|
1960
|
+
}
|
|
1961
|
+
/** Replaces the bucket's tags (an empty list clears them). */
|
|
1962
|
+
setTags(bucketId, body, options) {
|
|
1963
|
+
return this._put(path`/buckets/${bucketId}/tags`, body, options);
|
|
1964
|
+
}
|
|
1965
|
+
/** Reads the bucket's default object lock configuration. */
|
|
1966
|
+
getObjectLock(bucketId, options) {
|
|
1967
|
+
return this._get(path`/buckets/${bucketId}/object-lock`, void 0, options);
|
|
1968
|
+
}
|
|
1969
|
+
/** Updates the bucket's default object lock configuration. */
|
|
1970
|
+
setObjectLock(bucketId, body, options) {
|
|
1971
|
+
return this._put(path`/buckets/${bucketId}/object-lock`, body, options);
|
|
1972
|
+
}
|
|
1973
|
+
};
|
|
1974
|
+
var BucketObjects = class extends APIResource {
|
|
1975
|
+
/** Lists folders and objects under a prefix, searches across the bucket, or lists object versions. */
|
|
1976
|
+
list(bucketId, params = {}, options) {
|
|
1977
|
+
return this._get(path`/buckets/${bucketId}/objects`, params, options);
|
|
1978
|
+
}
|
|
1979
|
+
/** Reads metadata, headers, tags, lock status, and public visibility of one object. */
|
|
1980
|
+
getMeta(bucketId, params, options) {
|
|
1981
|
+
return this._get(path`/buckets/${bucketId}/objects/meta`, params, options);
|
|
1982
|
+
}
|
|
1983
|
+
/** Downloads an object's raw bytes as an `ArrayBuffer`. */
|
|
1984
|
+
download(bucketId, params, options) {
|
|
1985
|
+
return this._request(
|
|
1986
|
+
"GET",
|
|
1987
|
+
path`/buckets/${bucketId}/objects/download`,
|
|
1988
|
+
{ query: params, responseType: "arrayBuffer" },
|
|
1989
|
+
options
|
|
1990
|
+
);
|
|
1991
|
+
}
|
|
1992
|
+
/** Mints a short-lived signed download URL when direct transfers are enabled. */
|
|
1993
|
+
presignDownload(bucketId, body, options) {
|
|
1994
|
+
return this._post(path`/buckets/${bucketId}/objects/download-url`, body, options);
|
|
1995
|
+
}
|
|
1996
|
+
/**
|
|
1997
|
+
* Streams an object upload into the bucket as raw bytes. Sets
|
|
1998
|
+
* `Content-Type: application/octet-stream` unless `options.headers` sets a
|
|
1999
|
+
* custom `Content-Type`.
|
|
2000
|
+
*/
|
|
2001
|
+
upload(bucketId, params, body, options) {
|
|
2002
|
+
return this._request("PUT", path`/buckets/${bucketId}/objects/upload`, { query: params, rawBody: body }, options);
|
|
2003
|
+
}
|
|
2004
|
+
/** Mints a short-lived signed upload URL when direct transfers are enabled. */
|
|
2005
|
+
presignUpload(bucketId, body, options) {
|
|
2006
|
+
return this._post(path`/buckets/${bucketId}/objects/upload-url`, body, options);
|
|
2007
|
+
}
|
|
2008
|
+
/** Creates a folder marker object ending with `/`. */
|
|
2009
|
+
createFolder(bucketId, body, options) {
|
|
2010
|
+
return this._post(path`/buckets/${bucketId}/objects/folder`, body, options);
|
|
2011
|
+
}
|
|
2012
|
+
/** Copies, renames, or updates metadata of an object inside the bucket. */
|
|
2013
|
+
copy(bucketId, body, options) {
|
|
2014
|
+
return this._post(path`/buckets/${bucketId}/objects/copy`, body, options);
|
|
2015
|
+
}
|
|
2016
|
+
/** Deletes one or more objects or versions, or deletes a folder prefix recursively. */
|
|
2017
|
+
delete(bucketId, body, options) {
|
|
2018
|
+
return this._post(path`/buckets/${bucketId}/objects/delete`, body, options);
|
|
2019
|
+
}
|
|
2020
|
+
/** Replaces tags on an object or object version. */
|
|
2021
|
+
setTags(bucketId, body, options) {
|
|
2022
|
+
return this._put(path`/buckets/${bucketId}/objects/tags`, body, options);
|
|
2023
|
+
}
|
|
2024
|
+
/** Sets retention or legal hold on an object or object version. */
|
|
2025
|
+
setLock(bucketId, body, options) {
|
|
2026
|
+
return this._put(path`/buckets/${bucketId}/objects/lock`, body, options);
|
|
2027
|
+
}
|
|
2028
|
+
/** Sets whether a specific object is publicly readable and returns its `public_url`. */
|
|
2029
|
+
setVisibility(bucketId, body, options) {
|
|
2030
|
+
return this._put(path`/buckets/${bucketId}/objects/visibility`, body, options);
|
|
2031
|
+
}
|
|
2032
|
+
};
|
|
2033
|
+
var BucketMultipart = class extends APIResource {
|
|
2034
|
+
/** Starts a multipart upload session for a large object. Sent once: not retried on error. */
|
|
2035
|
+
start(bucketId, body, options) {
|
|
2036
|
+
return this._post(path`/buckets/${bucketId}/objects/multipart/start`, body, options, { noRetry: true });
|
|
2037
|
+
}
|
|
2038
|
+
/** Mints a short-lived signed upload URL for one part of an active multipart upload. */
|
|
2039
|
+
signPart(bucketId, body, options) {
|
|
2040
|
+
return this._post(path`/buckets/${bucketId}/objects/multipart/sign-part`, body, options);
|
|
2041
|
+
}
|
|
2042
|
+
/** Uploads one part of an active multipart upload as raw bytes. */
|
|
2043
|
+
uploadPart(bucketId, params, body, options) {
|
|
2044
|
+
return this._request(
|
|
2045
|
+
"PUT",
|
|
2046
|
+
path`/buckets/${bucketId}/objects/multipart/part`,
|
|
2047
|
+
{ query: params, rawBody: body },
|
|
2048
|
+
options
|
|
2049
|
+
);
|
|
2050
|
+
}
|
|
2051
|
+
/** Completes a multipart upload from its uploaded part ETags. Sent once: not retried on error. */
|
|
2052
|
+
complete(bucketId, body, options) {
|
|
2053
|
+
return this._post(path`/buckets/${bucketId}/objects/multipart/complete`, body, options, { noRetry: true });
|
|
2054
|
+
}
|
|
2055
|
+
/** Aborts an active multipart upload and discards uploaded parts. */
|
|
2056
|
+
abort(bucketId, body, options) {
|
|
2057
|
+
return this._post(path`/buckets/${bucketId}/objects/multipart/abort`, body, options);
|
|
2058
|
+
}
|
|
2059
|
+
};
|
|
2060
|
+
|
|
1607
2061
|
// src/resources/operations.ts
|
|
1608
2062
|
function operationId(ref) {
|
|
1609
2063
|
const id = typeof ref === "string" ? ref : ref.operation_id;
|
|
@@ -2034,7 +2488,7 @@ var WebhookDeliveries = class extends APIResource {
|
|
|
2034
2488
|
};
|
|
2035
2489
|
|
|
2036
2490
|
// src/version.ts
|
|
2037
|
-
var VERSION = "0.
|
|
2491
|
+
var VERSION = "0.6.0";
|
|
2038
2492
|
|
|
2039
2493
|
// src/client.ts
|
|
2040
2494
|
var DEFAULT_BASE_URL = "https://api.pantechdynamics.com/public/v1";
|
|
@@ -2044,7 +2498,7 @@ var MAX_RETRY_AFTER_MS = 6e4;
|
|
|
2044
2498
|
var RETRY_STATUSES = /* @__PURE__ */ new Set([429, 500, 502, 503, 504]);
|
|
2045
2499
|
var ACCEPT = {
|
|
2046
2500
|
json: "application/json",
|
|
2047
|
-
arrayBuffer: "
|
|
2501
|
+
arrayBuffer: "application/octet-stream",
|
|
2048
2502
|
text: "text/dns, text/plain;q=0.9",
|
|
2049
2503
|
response: "application/json"
|
|
2050
2504
|
};
|
|
@@ -2097,6 +2551,10 @@ var Pantech = class {
|
|
|
2097
2551
|
iam;
|
|
2098
2552
|
/** TLS certificates Pantech issues and renews, or ones you import. */
|
|
2099
2553
|
certificates;
|
|
2554
|
+
/** S3-compatible object storage: status, usage and access keys. */
|
|
2555
|
+
objectStorage;
|
|
2556
|
+
/** Object storage buckets, objects, multipart uploads and bucket rules. */
|
|
2557
|
+
buckets;
|
|
2100
2558
|
operations;
|
|
2101
2559
|
constructor(options = {}) {
|
|
2102
2560
|
const apiKey = options.apiKey ?? readEnv("PANTECH_API_KEY");
|
|
@@ -2144,6 +2602,8 @@ var Pantech = class {
|
|
|
2144
2602
|
this.registry = new Registry(this);
|
|
2145
2603
|
this.iam = new IAM(this);
|
|
2146
2604
|
this.certificates = new Certificates(this);
|
|
2605
|
+
this.objectStorage = new ObjectStorage(this);
|
|
2606
|
+
this.buckets = new Buckets(this);
|
|
2147
2607
|
}
|
|
2148
2608
|
/**
|
|
2149
2609
|
* Sends one request and returns its decoded body (undefined for an empty
|
|
@@ -2160,7 +2620,12 @@ var Pantech = class {
|
|
|
2160
2620
|
Authorization: `Bearer ${this.#apiKey}`
|
|
2161
2621
|
};
|
|
2162
2622
|
let payload;
|
|
2163
|
-
if (req.
|
|
2623
|
+
if (req.rawBody !== void 0) {
|
|
2624
|
+
payload = req.rawBody;
|
|
2625
|
+
if (!hasHeader(headers, "content-type")) {
|
|
2626
|
+
headers["Content-Type"] = "application/octet-stream";
|
|
2627
|
+
}
|
|
2628
|
+
} else if (req.body !== void 0) {
|
|
2164
2629
|
payload = JSON.stringify(req.body);
|
|
2165
2630
|
headers["Content-Type"] = "application/json";
|
|
2166
2631
|
}
|
|
@@ -2218,6 +2683,9 @@ var Pantech = class {
|
|
|
2218
2683
|
}
|
|
2219
2684
|
}
|
|
2220
2685
|
};
|
|
2686
|
+
function hasHeader(headers, name) {
|
|
2687
|
+
return Object.keys(headers).some((key) => key.toLowerCase() === name);
|
|
2688
|
+
}
|
|
2221
2689
|
function queryString(query) {
|
|
2222
2690
|
if (!query) return "";
|
|
2223
2691
|
const params = new URLSearchParams();
|