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