Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

dots-wrapper

pjpimentel17.9kMIT3.12.1TypeScript support: included

Digital Ocean v2 api wrapper - javascript - typescript - nodejs

api, cloud, digital ocean, digital-ocean, digital, digitalocean, ocean, sdk, wrapper

readme

dots

digital ocean api wrapper

actions quality coverage security npm

installing

    npm install --save dots-wrapper@latest

using

typescript

  import { createApiClient } from 'dots-wrapper';
  const myApiToken = 'my-long-token';
  const dots = createApiClient({token: myApiToken});

  const main = async () => {
    const {data:{account}} = await dots.account.getAccount();
    console.log(account);
  };

  main();

javascript/nodejs

  const {createApiClient} = require('dots-wrapper');
  const myApiToken = 'my-long-token';
  const dots = createApiClient({token: myApiToken});

  const main = async () => {
    const {data:{account}} = await dots.account.getAccount();
    console.log(account);
  };

  main();

browser

index.html

  <script src='https://unpkg.com/dots-wrapper@latest/dist/index-browser.min.js'></script>

js.js

  const {createApiClient} = window.dots;
  const myApiToken = 'my-long-token';
  const dots = createApiClient({token: myApiToken});

  const main = async () => {
    const {data:{account}} = await dots.account.getAccount();
    console.log(account);
  };

  main();

docs

  1. account
    1. get-account
  2. action
    1. get-action
    2. list-actions
  3. app
    1. cancel-app-deployment
    2. create-app-deployment
    3. create-app
    4. delete-app
    5. get-active-deployment-logs
    6. get-aggregated-app-deployment-logs
    7. get-app-deployment-logs
    8. get-app-deployment
    9. get-app
    10. list-app-deployments
    11. list-apps
    12. run-app-detection
    13. update-app
  4. cdn-endpoint
    1. create-cdn-endpoint
    2. delete-cdn-endpoint
    3. get-cdn-endpoint
    4. list-cdn-endpoints
    5. purge-cache
    6. update-cdn-endpoint
  5. certificate
    1. create-certificate
    2. delete-certificate
    3. get-certificate
    4. list-certificates
  6. container-registry
    1. configure-registry
    2. delete-registry
    3. get-docker-credentials
    4. get-registry
  7. customer
    1. download-invoice
    2. get-balance
    3. get-invoice-summary
    4. list-billing-history
    5. list-invoice-items
    6. list-invoices
  8. database
    1. configure-database-cluster-eviction-policy
    2. configure-database-cluster-maintenance-window
    3. configure-database-cluster-sql-modes
    4. create-connection-pool
    5. create-database-cluster-db
    6. create-database-cluster-user
    7. create-database-cluster
    8. create-read-only-replica
    9. delete-connection-pool
    10. delete-database-cluster-db
    11. destroy-database-cluster
    12. destroy-read-only-replica
    13. get-connection-pool
    14. get-database-cluster-db
    15. get-database-cluster-eviction-policy
    16. get-database-cluster-sql-mode
    17. get-database-cluster-user
    18. get-database-cluster
    19. get-read-only-replica
    20. list-connection-pools
    21. list-database-cluster-backups
    22. list-database-cluster-dbs
    23. list-database-cluster-firewall-rules
    24. list-database-cluster-users
    25. list-database-clusters
    26. list-database-options
    27. list-read-only-replicas
    28. migrate-database-cluster
    29. remove-database-cluster-user
    30. resize-database-cluster
    31. restore-database-cluster-backup
    32. update-database-cluster-firewall-rules
  9. domain
    1. create-domain
    2. create-domain-record
    3. delete-domain
    4. delete-domain-record
    5. get-domain
    6. get-domain-record
    7. list-domain-records
    8. list-domains
    9. update-domain-record
  10. droplet
    1. change-droplet-kernel
    2. create-droplet
    3. create-droplets
    4. delete-droplet
    5. delete-droplets-by-tag
    6. destroy-droplet-and-all-associated-resources
    7. destroy-droplet-and-associated-resources
    8. disable-droplet-backups
    9. do-action-by-droplet-tag
    10. enable-droplet-backups
    11. enable-droplet-ipv6
    12. enable-droplet-private-networking
    13. get-droplet-action
    14. get-droplet-destroy-status
    15. get-droplet
    16. list-droplet-actions
    17. list-droplet-associated-resources
    18. list-droplet-backups
    19. list-droplet-kernels
    20. list-droplet-neighborhoods
    21. list-droplet-neighbors
    22. list-droplet-snapshots
    23. list-droplets
    24. power-cycle-droplet
    25. power-off-droplet
    26. power-on-droplet
    27. reboot-droplet
    28. rebuild-droplet
    29. rename-droplet
    30. reset-droplet-password
    31. resize-droplet
    32. restore-droplet
    33. retry-droplet-destroy
    34. shutdown-droplet
    35. snapshot-droplet
  11. firewall
    1. add-droplets-to-firewall
    2. add-rules-to-firewall
    3. add-tags-to-firewall
    4. create-firewall
    5. delete-firewall
    6. get-firewall
    7. list-firewalls
    8. remove-droplets-from-firewall
    9. remove-rules-from-firewall
    10. remove-tags-from-firewall
    11. update-firewall
  12. floating-ip
    1. assign-ip-to-droplet
    2. create-floating-ip
    3. delete-floating-ip
    4. get-floating-ip
    5. get-floating-ip-action
    6. list-floating-ip-actions
    7. list-floating-ips
    8. unassign-ip-from-droplet
  13. gen-ai
    1. list-models
    2. list-regions
    3. list-agents
    4. create-agent
    5. get-agent
    6. update-agent
    7. delete-agent
    8. update-agent-visibility
    9. list-agent-keys
    10. create-agent-key
    11. update-agent-key
    12. delete-agent-key
    13. regenerate-agent-key
    14. list-agent-routes
    15. attach-agent-route
    16. update-agent-route
    17. detach-agent-route
    18. attach-function-route
    19. update-function-route
    20. detach-function-route
    21. attach-knowledge-base
    22. attach-knowledge-bases
    23. detach-knowledge-base
    24. list-agent-versions
    25. rollback-agent-version
      The agent versioning methods above are experimental and may change without notice.
    26. list-openai-keys
    27. create-openai-key
    28. get-openai-key
    29. update-openai-key
    30. delete-openai-key
    31. list-agents-by-openai-key
    32. list-anthropic-keys
    33. create-anthropic-key
    34. get-anthropic-key
    35. update-anthropic-key
    36. delete-anthropic-key
    37. list-agents-by-anthropic-key
    38. list-knowledge-bases
    39. create-knowledge-base
    40. get-knowledge-base
    41. update-knowledge-base
    42. delete-knowledge-base
    43. list-knowledge-base-data-sources
    44. add-knowledge-base-data-source
    45. delete-knowledge-base-data-source
    46. list-indexing-jobs
    47. create-indexing-job
    48. list-indexing-job-data-sources
    49. get-indexing-job
    50. cancel-indexing-job
  14. image
    1. convert-image-to-snapshot
    2. create-custom-image
    3. delete-image
    4. get-image
    5. get-image-action
    6. list-image-actions
    7. list-images
    8. transfer-image
    9. update-image
  15. kubernetes
    1. add-container-registry
    2. create-kubernetes-cluster
    3. create-node-pool
    4. delete-kubernetes-cluster
    5. delete-node-pool
    6. delete-node
    7. get-clusterlint-diagnostics
    8. get-kubernetes-cluster-credentials
    9. get-kubernetes-cluster-kubeconfig
    10. get-kubernetes-cluster
    11. get-node-pool
    12. list-available-options-of-kubernetes
    13. list-kubernetes-cluster-available-upgrades
    14. list-kubernetes-clusters
    15. list-node-pools
    16. remove-container-registry
    17. run-clusterlint-on-kubernetes-cluster
    18. update-kubernetes-cluster
    19. update-node-pool
    20. upgrade-kubernetes-cluster
  16. load-balancer
    1. add-droplets-to-load-balancer
    2. add-rules-to-load-balancer
    3. create-load-balancer
    4. delete-load-balancer
    5. get-load-balancer
    6. list-load-balancers
    7. remove-droplets-from-load-balancer
    8. remove-rules-from-load-balancer
    9. update-load-balancer
  17. monitoring
    1. get-droplet-available-memory-metrics
    2. get-droplet-bandwidth-metrics
    3. get-droplet-cpu-metrics
    4. get-droplet-free-memory-metrics
    5. get-droplet-total-memory-metrics
  18. project
    1. assign-resources-to-default-project
    2. assign-resources-to-project
    3. create-project
    4. delete-project
    5. get-default-project
    6. get-project
    7. list-default-project-resources
    8. list-project-resources
    9. list-projects
    10. patch-default-project
    11. patch-project
    12. update-default-project
    13. update-project
  19. region
    1. list-regions
  20. size
    1. list-sizes
  21. snapshot
    1. delete-snapshot
    2. get-snapshot
    3. list-snapshots
  22. ssh-key
    1. create-ssh-key
    2. destroy-ssh-key
    3. get-ssh-key
    4. list-ssh-keys
    5. update-ssh-key
  23. tag
    1. create-tag
    2. delete-tag
    3. get-tag
    4. list-tags
    5. tag-resources
    6. untag-resources
  24. volume
    1. attach-volume-to-droplet
    2. create-volume
    3. create-volume-snapshot
    4. delete-volume-by-name
    5. delete-volume
    6. detach-volume-from-droplet
    7. get-volume
    8. get-volume-action
    9. list-volume-actions
    10. list-volumes
    11. list-volume-snapshots
    12. resize-volume
  25. vpc
    1. create-vpc
    2. get-vpc
    3. list-vpcs
    4. update-vpc
    5. list-vpc-resources
    6. delete-vpc

contributors

license: mit

changelog

changelog

2025-06-14 - new version 3.12.1

  • npm audit + update dependencies
  • genAi module fixed for indexing jobs, thanks (@digipigeon)
  • drop nodejs 16.x support
  • add nodejs 24.x support
  • use nodejs 22.x to build and publish

2025-05-23 - new version 3.12.0

  • npm audit + update dependencies
  • genAi module, thanks (@AhmedElywa)

2025-05-11 - new version 3.11.17

  • npm audit + update dependencies

2025-03-21 - new version 3.11.16

  • npm audit + update dependencies

2025-02-01 - new version 3.11.15

  • update dependencies

2025-01-05 - new version 3.11.14

  • update dependencies
  • add attribute with_droplet_agent

2024-12-21 - new version 3.11.13

  • update dependencies

2024-10-20 - new version 3.11.12

  • update dependencies

2024-09-04 - new version 3.11.11

  • update dependencies
  • modified region input to be optional at droplet creation.

2024-08-24 - new version 3.11.10

  • npm audit + update dependencies
  • upgrade actions/setup-node@v3 to actions/setup-node@v4
  • add dependabot setting for github-actions

2024-06-23 - new version 3.11.9

  • npm audit + update dependencies
  • drop node 16 support
  • add node 20 support
  • using node 20 to build

2024-05-19 - new version 3.11.8

  • update dependencies

2024-03-30 - new version 3.11.7

  • update dependencies

2024-03-10 - new version 3.11.6

  • update dependencies

2024-02-12 - new version 3.11.5

  • update dependencies

2023-11-16 - new version 3.11.4

  • update dependencies

2023-10-22 - new version 3.11.3

  • update dependencies

2023-08-24 - new version 3.11.2

  • update dependencies

2023-07-09 - new version 3.11.1

  • update all dependencies

2023-06-19 - new version 3.11.0

  • add node 20 to tests coverage.
  • removed package axios-mock-adapter
  • update all dependencies
  • updated all unit tests using axios-mock-adapter
  • upgrade actions/checkout@v2 to actions/checkout@v3
  • upgrade actions/setup-node@v2 to actions/setup-node@v3
  • upgrade axios to latest version :)
    • if new axios version breaks something not predicted rollback to 3.10.1 and file a issue for me.
  • upgrade node from 16 to 18 on publish workflow
  • upgrade SonarSource/sonarcloud-github-action@v1.6 to SonarSource/sonarcloud-github-action@v1.9.1
  • upgrade workflow codeql from v1 to v2

2023-05-31 - new version 3.10.1

  • dependencies updates
  • fix get-droplet-bandwidth-metrics documentation

2023-04-25 - new version 3.10.0

  • add getActiveDeploymentLogs (@kkhanhluu)
  • dependencies updates

2023-04-23 - new version 3.9.0

  • add listDatabaseOptions (@mueschm)
  • dependencies updates

2023-04-12 - new version 3.8.4

2023-03-25 - new version 3.8.3

  • fix IListResponse type
  • dependencies updates

2023-02-03 - new version 3.8.2

  • dependencies updates
  • add with_projects input to app.listApps
  • add project_id input to app.createApp

2022-10-09 - new version 3.8.1

  • dependencies updates

2022-09-18 - new version 3.8.0

  • dependencies updates
  • drop node 12.x test support

2022-08-22 - new version 3.7.13

  • dependencies updates
  • add param expiry_seconds to getDockerCredentials

2022-08-13 - new version 3.7.12

  • dependencies updates

2022-07-25 - new version 3.7.11

  • dependencies updates

2022-07-09 - new version 3.7.10

  • dependencies updates
  • fix IApp type

2022-06-18 - new version 3.7.9

  • dependencies updates

    2022-05-29 - new version 3.7.8

  • npm audit + dependencies updates

2022-05-21 - new version 3.7.7

  • npm audit + dependencies updates

2022-05-07 - new version 3.7.6

  • add node 18.x test support
  • drop node 10.x test support
  • fix app spec types, thanks (@carlosbaraza)
  • npm audit + dependencies updates

2022-04-30 - new version 3.7.5

  • add downloads badge to readme.md
  • npm audit + dependencies updates
  • remove console.log from spec file

2022-04-09 - new version 3.7.4

  • npm audit + dependencies updates

2022-03-26 - new version 3.7.3

  • npm audit + dependencies updates

2022-03-13 - new version 3.7.2

  • npm audit + dependencies updates

2022-02-26 - new version 3.7.1

  • npm audit + dependencies updates

2022-02-16 - new version 3.7.0

  • npm audit + dependencies updates
  • add module dots.monitoring
  • breaking change: removed dots.util, now it's called dots.modules.common

2022-02-10 - new version 3.6.3

2021-10-30 - new version 3.6.2

  • npm audit + dependencies updates

2021-10-05 - new version 3.6.1

2021-10-04 - new version 3.6.0

  • add "force_build" input to dots.app.createAppDeployment

2021-09-25 - new version 3.5.9

  • npm audit + dependencies updates

2021-09-04 - new version 3.5.8

  • npm audit + dependencies updates

2021-06-14 - new version 3.5.7

  • npm audit + dependencies updates

2021-05-29 - new version 3.5.6

2021-05-17

  • fixed domain module docs

2021-05-06 - new version: 3.5.5

2021-05-01 - new version: 3.5.4

  • npm audit + dependencies updates
  • add method volume.deleteVolumeByName

2021-03-29 - new version: 3.5.3

  • npm audit + dependencies updates

2020-12-22 - new version: 3.5.2

  • npm audit + dependencies updates

2020-12-03 - new version: 3.5.1

2020-11-21 - new version: 3.5.0

  • npm audit + dependencies updates
  • add app module
  • removed node 8 test support
  • add k8s container registry methods

2020-11-01 - new version: 3.4.0

  • add missing attributes to firewall type
  • npm audit + dependencies updates
  • add list domain record filters
  • add k8s node pool taints
  • add droplet.destroyDropletAndAllAssociatedResources
  • add droplet.destroyDropletAndAssociatedResources
  • add droplet.getDropletDestroyStatus
  • add droplet.listDropletAssociatedResources
  • add droplet.retryDropletDestroy
  • "add is_default" parameter to vpc.updateVpc and vpc.createVpc
  • removed "id" field compatibility, see 3.1.0

2020-08-10 - new version: 3.3.3

  • load balancer types
  • npm audit + dependencies updates

2020-07-22 - new version: 3.3.2

  • pkg.json homepage

2020-07-15 - new version: 3.3.1

  • npm audit + dependencies updates

2020-06-20 - new version: 3.3.0

  • add listInvoices, downloadInvoice, getInvoiceSummary, getInvoice to customer module
  • npm audit + dependencies updates

    2020-05-22 - new version: 3.2.1

  • ICreateDropletsApiRequest && ICreateDropletApiRequest ssh_keys attr

2020-05-03 - new version: 3.2.0

  • add vpc module
  • add kubernetes node pool labels
  • add mysql_settings to createDatabaseClusterUser
  • npm audit

2020-04-30 - new version: 3.1.10

2020-04-27 - new version: 3.1.9

  • IKubernetesClusterStatus type
  • npm audit

2020-04-18 - new version: 3.1.8

  • IDroplet type

2020-03-17 - new version: 3.1.7

  • packages update
  • npm audit

2020-03-15 - new version: 3.1.6

  • automatic update package acorn from 5.7.3 to 5.7.4

2019-12-15 - new version: 3.1.5

  • fix quality gate issues

2019-12-15 - new version: 3.1.4

  • add cdn-endpoints module
  • add container-registry module
  • fix list-available-options-of-kubernetes url path

2019-12-14 - new version: 3.1.3

  • add kubernetes module
  • fix updateLoadBalancer test

2019-12-12 - new version: 3.1.2

  • add project module

2019-12-10 - new version: 3.1.1

2019-12-08 - new version: 3.1.0

the id input was removed from the following methods to avoid missunderstands. now it is {entity}_id. (to allow backward compatibility the id field still accepted but will be removed in future versions)

the following methods were affected:

  • add database module
  • loadBalancer.addDropletsToLoadBalancer >> id -> load_balancer_id
  • loadBalancer.addRulesToLoadBalancer >> id -> load_balancer_id
  • loadBalancer.deleteLoadBalancer >> id -> load_balancer_id
  • loadBalancer.getLoadBalancer >> id -> load_balancer_id
  • loadBalancer.removeDropletsFromLoadBalancer >> id -> load_balancer_id
  • loadBalancer.removeRulesFromLoadBalancer >> id -> load_balancer_id
  • loadBalancer.updateLoadBalancer >> id -> load_balancer_id
  • snapshot.deleteSnapshot >> id -> snapshot_id
  • snapshot.getSnapshot >> id -> snapshot_id
  • sshKey.destroySshKey >> id -> ssh_key_id
  • sshKey.getSshKey >> id -> ssh_key_id
  • sshKey.updateSshKey >> id -> ssh_key_id
  • volume.attachVolumeToDroplet >> id -> volume_id
  • volume.createVolumeSnapshot >> id -> volume_id
  • volume.deleteVolume >> id -> volume_id
  • volume.detachVolumeFromDroplet >> id -> volume_id
  • volume.getVolume >> id -> volume_id
  • volume.listVolumeActions >> id -> volume_id
  • volume.listVolumeSnapshots >> id -> volume_id
  • volume.resizeVolume >> id -> volume_id

2019-11-20 - new version: 3.0.2

  • browser build

2019-11-17 - new version: 3.0.1

  • updated main readme

2019-11-09 - new version: 3.0.0

project refactor to make it (simple and better) to (use and mantain).

if you are using the 2.6.0 and migrate to 3.0.0 you will need to change the inputs/outputs to fit the new pattern.

the main changes are:

  • not using rxjs anymore, just simple promises.
  • the return signature contain the full http response.
  • as DO use snake_case, ALL camelCase properties were removed.
  • unit tests with 100% code coverage.

version 2.6.0

  • initial stable version